conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use updated registry in Ember 2.1\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport function initialize(instance) {\n const config = instance.container.lookupFactory('config:environment');\n\n // Default to true when not set\n let _includeRo...
javascript
chosen
[ { "from": "system", "value": "Update production build for react-0.14\n" }, { "from": "human", "value": "var config = module.exports = require(\"./webpack.config.js\");\nvar webpack = require('webpack');\nvar _ = require('lodash');\n\nconfig = _.merge(config, {\n externals : {\n \"react...
javascript
chosen
[ { "from": "system", "value": "Enforce SSL connection to Postgres\n" }, { "from": "human", "value": "//For Heroku Deployment\nvar URI = require('urijs');\nvar config = URI.parse(process.env.DATABASE_URL);\n\nmodule.exports = config;\n// module.exports = {\n// database: 'sonder',\n// user: 'po...
javascript
chosen
[ { "from": "system", "value": "Allow \"define\" in examples (no-undef)\n" }, { "from": "human", "value": "'use strict';\n\nrequire.config({\n paths: {\n Ably: '/ably.min'\n }\n});\n\ndefine(['Ably'], function(Ably) {\n var ably = new Ably();\n return ably;\n});\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Fix bug when starting pmdr multiple times\n" }, { "from": "human", "value": "\nvar Pomodoro = Backbone.Model.extend({\n\n defaults: {\n isStarted: false,\n duration: 25 * 60,\n remainingSeconds: null\n },\n\n initialize: function() {\n ...
javascript
chosen
[ { "from": "system", "value": "[cleanup] Read dev server port from env if its there" }, { "from": "human", "value": "/* eslint no-var: 0, func-names: 0 , no-console: 0 */\n\n/**\n * Development Server\n * - See https://github.com/gaearon/react-transform-boilerplate\n */\n\nvar path = require('pat...
javascript
chosen
[ { "from": "system", "value": "Make more similar to original version" }, { "from": "human", "value": "var Immutable = require('immutable');\n\nvar is = Immutable.is.bind(Immutable),\n getKeys = Object.keys.bind(Object);\n\nfunction shallowEqualImmutable(objA, objB) {\n if (is(objA, objB)) {\n...
javascript
chosen
[ { "from": "system", "value": "Use new for Array construction\n\nFixes issue with jshint.\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nfunction range(start, end) {\n return Array(end-start).join(0).split(0).map((val, id) => id + start);\n}\nexport default Ember.Component.exte...
javascript
chosen
[ { "from": "system", "value": "Add id the link where the toggleUser is bind\n" }, { "from": "human", "value": "import React from 'react';\nimport {\n Link\n} from 'react-router';\nimport './Menu.css';\nimport User from './User';\nimport language from '../language/language';\n\nconst menuLanguage...
javascript
chosen
[ { "from": "system", "value": "Remove \"Testing\" as best word every time\n\nSigned-off-by: Reicher <d5b86a7882b5bcb4262a5e66c6cf4ed497795bc7@gmail.com>\n" }, { "from": "human", "value": "MiniPanel = function (game, text, x, y) {\n Phaser.Group.call(this, game);\n\n text = \"TESTING\"\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add missing whitespace around link\n" }, { "from": "human", "value": "import React from 'react';\nimport './App.css';\nimport Clock from './Clock.js';\n\nfunction App() {\n return (\n <div className=\"App\">\n <Clock></Clock>\n\n {/*\n If you add ...
javascript
chosen
[ { "from": "system", "value": "Use needleNase API in clientBase\n" }, { "from": "human", "value": "const needleBase = require('./needle-base');\n\nmodule.exports = class extends needleBase {\n addStyle(style, comment, filePath, needle) {\n const styleBlock = this.mergeStyleAndComment(st...
javascript
chosen
[ { "from": "system", "value": "Add return for async task cmpletition\n" }, { "from": "human", "value": "import gulp from 'gulp';\nimport plumber from 'gulp-plumber';\nimport filter from 'gulp-filter';\nimport changed from 'gulp-changed';\nimport imagemin from 'gulp-imagemin';\nimport { plumberCon...
javascript
chosen
[ { "from": "system", "value": "Simplify browser version selection for autoprefixer\n" }, { "from": "human", "value": "/*eslint-disable no-alert, no-console */\nimport gulp from 'gulp';\nimport gulpLoadPlugins from 'gulp-load-plugins';\n\nimport * as paths from './paths';\n\n\nconst $ = gulpLoadPl...
javascript
chosen
[ { "from": "system", "value": "Update configuration file according to new API\n" }, { "from": "human", "value": "exports[\"Buster terminal tests\"] = {\n environment: \"node\",\n tests: [\"test/**/*.js\"]\n};\n" }, { "from": "gpt", "value": "exports[\"Buster terminal tests\"] = ...
javascript
chosen
[ { "from": "system", "value": "Use promise installer when using CLI\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar _ = require('lodash')\nvar yargs = require('yargs')\n\nvar installer = require('./installer')\nvar pkg = require('../package.json')\n\nvar argv = yargs\n .version(pkg...
javascript
chosen
[ { "from": "system", "value": "Enable native async/await in Node 8.\n" }, { "from": "human", "value": "module.exports = function (babel) {\n var t = babel.types;\n\n return {\n visitor: {\n Function: function (path) {\n var node = path.node;\n if (! node.async) {\n ...
javascript
chosen
[ { "from": "system", "value": "Clean up HKID verification code\n" }, { "from": "human", "value": "Meteor.methods({\n checkHKID: function (hkid) {\n var hkidPat = /^([A-Z]{1,2})([0-9]{6})([A0-9])$/;\n var matchArray = hkid.match(hkidPat);\n if(matchArray == null){throw new ...
javascript
chosen
[ { "from": "system", "value": "Create unit watcher grunt task\n" }, { "from": "human", "value": "/*jshint camelcase:false */\n\nmodule.exports = function (grunt) {\n // Load all grunt tasks\n require('load-grunt-tasks')(grunt);\n\n // Project configuration.\n grunt.initConfig({\n release: ...
javascript
chosen
[ { "from": "system", "value": "Clean up & node-webkit version bump\n" }, { "from": "human", "value": "/*jshint node:true */\n\"use strict\";\n\nvar fs = require(\"fs\"),\n async = require(\"async\");\n\nmodule.exports = function(grunt) {\n \n var nwDir = grunt.option(\"nwdir\") || \"....
javascript
chosen
[ { "from": "system", "value": "Add a grunt task to translipe stylus\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(grunt) {\n // Load all tasks\n require('load-grunt-tasks')(grunt);\n\n grunt.initConfig({\n pck: grunt.file.readJSON('package.json'),\n\n clea...
javascript
chosen
[ { "from": "system", "value": "Fix Karma trying to compile files that should not be compiled\n\nPerhaps we need another strategy here. Basically only 'frontend' files\nneed to be compiled.\n" }, { "from": "human", "value": "module.exports = function(karma) {\n const rollupConfig = require(\"./ro...
javascript
chosen
[ { "from": "system", "value": "Remove old and incorrect workflow docs\n\n" }, { "from": "human", "value": "/**\n * Configuration library\n *\n * On start-up:\n * - load a configuration file\n * - validate the configuration\n * - populate configuration secrets from environment variables\n *\n * On...
javascript
chosen
[ { "from": "system", "value": "Use target attribute instead of srcElement\n" }, { "from": "human", "value": "document.addEventListener('mouseup', function (e) {\n var ws = null;\n var el = e.srcElement;\n\n while (ws == null && el && el.getAttribute) {\n ws = el.getAttribute(\"wicketsource\...
javascript
chosen
[ { "from": "system", "value": "Stop needlessly recreating field ref string\n" }, { "from": "human", "value": "lunr.FieldRef = function (docRef, fieldName) {\n this.docRef = docRef\n this.fieldName = fieldName\n this._stringValue = fieldName + lunr.FieldRef.joiner + docRef\n}\n\nlunr.FieldRef.j...
javascript
chosen
[ { "from": "system", "value": "Use offset rather than calculating position by hand" }, { "from": "human", "value": "(function ($) {\n \n // http://davidwalsh.name/ways-css-javascript-interact\n function addCSSRule (sheet, selector, rules, index) {\n if (sheet.insertRule) {\n sheet.inser...
javascript
chosen
[ { "from": "system", "value": "Update first Wit example to do it more simple\n" }, { "from": "human", "value": "const speeech = require(\"../src/index\");\nconst get = require(\"lodash.get\");\nconst say = require(\"say\");\n\nconst serviceConfig = require(\"../witkeyfile.json\");\n\nconst proces...
javascript
chosen
[ { "from": "system", "value": "Fix extra v1 for microservice user login\n" }, { "from": "human", "value": "\"use strict\";\n\nconst config = require(\"../../../config.js\");\nconst Client = require(\"node-rest-client\").Client;\nconst client = new Client();\n\nmodule.exports = function (UserSche...
javascript
chosen
[ { "from": "system", "value": "Add valid test for front page\n" }, { "from": "human", "value": "casper.test.begin('index loads', 1, function suite(test) {\n casper.start('http://localhost:5000', function() {\n test.assertTextExists('MLTSP', 'successfully loaded index page');\n });\n\...
javascript
chosen
[ { "from": "system", "value": "Use module pattern because its javascript\n" }, { "from": "human", "value": "let rethinkdbConfig = {\n host: process.env.RETHINKDB_HOST || 'localhost',\n port: process.env.RETHINKDB_PORT || 28015,\n db: 'quill_lessons'\n}\n\nif (process.env.RETHINKDB_USER) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix Slovak localisation and add AM/PM markers" }, { "from": "human", "value": "/* Slovak translation for the jQuery Timepicker Addon */\n/* Written by David Vallner */\n(function($) {\n\t$.timepicker.regional['sk'] = {\n\t\ttimeOnlyTitle: 'Zvoľte čas',\n\t\ttimeText...
javascript
chosen
[ { "from": "system", "value": "Add unit test for object inversion\n" }, { "from": "human", "value": "describe('Support module', function () {\n var S = GameOfLife.Support;\n\n describe('For validating canvas', function () {\n it('throws InvalidArgument if given other than a canvas element', ...
javascript
chosen
[ { "from": "system", "value": "chore: Split out the card template funciton\n\n" }, { "from": "human", "value": "const utilities = require('./utilities');\n\nconst limited = (limited) => limited ? ' | limited' : '';\nconst unique = (unique) => unique ? ' | unique' : '';\nconst points = (po...
javascript
chosen
[ { "from": "system", "value": "Fix compatibility with sharp >=0.22.x\n\n.min() was removed" }, { "from": "human", "value": "const sharp = require('sharp')\n\nconst cropDimensions = (width, height, maxSize) => {\n if (width <= maxSize && height <= maxSize) return [width, height]\n const aspectRa...
javascript
chosen
[ { "from": "system", "value": "Fix sort order since we now display the module logo right aligned to the module name cell\n" }, { "from": "human", "value": "jQuery(function ($) {\n setup_search_box();\n $('.tablesorter').tablesorter({\n sortList: [[1,0]],\n headers: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add loading data log message.\n" }, { "from": "human", "value": "var Cache = require('./cache');\nvar fs = require('fs');\nvar handlers = require('./handlers');\nvar Ute = require('ute');\nvar util = require('./util');\n\nfunction FeedPaper() {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove setTimeout in favor of process.nextTick()\n\nAccording to [process.nextTick() documentation](http://nodejs.org/api/process.html#process_process_nexttick_callback), using setTimeout is not recommended:\r\n\r\n On the next loop around the event loop call this callback. ...
javascript
chosen
[ { "from": "system", "value": "Fix modifiers for ebook format\n" }, { "from": "human", "value": "var svgToImg = require('./svgToImg');\nvar svgToPng = require('./svgToPng');\nvar resolveImages = require('./resolveImages');\nvar fetchRemoteImages = require('./fetchRemoteImages');\n\nvar Promise = ...
javascript
chosen
[ { "from": "system", "value": "perf(util): Change template string to concatenation\n" }, { "from": "human", "value": "/**\n * Bytes to encode to VT100 control sequence.\n *\n * @param {String} code Control code that you want to encode\n * @returns {Buffer} Returns encoded bytes\n */\nexport const...
javascript
chosen
[ { "from": "system", "value": "Test Fenwick Tree: Sums till index\n" }, { "from": "human", "value": "/* eslint-env mocha */\nconst FenwickTree = require('../../src').DataStructures.FenwickTree;\nconst assert = require('assert');\n\ndescribe('Fenwick Tree', () => {\n it('should be empty when init...
javascript
chosen
[ { "from": "system", "value": "Add database url for production\n" }, { "from": "human", "value": "const config = {\n development: {\n username: 'postgres',\n password: '212213',\n database: 'more-recipes-development',\n host: '127.0.0.1',\n dialect: 'postgres'\n },\n test: {\n ...
javascript
chosen
[ { "from": "system", "value": "Change GoogleUniversal to set page as well\n\nThis has additional benefit that future trackEvent() calls will use the new page value as well.\r\n\r\nAlso, it silences a minor warning from the Analytics Debugger." }, { "from": "human", "value": "(function(){\n ang...
javascript
chosen
[ { "from": "system", "value": "Make TriggerEventWidgetComponent compatible with Ember 3.8\n" }, { "from": "human", "value": "import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { keyResponder, onKey } from 'ember-keyboard';\n\n@keyResponder({ activate...
javascript
chosen
[ { "from": "system", "value": "Fix team list endpoint to start with /organizations/:orgId\n" }, { "from": "human", "value": "const _ = require('koa-route');\nconst { teams } = require('src/api');\nconst { read } = require('src/middlewares/methods');\n\n\nmodule.exports = [\n _.get('/teams/', rea...
javascript
chosen
[ { "from": "system", "value": "Add isOneOfFieldSet method to Northstar service\n" }, { "from": "human", "value": "'use strict';\n\nconst NorthstarClient = require('@dosomething/northstar-js');\n\n/**\n * Nortstar client service.\n */\nmodule.exports = {\n\n getClient() {\n if (!this.client) {...
javascript
chosen
[ { "from": "system", "value": "Test rewritten to get more precise error location." }, { "from": "human", "value": "// test for string split\nvar b = \"1,4,7\";\nvar a = b.split(\",\");\n\nresult = a.length==3 && a[0]==1 && a[1]==4 && a[2]==7;\n" }, { "from": "gpt", "value": "// test f...
javascript
chosen
[ { "from": "system", "value": "Remove unnescessary routes from registration parameters\n" }, { "from": "human", "value": "'use strict';\nrequire('css/registrations.css');\n\nvar ko = require('knockout');\nvar $ = require('jquery');\n\nvar $osf = require('js/osfHelpers');\nvar RegistrationManager ...
javascript
chosen
[ { "from": "system", "value": "Add instructions and improve formatting\n" }, { "from": "human", "value": "import React from 'react';\nimport { Modal } from 'react-bootstrap';\n\n\nexport default class ListSignupFormCreator extends React.Component {\n constructor(props) {\n super(props);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Replace forEach with while for wider reach\n" }, { "from": "human", "value": "(function () {\n\nfunction descend(path, o) {\n var step = path.shift();\n\n if (typeof(o[step]) === \"undefined\") {\n throw new Error(\"Broken descend path\");\n }\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add images to the copy task\n" }, { "from": "human", "value": "'use strict';\nvar gulp = require('gulp');\n\nexports.css = function() {\n gulp.watch('./app/**/*.css', ['autoprefix']);\n};\n\nexports.copy = function() {\n gulp.watch('./app/**/*.html', ['copy']);\n}...
javascript
chosen
[ { "from": "system", "value": "Fix s3 bucket variable name bug\n" }, { "from": "human", "value": "const express = require('express');\nconst aws = require('aws-sdk');\n\nconst app = express();\nconst port = process.env.PORT || 3000;\nconst bucket = process.env.S3_BUCKET;\n\napp.use(express.static...
javascript
chosen
[ { "from": "system", "value": "Make routes match nginx config\n" }, { "from": "human", "value": "const express = require('express');\nconst db = require('./lib/db');\n\nconst app = express();\nconst port = process.env.PORT || 3000;\n\nprocess.env.PATH = `${process.env.PATH}:./node_modules/.bin`;\...
javascript
chosen
[ { "from": "system", "value": "Change import order for package.json" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\nvar meow = require('meow');\nvar chalk = require('chalk');\nvar updateNotifier = require('update-notifier');\nvar quote = require('./index.js');\nvar pkg = re...
javascript
chosen
[ { "from": "system", "value": "Update filenames for Windows support" }, { "from": "human", "value": "Package.describe({\n name: 'templates:tabs',\n summary: 'Reactive tabbed interfaces compatible with routing.',\n version: '2.2.1',\n git: 'https://github.com/meteortemplates/tabs.git'\n});\n\n...
javascript
chosen
[ { "from": "system", "value": "Add error check. Throw errors for now\n" }, { "from": "human", "value": "var Pokeio = require('./poke.io')\n\nPokeio.playerInfo.latitude = 62.0395926\nPokeio.playerInfo.longitude = 14.0266575\n\nPokeio.GetLocation(function(loc) {\n console.log('[i] Current locati...
javascript
chosen
[ { "from": "system", "value": "Test if function update is defined\n" }, { "from": "human", "value": "var client = require('../dist/client.js');\n\ndescribe('A suite', function () {\n it('contains spec with an expectation', function () {\n expect(true).toBe(true);\n });\n});\n" }, { "...
javascript
chosen
[ { "from": "system", "value": "Upgrade to new snarl API.\n" }, { "from": "human", "value": "var Eliza = require('./lib/eliza');\nvar eliza = new Eliza();\n\neliza.memSize = 500;\n\nvar initial = eliza.getInitial();\n\nmodule.exports = {\n conversation: 'You can @mention me in a channel (or DM me...
javascript
chosen
[ { "from": "system", "value": "Add more to test for selection in create hook.\n" }, { "from": "human", "value": "var tape = require(\"tape\"),\n jsdom = require(\"jsdom\"),\n d3 = Object.assign(require(\"../\"), require(\"d3-selection\"));\n\n/*************************************\n *******...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary strings from object keys.\n" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\n\nconst mocksPath = path.join(__dirname, 'mocks');\n\nmodule.exports = {\n computationPath: path.resolve(__dirname, '../src/index.js'),\n...
javascript
chosen
[ { "from": "system", "value": "Add tests against destroying mouse events.\n" }, { "from": "human", "value": "window.addEventListener('load', function(){\n\n module('touchstart');\n\n test('should use touchstart when touchstart is supported', function() {\n assert({ listener:'touchstart', rec...
javascript
chosen
[ { "from": "system", "value": "Fix how parseCommand sends arguments to Command class" }, { "from": "human", "value": "const {exec} = require('child_process')\n\nconst Command = exports.Command = require('./command')\nconst Response = exports.Response = require('./response')\nconst Controller = ex...
javascript
chosen
[ { "from": "system", "value": "Use beforeEach in property test\n" }, { "from": "human", "value": "import assert from \"power-assert\";\nimport Component from \"../src/Component\";\nimport * as property from \"../src/property\";\n\ndescribe(\"property\", () => {\n describe(\".bind\", () => {\n ...
javascript
chosen
[ { "from": "system", "value": "Make isStandalone() compatible with webkit1\n\nIn webkit1 implementation, we don't use 'activity' as a protocol.\n" }, { "from": "human", "value": "define(function () {\n\n 'use strict';\n\n var env = {};\n\n env.getEnvironment = function (callback) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add test for rootElm with name prop fix.\n" }, { "from": "human", "value": "var test = require(\"tape\")\nvar h = require(\"hyperscript\")\n\nvar FormData = require(\"../index\")\n\ntest(\"FormData works with <select> elements\", function (assert) {\n var element...
javascript
chosen
[ { "from": "system", "value": "Fix issue where 24h format needed additional configuration for the plugin\n" }, { "from": "human", "value": "$(document).on('ajaxComplete ready', function () {\n\n // Initialize inputs\n $('input[data-provides=\"anomaly.field_type.datetime\"]:not([data-initial...
javascript
chosen
[ { "from": "system", "value": "Make commit_to_it fail when the repo is blank\n\nBefore that I could PASS the tests with an empty repo :\n * no commits\n * no files\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar exec = require('child_process').exec\n\n// check that they've commite...
javascript
chosen
[ { "from": "system", "value": "Make all right with the world\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nvar dateCreated = new Date();\n\nvar meta = {\n title: 'The Linux Command Line',\n authors: 'Zach Janicki',\n dateCreated: dateCreated,\n abstract: \"This is a...
javascript
chosen
[ { "from": "system", "value": "Make bundle-visualizer depend on dynamic-import directly again.\n\nSince bundle-visualizer is a non-core package, it could be used with a\nversion of ecmascript that does not imply dynamic-import, though it\ndefinitely requires support for `import()` to function properly.\n" ...
javascript
chosen
[ { "from": "system", "value": "Remove spaces from basic e2e tests.\n" }, { "from": "human", "value": "'use strict';\n\n/* https://github.com/angular/protractor/blob/master/docs/toc.md */\n\ndescribe('my app', function() {\n\n browser.get('index.html');\n\n it('should automatically redirect to /...
javascript
chosen
[ { "from": "system", "value": "Change AcountStats field type from Integer -> Number\nInteger isn't a type.\n" }, { "from": "human", "value": "var wompt = require(\"../includes\"),\nmongoose = wompt.mongoose,\nObjectId = mongoose.Schema.ObjectId;\n\nvar AccountStats = new mongoose.Schema({\n\tacco...
javascript
chosen
[ { "from": "system", "value": "Fix bug by resetting dateMap during update\n" }, { "from": "human", "value": "const Logger = require('franston')('jobs/update-cache')\n\nconst GithubActivity = require('../models/github-activity')\nconst GithubCache = require('../models/github-cache')\nconst Series ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Fixed: double-execution of webkitStartDart() broke polymer-element instantiations.\"\n\nThis reverts commit 77cfec11555d42515b809f7aa5624dfdbbce4379.\n" }, { "from": "human", "value": "// Copyright (c) 2013, Google Inc. Please see the AUTHORS file for detai...
javascript
chosen
[ { "from": "system", "value": "Fix clicking on suggestion to set the username\n\n[Fixes: #128912639](https://www.pivotaltracker.com/story/show/128912639)\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react'\nimport FormControl from './FormControl'\n\nclass Userna...
javascript
chosen
[ { "from": "system", "value": "Use Glyphicons for confirm/retract buttons.\n" }, { "from": "human", "value": "var React = require(\"react\");\nvar {Button} = require(\"react-bootstrap\");\n\n\nvar confirmMark = \"\\u2713\"; // check mark\nvar retractMark = \"\\u00D7\"; // multiplication sign\n\nf...
javascript
chosen
[ { "from": "system", "value": "Fix broken test build: htmlparser2 loads a .json file so webpack needs to use json-loader.\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = {\n entry: './test/build/index.js',\n output: {\n path: __dirname + \"/build\",\n fi...
javascript
chosen
[ { "from": "system", "value": "Allow poly fill usage, even if native Proxy exists\n" }, { "from": "human", "value": "'use strict';\n\nif (global.Proxy)\n{\n\treturn;\n}\n\nvar decorateProperty = require('poor-mans-proxy-decorate-property');\n\n\nglobal.Proxy = function(target, handler) {\n\n\tvar...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix by targeting zeros within values only\n" }, { "from": "human", "value": "'use strict';\n\nvar helpers = require('../helpers');\n\nvar units = ['em', 'ex', 'ch', 'rem', 'vh', 'vw', 'vmin', 'vmax',\n 'px', 'mm', 'cm', 'in', 'pt', 'pc'];\n\nmodule....
javascript
chosen
[ { "from": "system", "value": "Add waiting time for the new bmc to take effect after flashing quanta,\nwhich is suggested by quanta in demo script\n" }, { "from": "human", "value": "// Copyright 2015, EMC, Inc.\n\n'use strict';\n\nmodule.exports = {\n friendlyName: 'Flash Quanta BMC',\n inj...
javascript
chosen
[ { "from": "system", "value": "Use objectMode for throttle stream\n" }, { "from": "human", "value": "var Transform = require('readable-stream/transform');\nvar util = require('util');\n\nfunction ThrottleStream (options) {\n if (!(this instanceof ThrottleStream)) {\n return new ThrottleStream...
javascript
chosen
[ { "from": "system", "value": "Fix bug in popstate navigating.\n" }, { "from": "human", "value": "\nvar runway = require('./runway.js')\nmodule.exports = runway\n\n\n\ndocument.onclick = function(event) {\n event = event || window.event // IE specials\n var target = event.target || event.srcEle...
javascript
chosen
[ { "from": "system", "value": "Improve input size helper function\n\nThe input could affect layout of tapps" }, { "from": "human", "value": "let input = null;\n\nexport default function getInputSize(value) {\n if (!input) {\n input = document.createElement('div');\n input.classNa...
javascript
chosen
[ { "from": "system", "value": "Use defs instead of symbol in SVG sprite\n" }, { "from": "human", "value": "import fs from 'fs';\nimport glob from 'glob';\nimport path from 'path';\nimport SVGSprite from 'svg-sprite';\nimport vinyl from 'vinyl';\n\nfunction SVGCompilerPlugin(options) {\n this.opt...
javascript
chosen
[ { "from": "system", "value": "Edit path to config.json in require statement\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar Sequelize = require('sequelize');\nvar basename = path.basename(module.filename);\nvar env ...
javascript
chosen
[ { "from": "system", "value": "Fix the duplicate import again\n" }, { "from": "human", "value": "const path = require('path');\nconst ghost = require('ghost');\nconst express = require('express');\nconst path = require('path');\n\nconst wrapperApp = express();\n\nghost({\n config: path.join(__di...
javascript
chosen
[ { "from": "system", "value": "Exit cleanly on a broken pipe\n" }, { "from": "human", "value": "var ActivityStream = require('./activity-stream.js');\nvar SimplerEventLogger = require('./simple-event-logger.js');\n\n(new ActivityStream())\n.pipe(new SimplerEventLogger())\n.pipe(process.stdout);\n...
javascript
chosen
[ { "from": "system", "value": "Add test event and adjust URL to proxy config\n" }, { "from": "human", "value": "const express = require('express')\nconst socketio = require('socket.io')\nconst http = require('http')\nconst config = require('./config')\n\nconst app = express()\nconst server = http...
javascript
chosen
[ { "from": "system", "value": "Fix a bug with not catching meteor method errors thrown on the client\n" }, { "from": "human", "value": "import {\n isFunction,\n last\n}\nfrom 'lodash';\nimport callMeteorMethod from '../../storage/utils/call_meteor_method';\nimport rawAll from '../../fields/util...
javascript
chosen
[ { "from": "system", "value": "Clear textarea after posting successfully\n" }, { "from": "human", "value": "$().ready(function () {\n\n $(\"form.comment\").on(\"submit\", function (event) {\n event.preventDefault();\n var $form = $(this);\n var $comments = $(\".comment-group\");\n $....
javascript
chosen
[ { "from": "system", "value": "Update ambient light when color changes\n" }, { "from": "human", "value": "elation.require(['engine.things.light'], function() {\n elation.component.add('engine.things.light_ambient', function() {\n this.postinit = function() {\n this.defineProperties({\n ...
javascript
chosen
[ { "from": "system", "value": "Remove usage of _.memoize and WeakMap\n" }, { "from": "human", "value": "import _ from 'lodash';\nimport { Graph, alg } from 'graphlib';\n\n_.memoize.Cache = WeakMap;\nlet dijkstra = _.memoize(alg.dijkstra);\n\nexport function setupGraph(pairs) {\n\tlet graph = new ...
javascript
chosen
[ { "from": "system", "value": "Make the validate function async\n" }, { "from": "human", "value": "const Joi = require('joi');\n\nconst ValidationError = require('./validation-error');\nconst { mergeJoiOptions, joiSchema } = require('./joi');\nconst { mergeEvOptions, evSchema } = require('./ev');...
javascript
chosen
[ { "from": "system", "value": "Print incomming message on console\n" }, { "from": "human", "value": "var net = require('net');\n\nvar server = net.createServer(function (socket) {\n socket.write('Echo server\\r\\n');\n socket.pipe(socket);\n});\n\nserver.listen(1337, '127.0.0.1');" }, { ...
javascript
chosen
[ { "from": "system", "value": "Add first time attender helper\n" }, { "from": "human", "value": "Template.wizardReview.onCreated(function () {\n // Get reference to template instance\n const instance = this;\n\n // Get form data as instance variable\n instance.registration = instance.data.wiz...
javascript
chosen
[ { "from": "system", "value": "Fix missing comma by Ximik\n" }, { "from": "human", "value": "/* Vietnamese translation for the jQuery Timepicker Addon */\n/* Written by Nguyen Dinh Trung */\n(function($) {\n\t$.timepicker.regional['vi'] = {\n\t\ttimeOnlyTitle: 'Chọn giờ',\n\t\ttimeText: 'Thời gia...
javascript
chosen
[ { "from": "system", "value": "Implement find for older node.\n" }, { "from": "human", "value": "/*global require: false, module: false */\n'use strict';\nvar webpack = require('webpack');\nvar config = require('./webpack.config');\n\nfunction wrapEntry(entry) {\n\tif (entry instanceof Array) {\n...
javascript
chosen
[ { "from": "system", "value": "Change array to object for data\n" }, { "from": "human", "value": "/**\n * BaseCache it's a simple static cache\n *\n * @namespace Barba.BaseCache\n * @type {Object}\n */\nvar BaseCache = {\n /**\n * The array that keeps everything.\n *\n * @memberOf Barba.Ba...
javascript
chosen
[ { "from": "system", "value": "Support cleaning of installedChunks callbacks\n\nIt requires this PR https://github.com/webpack/webpack/pull/1380\nto be approved. Or using custom webpack build with that PR. Otherwise,\nstuck callback may cause memory leaks.\n" }, { "from": "human", "value": "patch...
javascript
chosen
[ { "from": "system", "value": "Fix reference to image in realworld example.\n" }, { "from": "human", "value": "/* mithril\nimport m from \"mithril\"\nimport { h } from \"seview/mithril\"\n\nexport const render = (view, element) => m.render(element, h(view))\nend mithril */\n\n/* preact */\nimport...
javascript
chosen
[ { "from": "system", "value": "Add Leaflet to vendor for specs\n" }, { "from": "human", "value": "var _ = require('underscore');\n\nvar defaultOptions = {\n keepRunner: true,\n summary: true,\n display: 'short',\n vendor: [\n // Load & install the source-map-support lib (get proper stack t...
javascript
chosen
[ { "from": "system", "value": "ci(Travis): Add debug mode in mongodb-memory-server\n" }, { "from": "human", "value": "/* @flow */\n/* eslint-disable no-param-reassign, no-console */\n\nimport mongoose, { Schema } from 'mongoose';\nimport MongodbMemoryServer from 'mongodb-memory-server';\n\nmongoo...
javascript
chosen