conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Make windowTint color with more opacity\n" }, { "from": "human", "value": "const colors = {\n main: '#023365',\n background: '#EEF1F4',\n clear: 'rgba(0,0,0,0)',\n facebook: '#3b5998',\n transparent: 'rgba(0,0,0,0)',\n silver: '#F7F7F7',\n steel: '#CCCCCC',\n...
javascript
chosen
[ { "from": "system", "value": "Fix globbing pattern in Modernizr taks when not defined\n" }, { "from": "human", "value": "import config from '../lib/config';\n\nimport log from 'fancy-log';\nimport pump from 'pump';\nimport gulpModernizr from 'gulp-modernizr';\nimport terser from 'gulp-terser';\n...
javascript
chosen
[ { "from": "system", "value": "Use read instead of load\n" }, { "from": "human", "value": "\"use strict\";\n/*jshint rhino:true*/\n/*eslint-env rhino*/\n/*global environment*/\n\nvar gpfPath = environment[\"user.dir\"];\n\nload(gpfPath + \"\\\\test\\\\host\\\\loader.js\"); /*global loadGpfAndTest...
javascript
chosen
[ { "from": "system", "value": "Add name regex test and mail validation\n" }, { "from": "human", "value": "describe('Users', function() {\n\n describe('Creation', function () {\n\n context('When creating a new user', function() {\n var some_guy = jsf(mocks.user);\n it('Should have an...
javascript
chosen
[ { "from": "system", "value": "Remove outdated test. Add new one for privacy\n" }, { "from": "human", "value": "const request = require('supertest');\nconst app = require('../app.js');\n\ndescribe('GET /', () => {\n it('should return 200 OK', (done) => {\n request(app)\n .get('/')\n ...
javascript
chosen
[ { "from": "system", "value": "chore: Increase test suite time-out for Travis I/O\n" }, { "from": "human", "value": "module.exports = {\n options: {\n // On TravisCI, sometimes the tests that require I/O need extra time.\n timeout: 5000,\n reporter: 'mocha-multi',\n reporterOptions: ...
javascript
chosen
[ { "from": "system", "value": "Add custom success and faluire messages\n" }, { "from": "human", "value": "/*\n * grunt-perl-tidy\n * https://github.com/rabrooks/grunt-perl-tidy\n *\n * Copyright (c) 2014 Aaron Brooks\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nmodule.exports = fu...
javascript
chosen
[ { "from": "system", "value": "Move function chain to single line.\n" }, { "from": "human", "value": "function formatCrateName(crateTitleAndVersion) {\n const stringParts = crateTitleAndVersion.split(\" \", 2);\n return stringParts[0] + ' = \"' + stringParts[1] + '\"';\n}\n\nfunction copyTe...
javascript
chosen
[ { "from": "system", "value": "Clarify the test being dummy\n" }, { "from": "human", "value": "import expect from 'expect';\n\ndescribe('Textfit', () => {\n it('works', () => {\n expect(true).toBe(true);\n });\n});\n" }, { "from": "gpt", "value": "import expect from 'expe...
javascript
chosen
[ { "from": "system", "value": "Fix problems in displaying common style of some article components\n\nFix problems in displaying common style of some article components" }, { "from": "human", "value": "/*eslint no-unused-vars:0*/\n'use strict'\nimport _ from 'lodash'\nimport React, { Component } f...
javascript
chosen
[ { "from": "system", "value": "Update to make it work with Astronomy 2.0.0-rc.4\n" }, { "from": "human", "value": "Package.describe({\n summary: 'Timestamp behavior for Meteor Astronomy',\n version: '2.0.0-rc.1',\n name: 'jagi:astronomy-timestamp-behavior',\n git: 'https://github.com/jagi/met...
javascript
chosen
[ { "from": "system", "value": "Make sure moment only loads in server\n" }, { "from": "human", "value": "Package.describe({\n name: 'd4nyll:moment',\n version: '0.0.3',\n // Brief, one-line summary of the package.\n summary: 'Meteor wrapper for Moment and Moment Timezone',\n // URL to the Git...
javascript
chosen
[ { "from": "system", "value": "Use real port for handle test\n" }, { "from": "human", "value": "require('../index.js');\n\nvar test = require('tap').test;\nvar net = require('net');\n\ntest('synchronous errors during connect return a null _handle', function(t){\n t.plan(3);\n\n // listening ser...
javascript
chosen
[ { "from": "system", "value": "Remove the extra angular declaration from tests\n\nBrowserify has already bundled angular on the main script.\n" }, { "from": "human", "value": "'use strict';\n\nvar istanbul = require('browserify-istanbul');\nvar isparta = require('isparta');\n\nmodule.exports = f...
javascript
chosen
[ { "from": "system", "value": "Convert test data collection to structure" }, { "from": "human", "value": "$(document).ready(function() {\n $('#run').click(function() {\n runTest();\n });\n});\n\nvar testWin;\nvar testOutput = {\n userAgent: navigator.userAgent,\n tests: []\n};\n\nfunction ...
javascript
chosen
[ { "from": "system", "value": "Add critical to build pipeline\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst htmlmin = require('gulp-htmlmin');\nconst terser = require('gulp-terser');\nconst cssnano = require('gulp-cssnano');\nconst imagemin = require('gulp-imagemin');\nc...
javascript
chosen
[ { "from": "system", "value": "Transform subdocuments' IDs as well\n" }, { "from": "human", "value": "module.exports = function(config, mongoose) {\n const rawEvent = require('./schemas-with-methods/event.js');\n const rawLocation = require('./schemas-with-methods/location.js');\n const rawUse...
javascript
chosen
[ { "from": "system", "value": "Make morphRetriever work more like a real service\n" }, { "from": "human", "value": "\"use strict\";\n\nannotationApp.service('morphRetriever', function($http) {\n this.getData = function(callback) {\n var request = $.ajax({\n url: './static/analyses.json',...
javascript
chosen
[ { "from": "system", "value": "Add watch target for gulp\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst butternut = require('gulp-butternut');\nconst coffee = require('gulp-coffee');\nconst mocha = require('gulp-mocha');\n\ngulp.task('coffee', function() {\n gulp.src('....
javascript
chosen
[ { "from": "system", "value": "Add options to gulp-chug to clean logs\n" }, { "from": "human", "value": "'use strict';\r\n\r\nvar gulp = require('gulp');\r\nvar chug = require( 'gulp-chug' );\r\nvar shell = require('gulp-shell');\r\nvar del = require('del');\r\n\r\ngulp.task( 'client', function (...
javascript
chosen
[ { "from": "system", "value": "Make eslint fail *after* errors\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar eslint = require('gulp-eslint');\n\ngulp.task('eslint', function () {\n gulp.src('./modules/**/*.js')\n .pipe(eslint())\n .pipe(eslint.formatEach('stylish', pr...
javascript
chosen
[ { "from": "system", "value": "Remove watch-statement from default builds\n" }, { "from": "human", "value": "var gulp = require('gulp')\n , compass = require('gulp-compass')\n , watcher = gulp.watch('sass/**/*.scss', ['sass']);\n\ngulp.task('sass', function () {\n gulp.src('./sass/**/*.scss')\...
javascript
chosen
[ { "from": "system", "value": "Update Dockstore link to release 0.0.6.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc service\n * @name dockstore.ui.WebService\n * @description\n * # WebService\n * Constant in the dockstore.ui.\n */\nangular.module('dockstore.ui')\n .constant...
javascript
chosen
[ { "from": "system", "value": "Update gulp config with new paths\n" }, { "from": "human", "value": "const path = require('path');\nconst gulp = require('gulp');\nconst babel = require('gulp-babel');\nconst postcss = require('gulp-postcss');\n\ngulp.task('js', function() {\n return gulp\n .src...
javascript
chosen
[ { "from": "system", "value": "Revert \"Added: default sass compiler\"\n\nThis reverts commit 6e89a663200b996c605ecd05dc1f0b60852c004e.\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst plugins = require('gulp-load-plugins')();\nconst config = require('./gulp/config')();\nco...
javascript
chosen
[ { "from": "system", "value": "Fix error in on-connect emission of userstats\n" }, { "from": "human", "value": "/*\n Created by 'myth' on July 3. 2015\n\n CognacTime is licenced under the MIT licence.\n*/\n\nvar log = require('./logging')\nvar util = require('../client/util')\n\n// Start by def...
javascript
chosen
[ { "from": "system", "value": "Move ContentSearcher HTML-parsing to separate function\n" }, { "from": "human", "value": "import cheerio from 'cheerio';\nimport Core from './core';\nimport RefResult from './ref-result.js';\n\nclass ContentSearcher {\n\n search(queryStr) {\n\n let searchURL = `...
javascript
chosen
[ { "from": "system", "value": "Replace complex validations with simple ones\n" }, { "from": "human", "value": "$(document).ready(function(){\n $('#crystallized').validate({\n rules: {\n company: {\n required: true\n },\n email: {\n ...
javascript
chosen
[ { "from": "system", "value": "Move DOMURL outside and add istanbul ignore\n" }, { "from": "human", "value": "/**\n * Get an image's width and height\n * @param {(File|blob|string)} File, blob, or URL string\n * @returns {Promise} resolved with object containing image width and height\n */\nmodul...
javascript
chosen
[ { "from": "system", "value": "Update file to exclude User Stories.\n" }, { "from": "human", "value": "##USER STORIES\n\n// /As a user i’d like to do three things to a list of numbers.\n// Using “sum” and the list I want to add together all the numbers whether the list is even or odd in length.\n...
javascript
chosen
[ { "from": "system", "value": "Change price back to number temporarily\n" }, { "from": "human", "value": "import Model from \"ember-data/model\";\nimport attr from \"ember-data/attr\";\nimport { belongsTo, hasMany } from \"ember-data/relationships\";\nimport { computed, get } from \"@ember/object...
javascript
chosen
[ { "from": "system", "value": "Create sample using new process create method.\n" }, { "from": "human", "value": "(function (module) {\n module.controller(\"SamplesController\", SamplesController);\n SamplesController.$inject = [\"$state\", \"project\", \"$filter\", \"samples\", \"processTem...
javascript
chosen
[ { "from": "system", "value": "Handle *.iced sources in addition to *.coffee.\n" }, { "from": "human", "value": "var fs = Npm.require('fs');\nvar path = Npm.require('path');\nvar iced = Npm.require('iced-coffee-script');\n\nvar handler = function (compileStep) {\n var source = compileStep.read()...
javascript
chosen
[ { "from": "system", "value": "Add dbversion parameter to call of webservice via ajax\n" }, { "from": "human", "value": "$(document).ready(function(){\n \n //autocomplete for organism search\n $(\"#search_organism\").autocomplete({\n position: {\n my: \"right top\", at:...
javascript
chosen
[ { "from": "system", "value": "Fix Karma tests for Webpack 2 and 3\n" }, { "from": "human", "value": "var expect = require('expect');\n\nmodule.exports = function chunk2(callback) {\n var resourcesWithIntegrity;\n function forEachElement(el) {\n var src = el.getAttribute('src') || el.getAttr...
javascript
chosen
[ { "from": "system", "value": "Add a get note method\n" }, { "from": "human", "value": "function NoteApplication (author) {\n\tthis.author = author;\n\tthis.notes = [];\n\n\tthis.create = function(note_content) {\n\t\tif (note_content.length > 0) {\n \t\tthis.notes.push(note_content);\n ...
javascript
chosen
[ { "from": "system", "value": "[eslint] Remove no-else-return from being checked\n\nTest Plan:\n - You can write\n\n if (something) {\n return somethingElse;\n else {\n return somethingElseEntirely;\n }\n\n without eslint getting mad about the else\n\nChange-Id: I92e5bbb2d9dbaed...
javascript
chosen
[ { "from": "system", "value": "Complete a bit the application helpers tests\n" }, { "from": "human", "value": "require('../test_helper');\nrequire('../../app/helpers');\n\ndescribe('Application helpers', () => {\n describe('#g', () => {\n it('should generate a Glyphicon span', () => {\n ...
javascript
chosen
[ { "from": "system", "value": "Clean up code for JsHint\n" }, { "from": "human", "value": "(function () {\n\n // Establish the root object, `window` in the browser, or `global` on the server.\n var root = this; \n \n // Create a reference to this\n var Instructor = function (fStrin...
javascript
chosen
[ { "from": "system", "value": "Use DOMContentLoaded instead of domready\n" }, { "from": "human", "value": "'use strict';\n\n// Module dependencies\nvar DOMReady = require('domready');\nvar MainView = require('./views/main');\nvar Me = require('./models/me');\n\n// The app's entry point. Reg...
javascript
chosen
[ { "from": "system", "value": "Make hash method return whole numbers\n\nThe generated hash number is used to create\nan array index which should be a whole number.\n\nFixes #8\n" }, { "from": "human", "value": "/*\n * Conversion from virtual time streams out to diagram data, and\n * vice-versa, a...
javascript
chosen
[ { "from": "system", "value": "Add tests for the application list view\n" }, { "from": "human", "value": "define([\n \"home/models\",\n \"home/views/application_list_view\",\n \"jquery\"\n], function (models, application_list_view, $) {\n \"use strict\";\n QUnit.module(\"home.views...
javascript
chosen
[ { "from": "system", "value": "Update data closer to the top of the hour\n\nThis will help make Salmon Run times show up sooner." }, { "from": "human", "value": "const CronJob = require('cron').CronJob;\nconst splatnet = require('./splatnet');\n\nconsole.info('Starting periodic tasks...');\n\n// ...
javascript
chosen
[ { "from": "system", "value": "Add message for report issue\n" }, { "from": "human", "value": "import React from 'react';\nimport Header from '../app/Header';\n\nconst Help = () =>\n <div className=\"main-panel\">\n <Header />\n <div className=\"my-5\">\n <div className=\"container te...
javascript
chosen
[ { "from": "system", "value": "Fix typo in POST request\n" }, { "from": "human", "value": "/* eslint-env jquery */\n\nstart();\nfunction start () {\n 'use strict';\n\n $(document).ready(() => {\n $('form').submit(event => {\n event.preventDefault();\n const username = $('#username'...
javascript
chosen
[ { "from": "system", "value": "Add CombatHelper class and getters/setters for modifiers.\n" }, { "from": "human", "value": "const Type = require('./type').Type;\n\n\n/*\n * These functions take an entity (npc/player)\n * and return the correct method or property\n * depending on type.\n */\n\ncon...
javascript
chosen
[ { "from": "system", "value": "Add google map component under city heading\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport Chart from '../components/chart';\n\nclass WeatherList extends Component {\n renderWeather(cityD...
javascript
chosen
[ { "from": "system", "value": "Rename migration name on 108 to match file name" }, { "from": "human", "value": "RocketChat.Migrations.add({\n\tversion: 107,\n\tup() {\n\t\tconst roles = RocketChat.models.Roles.find({\n\t\t\t_id: { $ne: 'guest' },\n\t\t\tscope: 'Users'\n\t\t}).fetch().map((role)=>...
javascript
chosen
[ { "from": "system", "value": "Change PolygonSet to not inherit from array.\n" }, { "from": "human", "value": "var clipper = require('../lib/clipper');\n\nvar SCALE = 100;\n\nvar PolygonSet = function(polygons) {\n polygons.__proto__ = PolygonSet.prototype;\n return polygons;\n};\n\nPolygonSet....
javascript
chosen
[ { "from": "system", "value": "Add options to unbox() to support logging\n" }, { "from": "human", "value": "var utils = require(\"./lib/utils\");\n\nvar Box = {\n unbox: function(url, destination) {\n return Promise.resolve()\n .then(function() {\n return utils.downloadBox(url, de...
javascript
chosen
[ { "from": "system", "value": "Add os to settings store\n" }, { "from": "human", "value": "import { createUIStore } from 'redux-webext';\nimport { resetSettings } from './actions';\nimport addInputBindings from './input-bindings';\nimport { initKeybindingTable, initSettings } from './dom';\n\nadd...
javascript
chosen
[ { "from": "system", "value": "Add options to Slick config\n" }, { "from": "human", "value": "jQuery(document).ready(function($) {\n $( '.slick' ).slick();\n});\n" }, { "from": "gpt", "value": "jQuery(document).ready(function($) {\n $( '.slick' ).slick({\n 'adaptiveHeight': true,...
javascript
chosen
[ { "from": "system", "value": "[CP-1156] Copy change for Catch-all section\n" }, { "from": "human", "value": "import React from 'react';\nimport { c } from 'ttag';\nimport { Alert } from '../../components';\n\nconst CatchAllSection = () => {\n return (\n <Alert learnMore=\"https://proto...
javascript
chosen
[ { "from": "system", "value": "Apply spoilers to the entire user activity stream.\n" }, { "from": "human", "value": "(function() {\n\n Discourse.addInitializer(function () {\n\n var applySpoilers = function($post) {\n // text\n $('.spoiler:not(:has(img))', $post).removeClass('spoile...
javascript
chosen
[ { "from": "system", "value": "Store the expense on pounchdb\n" }, { "from": "human", "value": "import * as pouchdbService from '../services/pouchdbService';\nimport {\n NEW_ITEM,\n NEW_CATEGORY,\n EDIT_SALARY,\n NEW_INCOME,\n} from '../constants/ActionTypes';\n\nimport { updateRev } from '.....
javascript
chosen
[ { "from": "system", "value": "Reduce opacity on LinkedIn icon highlight\n\n" }, { "from": "human", "value": "//@flow\n\nimport React from \"react\";\nimport styled, { css } from \"styled-components\";\n\nconst StyledHighlight = styled.rect`\n\n ${({ theme, isActive }: { theme: Theme, isActive: ...
javascript
chosen
[ { "from": "system", "value": "Add `miniplug:ws` debug namespace, logging all incoming events\n" }, { "from": "human", "value": "import login from 'plug-login'\nimport socket from 'plug-socket'\nimport createDebug from 'debug'\n\nconst debug = createDebug('miniplug:connect')\n\nexport default fun...
javascript
chosen
[ { "from": "system", "value": "Add support for specifying configurations in rule test helper\n" }, { "from": "human", "value": "import assert from 'assert';\nimport { parse } from 'graphql';\nimport { validate } from 'graphql/validation';\nimport { buildASTSchema } from 'graphql/utilities/buildAS...
javascript
chosen
[ { "from": "system", "value": "Add hash of the changes to the response to facilitate comparison\n" }, { "from": "human", "value": "const request = require('request-promise');\nconst cheerio = require('cheerio');\n\nconst BASE_URL = 'https://play.google.com/store/apps/details?hl=en&id=';\nconst HE...
javascript
chosen
[ { "from": "system", "value": ":rotating_light: Add a long ago written test\n\nThe test was not commited, only on my machine.\n" }, { "from": "human", "value": "/*jshint node:true,laxcomma:true*/\n/* global describe, it */\n'use strict';\nvar assert = require('assert')\n , JBJ = require('jbj');\...
javascript
chosen
[ { "from": "system", "value": "Change boolean check to utilize shortciruit\n" }, { "from": "human", "value": "define([], function () {\n return {\n hasLoggedInUser: function() {\n return !!this.profile.get('username');\n },\n profile: null\n }\n});\n" }, { "from": "gpt",...
javascript
chosen
[ { "from": "system", "value": "Indent code after changing editor to netbeans." }, { "from": "human", "value": "/*global angular*/\nangular.module('post')\n\t/**\n * @ngdoc controller\n * @name post.controller:PostMainController\n *\n * @description\n * # main post controller\n *...
javascript
chosen
[ { "from": "system", "value": "Use module `once` method in test harness.\n\nCloses #67.\n" }, { "from": "human", "value": "module.exports = require('proof')(function () {\n var register = require('../../register')\n var stream = require('stream')\n var path = require('path')\n return ...
javascript
chosen
[ { "from": "system", "value": "Add dynamic segment to nightlife route\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport config from './config/environment';\n\nconst Router = Ember.Router.extend({\n location: config.locationType,\n rootURL: config.rootURL\n});\n\nRouter.map(f...
javascript
chosen
[ { "from": "system", "value": "Add test files for cssmin with and without banner\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n pkg: '<json:package.json>',\n test: {\n files: ['test/**/*.js']\n },\n lin...
javascript
chosen
[ { "from": "system", "value": "Set up services to contain logic and inject in date wrapper\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('myApp.view1', ['ngRoute'])\n\n.config(['$routeProvider', function($routeProvider) {\n $routeProvider.when('/view1', {\n templateUrl: '...
javascript
chosen
[ { "from": "system", "value": "Remove renderAsync() since it's sync anyway\n\nFixes #1" }, { "from": "human", "value": "'use strict';\n\nvar octet = require('octet');\nvar merge = require('merge');\nvar Promise = require('promise');\n\nexports.name = 'octet';\nexports.outputFormat = 'html';\n\nex...
javascript
chosen
[ { "from": "system", "value": "Use the precompiled css by default, allow an option to use scss\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar path = require('path'),\n path_join = function () {\n // fix path with windows back slash with path_join\n return path...
javascript
chosen
[ { "from": "system", "value": "Clean up and print error in dev mode\n" }, { "from": "human", "value": "const { send } = require('micro')\n\nconst errorHandler = next => async (req, res) => {\n try {\n return await next(req, res)\n } catch (err) {\n const code = err.statusCode || 500\n ...
javascript
chosen
[ { "from": "system", "value": "Change port syntax to fit deployment\n" }, { "from": "human", "value": "var app = require('./server/server.js');\n\nvar port = process.env.port || 3000;\napp.listen(port, function() {\n console.log('Server is listening on ' + port);\n});" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Fix misuse of `-force` flag\n\nIf the source file is already well optimized, `-force` option produces larger image unfortunately. Without `-force` option exactly the same image will be copied to the destination.\n\nfix https://github.com/sindresorhus/gulp-imagemin/issues/196\n"...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary complexity from getHelpers.\n" }, { "from": "human", "value": "var helpers = require('./lib/helpers.js');\n\n/**\n Gets helpers in the provided location?\n */\nmodule.exports.getHelpers = function (location) {\n if (location === 'Intl') {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix background color transparencies to match new vibrancy behaviour\n" }, { "from": "human", "value": "module.exports.onWindow = browserWindow => browserWindow.setVibrancy('dark');\n\nconst foregroundColor = '#fff';\nconst backgroundColor = 'rgba(31, 43, 49, .96)';\...
javascript
chosen
[ { "from": "system", "value": "Remove useless return in exec() callback\n" }, { "from": "human", "value": "var fs = require('fs')\n , findExec = require('find-exec')\n , child_process = require('child_process')\n , players = [\n 'mplayer...
javascript
chosen
[ { "from": "system", "value": "Use same fs for client & server.\n" }, { "from": "human", "value": "'use strict';\n\nconst compose = require('compose-middleware').compose;\nconst merge = require('lodash.merge');\nconst standardFs = require('./lib/fs/standardFs');\nconst memoryFs = require('./lib/f...
javascript
chosen
[ { "from": "system", "value": "Add a few more cgi paths\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = [\n 'admin.cgi',\n 'administrator.cgi',\n 'backup.cgi',\n 'cgi-bin/common/attr', // open proxy test\n 'cgi-bin/printenv',\n 'concept.cgi',\n 'count.cgi...
javascript
chosen
[ { "from": "system", "value": "Emphasize that events fire just once\n" }, { "from": "human", "value": "'use strict';\n\nconst EventEmitter = require('events');\n\nconst devtools = require('./lib/devtools');\nconst Chrome = require('./lib/chrome');\n\nmodule.exports = function (options, callback) ...
javascript
chosen
[ { "from": "system", "value": "Exclude environment variables which are not defined\n" }, { "from": "human", "value": "var util = require('util');\n\n\nvar DECLARATION = 'window.__env__ = window.__env__ || {};\\n',\n TEMPLATE = function(name) {\n var tmpl = 'window.__env__[\\'%s\\'] = \\'%...
javascript
chosen
[ { "from": "system", "value": "Make sure disableInputsInitializer deprecation printed only once\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n name: require('./package').name,\n\n config(environment, appConfig) {\n const addonConfig = appConfig['emberKeyboard'] || {...
javascript
chosen
[ { "from": "system", "value": "js: Remove useless timeout from DefaultScanOptions\n" }, { "from": "human", "value": "'use strict';\n\nimport { NativeAppEventEmitter, NativeModules } from 'react-native';\nconst ReactNativeBluetooth = NativeModules.ReactNativeBluetooth;\n\nconst didChangeState = (c...
javascript
chosen
[ { "from": "system", "value": "Support running the callback immediately\n" }, { "from": "human", "value": "import { timer as d3Timer } from 'd3-timer';\n\nexport default function PeriodicJS(opts) {\n\n\tconst { duration, displaySelector, callback } = opts;\n\tlet timer;\n\n\tfunction displayTimeL...
javascript
chosen
[ { "from": "system", "value": "Increase wait time in acceptance test\n" }, { "from": "human", "value": "\nFeature('Render The Map');\n\nScenario('CartoDB loads the leaflet map', function* (I) {\n\n I.amOnPage('/test/examples/leaflet.html');\n\n I.seeInTitle('CartoDB.js example');\n\n let carto...
javascript
chosen
[ { "from": "system", "value": "Fix argv usage for uncompiled and for jxcore bundled package usage\n" }, { "from": "human", "value": "#! /usr/bin/env node\n\nvar fs = require('fs-promise');\nvar compiler = require('./compiler');\n\nfs.lstat('tomahawk/resolver.js').then(function(stats) {\n if(!s...
javascript
chosen
[ { "from": "system", "value": "Use argv0 instead of node (for Travis CI)\n" }, { "from": "human", "value": "const path = require(\"path\");\nconst rootDir = path.normalize(path.join(__dirname, \"..\"));\nconst tester = path.join(rootDir, \"node_modules\", \"vscode\", \"bin\", \"test\");\nconst cp...
javascript
chosen
[ { "from": "system", "value": "Fix syntax error in addon blueprint\n" }, { "from": "human", "value": "/*jshint node:true*/\nmodule.exports = {\n description: ''\n\n // locals: function(options) {\n // // Return custom template variables here.\n // return {\n // foo: options.entity.op...
javascript
chosen
[ { "from": "system", "value": "Hide restart on start page\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport store from '../store.js';\nimport { restart } from '../actions/name-actions';\nimport { selectGender } from '../ac...
javascript
chosen
[ { "from": "system", "value": "Fix improper grammar in Dutch i18n file\n\nGrammar is incorrect when maximum is 1, 'kunnen' should be 'kan' in that case." }, { "from": "human", "value": "define(function () {\n // Dutch\n return {\n errorLoading: function () {\n return 'De resultaten kond...
javascript
chosen
[ { "from": "system", "value": "Add random gold or blue\n" }, { "from": "human", "value": "var _ = require('underscore');\n\n// Load .env for development environments\nrequire('dotenv').load();\n\nexports.initLocals = function(req, res, next) {\n\n var locals = res.locals;\n\n locals.user = req....
javascript
chosen
[ { "from": "system", "value": "Add mapping for Google Translate service" }, { "from": "human", "value": "// These URL paths will be transformed to CN mirrors.\nvar mirrors = {\n \"//developers.google.com\" : \"//developers.google.cn\",\n \"//firebase.google.com\" : \"//firebase.google.cn\",\n...
javascript
chosen
[ { "from": "system", "value": "Update sourcemappingurl declaration in example\n" }, { "from": "human", "value": "function add(a,b){\"use strict\";return a+b}function multiply(a,b){\"use strict\";return a*b}function divide(a,b){\"use strict\";try{return multiply(add(a,b),a,b)/c}catch(e){Raven.capt...
javascript
chosen
[ { "from": "system", "value": "Improve content-type header detection +\nFix webRequest listener check for ff\n" }, { "from": "human", "value": "\nmd.headers = ({storage: {state}, detect}) => {\n\n var callback = ({method, url, responseHeaders}) => {\n if (method !== 'GET') {\n return {re...
javascript
chosen
[ { "from": "system", "value": "Remove old control button code\n" }, { "from": "human", "value": "angular.module('progressButtonDemo', ['progressButton'])\n\t.controller('ProgressButtonsCtrl', function($scope, $interval) {\n\t\t$scope.buttons = [\n\t\t\t{ value: 0.0 },\n\t\t\t{ value: 0.0 },\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Use localstorage location only if it is valid\n" }, { "from": "human", "value": "'use strict';\n\nvar etcdApp = angular.module('etcdApp', ['ngRoute', 'etcdResource', 'timeRelative'])\n .config(['$routeProvider', function ($routeProvider) {\n //read localstorage\...
javascript
chosen
[ { "from": "system", "value": "Add output of ASCII chess board\n" }, { "from": "human", "value": "var DGT = require('..');\nvar board = new DGT.Board('/dev/ttyUSB0');\n\nboard.on('ready', function() {\n console.log('Serial No:', board.serialNo);\n console.log('Version:', board.versionNo);\n co...
javascript
chosen
[ { "from": "system", "value": "Check if we want to disable and return" }, { "from": "human", "value": "/* global Raven */\n\nimport config from '../config/environment';\nimport Ember from 'ember';\n\nexport function initialize() {\n var _onerror;\n\n Raven.config(config.sentry.dsn, {\n white...
javascript
chosen
[ { "from": "system", "value": "Tidy Up: JSHint clean up\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('quakeStatsApp')\n .controller('MainCtrl', ['$scope',\n function ($scope) {\n }]);\n" }, { "from": "gpt", "value": "'use strict';\n\nangular.module('...
javascript
chosen
[ { "from": "system", "value": "Edit grunt command: Add --url parameter\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\n var url = grunt.option('url') || 'http://localhost:3000';\n\n // Project configuration.\n grunt.initConfig({\n bowercopy: {\n ...
javascript
chosen
[ { "from": "system", "value": "devlogin: Fix handling of fragments in the URL.\n\nWhen a fragment (i.e. section starting with `#`) is present in the URL\nwhen landing the development login page, dev-login.js used to append\nit to the appends it to the `formaction` attribute of all the input\ntag present in t...
javascript
chosen
[ { "from": "system", "value": "perf: Use for-loop instead of forEach\n" }, { "from": "human", "value": "const defer = () => {\n let state = false // Resolved or not\n let value\n const callbacks = []\n const resolve = val => {\n if (state) {\n return\n }\n\n state = true\n va...
javascript
chosen
[ { "from": "system", "value": "Complete operators tests to pass\n" }, { "from": "human", "value": "\nmodule(\"About Operators (topics/about_operators.js)\");\n\ntest(\"addition\", function() {\n var result = 0;\n //starting i at 0, add i to result and increment i by 1 until i is equal to 5\n f...
javascript
chosen