conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change the ToggleButton helpers test to ToggleButton:Helpers\n" }, { "from": "human", "value": "import { expect } from 'chai';\nimport { isButtonSelected } from '../helpers.js';\n\ndescribe('isButtonSelected', () => {\n it('should return false when ...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect duration calculation in demo app.\n\nDemo app used Date for convert total seconds to hours, minutes and seconds.\nIt set Date in UTC format but read in local time zone.\nAs result localtime zone hours count added to output.\n" }, { "from": "human", "va...
javascript
chosen
[ { "from": "system", "value": "Modify player teams upon clan add/remove\n" }, { "from": "human", "value": "class Clan {\n removePlayer(player) {\n for (var i = 0; i < this.members.length; ++i) {\n if (this.members[i].player.sid === player.player.sid) {\n this.m...
javascript
chosen
[ { "from": "system", "value": "Add Color math operations (add, multiply, multiplyScalar).\n" }, { "from": "human", "value": "/*jshint bitwise:false*/\n'use strict';\n\nvar lerp = require( './utils' ).lerp;\n\n// RGB values are ints from [0, 255].\nfunction Color( r, g, b ) {\n this.r = r || 0;\n...
javascript
chosen
[ { "from": "system", "value": "Use the right Sentry method\n" }, { "from": "human", "value": "import angular from 'angular';\n\n/** Sentry.io exception reporting */\nexport let reportException = () => {};\n\nif ($featureFlags.sentry) {\n // The require instead of import helps us trim this from t...
javascript
chosen
[ { "from": "system", "value": "Replace some CRLFs with LFs.\n" }, { "from": "human", "value": "const random = require('./random');\r\n\r\ndescribe('getNumberBetween', () => {\r\n\r\n test('is exclusive', () => {\r\n let number = random.getNumberBetween(0, 1);\r\n expect(number).toBeGreater...
javascript
chosen
[ { "from": "system", "value": "Revert \"Fix bug in ZCR\"\n\nThis reverts commit 4f39a3a91626354f993ba3f0590529c311bc1000.\n" }, { "from": "human", "value": "export default function() {\n if (typeof arguments[0].signal !== 'object') {\n throw new TypeError();\n }\n\n var zcr = 0;\n for (var...
javascript
chosen
[ { "from": "system", "value": "feature(blog): Add functionality to created blog post\n" }, { "from": "human", "value": "'use strict';\n//noinspection JSUnresolvedVariable\nvar path = require('path'),\n baboon = require('../lib/baboon')(path.join(__dirname)),\n// middleware = baboon.middlewa...
javascript
chosen
[ { "from": "system", "value": "Fix moves across monitors acting funny\n\nWhen moving a tab to a different monitor, the tab would not render using\nthe new window size. This change fixes that bug by creating a new tab on\nthe target window and removing the old one (chrome.tabs.create,\nchrome.tabs.remove) rat...
javascript
chosen
[ { "from": "system", "value": "Add class BackgroundFlashData + small fix\n" }, { "from": "human", "value": "/**\n * StopFlash\n *\n * https://github.com/JWhile/StopFlash\n *\n * background.js\n */\n\nvar flashElements = {}; // :Map<chrome.Tab, Object>\n\nchrome.runtime.onConnect.addListener(funct...
javascript
chosen
[ { "from": "system", "value": "Use more idiomatic ember api\n" }, { "from": "human", "value": "import DS from 'ember-data';\n\nvar SiteSerializer = DS.RESTSerializer.extend({\n serialize: function(site, options) {\n var fields = [ 'name', 'tagline', 'description', 'moreDesc', 'joinText' ];\n ...
javascript
chosen
[ { "from": "system", "value": "Solve an error when input is undefined in ‘markdown’ filter.\n" }, { "from": "human", "value": "'use strict';\n\n// Filters\n\nvar filters = angular.module('martianblogFilters', ['ngSanitize']);\n\nfilters.filter('calendar', function() {\n\treturn function (input) {...
javascript
chosen
[ { "from": "system", "value": "Trim username whitespace before submitting\n" }, { "from": "human", "value": "var response = require('response');\nvar JSONStream = require('JSONStream');\nvar formBody = require('body/form');\nvar redirect = require('../lib/redirect');\n\nexports.install = function...
javascript
chosen
[ { "from": "system", "value": "Make sure error is a handled error\n" }, { "from": "human", "value": "const create = require('./index')\n\ndescribe('rpc/create', () => {\n it('should create a new user', async () => {\n const email = 'test@test.com'\n const id = '12345'\n const insertResu...
javascript
chosen
[ { "from": "system", "value": "Set this.music to empty object\n" }, { "from": "human", "value": "/*\n * mainmenu.js\n * Handles main menu\n */\n\nYINS.MainMenu = function(game) {\n\tthis.music;\n};\n\nYINS.MainMenu.prototype = {\n\tcreate: function() {\n\t\t/* Our assets are preloaded, so h...
javascript
chosen
[ { "from": "system", "value": "Change syntax to template strings.\n" }, { "from": "human", "value": "$('<section class=\"min-chat\"> \\\n<header class=\"min-chat__header\"> \\\n <b class=\"min-chat__header__title\">\\\n <img src=\"http://i.imgur.com/RKJMsl8.png\" class=\"min-chat__...
javascript
chosen
[ { "from": "system", "value": "Replace non-standard prependArg with bind\n\nbind is not supported on IE8, but we have it in the Strophe.js polyfills.\n\nMore info here: https://groups.google.com/forum/#!topic/strophe/TkEpQQK37PM\n" }, { "from": "human", "value": "Strophe.addConnectionPlugin('iexd...
javascript
chosen
[ { "from": "system", "value": "Replace initial config for personal info.\n" }, { "from": "human", "value": "module.exports = {\n siteMetadata: {\n title: `Gatsby Default Starter`,\n description: `Kick off your next, great Gatsby project with this default starter. This barebones starter shi...
javascript
chosen
[ { "from": "system", "value": "Add players to server on connect\n" }, { "from": "human", "value": "\nvar config = {\n server_port: 5000,\n server_opts: {}\n};\n\nvar server = require('http').Server();\nvar serverio = require('socket.io').listen(server, config.server_opts);\nserver.listen(config...
javascript
chosen
[ { "from": "system", "value": "Add section 6.1 code to provide login for users\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\n// Login a user with basic auth\nrouter.post('/', function (req, res, next) {});\n\nmodule.exports = router;\n" ...
javascript
chosen
[ { "from": "system", "value": "Fix averaging / mixing of colours\n\nNo, I don't know why it took me such a long time to spot this bug :D\n" }, { "from": "human", "value": "import boundary from './boundary'\n\nexport default function average(x, y, factor) {\n factor = boundary(factor, 0, 1)\n re...
javascript
chosen
[ { "from": "system", "value": "Make sure we pass in the segments if this is not instanceof Message\n" }, { "from": "human", "value": "var _ = require('underscore')\n , utils = require('./utils')\n\nmodule.exports = Message\n\nfunction Message(segments) {\n if (!(this instanceof Message))\n r...
javascript
chosen
[ { "from": "system", "value": "Add actionCreators option for window.devToolsExtension()\n\nadd counter actions & push action of `react-router-redux`\n" }, { "from": "human", "value": "import { createStore, applyMiddleware, compose } from 'redux';\nimport thunk from 'redux-thunk';\nimport createLo...
javascript
chosen
[ { "from": "system", "value": "Increase timeout of CLI tests to let the update notifier do the job.\n" }, { "from": "human", "value": "var cp = require('child_process');\nvar expect = require('expect.js');\n\nmodule.exports = function () {\n describe('CLI', function () {\n it('shoul...
javascript
chosen
[ { "from": "system", "value": "style: Fix typo in eslint disable\n" }, { "from": "human", "value": "/* eslint-disable gloabal-require */\nimport test from 'ava';\n\nimport Validator from '../src/validator';\nimport extend from '../src/extend';\nimport rules from '../src/rules';\n\ntest('should ex...
javascript
chosen
[ { "from": "system", "value": "Update path fonts gulp task" }, { "from": "human", "value": "var gulp = require('gulp');\nvar browserify = require('browserify');\nvar source = require('vinyl-source-stream');\nvar uglify = require('gulp-uglify');\nvar buffer = require('vinyl-buffer');\n\...
javascript
chosen
[ { "from": "system", "value": "Fix stale data: Encapsulate initial pre-processed row cleanup.\n" }, { "from": "human", "value": "import { select } from 'd3-selection'\n\nexport function ensureData(d, i) {\n if (!d) select(this).datum([])\n}\n" }, { "from": "gpt", "value": "import { s...
javascript
chosen
[ { "from": "system", "value": "Rename alg value for easybox/secretbox\n" }, { "from": "human", "value": "'use strict';\nvar _ = require('lodash');\n\nvar algos = {\n 'eddsa': 'eddsa',\n 'curve25519': 'curve25519',\n 'triplesec-v3': 'triplesec-v3',\n 'scrypt': 'scrypt',\n 'nacl easybox': 'nac...
javascript
chosen
[ { "from": "system", "value": "Fix an invalid coordinate in SpriteSheet\n" }, { "from": "human", "value": "'use strict';\r\n\r\nimport Sprite from './sprite';\r\n\r\nexport default class SpriteSheet {\r\n\tconstructor(texture, width, height) {\r\n\t\tthis.texture = texture;\r\n\t\tthis.width = wi...
javascript
chosen
[ { "from": "system", "value": "Improve error is API is dead\n" }, { "from": "human", "value": "import fetch from 'isomorphic-fetch'\n\nimport config from './config'\n\n\nasync function fetchJson(url, options) {\n const response = await fetch(url, options)\n if (response.status < 200 || response...
javascript
chosen
[ { "from": "system", "value": "Convert to POST, clean formatting\n" }, { "from": "human", "value": "var sys = require('sys');\nvar http = require('http');\nvar base64 = require('./vendor/base64'); \n\n// Command line args \nvar USERNAME = process.ARGV[2];\nvar PASSWORD = process.ARGV[3];\nvar SER...
javascript
chosen
[ { "from": "system", "value": "Add user agent so we don't get bounced by sites requiring it (e.g. SoundCloud)\n" }, { "from": "human", "value": "'use strict';\nvar request = require( 'request' ),\n cheerio = require( 'cheerio' ),\n urlChecker = {\n bot : false,\n setup : funct...
javascript
chosen
[ { "from": "system", "value": "Modify test specs with correct error messages.\n" }, { "from": "human", "value": "const\n\tlabyParser = require('../lib/parser'),\n\texpect\t\t= require('chai').expect;\n\t\n\ndescribe('Icarus', function(){\n\tit('should throw an error if there is a line which has ...
javascript
chosen
[ { "from": "system", "value": "Work around gulp error during i18n asset rebuilding\n\nThe test file requires built assets, so linting fails with an unresolved require while the i18n assets are being built.\n" }, { "from": "human", "value": "const jsdom = require('jsdom');\n\nglobal.document = jsd...
javascript
chosen
[ { "from": "system", "value": "Allow PDP to be initialized with existing PAP and export new API\n" }, { "from": "human", "value": "var api = require('./api');\nvar pap = require('../pap');\n\n// TODO: Check how to share app with PAP\nfunction init(settings) {\n return new Promise(function(reso...
javascript
chosen
[ { "from": "system", "value": "Replace absolute paths with relative paths\n\nThis is a workaround for https://github.com/mochajs/mocha/issues/2126 but since\nrelative paths are usually much nicer to look at it also has its own advantages\n" }, { "from": "human", "value": "var CLIEngine = require(...
javascript
chosen
[ { "from": "system", "value": "Add aliases for vue-router and vue-form\n" }, { "from": "human", "value": "var path = require(\"path\");\nvar components = path.resolve(__dirname, \"remoteappmanager/static/components\");\nvar js = path.resolve(__dirname, \"remoteappmanager/static/js\");\n\nmodule.e...
javascript
chosen
[ { "from": "system", "value": "Handle a lack of key more elegantly\n" }, { "from": "human", "value": "'use strict';\n\nvar a11y = require('./lib/a11y');\nvar cssStats = require('./lib/css-stats');\nvar pageSpeed = require('./lib/page-speed');\n\nvar humanizeUrl = require('humanize-url');\nvar nor...
javascript
chosen
[ { "from": "system", "value": "Replace \\\\ to -- on windows and / to -- on linux" }, { "from": "human", "value": "var gutil = require('gulp-util');\nvar PluginError = gutil.PluginError;\nvar through = require('through');\n\nfunction pluginError (message) {\n return new PluginError('gulp-jade-te...
javascript
chosen
[ { "from": "system", "value": "Add support for scoped package\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar program = require('commander'),\n globalify = require('./globalify'),\n packageJson = require('./package.json'),\n fs = require('fs');\n\nprogram\n .version(packag...
javascript
chosen
[ { "from": "system", "value": "Change tile URL to work with HTTP or HTTPS.\n" }, { "from": "human", "value": "var southWest = L.latLng(34.9816, -85.4719);\nvar northEast = L.latLng(35.217, -85.0462);\nvar center = L.latLng(35.0657, -85.241);\nvar bounds = L.latLngBounds(southWest, northEast);\n\n...
javascript
chosen
[ { "from": "system", "value": "Add FluxibleMixin as an export to facilitate ES6 module import" }, { "from": "human", "value": "/**\n * Copyright 2014, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nmodule.exports = require('./lib/...
javascript
chosen
[ { "from": "system", "value": "Add path to game in router\n" }, { "from": "human", "value": "import React from 'react';\nimport { Route, DefaultRoute, NotFoundRoute } from 'react-router';\n\nimport App from './pages/app.jsx';\n\nimport Lobby from './pages/lobby.jsx';\nimport Game from './pages/ga...
javascript
chosen
[ { "from": "system", "value": "Use `'html'` as output format\n\nPer jstransformers/jstransformer#3.\n" }, { "from": "human", "value": "'use strict';\n\nvar re = /\\]\\]>/g;\n\nexports.name = 'cdata-css';\nexports.outputFormat = 'xml';\n\nexports.render = function (str, options) {\n var escaped =...
javascript
chosen
[ { "from": "system", "value": "Add env line to script\n" }, { "from": "human", "value": "var fs = require('fs');\nvar formidable = require('formidable');\nvar git = require('./lib/git')(__dirname);\nvar http = require('http');\nvar hyperglue = require('hyperglue');\nvar _ = require('lodash');\nva...
javascript
chosen
[ { "from": "system", "value": "Allow multiple level-0 headings by setting asciidoc's \"doctype\" option to \"book\"" }, { "from": "human", "value": "'use strict'\n\nvar entities = require('entities');\nvar util = require('hexo-util');\nvar cheerio = require('cheerio');\nvar asciidoctor = require(...
javascript
chosen
[ { "from": "system", "value": "Change port to use env variable.\n" }, { "from": "human", "value": "let express = require('express');\n\nlet app = express();\n\napp.use(express.static('public'));\n\napp.listen(3000, () => {\n console.log(\"http://localhost:3000/\");\n});\n" }, { "from": "...
javascript
chosen
[ { "from": "system", "value": "[minor] Use buffers to prevent node from doing unwanted checks\n" }, { "from": "human", "value": "'use strict';\n\nvar through = require('through2')\n , pumpify = require('pumpify')\n , split = require('split')\n , regex = /^[ \\t]+$/;\n\n//\n// Expose the transf...
javascript
chosen
[ { "from": "system", "value": "Check for type then fill.\n" }, { "from": "human", "value": "(function() {\n try {\n return new KeyboardEvent(eventType, init);\n } catch (error) {\n global.window.KeyboardEvent = function(eventType, init) {\n var modKeys = [\n init.ctrlKey ? 'Co...
javascript
chosen
[ { "from": "system", "value": "Update pit() to keep same context as it()\n\nThis way you can call this.fail() from within the pit function." }, { "from": "human", "value": "function install(globalObject) {\n if (!globalObject.jasmine) {\n throw new Error(\n 'It looks like you\\'re trying...
javascript
chosen
[ { "from": "system", "value": "Load app.js with relative path.\n\nThis originally would break if you bootstrap into a path, such as\napp/assets/javascripts/ember.\n" }, { "from": "human", "value": "//= require jquery\n//= require handlebars\n//= require ember\n//= require ember-data\n//= require_...
javascript
chosen
[ { "from": "system", "value": "Fix unchanged function name for gitPull" }, { "from": "human", "value": "/*\n @method gitPull\n Takes a flightplan instance and transport\n @param remote {Object} Flightplan transport instance\n @param webRoot {string} path to run git pull on the remote server\n...
javascript
chosen
[ { "from": "system", "value": "Fix js error: currentType is undefined\n\nhttps://github.com/rancher/rancher/issues/23437\n" }, { "from": "human", "value": "import { get } from '@ember/object';\nimport { alias } from '@ember/object/computed';\nimport { inject as service } from '@ember/service';\ni...
javascript
chosen
[ { "from": "system", "value": "Update server-sass command to use local-server gulp task.\n" }, { "from": "human", "value": "/**\n * Created by doug.schroeder on 2/10/16.\n */\n\nmodule.exports = {\n run: function () {\n require('../../lib/spawn-gulp')(['watch-res-sass'].concat(process.argv.sp...
javascript
chosen
[ { "from": "system", "value": "Remove unused `computed` var in blueprint app adapter\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport FirebaseAdapter from 'emberfire/adapters/firebase';\n\nconst {inject, computed} = Ember;\n\nexport default FirebaseAdapter.extend({\n firebas...
javascript
chosen
[ { "from": "system", "value": "Change minification config variable name\n" }, { "from": "human", "value": "/* ==========================================================================\n Settings for webpack JavaScript bundling system.\n =======================================================...
javascript
chosen
[ { "from": "system", "value": "Use password auth in single docker container config\n" }, { "from": "human", "value": "/*\nThis Source Code Form is subject to the terms of the Mozilla Public\nLicense, v. 2.0. If a copy of the MPL was not distributed with this\nfile, You can obtain one at http://mo...
javascript
chosen
[ { "from": "system", "value": "Check when session is null" }, { "from": "human", "value": "/* global SolidAuthClient, SolidUtils, $rdf */\n\nTweeFiUtils = {\n\n TweetUri: class {\n constructor(value) {\n // Regex-pattern to check URLs against: \n // https://twitter...
javascript
chosen
[ { "from": "system", "value": "Include error message in node status endpoint\n" }, { "from": "human", "value": "var PSQL = require('cartodb-psql');\n\nfunction AnalysisStatusBackend() {\n}\n\nmodule.exports = AnalysisStatusBackend;\n\n\nAnalysisStatusBackend.prototype.getNodeStatus = function (pa...
javascript
chosen
[ { "from": "system", "value": "Modify route for Categories GET command.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(app) {\napp.route('/categories')\n .get(function (request, response) {\n response.json([\n { name: 'Beverages' },\n { name: 'Condimen...
javascript
chosen
[ { "from": "system", "value": "Change port number for app\n" }, { "from": "human", "value": "var fs = require('fs');\nvar flatiron = require('flatiron'),\n app = flatiron.app;\n\n\napp.use(flatiron.plugins.http, {\n // HTTP options\n});\n\nvar text_index = fs.readFileSync('index.html');\nvar bu...
javascript
chosen
[ { "from": "system", "value": "Change URL so it matches json-server\n" }, { "from": "human", "value": "var OrderModel = require('../models/m_order');\n\nvar OrderCollection = Backbone.Collection.extend({\n model: OrderModel,\n url: \"/api/users/self/orders\"\n});\n\nmodule.exports = OrderCollec...
javascript
chosen
[ { "from": "system", "value": "Speed up webpack process by removing sourcemap from test process - needs more work here\n" }, { "from": "human", "value": "var webpack = require('webpack');\n\nmodule.exports = function (config) {\n config.set({\n browsers: [ 'PhantomJS' ], // use PhantomJS for ...
javascript
chosen
[ { "from": "system", "value": "Update DiscordBot: Shorter game setting & don't respond to bots\n" }, { "from": "human", "value": "const Discord = require('discord.js');\nconst client = new Discord.Client();\n\n// https://discordapp.com/oauth2/authorize?&client_id=368144406181838861&scope=bot&perm...
javascript
chosen
[ { "from": "system", "value": "Include licences from included libraries in final minified file.\n" }, { "from": "human", "value": "/*!\n * Pusher JavaScript Library v<%= VERSION %>\n * http://pusherapp.com/\n *\n * Copyright 2010, New Bamboo\n * Released under the MIT licence.\n */\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Implement Module.prototype.resolve for Reify's new module.link API.\n" }, { "from": "human", "value": "require(\"meteor-babel-helpers\");\n\nvar Module = module.constructor;\nrequire(\"reify/lib/runtime\").enable(Module.prototype);\n\nrequire(\"meteor-promise\").mak...
javascript
chosen
[ { "from": "system", "value": "Make sure the AMD module is named \"milsymbol\"\n\nFor backward compability\n" }, { "from": "human", "value": "import resolve from \"rollup-plugin-node-resolve\";\nimport commonjs from \"rollup-plugin-commonjs\";\n\nexport default {\n input: \"src/index.js\",\n ou...
javascript
chosen
[ { "from": "system", "value": "Set event content to QR code\n" }, { "from": "human", "value": "\n/*\n * GET home page.\n */\nvar mongo = require('mongodb');\nvar appconf = require('konphyg')(__dirname + '/../config')('conf'); \n\nexports.byid = function(req, res){\n var event_id = req.params.id...
javascript
chosen
[ { "from": "system", "value": "Add social sharing plugin and remove contacts and SMS plugins" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar fs = require('fs-extra');\nvar async = require('async');\nvar exec = require('child_process').exec;\nvar colors = require('colors');\n\nfunction...
javascript
chosen
[ { "from": "system", "value": "Use the current protocol and host if none is specified\n" }, { "from": "human", "value": "const React = require('react');\nconst ReactDOM = require('react-dom');\n\n//*------------------------------------------------------------------*\n\nconst DifferentialRouter = ...
javascript
chosen
[ { "from": "system", "value": "Add debug to handle date case (need to test).\n" }, { "from": "human", "value": "angular.module('materialscommons').directive('processSettings', processSettingsDirective);\nfunction processSettingsDirective() {\n return {\n restrict: 'E',\n scope: {...
javascript
chosen
[ { "from": "system", "value": "Update expects for home page\n" }, { "from": "human", "value": "var po = require('./page-objects');\nvar ptor = protractor.getInstance();\n\ndescribe('lean coffee', function() {\n var global = new po.GlobalFunction();\n\n describe('home page', function(){\n var...
javascript
chosen
[ { "from": "system", "value": "Clean up, use time helper rather than util\n" }, { "from": "human", "value": "import Component from 'flarum/component';\nimport humanTime from 'flarum/utils/human-time';\nimport username from 'flarum/helpers/username';\n\n/**\n Displays information about a the firs...
javascript
chosen
[ { "from": "system", "value": "Fix typescript stacktraces using webpack sourcemaps\n" }, { "from": "human", "value": "// This is the webpack config used for unit tests.\n\nvar utils = require('./utils')\nvar webpack = require('webpack')\nvar merge = require('webpack-merge')\nvar baseConfig = requ...
javascript
chosen
[ { "from": "system", "value": "Fix: Allow proper logging of node.js Error objects.\n\nSee: https://github.com/bluejamesbond/Scribe.js/issues/70\n" }, { "from": "human", "value": "'use strict';\n\nvar config = require('./config');\n\n\n// Hack to allow proper logging of Error.\nObject.defineProper...
javascript
chosen
[ { "from": "system", "value": "Add hint that authentication check is currently commented out\n" }, { "from": "human", "value": "var env = require('./../env/env-config');\nvar util = require('./lib/utility.js')\n\nvar express = require('express');\nvar passport = require('passport');\n\nvar app = ...
javascript
chosen
[ { "from": "system", "value": "Fix sitemap include (to work on case sensitive linux)\n" }, { "from": "human", "value": "var SiteMap = require('sitemap.js').SiteMap;\nvar Doc = require('ngdoc.js').Doc;\n\n\ndescribe('sitemap', function(){\n it('should render empty sitemap', function(){\n var m...
javascript
chosen
[ { "from": "system", "value": "Remove warning when a call agent is not present\n" }, { "from": "human", "value": "/*\n * Copyright 2011 Intel Corporation.\n *\n * This program is licensed under the terms and conditions of the\n * Apache License, version 2.0. The full text of the Apache License i...
javascript
chosen
[ { "from": "system", "value": "Add driver code to test function\n" }, { "from": "human", "value": "// take input string\n// create empty output string\n// remove last letter of input string\n// add that letter to empty string\n// keep doing this until the input string is empty\n// return output s...
javascript
chosen
[ { "from": "system", "value": "Use function to get IntlString type\n" }, { "from": "human", "value": "import SimpleSchema from 'simpl-schema';\n\n/*\n\nLook for type name in a few different places\nNote: look into simplifying this\n\n*/\nexport const isIntlField = fieldSchema => {\n const typePr...
javascript
chosen
[ { "from": "system", "value": "Remove superfluous fix in favor of the remaining better one\n" }, { "from": "human", "value": "import DS from 'ember-data';\nimport { recordKey } from 'ember-gdrive/lib/util';\n\nfunction serializeId(record, relationship) {\n if (!record) {\n return null;\n }\n...
javascript
chosen
[ { "from": "system", "value": "Refactor stub into real query\n" }, { "from": "human", "value": "var db = require( '../config/db' );\nvar helpers = require( '../config/helpers' );\nvar Sequelize = require( 'sequelize' );\nvar User = require( '../users/users' );\nvar Session = require( '../sessions...
javascript
chosen
[ { "from": "system", "value": "Use mocha style reporting for tests\n" }, { "from": "human", "value": "var webpack = require('webpack');\n\nmodule.exports = function (config) {\n config.set({\n browsers: [ 'PhantomJS' ], // use PhantomJS for now (@gordyd - I'm using a VM)\n singleRun: true,...
javascript
chosen
[ { "from": "system", "value": "Fix `ns` decorator. Don't return a value.\n" }, { "from": "human", "value": "import App from \"./App\";\n\nexport default class Action {\n dispatchAction(...args) {\n return App.dispatchAction(...args);\n }\n\n get logger() {\n return App.logg...
javascript
chosen
[ { "from": "system", "value": "Configure mongodb uri to compose.io service\n" }, { "from": "human", "value": "'use strict';\n\n// Test specific configuration\n// ===========================\nmodule.exports = {\n // MongoDB connection options\n mongo: {\n uri: 'mongodb://localhost/workspace-t...
javascript
chosen
[ { "from": "system", "value": "Revert \"For getCurrentPosition(), use chrome.runtime.sendMessage() as the callback function; this avoids the problem of undefined lat/longitude because getCurrentPosition did not fetch values before chrome.runtime.sendMessage() fires\"\n\nThis reverts commit b893f4cb3b4c1665e2...
javascript
chosen
[ { "from": "system", "value": "Call onlyRegex just once when removing\n" }, { "from": "human", "value": "'use strict'\n\nvar sorted = require('sorted-array-functions')\nvar match = require('./match')\nvar onlyRegex = require('./onlyRegex')\n\nfunction Bucket (parent) {\n this.data = []\n this._...
javascript
chosen
[ { "from": "system", "value": "Include @sanity/core in bootstrapped packages\n" }, { "from": "human", "value": "export default {\n // Dependencies for a default Sanity installation\n core: {\n '@sanity/base': '^0.0.23',\n '@sanity/components': '^0.0.27',\n '@sanity/default-layout': '^0...
javascript
chosen
[ { "from": "system", "value": "Remove unused '/matches/:year' API for now\n" }, { "from": "human", "value": "'use strict';\n\nvar moment = require('moment');\nvar restify = require('restify');\nvar mongoose = require('mongoose');\n\nvar Match = mongoose.model('match');\nvar server = restify.c...
javascript
chosen
[ { "from": "system", "value": "Add functionality to allow for arrays of error values\n" }, { "from": "human", "value": "export default function isValid(error) {\n\n}\n" }, { "from": "gpt", "value": "export default function isValid(error) {\n if ( !Array.isArray(error) ) {\n return...
javascript
chosen
[ { "from": "system", "value": "Remove closure wrapping around script injector\n\nIt turns out that content scripts and JS in the document cannot affect\neach others state.\n" }, { "from": "human", "value": "(() => {\n const isURLAvailable = url => {\n const req = new Request(url, {\n met...
javascript
chosen
[ { "from": "system", "value": "Set up module exports differently\n" }, { "from": "human", "value": "var message_states = Object.freeze(\n {\n MESSAGE_FAILED: -1,\n MESSAGE_SENT: 1,\n MESSAGE_DELIVERED_SERVICE: 2,\n MESSAGE_DELIVERED_USER: 3,\n MESSAGE_READ: 4,\n MESSAGE_REPLIED...
javascript
chosen
[ { "from": "system", "value": "Remove table row links init method\n" }, { "from": "human", "value": "\n/* ==========================================================================\n Table Row Links\n\n Mixin for adding row link click functionality to table organism.\n\n ===================...
javascript
chosen
[ { "from": "system", "value": "Fix some typos in the German locale. Three letter day shorts are not really used in German, it's better to use two letters for dayNamesShort, too." }, { "from": "human", "value": "/**\n * RightJS UI Internationalization: German module\n *\n * Copyright (C) Nikolay V...
javascript
chosen
[ { "from": "system", "value": "Fix missing methods for displaying tags on archived toggles\n\nFixes #233\n" }, { "from": "human", "value": "import { connect } from 'react-redux';\nimport { fetchArchive, revive } from './../../store/archive/actions';\nimport ViewToggleComponent from './../feature/...
javascript
chosen
[ { "from": "system", "value": "Add new fields to investigation\n" }, { "from": "human", "value": "App.Investigation = DS.Model.extend({\n name: DS.attr('string', {defaultValue: 'New investigation'}),\n queryDefinition: DS.attr('string'),\n xAxisLabel: DS.attr('string'),\n yAxisLabel: DS.attr(...
javascript
chosen
[ { "from": "system", "value": "Use DEV_ENV. Add console.log for testing UglifyJS\n" }, { "from": "human", "value": "// welcome.js\n\n\"use strict\";\n\nfunction welcome(message) {\n if (NODE_ENV == \"development\") {\n debugger;\n }\n\n alert(`Welcome ${message}`);\n}\n\nexport { welcome };...
javascript
chosen
[ { "from": "system", "value": "Use System.import syntax for CSS\n" }, { "from": "human", "value": "'use strict';\n\n// import './CardComponent.css!';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nexport default class CardComponent extends React.Component {\n render() {\n ...
javascript
chosen
[ { "from": "system", "value": "Include width and height in brand image\n" }, { "from": "human", "value": "/* Tooling\n/* ========================================================================== */\n\nimport { $assign as $, $dispatch, $replaceAll } from 'esri-global-shared';\n\n/* Brand\n/* ====...
javascript
chosen
[ { "from": "system", "value": "Call fetchPosts when PostsIndex components mounts\n" }, { "from": "human", "value": "import React from 'react';\n\nclass PostsIndex extends React.Component {\n render() {\n return (\n <div className='posts-index'>\n Posts Index\n </div>\n )\n...
javascript
chosen