conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove redis session after mongo token\n" }, { "from": "human", "value": "// Do logout\n\n\n'use strict';\n\n\nmodule.exports = function (N, apiPath) {\n N.validate(apiPath, {});\n\n N.wire.on(apiPath, function logout(env, callback) {\n if (!env.session_id) {\n...
javascript
chosen
[ { "from": "system", "value": "Fix for unexpected null error\n" }, { "from": "human", "value": "var JSLINT = require(\"../lib/nodelint\");\n\nfunction addDefaults(options) {\n 'use strict';\n ['node', 'es5'].forEach(function (opt) {\n if (!options.hasOwnProperty(opt)) {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove default error log file\n" }, { "from": "human", "value": "'use strict';\n\nvar defaultLogAdapter = require('./adapter/logger/winston');\nvar defaultFsAdapter = require('./adapter/fs/fs');\n\nfunction logger(logDirectory, adapters)\n{\n logDirectory = typeo...
javascript
chosen
[ { "from": "system", "value": "Change exclamination with a dot\n" }, { "from": "human", "value": "import Component from '../components/component.react';\nimport React from 'react';\n\nclass Home extends Component {\n\n render() {\n return (\n <div className='home-page'>\n <h1 clas...
javascript
chosen
[ { "from": "system", "value": "Add header status 307 support. Pass user options\n\nAdd support for header status 307 where the method and body of the request are preserved when redirecting.\r\nPass user options when redirecting so that they are preserved.\r\nRemove unnecessary parentheses." }, { "fro...
javascript
chosen
[ { "from": "system", "value": "Add name additing to config\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2020 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfoam.CLASS({\n package: 'foam.nanos.alarming',\n name: 'AddAlarmNameDAO...
javascript
chosen
[ { "from": "system", "value": "fix: Make codesplitting split on each container\n" }, { "from": "human", "value": "import React from 'react';\nimport { get } from 'lodash';\nimport { IndexRoute, Route } from 'react-router';\n\nimport App from './containers/App';\n\nfunction getContainer(name) {\n ...
javascript
chosen
[ { "from": "system", "value": "Extend test coverage for recent changes in Heading component\n" }, { "from": "human", "value": "import 'core-js/es5';\nimport React from 'react/addons';\nimport Heading from '../src/book/heading.jsx';\n\nvar ReactTestUtils = React.addons.TestUtils;\n\ndescribe('Head...
javascript
chosen
[ { "from": "system", "value": "Put QIF export under /transactions/export/:id/transactions.qif\n" }, { "from": "human", "value": "// @flow\nimport { checkUserPin, getUserTransactions, getUserTransactionsAsQIF } from 'Service/UserService';\nimport Router from 'koa-router';\nimport TransactionModel ...
javascript
chosen
[ { "from": "system", "value": "Fix detection of QUnit version in QUnitAdapter.\n" }, { "from": "human", "value": "import { inspect } from 'ember-utils';\nimport Adapter from './adapter';\n\n/**\n This class implements the methods defined by Ember.Test.Adapter for the\n QUnit testing framework.\...
javascript
chosen
[ { "from": "system", "value": "Use primaryKeyAttribute to resolve globalIdField\n" }, { "from": "human", "value": "import * as typeMapper from './typeMapper';\nimport { GraphQLNonNull, GraphQLEnumType } from 'graphql';\nimport { globalIdField } from 'graphql-relay';\n\nmodule.exports = function (...
javascript
chosen
[ { "from": "system", "value": "Add \"last reply\" icon to discussion list\n" }, { "from": "human", "value": "import Component from 'flarum/Component';\nimport humanTime from 'flarum/helpers/humanTime';\n\n/**\n * Displays information about a the first or last post in a discussion.\n *\n * ### Pro...
javascript
chosen
[ { "from": "system", "value": "Add common image extensions to list of defaults" }, { "from": "human", "value": "export const DEFAULT_EXTENSIONS = [\n '.css',\n '.scss',\n '.sass',\n '.stylus',\n '.styl',\n '.less',\n]\n\nexport let oldHandlers = {}\n\nexport function noOp() {}\n\nexport fun...
javascript
chosen
[ { "from": "system", "value": "FIX: Support git URLs without a .git extension\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Handlebars.makeBoundHelper(function(sha1, url, branch) {\n if (Ember.isNone(url)) { return; }\n if (Ember.isNone(branch)) {\n re...
javascript
chosen
[ { "from": "system", "value": "Add css class to Opt-Out Information link\n" }, { "from": "human", "value": "Kwf.onContentReady(function(body, param) {\n if (!param.newRender) return;\n // TODO: make default behaviour customizable\n if (Kwf.Statistics.getDefaultOptValue() == 'out' && !Kwf...
javascript
chosen
[ { "from": "system", "value": "Rename to XHR to avoid clashes, added extra check for Titanium object first\n" }, { "from": "human", "value": "\t/**\n\t * Factory object for XMLHttpRequest\n\t */\n\tfunction Request(debug) {\n\t\tvar XMLHttpRequest;\n\n\n\t\tswitch (true)\n\t\t{\n\t\t\tcase typeof...
javascript
chosen
[ { "from": "system", "value": "Use strict equal for organizationId\n\nThis solves the lint offence\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n angular.module('exceptionless.validators')\n .directive('projectNameAvailableValidator', function($timeout, $q, projectSer...
javascript
chosen
[ { "from": "system", "value": "Add help and version commands\n" }, { "from": "human", "value": "import yargs from 'yargs'\nimport ext from './ext-finder'\nexport default ext\n\nexport function extFinder () {\n let argv = yargs.argv\n\n ext(argv._).map(ext =>\n ext.length\n ? console.log(e...
javascript
chosen
[ { "from": "system", "value": "lib: Allow for connection string to be used.\n" }, { "from": "human", "value": "'use strict';\n\nvar Hoek = require('hoek');\nvar sqlizr = require('sqlizr');\nvar Sequelize = require('sequelize');\n\n/**\n * Creates database connection, imports models, and exposes t...
javascript
chosen
[ { "from": "system", "value": "Fix route name (remove . delimiter)\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 _include...
javascript
chosen
[ { "from": "system", "value": "Fix typo in file name.\n" }, { "from": "human", "value": "var Client = require('./client');\nvar Renderer = require('./renderer');\nvar Router = require('./Router');\n\nmodule.exports = {\n Client: Client,\n createClient: Client.createClient,\n Renderer: Renderer...
javascript
chosen
[ { "from": "system", "value": "Enable running intagration tests with other databases, even if one does not exist.\n\nbefore() calls creating integration test DBs were outside of all describes() running the tests on each database. This caused all integration tests to not be run even if just one database conne...
javascript
chosen
[ { "from": "system", "value": "Change to local OpenCPU server as default.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar request = require(\"request\");\n\nfunction rCall(command, args, callback, options) {\n var opts = options || {},\n url,\n method = Object.keys(args...
javascript
chosen
[ { "from": "system", "value": "Use view factory to spawn formula view.\n" }, { "from": "human", "value": "var AnnotationView = require('../annotation').View;\nvar FormulaView = require('../formula').View;\n\nvar InlineFormulaView = function(node, viewFactory) {\n AnnotationView.call(this, node, ...
javascript
chosen
[ { "from": "system", "value": "Fix Unit Test according to update on controller.parseMethodName():\n* now controller.parseMethodName() receives the method name instead\nof the function object.\n" }, { "from": "human", "value": "'use strict'\r\n\r\nconst controller = require('./../lib/connectContro...
javascript
chosen
[ { "from": "system", "value": "Use customElement in chatOutput component\n" }, { "from": "human", "value": "\"use strict\";\n\nlet can = require(\"../../shims/can\");\n\nlet style = require(\"../../lib/ensureStyle\"),\n viewCss = require(\"./chatOutput.styl\");\n\nlet chatTemplate = require(\"...
javascript
chosen
[ { "from": "system", "value": "Allow adjusting \"fuel burning time\" for nether star in nether generator\n" }, { "from": "human", "value": "// This defines the output rate, with unit of RF/t. Must be float-point number, i.e. has decimals.\nvar gen_level = 10.0;\n\nvar Opcodes = org.objectweb.asm....
javascript
chosen
[ { "from": "system", "value": "Add flickr api key and secret options\n" }, { "from": "human", "value": "export default {\n authToken: process.env.AUTH_TOKEN || 'secret',\n env: process.env.NODE_ENV,\n host: process.env.HOST || 'localhost',\n github: {\n apiUrl: 'https://api.github.com',\n ...
javascript
chosen
[ { "from": "system", "value": "Bring d-click protection in line with styleguide.\n" }, { "from": "human", "value": "(function () {\n \"use strict\";\n var root = this,\n $ = root.jQuery;\n\n if(typeof root.GOVUK === 'undefined') { root.GOVUK = {}; }\n\n var doubleClickProtection = functi...
javascript
chosen
[ { "from": "system", "value": "Fix module for NodeJS - apped_dir_name\n" }, { "from": "human", "value": "var fs = require('fs');\nvar vm = require('vm');\nvar includeInThisContext = function(path) {\n var code = fs.readFileSync(path);\n vm.runInThisContext(code, path);\n}.bind(this);\ninclu...
javascript
chosen
[ { "from": "system", "value": "Fix for touchend event for iOS.\n" }, { "from": "human", "value": "/**\n * Flotr Event Adapter\n */\nFlotr.EventAdapter = {\n observe: function(object, name, callback) {\n bean.add(object, name, callback);\n return this;\n },\n fire: function(object, name, ...
javascript
chosen
[ { "from": "system", "value": "Fix a bug that change U.Collection.Collection to U.Collection\n" }, { "from": "human", "value": "U.Ring = U.Line.extend({\n addVertex:function (point, index) {\n\n var added = false;\n\n //remove last point\n var lastPoint = this.geometries.p...
javascript
chosen
[ { "from": "system", "value": "Fix typo import queryString from 'queryString'\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { inject, observer } from 'mobx-react'\nimport { MenuItem } from 'material-ui/Menu'\nimport { FormControl } from 'material-ui/Form'\nim...
javascript
chosen
[ { "from": "system", "value": "Add more properties to ShipBase\nAlso added collision functions\n" }, { "from": "human", "value": "var ShipBase = function (game, x, y, key) {\n\t//call base constructor\n\tPhaser.Sprite.call(this, game, x, y, key);\n\t\n\t//setup physics information\n\tthis.game.ph...
javascript
chosen
[ { "from": "system", "value": "Use ssl for DB always\n" }, { "from": "human", "value": "\"use strict\"\n\nvar cradle = require('cradle')\n\ncradle.setup({\n host: process.env.DB_HOST,\n port: process.env.DB_PORT,\n cache: false,\n timeout: 5000\n})\n\nvar conn = new (cradle.Connection)({\n s...
javascript
chosen
[ { "from": "system", "value": "Use `const` for the options variable\n\nThe options variable does not change, so use `const` for it.\n\nSigned-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n...
javascript
chosen
[ { "from": "system", "value": "Add code box utils file.\n" }, { "from": "human", "value": "import React from \"react\";\n\nimport CSSModules from 'react-css-modules';\nimport styles from \"../../../scss/_code-box.scss\";\n\nimport _ from \"lodash\";\n\nimport {compare} from '../../utils/code-box-...
javascript
chosen
[ { "from": "system", "value": "Use arrow funciton that immediately return obj literal syntax.\n" }, { "from": "human", "value": "const conditional = function(expression, if_block, else_block, when) {\n return {\n name: '',\n plugin: {\n args: {\n action:...
javascript
chosen
[ { "from": "system", "value": "Remove a bunch of text.\n\nThis referred to an earlier (never checked in) implementation.\n" }, { "from": "human", "value": "/*\n * Copyright 2015 the Mimu Authors (Dan Bornstein et alia).\n * Licensed AS IS and WITHOUT WARRANTY under the Apache License,\n * Version...
javascript
chosen
[ { "from": "system", "value": "Replace / with _ when writing files\n" }, { "from": "human", "value": "var builder = require('../builder');\n\nexports.all = function(config, options) {\n config.getModules().forEach(function(module) {\n var filters = config.getModuleFilters(module);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add 'type' support and use Promise with convert method.\n" }, { "from": "human", "value": "\"use strict\"\n\nvar Converter = module.exports = (function() {\n\n function Converter(ncmb, type) {\n\tthis.__proto__.ncmb = ncmb;\n\tthis._type = type;\n }\n\n Con...
javascript
chosen
[ { "from": "system", "value": "Allow npmRequire to load dev bundle and built-in modules.\n" }, { "from": "human", "value": "var assert = require(\"assert\");\n\nfunction getRelID(id) {\n assert.strictEqual(id.charAt(0), \"/\");\n return \"./npm\" + id.replace(/:/g, \"_\");\n}\n\nfunction npmReq...
javascript
chosen
[ { "from": "system", "value": "Rollback history after scope apply\n" }, { "from": "human", "value": "'use strict';\n\n$(document).ready(function(){\n\n});\n\n/**\n * @ngdoc directive\n * @name anyandgoApp.directive:tabsmod\n * @description\n * # tabsmod\n */\nangular.module('anyandgoApp')\n .dir...
javascript
chosen
[ { "from": "system", "value": "Add timer to check for new mail\n" }, { "from": "human", "value": "// @ngInject\nmodule.exports = function($scope, $stateParams, EmailState, API) {\n var vm = this;\n\n vm.emails = [];\n vm.label = 'inbox';\n vm.emailFilter = EmailState.filter;\n\n vm.fetchEmai...
javascript
chosen
[ { "from": "system", "value": "Use points from json directly\n" }, { "from": "human", "value": "angular.module(\"personaApp\")\n.controller('quizController', ['$http', function($http){\n var quiz = this;\n quiz.started = false;\n quiz.questionNumber = 0;\n quiz.gender = \"\";\n\n q...
javascript
chosen
[ { "from": "system", "value": "Create a hard copy of the super getTasksSummary value\n" }, { "from": "human", "value": "import {\n ROUTE_ACCESS_PREFIX,\n FRAMEWORK_ID_VALID_CHARACTERS\n} from '../constants/FrameworkConstants';\nimport Service from './Service';\n\nmodule.exports = class Framewor...
javascript
chosen
[ { "from": "system", "value": "Set the hmac.update encoding to utf-8 to support UTF-8 chars\n" }, { "from": "human", "value": "'use strict';\n\nvar crypto = require('crypto');\nvar _ = require(\"underscore\");\n\nvar signature = function(xhub, options){\n this.xhub = xhub;\n options = optio...
javascript
chosen
[ { "from": "system", "value": "Add addComponent method to Entity\n" }, { "from": "human", "value": "const createTransform = require('./transform')\n\nlet entityId = 0\n\nfunction Entity (components, parent) {\n this.id = entityId++\n\n this.components = components ? components.slice(0) : []\n\n...
javascript
chosen
[ { "from": "system", "value": "Add test for fetchText() of empty element\n" }, { "from": "human", "value": "/*eslint strict:0*/\ncasper.test.begin('fetchText() basic tests', 1, function(test) {\n casper.start('tests/site/index.html', function() {\n test.assertEquals(this.fetchText('ul l...
javascript
chosen
[ { "from": "system", "value": "Add Lunar scene to menu\n" }, { "from": "human", "value": "import React from 'react';\nimport DinoScene from '../../aframe/components/DinoScene';\nimport WarScene from '../../aframe/components/WarScene';\n\nconst pooScenes = {\n war: WarScene,\n dino: DinoScene,\n...
javascript
chosen
[ { "from": "system", "value": "Add 7digital previous and mute selectors" }, { "from": "human", "value": ";(function() {\n \"use strict\";\n\n require(\"BaseController\").init({\n siteName: \"7digital\",\n playPause: \".player-play-pause\",\n playNext: \".player-next\",\n\n playState...
javascript
chosen
[ { "from": "system", "value": "Fix coursera for new player.\n" }, { "from": "human", "value": ";(function() {\n \"use strict\";\n\n var BaseController = require(\"BaseController\");\n\n new BaseController({\n siteName: \"Coursera\",\n play: \".mejs-play\",\n pause: \".mejs-pause\",\n ...
javascript
chosen
[ { "from": "system", "value": "Remove `implicitBundleDest` property from example app (now uses default).\n" }, { "from": "human", "value": "var path = require(\"path\");\n\nvar Interlock = require(\"..\");\n\nvar ilk = new Interlock({\n srcRoot: __dirname,\n destRoot: path.join(__dirname, \"dis...
javascript
chosen
[ { "from": "system", "value": "Remove session and conversation data.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = exports = [\n (session) => {\n\n delete session.userData.profile;\n delete session.userData.impersonated;\n delete session.userData.pro...
javascript
chosen
[ { "from": "system", "value": "Remove try/catch around compile call\n\nThis prevents errors being thrown when someone breaks something in compiler." }, { "from": "human", "value": "'use strict';\n\nvar _ = require('underscore');\n\n// It should be given:\n// - t: a function that will translate a ...
javascript
chosen
[ { "from": "system", "value": "Refactor ember-utils imports in ember-template-compiler package.\n" }, { "from": "human", "value": "import PLUGINS from '../plugins';\nimport { assign } from 'ember-metal';\n\nlet USER_PLUGINS = [];\n\nexport default function compileOptions(_options) {\n let option...
javascript
chosen
[ { "from": "system", "value": "Move relese event object generation into function\n" }, { "from": "human", "value": "const axios = require('axios');\nconst Program = require('commander');\nconst Chalk = require('chalk');\n\nmodule.exports = async (pluginInfo) => {\n if (typeof Program.releaseEv...
javascript
chosen
[ { "from": "system", "value": "Add some comments explaining our tradeoffs" }, { "from": "human", "value": "angular.module('opal.services').service('Patient', function(Episode, FieldTranslater) {\n \"use strict\";\n var Patient = function(patientData){\n var self = this;\n _.extend(this, F...
javascript
chosen
[ { "from": "system", "value": "Set only default export for umd build\n" }, { "from": "human", "value": "import {Chart} from 'chart.js';\nimport StreamingPlugin from './plugins/plugin.streaming';\nimport RealTimeScale from './scales/scale.realtime';\n\nconst registerables = [StreamingPlugin, RealT...
javascript
chosen
[ { "from": "system", "value": "Remove empty meta objects from action" }, { "from": "human", "value": "import isPromise from './isPromise';\n\nconst defaultTypes = ['PENDING', 'FULFILLED', 'REJECTED']\n\nexport default function promiseMiddleware(config={}) {\n const promiseTypes = config.promiseT...
javascript
chosen
[ { "from": "system", "value": "Disable registering service-worker in developement mode\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport App from './App'\n\nReactDOM.render(\n <App />,\n document.getElementById('root')\n)\n\nif ('serviceWor...
javascript
chosen
[ { "from": "system", "value": "Allow passing handler in to the operation\n" }, { "from": "human", "value": "\"use strict\";\n\nconst Joi = require('joi');\n\nconst securitySchema = require('./securitySchema');\nconst parameterSchema = require('./parameterSchema');\n\nmodule.exports = Joi.object({...
javascript
chosen
[ { "from": "system", "value": "Add Modernizr Box-Sizing test and more concise polyfill\n" }, { "from": "human", "value": "/*global Modernizr:true */\n\n// Box sizing\n// =============================================================================\n\nif (Modernizr.boxsizing !== null && Modernizr....
javascript
chosen
[ { "from": "system", "value": "Use String.endsWith for a cleaner code.\nInclude polyfills for Array.some and String.endsWith.\n" }, { "from": "human", "value": "/**\n * Check if the provided file type should be accepted by the input with accept attribute.\n * https://developer.mozilla.org/en-US/d...
javascript
chosen
[ { "from": "system", "value": "Edit TODO to reflect edited file\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport { Link } from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport styles from './navItem.css';\n\nclass NavItem extends PureCompone...
javascript
chosen
[ { "from": "system", "value": "Test that drawAll delegates to other methods\n" }, { "from": "human", "value": "\"use strict\";\nconst chai = require('chai');\nconst assert = chai.assert;\nconst ST = require('../lib/spacetime');\nconst $ = require('jquery');\n\ndescribe('space-time func...
javascript
chosen
[ { "from": "system", "value": "Remove useless offset propety from addItem initialState\n" }, { "from": "human", "value": "import {\n SET_ITEM_NAME,\n SET_ITEM_CATEGORY,\n RESET_ADD_ITEM_FORM,\n} from '../constants/ActionTypes';\n\nconst initialState = {\n offset: null,\n name: null,\n categ...
javascript
chosen
[ { "from": "system", "value": "Component: Add cursor position marker to template.\n" }, { "from": "human", "value": "/* Author: <%= authorName %>, <%= authorUrl %>, <%= (new Date).getFullYear() %> */\n\n;(function($) {\n\t'use strict';\n\n\tclass <%= cls %> extends Component {\n\t\tinit() {\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Remove examples and in-line the write callback\n" }, { "from": "human", "value": "var through = require('through')\nvar tr = through(write, end)\ntr.write('beep')\ntr.write('boop')\ntr.end()\n\nfunction write(buf) { this.queue(buf.toString().toUpperCase()) }\nfuncti...
javascript
chosen
[ { "from": "system", "value": "Allow splitting of samples if sample all checkbox is checked.\n" }, { "from": "human", "value": "import React from 'react';\nimport {ButtonGroup} from 'react-bootstrap';\nimport UIStore from './../stores/UIStore';\nimport ElementActions from './../actions/ElementAct...
javascript
chosen
[ { "from": "system", "value": "Switch side of shrinking bar\n" }, { "from": "human", "value": "AFRAME.registerComponent('hit-listener', {\n schema: {\n characterId: { default: undefined },\n barWidth: { default: 1 },\n maxLife: { default: 100 }\n },\n\n init: function () {\n const e...
javascript
chosen
[ { "from": "system", "value": "Switch magenta for lighter color\n" }, { "from": "human", "value": "const BasicColorTheme = require('./templates/BasicColorTheme')\r\nconst ColorSchemeTransformations = require('./ColorSchemeTransformations')\r\nconst BasicTiming = require('./timings/BasicTiming')\r...
javascript
chosen
[ { "from": "system", "value": "Use mcprojstore rather than mcstate to get the current experiment\n" }, { "from": "human", "value": "class MCExperimentComponentController {\n /*@ngInject*/\n constructor(mcstate) {\n this.experiment = mcstate.get(mcstate.CURRENT$EXPERIMENT);\n }\n}\...
javascript
chosen
[ { "from": "system", "value": "[test] Add `data` property to `MonitorMock`\n" }, { "from": "human", "value": "var util = require('util'),\n broadway = require('broadway'),\n ChildProcessMock = require('./child-process').ChildProcessMock;\n\nvar MonitorMock = exports.MonitorMock = function (...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix test case in react 15\n" }, { "from": "human", "value": "import React from 'react';\n\nlet Trigger; // eslint-disable-line\n\nif (process.env.REACT === '15') {\n const ActualTrigger = require.requireActual('rc-trigger');\n // cannot use object destructio...
javascript
chosen
[ { "from": "system", "value": "Use object shorthand for properties\n" }, { "from": "human", "value": "var test = require('tape')\nvar net = require('net')\n\nvar TAPE_PORT = Number(process.env.TAPE_PORT)\n\nvar con = net.connect(TAPE_PORT, '127.0.0.1')\n\nvar success = false\ntest.createStream()....
javascript
chosen
[ { "from": "system", "value": "Add class to style active tags.\n" }, { "from": "human", "value": "class Tag extends React.Component {\n constructor() {\n super();\n\n this.handleClick = this.handleClick.bind(this);\n }\n\n handleClick(key) {\n this.props.handleChange(key);\n }\n\n r...
javascript
chosen
[ { "from": "system", "value": "TEST: Reduce waiting time before retrying to click yes/no option\n" }, { "from": "human", "value": "'use strict';\n\nvar util = require('util');\nvar common = require('../modules/common-functions');\n\nexports.command = function(fields, value, callback) {\n var cli...
javascript
chosen
[ { "from": "system", "value": "Optimize uglifyjs's output via options.\n" }, { "from": "human", "value": "import uglify from \"rollup-plugin-uglify\"\n\nexport default {\n plugins: [\n uglify()\n ]\n}\n\n" }, { "from": "gpt", "value": "import uglify from \"rollup-plugin-u...
javascript
chosen
[ { "from": "system", "value": "Remove advisor info when computing ID doesn't match.\n" }, { "from": "human", "value": "(function() {\n\t\"use strict\";\n\tfunction initPage() {\n\n\t\tvar outerForm = $(\".generic_work_contributor\");\n\t\t$(\"body\").on(\"keyup\", \".contributor_computing_id\", f...
javascript
chosen
[ { "from": "system", "value": "Correct import syntax for fs\n" }, { "from": "human", "value": "import { fs } from 'fs';\n\nconst rethinkdbConfig = (() => {\n const cert = fs.readFileSync(path.resolve(__dirname, '../cert'))\n let config = {\n host: process.env.RETHINKDB_HOST || 'localhost',\n...
javascript
chosen
[ { "from": "system", "value": "Add breadcrumb components to entry script\n" }, { "from": "human", "value": "export { Badge, BadgeColors } from './components/badge';\nexport { Button, Link, ButtonSizes, ButtonColors } from './components/button';\nexport { ButtonGroup, ButtonGroupSizes, ButtonGroup...
javascript
chosen
[ { "from": "system", "value": "Fix duplicate `graphql` package bug by checking for local installation\n\nSee https://github.com/graphql/graphiql/issues/58 for more info\n" }, { "from": "human", "value": "const axios = require('axios')\nconst { graphql } = require('graphql')\n\nconst { correctURL,...
javascript
chosen
[ { "from": "system", "value": "Use virtual stream for completion notifier\n" }, { "from": "human", "value": "import { Observable } from 'rxjs/Observable'\nimport { of } from 'rxjs/observable/of'\nimport { merge } from 'rxjs/observable/merge'\nimport { delay } from 'rxjs/operator/delay'\nimport { ...
javascript
chosen
[ { "from": "system", "value": "Improve error handling on service component.\n" }, { "from": "human", "value": "/**\n * Main script.\n *\n * This component provides a main script that handles HTTP requests using the\n * Express framework.\n *\n * This package provides a default service component w...
javascript
chosen
[ { "from": "system", "value": "Add validation for parameters, default value for path and refactor getPath\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 setu...
javascript
chosen
[ { "from": "system", "value": "Switch login flow a little\n" }, { "from": "human", "value": "$(document).ready(function(){\n facebookSdk(loginLink);\n sphere();\n nav();\n\n $(\"#os-phrases > h2\").lettering('words').children(\"span\").lettering().children(\"span\").lettering();\n\n $('.stop...
javascript
chosen
[ { "from": "system", "value": "Fix missing conflict error export\n" }, { "from": "human", "value": "import BadRequestError from './bad-request-error';\nimport ConflictError from './conflict-error';\nimport ForbiddenError from './forbidden-error';\nimport InternalServerError from './internal-serve...
javascript
chosen
[ { "from": "system", "value": "Use https ONLY in development\n" }, { "from": "human", "value": "/**\n * @file lib/index.js\n * @description Runs a single server instance to run the application.\n * @author Karim Alibhai\n * @license MIT\n * @copyright Karim Alibhai 2017\n */\n\nimport fs from 'fs...
javascript
chosen
[ { "from": "system", "value": "Revert \"just to initiate travis\"\n\nThis reverts commit c5a06bfc2b98c180ff4b32f7fe89bb3471fefa0f.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n\tEdge: require('./edge'),\n\tSystem: require('./system')\n};\n\n" }, { "from": "gpt",...
javascript
chosen
[ { "from": "system", "value": "Add style stringify and log\n" }, { "from": "human", "value": "const colors = ['red', 'blue', 'green']\n\nfunction cholk(text) {\n return {\n style: cholk._style,\n text,\n }\n}\n\ncholk._style = {}\n\nconst proto = Object.create(null)\nconst properties = co...
javascript
chosen
[ { "from": "system", "value": "Update plugin to work with version 6\n" }, { "from": "human", "value": "var redback = require('redback'),\n\tHoek = require('hoek'),\n\tDefaults = require('./defaults');\n\nexports.register = function (plugin, options, next) {\n\tvar settings = Hoek.applyToDefaults(...
javascript
chosen
[ { "from": "system", "value": "Allow dots as well :rocket:" }, { "from": "human", "value": "// Dependencies\nvar types = require(\"./core\")\n , constructors = require(\"./constructors\")\n , iterateObject = require(\"iterate-object\")\n , ul = require(\"ul\")\n , typpy = require(\"typpy\")\n...
javascript
chosen
[ { "from": "system", "value": "Add (failing) tests for URL reversal\n" }, { "from": "human", "value": "var Route = require('../Route');\n\n\ndescribe('Route', function() {\n describe('#url()', function() {\n\n it('generates a URL', function() {\n var route = new Route('/users/');\n ...
javascript
chosen
[ { "from": "system", "value": "Allow underscores in persistence keys." }, { "from": "human", "value": "const freeze = require('deep-freeze-node');\n\nclass LocalPath {\n constructor (localParts) {\n this.localParts = localParts;\n this.type = 'path';\n freeze(this);\n }\n\n createChil...
javascript
chosen
[ { "from": "system", "value": "Use the toolbar button example to open the toolbox (it'll become Firebug start button at some point)\n" }, { "from": "human", "value": "/* See license.txt for terms of usage */\n\n\"use strict\";\n\nvar tabs = require(\"sdk/tabs\");\n\nconst { ActionButton } = requi...
javascript
chosen
[ { "from": "system", "value": "Throw an error if a user tries to join a project twice\n" }, { "from": "human", "value": "Requests = new Mongo.Collection('requests');\n\nMeteor.methods({\n addRequest: function(requestAttributes) {\n check(Meteor.userId(), String);\n check(requestAttributes,...
javascript
chosen
[ { "from": "system", "value": "Check that a user has a status before we run our code.\n" }, { "from": "human", "value": "Users = Meteor.users\n\nUsers.helpers({\n avatar: function() {\n if (this.emails) {\n return Gravatar.imageUrl(this.emails[0].address);\n }\n },\n online: functio...
javascript
chosen
[ { "from": "system", "value": "Fix jshint warning about ternary operator placement.\n" }, { "from": "human", "value": "var o_around = require('./o-around.js');\nvar o_merge = require('./o-merge.js');\nvar o_clone = require('./o-clone.js');\n\nmodule.exports = function (parent, constructor, proto)...
javascript
chosen
[ { "from": "system", "value": "Include shebang in \"comment\" definition.\n" }, { "from": "human", "value": "import fs from \"fs\";\nimport InputStream from \"./InputStream\";\n\nexport function isGreyspace(string) {\n if (string === \"\" ||\n string === \" \" ||\n string === \"\...
javascript
chosen