conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use a catch with the JWT verify function\n" }, { "from": "human", "value": "const\n nJwt = require('njwt'),\n config = require('config.js'),\n errors = require('feathers-errors');\n\n\n\nfunction processJWTIfExists (req, res, next) {\n\n req.feathers = req...
javascript
chosen
[ { "from": "system", "value": "Use https to load openstreetmap data\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n angular.module('kuulemmaApp').directive('locationMap', function($window) {\n return {\n restrict: 'A',\n scope: {\n latitude: '@',\n ...
javascript
chosen
[ { "from": "system", "value": "Simplify updating of locale field in user account.\n" }, { "from": "human", "value": "// Store the preference locale in cookies and (if available) session to use\n// on next requests.\n\n\n'use strict';\n\n\nvar _ = require('lodash');\n\n\nvar LOCALE_COOKIE_MAX_AGE ...
javascript
chosen
[ { "from": "system", "value": "Fix a bug, used .test instead of .test()\n" }, { "from": "human", "value": "import React from 'react';\nimport { expect } from 'chai';\nimport { shallow } from 'enzyme';\nimport ArticlePreview from '../ArticlePreview';\n\ndescribe('ArticlePreview', () => {\n it('...
javascript
chosen
[ { "from": "system", "value": "Use condition instead of setActive and listeners" }, { "from": "human", "value": "import ExtentInteraction from '../src/ol/interaction/Extent.js';\nimport GeoJSON from '../src/ol/format/GeoJSON.js';\nimport Map from '../src/ol/Map.js';\nimport View from '../src/ol/V...
javascript
chosen
[ { "from": "system", "value": "Fix new API call for datatable consumer\n" }, { "from": "human", "value": "function short_hash(data, type, row, meta)\n{\n return data.substring(0,8);\n}\n\nfunction init_page()\n{\n $('#tickets').dataTable({\n \"ajax\": '../api/v1/tickets?filter=sold e...
javascript
chosen
[ { "from": "system", "value": "Fix cancel button on new sprint page\n" }, { "from": "human", "value": "$(document).ready(function() {\n\t$('select').chosen();\n\t$('input.date').datepicker({\n\t\tbeforeShowDay: $.datepicker.noWeekends\n\t});\n\n\t$('#save-button').savebutton($('#post-status'), ''...
javascript
chosen
[ { "from": "system", "value": "Allow \"reverse:fieldname\" for a descending sort\n\nCloses #42\n" }, { "from": "human", "value": "export default function argsToFindOptions(args, target) {\n var result = {}\n , targetAttributes = Object.keys(target.rawAttributes);\n\n if (args) {\n Object....
javascript
chosen
[ { "from": "system", "value": "Use not equal filter instead.\n" }, { "from": "human", "value": "'use strict';\n\nconst _ = require('lodash');\n\nmodule.exports = function (Model, bootOptions = {}) {\n Model.defineProperty('deleted', {\n type: Boolean,\n required: true,\n default: false\...
javascript
chosen
[ { "from": "system", "value": "Support for Web Page Media Control API v0.4\n" }, { "from": "human", "value": "// Tab registration by MediaControlled event\ndocument.addEventListener(\"MediaControlled\", function () {\n chrome.runtime.sendMessage({command: \"registerTab\"});\n});\n\n// Tab unre...
javascript
chosen
[ { "from": "system", "value": "Change JSON url to API url\n" }, { "from": "human", "value": "var QuizzCollection = Backbone.Collection.extend({\n model: QuizzModel,\n url: './data/quizz.json'\n});\n" }, { "from": "gpt", "value": "var QuizzCollection = Backbone.Collection.extend({\n ...
javascript
chosen
[ { "from": "system", "value": "Fix error with module export\n" }, { "from": "human", "value": "function Smallstache(source) {\n this.template = source.match(/^[#|\\.].*/g) ?\n document.querySelector(source) : // source is selector\n source; // source is...
javascript
chosen
[ { "from": "system", "value": "Fix display of return type.\n" }, { "from": "human", "value": "'use strict';\n\nvar Component = require('../../ui/Component');\nvar $$ = Component.$$;\n\nfunction CrossLinkComponent() {\n Component.apply(this, arguments);\n}\n\nCrossLinkComponent.Prototype = functi...
javascript
chosen
[ { "from": "system", "value": "Use path.join for link prefixing\n" }, { "from": "human", "value": "import { config } from 'config'\nimport invariant from 'invariant'\nimport isString from 'lodash/isString'\n\nfunction isDataURL (s) {\n // Regex from https://gist.github.com/bgrins/6194623#gistcom...
javascript
chosen
[ { "from": "system", "value": "Fix path handling in dependencyLoader\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.core').service('dependencyLoader', [\n '$ocLazyLoad',\n '$q',\n 'basePath',\n function($ocLazyLoad, $q, basePath) {\n function expand(p) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug where reactions would break after starting new game\n" }, { "from": "human", "value": "import m from 'mithril';\nimport classNames from '../classnames.js';\n\nclass PlayerReactionComponent {\n\n oninit({ attrs: { session, player } }) {\n session.on('send...
javascript
chosen
[ { "from": "system", "value": "Add shared immutable prop types for Profile models\n\nSigned-off-by: Victor Porof <7d8eebacd0931807085fa6b9af29638ed74e0886@mozilla.com>\n" }, { "from": "human", "value": "/*\nCopyright 2016 Mozilla\n\nLicensed under the Apache License, Version 2.0 (the \"License\")...
javascript
chosen
[ { "from": "system", "value": "Update test to check all files created\n" }, { "from": "human", "value": "/*global describe, beforeEach, it*/\n'use strict';\n\nvar path = require('path');\nvar helpers = require('yeoman-generator').test;\n\n\ndescribe('ink generator', function () {\n beforeEach...
javascript
chosen
[ { "from": "system", "value": "Enable more linting for shared imports\n" }, { "from": "human", "value": "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n\nconst Lint = require(\"tslint\");\n\nclass Rule extends Lint.Rules.AbstractRule {\n\tapply(sourceFile) {\...
javascript
chosen
[ { "from": "system", "value": "Refactor of comma separated list to selectbox & other inputs.\n" }, { "from": "human", "value": "\nfunction setupDisplayFieldsEducationTab(TempObject, selectBox){\n // This code is needed to merge the multiselect field and the \"other\" input field per\n if (t...
javascript
chosen
[ { "from": "system", "value": "Set default page size to 10 events.\n" }, { "from": "human", "value": "import React from 'react'\n\nimport EventBets from '../templates/event-bets'\nimport EventHeading from '../templates/event-heading'\n\nimport styles from './index.module.styl'\n\nexport default (...
javascript
chosen
[ { "from": "system", "value": ":new: Implement proper plugins, resolution and maps support\n" }, { "from": "human", "value": "'use babel'\n\nexport const compiler = false\nexport const minifier = false\nexport function process(contents) {\n const chunks = contents.split(/\\r?\\n/)\n if (chunks[...
javascript
chosen
[ { "from": "system", "value": "Correct indentation in westley tests\n" }, { "from": "human", "value": "var lib = require(\"__buttercup/module.js\"),\n Westley = lib.Westley;\n\nmodule.exports = {\n\n setUp: function(cb) {\n this.westley = new Westley();\n (cb)();\n },\n\n _getCommandFor...
javascript
chosen
[ { "from": "system", "value": "Fix policy for new responses\n" }, { "from": "human", "value": "/**\n * isAuthenticated\n * @description :: Policy that inject user in `req` via JSON Web Token\n */\n\nvar passport = require('passport');\n\nmodule.exports = function (req, res, next) {\n passport.au...
javascript
chosen
[ { "from": "system", "value": "Allow simple shimming of http.Server if full instrumentation is disabled\n" }, { "from": "human", "value": "'use strict'\n\nvar shimmer = require('shimmer')\nvar modules = require('./instrumentation/modules')\n\nmodule.exports = function (client) {\n if (!client._f...
javascript
chosen
[ { "from": "system", "value": "Add comment to remove loggerMiddleware in production.\n" }, { "from": "human", "value": "import {createStore, applyMiddleware } from 'redux';\nimport thunkMiddleware from 'redux-thunk';\nimport createLogger from 'redux-logger';\nimport reducer from './reducer';\n\nc...
javascript
chosen
[ { "from": "system", "value": "Fix changed done callback, missing typeof." }, { "from": "human", "value": "import Server from './server';\nimport Client from './client';\n\nconst debug = require('debug')('tinylr');\n\n// Need to keep track of LR servers when notifying\nconst servers = [];\n\nexpo...
javascript
chosen
[ { "from": "system", "value": "Fix Load multiple JSON bug using array of promises\n" }, { "from": "human", "value": " define([\n 'base/class',\n 'jquery',\n 'underscore',\n 'base/utils'\n ], function(Class, $, _, Util) {\n\n var LocalJSONReader = Class.extend({\n\n ini...
javascript
chosen
[ { "from": "system", "value": "Fix test so that is uses regex to check the text returned.\n" }, { "from": "human", "value": "/* jshint -W117, -W030 */\ndescribe('dataservice', function() {\n beforeEach(function() {\n bard.appModule('app.core');\n bard.inject('$http','$httpBackend','$q','da...
javascript
chosen
[ { "from": "system", "value": "Add required flag to label prop\n" }, { "from": "human", "value": "import React, {Component} from 'react';\n\nimport Icon from './Icon';\n\nclass CollapsibleContainer extends Component {\n constructor() {\n super(...arguments);\n\n this.state = {\n toggl...
javascript
chosen
[ { "from": "system", "value": ":racehorse: Tweak uglifyjs config to be faster\n" }, { "from": "human", "value": "// @flow\n\nimport { minify as processUglify } from 'uglify-es'\nimport { minify as processTerser } from 'terser'\nimport { createChunkTransformer } from 'pundle-api'\n\nimport manifes...
javascript
chosen
[ { "from": "system", "value": "Add 'present' url query/search param to presentation mode middleware.\n" }, { "from": "human", "value": "// Trigger resize event to relayout the React Layout plugin\n\nexport default function resizeLayout() {\n return next => action => {\n next(action)\n if (...
javascript
chosen
[ { "from": "system", "value": "ui(topbar): Update color to match with header\n" }, { "from": "human", "value": "import React, { Component } from \"react\"\nimport TopBarProgressIndicator from \"react-topbar-progress-indicator\"\n\nimport styles from \"./index.css\"\n\nTopBarProgressIndicator.conf...
javascript
chosen
[ { "from": "system", "value": "Comment out missing call to notify plugin\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar sass = require('gulp-sass');\nvar sasslint = require('gulp-sass-lint');\nvar sourcemaps = require('gulp-sourcemaps');\nvar rename = require('gulp-rename');\...
javascript
chosen
[ { "from": "system", "value": "Implement a basic version of filtering based on use selection\n" }, { "from": "human", "value": "var glimpse = require('glimpse'),\n _requests = [];\n\n(function() {\n function dataFound(payload) {\n // TODO: Really bad hack to get things going atm\n ...
javascript
chosen
[ { "from": "system", "value": "Use release channel of ember-data\n\nv1.13 is not supported for the next version of\nember-data-fixture-adapter.\n" }, { "from": "human", "value": "module.exports = {\n scenarios: [\n {\n name: 'default',\n dependencies: { }\n },\n {\n name:...
javascript
chosen
[ { "from": "system", "value": "Fix lint error and update JSDoc examples\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\nvar RE = require( '@stdlib/regexp/function-name' );\nvar isBuffer = require( '@stdlib/assert/is-...
javascript
chosen
[ { "from": "system", "value": "Add ajax call for questions\n" }, { "from": "human", "value": "$(document).ready(function() {\n\n $(\"a.up-vote-answer\").click(function(event) {\n event.preventDefault();\n var $target = $(event.target);\n console.log($target.data(\"url\"))\n $....
javascript
chosen
[ { "from": "system", "value": "Remove unused param from daysRemaining function\n" }, { "from": "human", "value": "import moment from 'moment';\nimport getPetitionEndDate from 'selectors/petitionEndDate';\n\nexport default ({ created, expires }, timeNow) => {\n const endDate = getPetitionEndDate(...
javascript
chosen
[ { "from": "system", "value": "Add comment clarifying that cio event version is data schema version\n" }, { "from": "human", "value": "'use strict';\n\nclass CustomerIoEvent {\n constructor(id, name, data) {\n this.id = id;\n this.name = name;\n this.data = data;\n }\n\n getId() {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix origin-checking logic in postMessage\n\nThis allows us to post messages where the origin is something other than `*`. Closes #1789." }, { "from": "human", "value": "\"use strict\";\nconst isValidTargetOrigin = require(\"../utils\").isValidTargetOrigin;\nconst DO...
javascript
chosen
[ { "from": "system", "value": "Add trailing newline charater when generating config schema for package.json.\n" }, { "from": "human", "value": "\"use strict\";\n\nconst fs = require(\"fs\");\nconst packageJsonPath = \"./package.json\";\nconst packageJson = require(packageJsonPath);\nconst configu...
javascript
chosen
[ { "from": "system", "value": "Improve client side error detection\n" }, { "from": "human", "value": "exports.assertion = function () {\n\n this.message = 'Page loaded with no errors.';\n\n this.expected = [];\n\n this.pass = function (result) {\n\n return result && result.length...
javascript
chosen
[ { "from": "system", "value": "Add missing $q service to User\n" }, { "from": "human", "value": "var angularMeteorUser = angular.module('angular-meteor.user', ['angular-meteor.utils']);\n\nangularMeteorUser.run(['$rootScope', '$meteorUtils', function($rootScope, $meteorUtils){\n var currentUserD...
javascript
chosen
[ { "from": "system", "value": "Revert \"Disable code-split in development mode and for server side\"\n\nThis reverts commit 90d307f6cf9792882dc4beabc2cd1d007ae26dc6.\n" }, { "from": "human", "value": "//@flow\nimport React from 'react'\nimport { Route, IndexRoute } from 'react-router'\nimport App...
javascript
chosen
[ { "from": "system", "value": "Check the end of notification fade-out animation\n" }, { "from": "human", "value": "var NotificationComponent = Ember.Component.extend({\n classNames: ['js-bb-notification'],\n\n typeClass: function () {\n var classes = '',\n message = this.g...
javascript
chosen
[ { "from": "system", "value": "Fix button class on upload modal\n\nno issue\n\n- this makes sure that the cancel button on the upload modal gets the\n correct class\n" }, { "from": "human", "value": "import ModalDialog from 'ghost/components/gh-modal-dialog';\nimport upload from 'ghost/assets/li...
javascript
chosen
[ { "from": "system", "value": "Add test for single instance\n" }, { "from": "human", "value": "var tape = require(\"tape\"),\n jsdom = require(\"jsdom\"),\n d3 = Object.assign(\n require(\"../\"),\n require(\"d3-selection\")\n );\n\n// An example component.\nfunction Paragraph(...
javascript
chosen
[ { "from": "system", "value": "Complete working algorithm, follows all rules and works perfectly\n" }, { "from": "human", "value": "// Reverse Array In Place\n\n/*RULES:\n Take array as parameter\n Reverse array\n Return reversed array\n\n NOTES:\n Can't create new empty array to push in...
javascript
chosen
[ { "from": "system", "value": "Change code style issues to warnings\n" }, { "from": "human", "value": "module.exports = {\n \"extends\": \"react-app\",\n \"rules\": {\n \"comma-dangle\": [\"error\", \"always-multiline\"],\n // disallow unnecessary semicolons\n 'no-extra-semi': 'error',...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary comment, since the origins of the Dispatcher are now\napparent\n" }, { "from": "human", "value": "// This dispatcher modifies some of the ideas in Facebook's template:\n// https://github.com/facebook/flux/blob/master/src/Dispatcher.js\n\nvar FluxD...
javascript
chosen
[ { "from": "system", "value": "Revert \"Make compatible with Node 0.10 🤢\"\n\nThis reverts commit eaf1ad7\n" }, { "from": "human", "value": "var assert = require('assert');\nvar encoders = require('../lib/encoders');\nvar fixtures = require('./fixture/server');\n\ndescribe('encoders', function (...
javascript
chosen
[ { "from": "system", "value": "Remove unused methods from navigator control\n" }, { "from": "human", "value": "define(['underscore', 'backbone', 'jquery'], function(_, Backbone, $) {\n\t'use strict';\n\n\tvar $navigatorBtn = $('.caption .controls button.navigator');\n\tvar $navigatorOverlay = $('...
javascript
chosen
[ { "from": "system", "value": "Refactor `validateSelfClosingTags` to handle new token structure\n" }, { "from": "human", "value": "var utils = require('../utils')\n , selfClosing = require('void-elements')\n\nmodule.exports = function () {}\n\nmodule.exports.prototype =\n { name: 'validateSelfC...
javascript
chosen
[ { "from": "system", "value": "Fix bug: call reply method on messenger\n" }, { "from": "human", "value": "'use strict';\n\nconst CommonModel = require('../common/model.js');\n\nclass ServerModel extends CommonModel {\n constructor(validator, messenger, dbStorage, config, jwt) {\n super(valida...
javascript
chosen
[ { "from": "system", "value": "Fix no topics shown when loading a deck\n" }, { "from": "human", "value": "import rp from 'request-promise';\n\nimport {Microservices} from '../../configs/microservices';\nimport {isEmpty, assignToAllById} from '../../common';\n\nexport default {\n\n // fetches t...
javascript
chosen
[ { "from": "system", "value": "Add test for getHasFailedAuth selector\n" }, { "from": "human", "value": "import * as selectors from '../src/selectors'\n\ndescribe('selectors', () => {\n it('includes selector to get session data', () => {\n const state = {\n session: {\n data: { to...
javascript
chosen
[ { "from": "system", "value": "Implement shells for law index collection chooser.\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport ImmutableTypes from 'react-immutable-proptypes';\nimport { Grid, Cell, Button } from 'react-mdl';\n\n\nconst LawCollectionChooser ...
javascript
chosen
[ { "from": "system", "value": "Remove require of old dependency \"shell-escape\"\n" }, { "from": "human", "value": "var _ = require(\"lodash\");\nvar Q = require(\"q\");\nvar fs = require(\"./fs\");\nvar shellescape = require('shell-escape');\nvar spawn = require('spawn-cmd').spawn;\n\nvar links ...
javascript
chosen
[ { "from": "system", "value": "Support for two headers with same name.\n\nI found an example file with two different firmware version header lines. This caused a React error due to duplicate item keys.\n\nFixed by appending the index to the name.\n" }, { "from": "human", "value": "import React, {...
javascript
chosen
[ { "from": "system", "value": "Make window persist on close\n" }, { "from": "human", "value": "import { app, BrowserWindow } from 'electron';\n\nlet mainWindow = null;\n\napp.on('window-all-closed', () => {\n if (process.platform != 'darwin') {\n app.quit();\n }\n});\n\napp.on('ready', () =>...
javascript
chosen
[ { "from": "system", "value": "Fix the link sign in\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('<%=angularAppName%>')\n .controller('HomeController', function ($scope, Principal, LoginService) {\n function getAccount() {\n Principal.identity().then(fun...
javascript
chosen
[ { "from": "system", "value": "Initialize earlier the Everlive instance." }, { "from": "human", "value": "(function (global) {\n 'use strict';\n\n var app = global.app = global.app || {};\n \n var fixViewResize = function () {\n \n if (device.platform === 'iOS') {\n ...
javascript
chosen
[ { "from": "system", "value": "Change tab to 4 instead of 8" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(grunt) {\n\ngrunt.initConfig({\n\n\t\tpkg: grunt.file.readJSON('package.json'),\n\n\t\t//JS Source files\n\t\tsrc: {\n\t\t\tjs: ['app/js/**/*.js']\n\t\t},\n\t\t/...
javascript
chosen
[ { "from": "system", "value": "Add datatable libs to browserify config\n" }, { "from": "human", "value": "/**\n * Pulsar\n *\n * Core UI components that should always be present.\n *\n * Jadu Ltd.\n */\n\n// Fixes issue with dependencies that expect both $ and jQuery to be set\nwindow.jQuery = wi...
javascript
chosen
[ { "from": "system", "value": "Include the scale and fetch plugins in the module.\n" }, { "from": "human", "value": "module.exports = require('./load-image')\n\nrequire('./load-image-meta')\nrequire('./load-image-exif')\nrequire('./load-image-exif-map')\nrequire('./load-image-orientation')\n" }...
javascript
chosen
[ { "from": "system", "value": "Increase interrupt test wait time to 5s\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n 'use strict';\n grunt.initConfig({\n echo: {\n one: { message: 'one has changed' },\n two: { message: 'two has changed' },\n wait: { m...
javascript
chosen
[ { "from": "system", "value": "Fix URL for logging achievement to match RequestMapping\n" }, { "from": "human", "value": "angular.module('worldOfWorkCraftApp')\n .controller('LogAchievementCtrl', function($scope, $routeParams, $location, $http, UserData) {\n\n $scope.challengeName = $routePar...
javascript
chosen
[ { "from": "system", "value": "Update hook i18n to consider new locales filename\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies\n */\n\n// Node.js core.\nconst path = require('path');\n\n// Public node modules.\nconst _ = require('lodash');\n\n/**\n * i18n hook\n ...
javascript
chosen
[ { "from": "system", "value": "Change return type on empty arguments" }, { "from": "human", "value": "VideoStream.utils.loadFileFromURL = function(file, dir = '.'){\r\n\tif(!file){\r\n\t\treturn new Promise(function(resolve){resolve('');});\r\n\t}\r\n\tvar path = file;\r\n\tif(file.startsWith('/'...
javascript
chosen
[ { "from": "system", "value": "Add unit tests for service cache mixin\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport ServiceCacheMixin from '../../../mixins/service-cache';\nimport { module, test } from 'qunit';\n\nmodule('Unit | Mixin | service cache');\n\n// Replace this ...
javascript
chosen
[ { "from": "system", "value": "Test two subsequent requests get the same data\n" }, { "from": "human", "value": "'use strict';\n\nvar test = require('ava');\nvar githubRepos = require('./');\n\ntest('user with more than 100 repos', function (t) {\n\tt.plan(2);\n\tvar token = '523ef691191741c99d5a...
javascript
chosen
[ { "from": "system", "value": "Fix links on project not saved because of failed init\n" }, { "from": "human", "value": "import { inject, bindable, bindingMode } from 'aurelia-framework';\nimport { EventAggregator } from 'aurelia-event-aggregator';\n\n@inject(EventAggregator)\nexport class LlLinks...
javascript
chosen
[ { "from": "system", "value": "Fix date display on case\n" }, { "from": "human", "value": "/* @flow */\n\nconst CONSUMER = 'Consumer';\nconst NON_CONSUMER = 'Non Consumer';\nconst days = (date: number) => date / 1000 / 60 / 60 / 24;\n\nconst ConsumerParty = {\n type: 'Consumer',\n name: 'Consum...
javascript
chosen
[ { "from": "system", "value": "Allow Renderable name to be included in initialization data\n" }, { "from": "human", "value": "\"use strict\";\n\nconst merge = require('../../../util/merge');\nconst {coroutine: co} = require('bluebird');\n\nclass Renderable {\n constructor(data) {\n this.paren...
javascript
chosen
[ { "from": "system", "value": "Replace VERSION correctly in transpiled code\n" }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\nconst pkg = require('../package.json');\n\nconst buildDir = path.resolve(__dirname, '../build/ol');\n\n// update the version num...
javascript
chosen
[ { "from": "system", "value": "Call backend view on delete account frontend\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport {Button} from 'react-bootstrap';\n\nclass DeleteAccountForm extends Component {\n constructor(props) {\n super(props);\n ...
javascript
chosen
[ { "from": "system", "value": "Update dialog service to use defaults of angular ui-bootstrap.\n" }, { "from": "human", "value": "/*\n * Spreed WebRTC.\n * Copyright (C) 2013-2014 struktur AG\n *\n * This file is part of Spreed WebRTC.\n *\n * This program is free software: you can redistribute it...
javascript
chosen
[ { "from": "system", "value": ":art: Use async/await instead of Promise().then\n" }, { "from": "human", "value": "// Copyright (c) 2017 The Regents of the University of Michigan.\n// All Rights Reserved. Licensed according to the terms of the Revised\n// BSD License. See LICENSE.txt for details.\...
javascript
chosen
[ { "from": "system", "value": "Make IntersectionPrams standard type strings available as constants.\n" }, { "from": "human", "value": "/**\n *\n * IntersectionParams.js\n *\n * copyright 2002, Kevin Lindsey\n *\n */\n\n/**\n * IntersectionParams\n *\n * @param {String} name\n * @param {Arr...
javascript
chosen
[ { "from": "system", "value": "Add method 'AddLine' to the Module TrackNetwork\n" }, { "from": "human", "value": "/*\n\t@autor: Robin Giles Ribera\n\t* Module: TrackNetwork\n\t* Used on trackevent.js\n*/\n\ndefine( [], function() {\n\tconsole.log(\"[TrackNetwork][***###***]\");\n\n\tfunction Trac...
javascript
chosen
[ { "from": "system", "value": "Add missing function calls in tests\n" }, { "from": "human", "value": "'use strict';\n\nvar Chance = require('chance'),\n chance = new Chance();\n\nclass InvitePage {\n\n constructor () {\n this.titleEl = element(by.css('.project-title'));\n\n this.message...
javascript
chosen
[ { "from": "system", "value": "Add promise & create zip tests\n" }, { "from": "human", "value": "\"use strict\";\n\nconst assert = require(\"power-assert\");\nconst rimraf = require(\"rimraf\");\nconst unzip = require(\"unzip\");\nconst gitDiffArchive = require(\"../\");\n\nconst ID1 = \"\";\ncon...
javascript
chosen
[ { "from": "system", "value": "Change spec test according to new javascript test code\n" }, { "from": "human", "value": "describe('pingPong', function() {\n it(\"is true for a number that is divisible by 3\", function() {\n expect(pingPong(6)).to.equal(true);\n });\n it(\"is true for a numb...
javascript
chosen
[ { "from": "system", "value": "Clean up weak initial position constraints.\n" }, { "from": "human", "value": "var scrollingExample = {\n box: {\n id: \"clip\",\n className: \"clip\",\n children: {\n id: \"image\",\n className: \"image\"\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Use post over put for the status change api\n" }, { "from": "human", "value": "var QuestionCtrl = require('../controllers/questionCtrl.js');\n\nmodule.exports = function(express, app){\n var router = express.Router();\n\n router.post('/', QuestionCtrl.create);\n ...
javascript
chosen
[ { "from": "system", "value": "Test cases for math.sign() and math.clamp()\n" }, { "from": "human", "value": "define(['base'], function (base) { \"use strict\";\n\tvar math = base.math;\n\t\n\tdescribe(\"math\", function () {\n\t\tit(\".factorial()\", function () {\n\t\t\texpect(typeof math.fact...
javascript
chosen
[ { "from": "system", "value": "Use env library to parse config out of environment\n" }, { "from": "human", "value": "#!/usr/bin/env node\n/* @flow */\nimport { serve } from 'aspect/src/adapters/server'\n\nasync function run(): Promise<void> {\n const server = await serve({\n port: 'PORT' in p...
javascript
chosen
[ { "from": "system", "value": "Remove example info text before rendering" }, { "from": "human", "value": "/*global slimer */\n\nvar webpage = require(\"webpage\").create();\nvar messages = [];\n\nvar system = require(\"system\");\nvar args = system.args;\n\nvar url = args[1] || \"\";\nvar thumbPa...
javascript
chosen
[ { "from": "system", "value": "Remove -beta.n suffix from standard-minifier-css before republishing.\n" }, { "from": "human", "value": "Package.describe({\n name: 'standard-minifier-css',\n version: '1.3.3-beta.1',\n summary: 'Standard css minifier used with Meteor apps by default.',\n docume...
javascript
chosen
[ { "from": "system", "value": "Remove reference to old demo.\n" }, { "from": "human", "value": "// Demo components.\nimport \"./src/CalendarDayMoonPhase.js\";\nimport \"./src/CarouselComboBox.js\";\nimport \"./src/CountryListBox.js\";\nimport \"./src/CustomCarousel2.js\";\nimport \"./src/CustomDr...
javascript
chosen
[ { "from": "system", "value": "Throw instead of warning when the handler is not declared\n" }, { "from": "human", "value": "\nvar StoreWatchMixin = function(stores, options) {\n if (!options) options = {};\n\n options.addListenerFnName = options.addListenerFnName || 'addChangeListener';\n opti...
javascript
chosen
[ { "from": "system", "value": "Update API to do -all- the logic\n" }, { "from": "human", "value": "var http = require('http');\nvar request = require('request').defaults({ encoding: null });\nvar url = require('url');\n\nvar h = {\n 'Referer': null,\n 'Accept': 'text/html,application/xhtml+xml,...
javascript
chosen
[ { "from": "system", "value": "Stop mounting quickfiles if no quickfiles\n" }, { "from": "human", "value": "/**\n * Initialization code for the profile page. Currently, this just loads the necessary\n * modules and puts the profile module on the global context.\n *\n*/\nvar $ = require('jquery');...
javascript
chosen
[ { "from": "system", "value": "Add constrain type index for home page\n" }, { "from": "human", "value": "MarketingController = RouteController.extend({\n waitOn: function () {\n return Meteor.subscribe('marketing');\n },\n\n action: function () {\n var indexPage = Pages.findOne();\n i...
javascript
chosen
[ { "from": "system", "value": "Remove name conflict module => moduleConfig\n" }, { "from": "human", "value": "const nodeExternals = require('webpack-node-externals');\nconst path = require('path');\n\nconst entry = './src/ReactResponsiveSelect.js';\nconst library = 'ReactResponsiveSelect';\nconst...
javascript
chosen
[ { "from": "system", "value": "Update Bikeshed to use BaseModel\n" }, { "from": "human", "value": "/**\n * Bikeshed model\n */\nimport Joi from 'joi'\nimport * as utils from './utils'\n\nexport const INDEXES = ['userId', 'createdAt']\nexport const TABLE = 'bikesheds'\nexport const TYPE = 'Bikeshe...
javascript
chosen
[ { "from": "system", "value": "Return null for the the properties if the string cannot be parsed as a date\n" }, { "from": "human", "value": "'use strict';\n\nvar path = process.cwd();\n\nmodule.exports = function (app) {\n\n\tapp.route('/')\n\t\t.get(function (req, res) {\n\t\t\tres.sendFile(pat...
javascript
chosen
[ { "from": "system", "value": "Use momentjs duration to parse timestamps\n" }, { "from": "human", "value": "const moment = require('moment')\n\nconst scrubVideoToTimestamp = function () {\n let player = document.getElementsByTagName('video')[0]\n let timestamp = this.innerHTML\n const timeToGo...
javascript
chosen
[ { "from": "system", "value": "Fix the path because the file had moved.\n" }, { "from": "human", "value": "#!/bin/node\nimport path from 'path';\nimport fs from 'fs';\n\nimport {all as rawMetadata} from '../katas/es6/language/__raw-metadata__';\n\nimport {writeToFileAsJson} from './_external-deps...
javascript
chosen