conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Throw out unnecessary dependencies in mFC\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.morph').directive('mirrorMorphForm', [\n 'morph',\n '$location',\n '$anchorScroll',\n '$document',\n '$timeout',\n function(morph, $locatio...
javascript
chosen
[ { "from": "system", "value": "Check for input types in methods\n" }, { "from": "human", "value": "Categories = new Mongo.Collection('categories');\n\nSchema.categories = new SimpleSchema({\n name: {\n type: String\n },\n slug: {\n type: String,\n index: true,\n unique: true\n },\...
javascript
chosen
[ { "from": "system", "value": "Add /user route for mongodb insert\n" }, { "from": "human", "value": "module.exports =\n{\n \"routes\": [{\n \"type\": \"POST\",\n \"url\": \"/example/:id\",\n\t\"handles\": [{\n\t\"module\": \"twilio\",\n\t\"config\": {\n\t\t\"configuration\": {\n\t\t\t\"acc...
javascript
chosen
[ { "from": "system", "value": "Add feature flag for enabling partial rendering in Relay Hooks by default\n\nReviewed By: josephsavona\n\nDifferential Revision: D16768104\n\nfbshipit-source-id: 878b99fb4a29a1e8283432f579ed4d0c18813617\n" }, { "from": "human", "value": "/**\n * Copyright (c) Facebo...
javascript
chosen
[ { "from": "system", "value": "CSRA-493: Fix the broken E2E test\n" }, { "from": "human", "value": "import DashboardPage from './pages/Dashboard.page';\nimport { givenThatTheOfficerIsSignedInWithoutLoadingData } from './tasks/officerSignsIn.task';\nimport whenTheOfficerAddsThePrisonersDetails fro...
javascript
chosen
[ { "from": "system", "value": "Add parse for task add\n" }, { "from": "human", "value": "'use strict';\n\nconst login = require('facebook-chat-api');\nconst moment = require('moment');\nconst config = require('./config');\nconst Task = require('./models/task');\n\n\nlogin({email: config.fb.e, pas...
javascript
chosen
[ { "from": "system", "value": "Fix bug from previous PR.\n" }, { "from": "human", "value": "import immutable from 'immutable';\n\nimport authStore from '../auth/store';\nimport intlStore from '../intl/store';\nimport todosStore from '../todos/store';\nimport usersStore from '../users/store';\n\ne...
javascript
chosen
[ { "from": "system", "value": "Use Array.isArray to check for array\n" }, { "from": "human", "value": "function classNames() {\n\tvar classes = '';\n\tvar arg;\n\n\tfor (var i = 0; i < arguments.length; i++) {\n\t\targ = arguments[i];\n\t\tif (!arg) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ('string' =...
javascript
chosen
[ { "from": "system", "value": "Enable BYO node-matrix-assets, and expose getAssetsById\n" }, { "from": "human", "value": "module.exports = function assets () {\n var asset = require('node-matrix-assets')\n\n return {\n folder: require('./assets/folder')(asset),\n site: require('./assets/s...
javascript
chosen
[ { "from": "system", "value": "Use empty string for name param\n\nThis removes the query param from the URL when you search for nothing." }, { "from": "human", "value": "import Ember from 'ember';\nvar computed = Ember.computed;\n\nexport default Ember.Controller.extend({\n queryParams: ['name']...
javascript
chosen
[ { "from": "system", "value": "Add routes for static mock pages\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport config from './config/environment';\n\nvar Router = Ember.Router.extend({\n location: config.locationType\n});\n\nRouter.map(function() {\n this.route('stops', {...
javascript
chosen
[ { "from": "system", "value": "Adjust max length to 34\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Regular expression for matching Bitcoin addresses\n *\n * @api public\n */\n\nmodule.exports = function () {\n\treturn /(?:^|\\s)(?:[13][1-9A-Za-z][^O0Il]{24,33})/g;\n};\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Remove interest group delete button\n\nI think we decided sometime that we'd make it not possible to delete\ngroups, so it doens't make any sense having the button here.\n" }, { "from": "human", "value": "// @flow\nimport React, { Component } from 'react';\nimport G...
javascript
chosen
[ { "from": "system", "value": "Use `'html'` as output format\n\nPer jstransformers/jstransformer#3.\n" }, { "from": "human", "value": "'use strict';\n\nvar MarkdownIt = require('markdown-it');\n\nexports.name = 'markdown-it';\nexports.outputFormat = 'xml';\nexports.render = function (str, options...
javascript
chosen
[ { "from": "system", "value": "Fix logic bug with css error reporting" }, { "from": "human", "value": "'use strict'\n\nvar postcss = require('postcss')\nvar defined = require('defined')\n\nvar noop = postcss.plugin('noop', function () {\n return function (css) {}\n})\n\nmodule.exports = postcss....
javascript
chosen
[ { "from": "system", "value": "Move render modules to vega-scenegraph.\n" }, { "from": "human", "value": "export {\n version\n} from './build/package';\n\nexport * from 'vega-statistics';\n\nexport * from 'vega-util';\n\nexport * from 'vega-loader';\n\nexport {\n Dataflow,\n EventStream,\n Pa...
javascript
chosen
[ { "from": "system", "value": "Add scroll position function calls\n" }, { "from": "human", "value": "if (Meteor.isClient) {\n\n Accounts.ui.config({\n passwordSignupFields: 'USERNAME_ONLY'\n });\n\n Template.messages.helpers({\n messages: function() {\n return Messages.find({...
javascript
chosen
[ { "from": "system", "value": "Update reference to latest path in bower dir\n\nThe latest version of flexibility doesn't have the flexibility.js inside the `dist` folder. This commit takes care of the reference update." }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar...
javascript
chosen
[ { "from": "system", "value": "Include regenerator-runtime in web app\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { MemoryRouter } from 'react-router-dom';\nimport { Provider } from 'react-redux';\nimport { AppContainer } from 'react-ho...
javascript
chosen
[ { "from": "system", "value": "Move p tag into conditional rendering\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\n\nclass ResultList extends Component {\n renderResults(resultData) {\n const name = resultData.name;\n ...
javascript
chosen
[ { "from": "system", "value": "Refactor to improve bundle size\n" }, { "from": "human", "value": "'use strict'\n\nvar iterate = require('array-iterate')\n\nmodule.exports = modifierFactory\n\n// Turn `callback` into a child-modifier accepting a parent. See\n// `array-iterate` for more info.\nfun...
javascript
chosen
[ { "from": "system", "value": "Fix to be more forgiving when stringifying\n\nThe implicit truthiness string for a node's `value` property\ncould cause problems when (albeit quite sneakily) setting\na node's `value` to an empty string.\n\nRelated bug:\n https://github.com/beaugunderson/node-sentence-tools/\n...
javascript
chosen
[ { "from": "system", "value": "Fix JSDoc optional type syntax\n" }, { "from": "human", "value": "'use strict';\n/**\n * Module dependencies\n */\n\nvar crypto = require('crypto');\n\n/**\n * 64 characters in the ascii range that can be used in URLs without special\n * encoding.\n */\nvar UIDCHARS...
javascript
chosen
[ { "from": "system", "value": "Fix coloring of earthquakes above sea level (blue -> red)\n\n[#130153315]\n" }, { "from": "human", "value": "export const TRANSITION_TIME = 750\n\nexport function depthToColor(depth) {\n const depthRange = Math.floor(depth / 100)\n switch(depthRange) {\n case 0...
javascript
chosen
[ { "from": "system", "value": "Make Files nav item selected in file detail page\n" }, { "from": "human", "value": "'use strict';\nvar $ = require('jquery');\n\nvar fileBrowser = require('../fileViewTreebeard');\nvar nodeApiUrl = window.contextVars.node.urls.api;\n\n$(document).ready(function() {\...
javascript
chosen
[ { "from": "system", "value": "Add URI.js in the exports.\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = {\n name: 'ember-data-factory-guy',\n\n included: function(app) {\n this._super.included(app);\n this.app = app;\n // need to load mockjax in dev...
javascript
chosen
[ { "from": "system", "value": "Remove useless return. warnings is always an array after a split." }, { "from": "human", "value": "module.exports = function parseWarningHeader (header) {\n if (!header || typeof header !== 'string') return\n var warnings = header.split(/([0-9]{3} [a-z0-9.@\\-\\/]...
javascript
chosen
[ { "from": "system", "value": "Use author's email address if no name given\n" }, { "from": "human", "value": "\"use strict\";\n\nvar Immutable = require('immutable')\n\nconst AUTHORS_BY_MSG_ID = {}\n\nconst EMPTY_ITEM_MAP = Immutable.Map({ total: 0, trend: 0 })\n , inc = n => n + 1\n , incC...
javascript
chosen
[ { "from": "system", "value": "Improve batching of ids for querying\n" }, { "from": "human", "value": "import {pluck} from 'lodash/collection'\nimport Promise from 'bluebird'\n\nconst BATCH_CHAR_LIMIT = 1990\n\n/**\n * Gets the content already existent on the destination space that needs\n * upda...
javascript
chosen
[ { "from": "system", "value": "Fix minor bug in weather source.\n" }, { "from": "human", "value": "/**\n * Provides weather data from the Yahoo API. The ID of a location can be found at\n * http://woeid.rosselliot.co.nz/.\n *\n * Provides data in the form:\n * {\n * temperature: \"14\" ...
javascript
chosen
[ { "from": "system", "value": "Upgrade SidebarController to ES6 syntax\n" }, { "from": "human", "value": "export default class SidebarController {\n constructor(AccountsRepository, MovementsRepository) {\n this.accounts = AccountsRepository;\n this.movements = MovementsRepository;\n }\n}\...
javascript
chosen
[ { "from": "system", "value": "Use full name of HTMLFormElement\n" }, { "from": "human", "value": "'use strict';\n\nvar form = require('../valid-html-form');\n\nmodule.exports = function () {\n\tvar event = form(this).ownerDocument.createEvent('HTMLEvents');\n\tevent.initEvent('submit', true, tru...
javascript
chosen
[ { "from": "system", "value": "Change Vector class to ES2015/ES6 format.\n" }, { "from": "human", "value": "import * as constants from \"./constants\";\n\nlet initNum = 1;\nfunction Attractor(game, center) {\n this.type = \"attractor\";\n this.id = initNum;\n this.isAlive = true;\n\n ...
javascript
chosen
[ { "from": "system", "value": "Make it compatible with node v5.0.0\n\n```\r\n/Users/guillermoruiz/.nvm/versions/node/v5.0.0/lib/node_modules/git-date/index.js:11\r\n let date = process.argv.join(\" \");\r\n ^^^\r\n\r\nSyntaxError: Block-scoped declarations (let, const, function, class) not yet supported ou...
javascript
chosen
[ { "from": "system", "value": "Store jobs with reduced redundancy on S3\n" }, { "from": "human", "value": "'use stirct'\n\nvar opbeat = require('opbeat').start()\nvar uuid = require('node-uuid')\nvar AWS = require('aws-sdk')\nvar Printer = require('ipp-printer')\n\nvar port = process.env.PORT || ...
javascript
chosen
[ { "from": "system", "value": "Remove wrong delete translation implementation.\n" }, { "from": "human", "value": "import DefaultCollectionModel from './DefaultCollectionModel'\n\nexport default class TranslateableCollectionModel extends DefaultCollectionModel {\n constructor(api) {\n super(ap...
javascript
chosen
[ { "from": "system", "value": "Fix indentation of the Python grammar\n" }, { "from": "human", "value": "define(function() {\n\n\t// Export\n\treturn function(Prism) {\n\n\t\tPrism.languages.python= {\n\t\t\t'comment': {\n\t\t\t\tpattern: /(^|[^\\\\])#.*?(\\r?\\n|$)/g,\n\t\t\t\tlookbehind: true\n\...
javascript
chosen
[ { "from": "system", "value": "Use the option \"watch\" in Grunt compass task" }, { "from": "human", "value": "/*jshint strict:true, browser:true, jquery:true, devel:true, curly:true, eqeqeq:true, immed:true, latedef:true, plusplus:true, undef:true, unused:true, laxbreak:true, nonew:false */\n/*g...
javascript
chosen
[ { "from": "system", "value": "Trim the team name before adding new team.\n" }, { "from": "human", "value": "function viewTeams() {\n\n getTeams(\n success = function (data) {\n populateTeamsTable(data.teams);\n },\n error = function (jqxhr) {\n handleApiError(jqxhr);\n }\n...
javascript
chosen
[ { "from": "system", "value": "Fix tasks never finishing (and thus never starting their deps)" }, { "from": "human", "value": "'use strict';\n\nvar through = require('through2');\nvar gutil = require('gulp-util');\n\nmodule.exports = function filelog (taskParam) {\n var count = 0;\n\n function ...
javascript
chosen
[ { "from": "system", "value": "Remove globals handled by grumbler-scripts\n" }, { "from": "human", "value": "/* @flow */\n\nmodule.exports = {\n 'extends': './node_modules/grumbler-scripts/config/.eslintrc-browser.js',\n\n 'globals': {\n 'Promise': false,\n '__TEST__': true,\n...
javascript
chosen
[ { "from": "system", "value": "fix(sanketa): Fix surrogate pair split :sushi:\n" }, { "from": "human", "value": "/* @flow */\n/**\n * sanketa\n *\n * @param {number|string} rawChars - raw chars\n * @param {Object} [opts] - options\n * @param {boolean} [opts.r] - reverse flag\n * @param {number|st...
javascript
chosen
[ { "from": "system", "value": "Disable warning for max-len and valid-jsdoc rules.\n" }, { "from": "human", "value": "module.exports = {\n \"extends\": \"google\",\n \"rules\": {\n \"max-len\": \"warn\",\n \"max-nested-callbacks\": [\"warn\", {\"max\": 5}],\n \"valid-jsd...
javascript
chosen
[ { "from": "system", "value": "Fix x axis for time\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Scatter } from 'react-chartjs-2';\n\nexport default function ScatterChart({ data, xAxisLabels }) {\n const series = {\n labels: xAxis...
javascript
chosen
[ { "from": "system", "value": "Add migration code to support default directories\n" }, { "from": "human", "value": "'use strict';\n\nvar Server = /** @type Server */ require('./core/server');\n\nvar _ = require('lodash-node');\nvar inherit = require('inherit');\nvar path = require('path');\nvar d...
javascript
chosen
[ { "from": "system", "value": "Fix eslint ts override tsx matching\n" }, { "from": "human", "value": "module.exports = {\n \"extends\": [\"matrix-org\", \"matrix-org/react\"],\n \"env\": {\n \"browser\": true,\n \"node\": true,\n },\n \"rules\": {\n \"quotes\": \"...
javascript
chosen
[ { "from": "system", "value": "Debug print the path it currently resolves to\n" }, { "from": "human", "value": "module.exports = {\n website: {\n assets: \".\",\n html: {\n \"body:start\": function(current) {\n var fs = require(\"fs\");\n console.log(\"### ADD-HEADER ###...
javascript
chosen
[ { "from": "system", "value": "Add call to make login default\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict'\n\nvar program = require('commander')\nvar winston = require('winston')\n\nvar exec = require('./lib/exec')\n\nprogram\n .version(require('./package.json').version...
javascript
chosen
[ { "from": "system", "value": "Remove legacy warning by using \"parserOptions.ecmaVersion\" now\n" }, { "from": "human", "value": "module.exports = {\n extends: [\n \"./rules/4-0\",\n \"./rules/4-2\",\n \"./rules/4-6\",\n \"./rules/es6\",\n \"./rules/es6-plugins\"\n ].map(require...
javascript
chosen
[ { "from": "system", "value": "Add new line after error message\n" }, { "from": "human", "value": "module.exports = handler\n\nvar debug = require('../debug').server\nvar fs = require('fs')\n\nfunction handler (err, req, res, next) {\n debug('Error page because of ' + err.message)\n\n var ldp =...
javascript
chosen
[ { "from": "system", "value": "Fix for broken payload when no internal actions\n" }, { "from": "human", "value": "const _ = require('lodash');\nconst Client = require('ci-client');\nconst commands = require('./commands');\n\nmodule.exports.start = (commonConfig) => {\n const commandNames = _.f...
javascript
chosen
[ { "from": "system", "value": "Call equal(srcItem, dstItem) with params in intuitive order\n" }, { "from": "human", "value": "module.exports = function diffResource(src, dst, opts) {\n\tif (!opts) opts = {};\n\tvar equal = opts.equal || defaultEqual();\n\tvar key = opts.key || 'id';\n\n\tvar tran...
javascript
chosen
[ { "from": "system", "value": "Remove support of uglify and change path\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n\tgrunt.initConfig({\n\n\t\tjshint: {\n\t\t\tall: ['Gruntfile.js', 'cookie.js', 'tests/spec.js'],\n\t\t\toptions: {\n\t\t\t\tbrowser: true,\n\t\t\t\tevi...
javascript
chosen
[ { "from": "system", "value": "Make endpoints configurable and the defaults just /\n" }, { "from": "human", "value": "var extend = require('cog/extend');\n\n/**\n # rtc-switchboard-messenger\n\n A specialised version of\n [`messenger-ws`](https://github.com/DamonOehlman/messenger-ws) designed ...
javascript
chosen
[ { "from": "system", "value": "Refactor shadow generator to map object directly instead of converting to pairs\n" }, { "from": "human", "value": "import _ from 'lodash'\nimport defineClass from '../util/defineClass'\n\nexport default function({shadows}) {\n return _(shadows)\n .toPairs()\n ...
javascript
chosen
[ { "from": "system", "value": "Allow routington to work with browserify\n" }, { "from": "human", "value": "module.exports = require('./lib/routington')\n\n;[\n 'define',\n 'match',\n 'parse'\n].forEach(function (x) {\n require('./lib/' + x)\n})" }, { "from": "gpt", "value": "modul...
javascript
chosen
[ { "from": "system", "value": "Update Object.assign polyfill from mdn site.\n\nThis is a more complete polyfill. The main problem with the existing implementation is that\nit doesn't return anything.\n\nThis also fixes compatibility with 'object-assign' library.\n\nFixes #19\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Add an excludePathnames parameter to the setOnLocationChange helper" }, { "from": "human", "value": "import { LOCATION_CHANGE } from 'react-router-redux';\n\nexport function patchObjectByKey(object, key, patcher) {\n return key in object ? { ...object, [key]: patch...
javascript
chosen
[ { "from": "system", "value": "Change matching pattern on settings.gradle\n\nSummary:\nLink doesn't work on f8app,\nas it is, android projects don't have to contain the matching string and then the linking would not work, I've switched it to the much simpler new-line.\nIf you can find a better common minimum...
javascript
chosen
[ { "from": "system", "value": "Fix error when no options are passed\n" }, { "from": "human", "value": "var deselectCurrent = require('toggle-selection');\n\nfunction copy(text, options) {\n var reselectPrevious, selection, range, mark, debug, message;\n debug = options.debug || false;\n messag...
javascript
chosen
[ { "from": "system", "value": "Set classes on ef-list based on context\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst {\n Component\n} = Ember;\n\n/**\n * @module\n * @augments ember/Component\n */\nexport default Component.extend({\n\n // -------------------------------...
javascript
chosen
[ { "from": "system", "value": "Update task controller to update its content after task edition\n" }, { "from": "human", "value": "/*\neslint no-shadow: [\"error\", { \"allow\": [\"$scope\"] }]\n*/\n/*\neslint no-underscore-dangle: [\"error\", { \"allow\": [\"_id\",] }]\n*/\n\nangular.module('Main...
javascript
chosen
[ { "from": "system", "value": "Change the way to find the controller (inside the component)\n" }, { "from": "human", "value": "// Dependencies\nimport Ember from 'ember';\nimport layout from '../templates/components/yebo-search';\n\n/**\n The search form\n\n @class YeboDetails\n @namespace Com...
javascript
chosen
[ { "from": "system", "value": "Remove file extension (dynamically) from indexed list of files and their contents\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\n\n/*\n * read *.txt files at given `path',\n * return array of files and their\n * textual content\n */\nex...
javascript
chosen
[ { "from": "system", "value": "Remove prefix, automagically handled by favicon plugin\n" }, { "from": "human", "value": "const FaviconsWebpackPlugin = require('favicons-webpack-plugin');\n\nmodule.exports.onCreateWebpackConfig = ({ actions, stage, getConfig }, { logo, icons = {}, title, backgroun...
javascript
chosen
[ { "from": "system", "value": "Revert back to original function\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Adds commas to a number\n * @param {number} number\n * @return {string}\n */\nmodule.exports = function(number) {\n return number.toLocaleString('en-US');\n};" }, { ...
javascript
chosen
[ { "from": "system", "value": "Update the path to Amanda in the ‘amanda.js’ file\n" }, { "from": "human", "value": "// Load dependencies\nvar amanda = require('../../../src/amanda.js');\n\n/**\n * Test #1\n */\nexports['Test #1'] = function(test) {\n\n var count = 0;\n\n var schema = {\n req...
javascript
chosen
[ { "from": "system", "value": "Handle event state for searchTerm.\n" }, { "from": "human", "value": "import React from 'react'\nimport preload from '../public/data.json'\nimport ShowCard from './ShowCard'\n\nconst Search = React.createClass({\n render () {\n return (\n <div className='se...
javascript
chosen
[ { "from": "system", "value": "Throw when we don't know the answer.\n" }, { "from": "human", "value": "'use strict';\n\nfunction defaultPort(protocol) {\n\n if (typeof protocol !== 'number') {\n return defaultPort[protocol];\n }\n\n for (const key in defaultPort) {\n if (Ob...
javascript
chosen
[ { "from": "system", "value": "Update broccoli-funnel to latest syntax\n" }, { "from": "human", "value": "/* eslint-env node */\n'use strict';\n\nvar Funnel = require('broccoli-funnel');\nvar findHost = require('./lib/utils/find-host');\n\nmodule.exports = {\n name: 'ember-asset-loader',\n\n /*...
javascript
chosen
[ { "from": "system", "value": "Improve failed render error handling\n" }, { "from": "human", "value": "\"use strict\";\n\nrequire(\"dotenv\").config();\nrequire('newrelic');\n\nvar express = require(\"express\");\nvar helmet = require(\"helmet\");\nvar readFile = require(\"fs-readfile-promise\");...
javascript
chosen
[ { "from": "system", "value": "Add timeout to default config\n" }, { "from": "human", "value": "require('./lib/boot/logger');\n\nvar defaultConfig = {\n amqpUrl: process.env.AMQP_URL || 'amqp://localhost',\n amqpPrefetch: process.env.AMQP_PREFETCH || 5,\n amqpRequeue: true\n};\n\nmodule.export...
javascript
chosen
[ { "from": "system", "value": "Make login page look a little better.\n" }, { "from": "human", "value": "import React from \"react\";\nimport {ButtonToolbar, Button} from \"react-bootstrap\";\nimport {connect} from \"react-redux\";\nimport {promptForLogin} from \"../store/actions/AuthenticationAct...
javascript
chosen
[ { "from": "system", "value": "Throw an error if includeLanguages option is used.\n" }, { "from": "human", "value": "/* eslint-env node */\n'use strict';\n\nlet path = require('path');\nlet Funnel = require('broccoli-funnel');\n\nmodule.exports = {\n name: 'ember-cli-numeral',\n\n included: fun...
javascript
chosen
[ { "from": "system", "value": "Remove unused variables and fix paths issue\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar elixir = require('laravel-elixir');\nvar htmlmin = require('gulp-htmlmin');\nvar config = elixir.config;\n\n/**\n * Minify static...
javascript
chosen
[ { "from": "system", "value": "Fix leftover artifact from refactor\n" }, { "from": "human", "value": "'use strict';\n\nvar exec = require('child_process').exec;\nvar serialNumber = function (cb, cmdPrefix) {\n\tvar delimiter = ': ';\n\tvar stdoutHandler = function (error, stdout) {\n\t\tcb(error,...
javascript
chosen
[ { "from": "system", "value": "Add client routes in production\n" }, { "from": "human", "value": "const http = require('http');\n\nconst bodyParser = require('body-parser');\nconst cors = require('cors');\nconst express = require('express');\n\nconst isProduction = process.env.NODE_ENV === 'produ...
javascript
chosen
[ { "from": "system", "value": "Load dist vue2Dropzone for older browser" }, { "from": "human", "value": "var component = {}\n\nif (process.browser) {\n component = require('vue2-dropzone')\n}\ncomponent.name = 'dropzone'\ncomponent.render = function (createElement) {\n const that = this._se...
javascript
chosen
[ { "from": "system", "value": "Add Filter of URL Names for Use in Output Files\n" }, { "from": "human", "value": "var fs = require('fs');\nvar links;\n\nfunction getLinks() {\n var links = document.querySelectorAll('.nav-link.t-nav-link');\n return Array.prototype.map.call(links, function (...
javascript
chosen
[ { "from": "system", "value": "Use new obit config to lookup sources and strategies\n" }, { "from": "human", "value": "import { getOwner } from '@ember/application';\nimport Coordinator from '@orbit/coordinator';\nimport modulesOfType from '../system/modules-of-type';\n\nexport default {\n creat...
javascript
chosen
[ { "from": "system", "value": "Update sourceMap to return .toJSON() output\n\nThis means we get a data object back rather than a SourceMapGenerator" }, { "from": "human", "value": "'use strict';\n\nvar visitors = require('./vendor/fbtransform/visitors');\nvar transform = require('jstransform').tr...
javascript
chosen
[ { "from": "system", "value": "Make initial window size a tad bigger\n" }, { "from": "human", "value": "const electron = require('electron')\nconst app = electron.app\nconst BrowserWindow = electron.BrowserWindow\n\nlet mainWindow\n\nfunction createWindow () {\n mainWindow = new BrowserWindow({w...
javascript
chosen
[ { "from": "system", "value": "Use forEach() in place of for-loop\n" }, { "from": "human", "value": "import geojs from 'geojs/geo.js';\nimport VisComponent from '../../VisComponent';\n\nexport default class Geo extends VisComponent {\n constructor (el, options) {\n super(el);\n\n this.plot...
javascript
chosen
[ { "from": "system", "value": "Reduce intermediate variables with merge function.\n" }, { "from": "human", "value": "var clone = function(o){\n var f = function(){};\n f.prototype = o;\n return new f();\n};\n\nexports.resolve = function(mappings, request){\n var host = (request.headers.host |...
javascript
chosen
[ { "from": "system", "value": "Add Accept: application/json to Alchemy.xhr\n" }, { "from": "human", "value": "Alchemy.on = function (eventName, baseSelector, targetSelector, callback) {\n var baseNode = document.querySelector(baseSelector)\n baseNode.addEventListener(eventName, function (evt) {...
javascript
chosen
[ { "from": "system", "value": "Send entityName to Graphs API with dots replaced by dashes for FQDN compatibility\n" }, { "from": "human", "value": "// TODO: This is not a real model or controller\nApp.Graphs = Ember.Controller.extend({\n graph: function(emberId, entityName, entityType) {\n re...
javascript
chosen
[ { "from": "system", "value": "Add start and end date to model.\n" }, { "from": "human", "value": "var Models = {};\nModels.ItemListing = Backbone.Model.extend({\n\tdefaults: {\n\t\tid: '',\n\t\tname: '',\n\t\tprice: '',\n\t\tlocation: '',\n\t\tbuyers: [],\n\t\towner: '',\n\t\timageUrl: ''\n\t},\...
javascript
chosen
[ { "from": "system", "value": "Serwer: Test commita, drobna modyfikacja bazy danych\n" }, { "from": "human", "value": "var Sequelize = require('sequelize');\nvar sequelize = require('./db.js').Sequelize;\n\n\nvar User = sequelize.define('Users', {\n name: Sequelize.STRING,\n passwo...
javascript
chosen
[ { "from": "system", "value": "Add serializer for png assets\n" }, { "from": "human", "value": "import jpegThumbnail from './jpeg-thumbnail';\nimport storage from '../storage';\n\nconst costumePayload = costume => {\n // TODO is it ok to base64 encode SVGs? What about unicode text inside them?...
javascript
chosen
[ { "from": "system", "value": "Fix title in About Window\n\nShows up as 'Electron' on Windows\n" }, { "from": "human", "value": "var about = module.exports = {\n init,\n win: null\n}\n\nvar config = require('../../config')\nvar electron = require('electron')\n\nfunction init () {\n if (about.w...
javascript
chosen
[ { "from": "system", "value": "Fix webpack config for latest.\n" }, { "from": "human", "value": "let path = require('path');\nlet fs = require('fs');\nlet webpack = require('webpack');\nlet WebpackIsomorphicToolsPlugin = require('webpack-isomorphic-tools/plugin');\nlet webpackIsomorphicToolsConfi...
javascript
chosen
[ { "from": "system", "value": "Add first draft of lpa journey ordering\n" }, { "from": "human", "value": "define([\n 'extensions/collections/conversioncollection'\n], function (ConversionCollection) {\n var ConversionSeries = ConversionCollection.extend({\n\n serviceName:'lasting-power-of-at...
javascript
chosen
[ { "from": "system", "value": "Implement function for validating TOS attributes\n" }, { "from": "human", "value": "/**\n * Validate TOS against rules\n * @param tos\n * @param rules\n * @returns {boolean}\n */\nexport const validateTOS = (tos, rules) => {\n let errors = [];\n // debugger;\n\n ...
javascript
chosen
[ { "from": "system", "value": "Exclude `node_modules` from transpilation explicitly\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// Native\nconst path = require('path')\n\n// Packages\nconst asyncToGen = require('async-to-gen/register')\nconst updateNotifier = require('update-notifie...
javascript
chosen
[ { "from": "system", "value": "Add test for string being null in hostutil\n" }, { "from": "human", "value": "const HostUtil = {\n stringToHostname: function (string) {\n const HOSTNAME_MAX_LENGTH = 63;\n\n // Strip or convert illegal characters\n let host = string.toLowerCase().replace(...
javascript
chosen
[ { "from": "system", "value": "Use bounds property to set window size\n\nUse bounds property to set window size\n" }, { "from": "human", "value": "chrome.app.runtime.onLaunched.addListener(function() {\n chrome.app.window.create('html/beagle.html', {\n width: 1024,\n height: 768\...
javascript
chosen
[ { "from": "system", "value": "Tests: Improve error message for Promise rejections\n" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\nconst fs = require('fs');\n\nconst noop = () => {};\n\nbefore('initialization', function () {\n\t// Load and override configuration...
javascript
chosen
[ { "from": "system", "value": "Update params to send object literal with `digits` property " }, { "from": "human", "value": "import chai, { expect } from 'chai';\nimport sinon from 'sinon';\nimport sinonChai from 'sinon-chai';\n\nchai.use(sinonChai);\n\nimport ResourceTestHelper...
javascript
chosen
[ { "from": "system", "value": "Add additional coverage for hook script contents\n" }, { "from": "human", "value": "/* global afterEach, beforeEach, describe, it */\n\nimport assert from 'assert'\nimport fs from 'fs'\nimport rimraf from 'rimraf'\nimport build from '../../src/build'\nimport hooks f...
javascript
chosen
[ { "from": "system", "value": "Add onConnect and onDisconnect callbacks and return 'connection' object with disconnect option\n" }, { "from": "human", "value": "var WebSocket = require('ws');\nvar debug = require('debug')('signalk:ws');\n\n\nfunction connectDelta(hostname, callback) {\n var url ...
javascript
chosen