conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add default search function, search result directive, and getResults function\n" }, { "from": "gpt", "value": "angular.module('zeus.results', [])\n.controller('ResultsController', function(Results) {\n var vm = this;\n vm.searchQuery = \"Jurassic Park\";\n vm.resu...
javascript
chosen
[ { "from": "system", "value": "Replace npms with <: $lia_name :>" }, { "from": "human", "value": "(function (env) {\n \"use strict\";\n env.ddg_spice_npm = function(api_result){\n\n // Validate the response\n if (api_result.error) {\n return Spice.failed('<: $lia_na...
javascript
chosen
[ { "from": "system", "value": "Add roles to user for game\n" }, { "from": "human", "value": "Meteor.methods({\n\t\"createGame\": function(gameName, lobbyName, password) {\n\t\tif(!GAME_DEFINITIONS.hasOwnProperty(gameName)) {\n\t\t\tthrow new Meteor.Error(\"unrecognized-game\", \"A game of the spe...
javascript
chosen
[ { "from": "system", "value": "Tweak the call with parameters of the tests\n" }, { "from": "human", "value": "import { setUpBrowserWindow } from '../../../src/set-up/browser-window';\nimport chai from 'chai';\nimport debug from 'debug';\nimport sinon from 'sinon';\nimport sinonAsPromised from 'si...
javascript
chosen
[ { "from": "system", "value": "Allow content renderer modules to use a kind: [extensions...] object to define the content types they can render.\n" }, { "from": "human", "value": "const KolibriModule = require('kolibri_module');\n\nmodule.exports = class ContentRenderer extends KolibriModule {\n ...
javascript
chosen
[ { "from": "system", "value": "Make sure el exists before manipulating it\n\nOtherwise it crashes when the overlay is open in the initial store\nstate.\n" }, { "from": "human", "value": "// essentials\nimport React from 'react'\nimport { connect } from 'react-redux'\n\n// actions\nimport toggleTr...
javascript
chosen
[ { "from": "system", "value": "Use arrow function in session storage\n" }, { "from": "human", "value": "export function getToken() {\n return new Promise(function(resolve, reject) {\n chrome.storage.local.get({ \"vkaccess_token\": null }, (items) => {\n resolve(items.vkaccess_token)\n ...
javascript
chosen
[ { "from": "system", "value": "Use host param in common request logic\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n const makeRequest = require('../../common/request.js').makeRequest;\n const config = require('./getConfig.js');\n\n module.exports = function requestEmpA...
javascript
chosen
[ { "from": "system", "value": "Add Onimaru to the character list" }, { "from": "human", "value": "export const characters = Object.assign({},\n require('./characters/geiger.jsx'),\n require('./characters/grave.jsx'),\n require('./characters/gwen.jsx'),\n require('./characters/jaina.js...
javascript
chosen
[ { "from": "system", "value": "Use the correct path for the database file\n" }, { "from": "human", "value": "async function sql( args ) {\n/*\ndescription(\"This will execute sql on the internal SQLite database\")\nbase_component_id(\"systemFunctionAppSql\")\nload_once_from_file(true)\n*/\n\n\n ...
javascript
chosen
[ { "from": "system", "value": "Make Display for the window numbers linear because of chrome.\n" }, { "from": "human", "value": "var body = document.getElementById(\"body\");\nvar currentWindow = null;\nvar ul = null;\n\nfunction clickHandler(){\n chrome.tabs.update(this.tabId, {active:true}); \n...
javascript
chosen
[ { "from": "system", "value": "Add subview's DOM before injecting to document\n" }, { "from": "human", "value": "var cdb = require('cartodb.js');\nvar TypeGuessingTogglerView = require('../../create/footer/type_guessing_toggler_view');\n\n/**\n * Footer view for the add layer modal.\n */\nmodule....
javascript
chosen
[ { "from": "system", "value": "Add { force: env.UNSAFE_MODE }\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst del = require('del');\n\n/**\n * Cleaning tasks\n *\n * @task clean:*\n */\ngulp.task('clean:dest', (done) => {\n return del(env.DIR_DEST);\n});\n\ngulp.task('c...
javascript
chosen
[ { "from": "system", "value": "Remove Hooks from qunit-rfc-232 util-test blueprint" }, { "from": "human", "value": "import <%= camelizedModuleName %> from '<%= dasherizedModulePrefix %>/utils/<%= dasherizedModuleName %>';\nimport { module, test } from 'qunit';\n\nmodule('<%= friendlyTestName %>',...
javascript
chosen
[ { "from": "system", "value": "tests: Migrate `hbs` import to `ember-cli-htmlbars`\n" }, { "from": "human", "value": "import { module, test } from 'qunit';\nimport { setupRenderingTest } from 'ember-qunit';\nimport { render } from '@ember/test-helpers';\nimport hbs from 'htmlbars-inline-precompil...
javascript
chosen
[ { "from": "system", "value": "Revert \"Increased maxBuffer size, for some reason it was reaching the limit on a big repository.\"\n\nThis reverts commit 111c0bcad3555505b7e5f3901ff60f05cdccd0bf.\n" }, { "from": "human", "value": "'use strict';\n\nvar grunt = require('grunt');\nvar chalk = requir...
javascript
chosen
[ { "from": "system", "value": "Make sure effect text fields are initialised.\n" }, { "from": "human", "value": "import $ from 'jquery';\nimport 'jquery-ui/widgets/slider';\n\nimport Signal from '../../../utils/signal';\n\nexport class EffectUIBase {\n constructor(target, effect, location) {\n ...
javascript
chosen
[ { "from": "system", "value": "Change input type for mobile browsers\n" }, { "from": "human", "value": "import {Observable} from 'rx'\nimport {div, input, label} from '@cycle/DOM'\n\nfunction renderInputField(value) {\n return input('.number-input .mdl-textfield__input',\n {type: 'text', valu...
javascript
chosen
[ { "from": "system", "value": "Fix the issue generation for taster css\n" }, { "from": "human", "value": "'use strict';\n\nvar argv = require('yargs').argv;\nvar path = require('path');\nvar mainBowerFiles = require('main-bower-files');\n\nmodule.exports = function(gulp, plugins, config, options)...
javascript
chosen
[ { "from": "system", "value": "refactor(react-component-utils): Remove validateEmail for validator lib\n" }, { "from": "human", "value": "export function validateEmail(email) {\n const re = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[...
javascript
chosen
[ { "from": "system", "value": "Fix :bug: to display ours/theirs deleted status\n" }, { "from": "human", "value": "/** @babel */\n/** @jsx etch.dom */\n\nimport etch from 'etch'\nimport {classNameForStatus} from '../helpers'\n\nconst statusSymbolMap = {\n added: '+',\n removed: '-',\n modified:...
javascript
chosen
[ { "from": "system", "value": "Allow for multiple invalid sources\n" }, { "from": "human", "value": "import { t } from '../util/locale';\nimport { utilDisplayLabel } from '../util';\nimport { validationIssue, validationIssueFix } from '../core/validator';\n\n\nexport function validationIncompatib...
javascript
chosen
[ { "from": "system", "value": "Fix error that prevented scrolling\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../../templates/components/power-select/options';\n\nexport default Ember.Component.extend({\n layout: layout,\n tagName: 'ul',\n attributeBindin...
javascript
chosen
[ { "from": "system", "value": "Fix to problem of chrome.runtime sometimes not being defined.\n\nThere appears to be some non-determinism in the order that the chrome.runtime\nnamespace gets set up relative to when the last_error.js file is loaded. This adds a require statement that should hopefully resolve t...
javascript
chosen
[ { "from": "system", "value": "Add jest module mapper for tests directory\n" }, { "from": "human", "value": "module.exports = {\n verbose: true,\n bail: true,\n collectCoverage: true,\n coverageDirectory: 'coverage',\n restoreMocks: true,\n moduleFileExtensions: ['js', 'jsx', 'json', 'vue']...
javascript
chosen
[ { "from": "system", "value": "fix(webpack): Fix source map generation in dist\n" }, { "from": "human", "value": "var webpack = require(\"webpack\");\n\n// Builds bundle usable <script>. Includes RGL and all deps, excluding React.\nmodule.exports = {\n context: __dirname,\n entry: {\n \"reac...
javascript
chosen
[ { "from": "system", "value": "Send route data as GeoJSON document to the server\n" }, { "from": "human", "value": "(function(app) {\n\nvar JAKARTA = [-6.1744444, 106.8294444];\n\napp.controller('SubmissionController', ['$scope', function($scope) {\n\n $scope.init = function() {\n }\n\n}]);\n\n...
javascript
chosen
[ { "from": "system", "value": "Exclude AppCache js test on IE < 10\n" }, { "from": "human", "value": "({\n /**\n * Verify the correct AppCache events are received and are in the right order, without an error event. This case\n * covers when we have not seen the page before and must do...
javascript
chosen
[ { "from": "system", "value": "Tweak tab tracking to pass in tab href\n\nGA’s automatic detection of the current page wasn’t picking up the\nreplaced href correctly. Instead explicitly set this when sending the\npage view.\n\nhttps://developers.google.com/analytics/devguides/collection/analyticsjs\n/pages#ov...
javascript
chosen
[ { "from": "system", "value": "Use a clean instance of Footer component at each test\n" }, { "from": "human", "value": "'use strict';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport TestUtils from 'react-addons-test-utils';\nimport Footer from './../Footer';\n\nimport { a...
javascript
chosen
[ { "from": "system", "value": "Fix a timing issue with Greasemonkey\n\nGreasemonkey ran the script too late with document-body even though it worked fine with Tampermonkey.\n" }, { "from": "human", "value": "// ==UserScript==\n// @author Janne K\n// @name Etlari Paywall Bypass\n// @...
javascript
chosen
[ { "from": "system", "value": "Fix bug with 'actionCard' property being reset improperly\n" }, { "from": "human", "value": "export default class GameModelService {\n\tconstructor($log, $localStorage, _, gamesApi) {\n\t\t'ngInject';\n\n\t\tthis.$log = $log.getInstance(this.constructor.name);\n\n\t...
javascript
chosen
[ { "from": "system", "value": "Add className to proptypes of textarea component\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport idgen from './idgen';\nimport Icon from './Icon';\nimport cx from 'classnames';\n\nclass Textar...
javascript
chosen
[ { "from": "system", "value": "Add tooltip to delete button in form group containers\n\nFixes DCOS-13199\n" }, { "from": "human", "value": "import React from 'react';\n\nimport Icon from '../Icon';\n\nconst FormGroupContainer = (props) => {\n let removeButton = null;\n if (props.onRemove != nul...
javascript
chosen
[ { "from": "system", "value": "Load config from executing directory\n\n" }, { "from": "human", "value": "const syrup = require('../../');\n\nsyrup.config(`${__dirname}/config.yaml`);\n\nsyrup.scenario('example.org1', `${__dirname}/test-example.org`, [], 'IEBrowser');\nsyrup.scenario('example.org2...
javascript
chosen
[ { "from": "system", "value": "Allow to define also a logger\n" }, { "from": "human", "value": "class MaxdomeErrorLogger {\n constructor(log = console.log) {\n this.log = log;\n }\n\n onError(e) {\n if (e.statusCode === 403) {\n const matches = /Reference #([a-zA-Z0-9.]*)/.exec(e.me...
javascript
chosen
[ { "from": "system", "value": "Test local version of babel/types\n" }, { "from": "human", "value": "import { createTypeAnnotationBasedOnTypeof } from \"@babel/types\";\n\ndescribe(\"builders\", function() {\n describe(\"flow\", function() {\n describe(\"createTypeAnnotationBasedOnTypeof\", fu...
javascript
chosen
[ { "from": "system", "value": "Fix catalog app icon issue\n\nhttps://github.com/rancher/rancher/issues/23291\n" }, { "from": "human", "value": "import Mixin from '@ember/object/mixin';\nimport { set, get } from '@ember/object';\nimport $ from 'jquery';\n\nexport default Mixin.create({\n srcSet: ...
javascript
chosen
[ { "from": "system", "value": "Fix logic for finding the user\n" }, { "from": "human", "value": "const Verifier = require('feathers-authentication-local').Verifier;\nconst errors = require('feathers-errors');\n\nmodule.exports = function createVerifier (options = {}, app) {\n if (!options.userSe...
javascript
chosen
[ { "from": "system", "value": "Enable access to expense through permalink\n" }, { "from": "human", "value": "// Filename: router.js\ndefine([\n 'Backbone',\n 'models/expense',\n 'views/home'\n], function(Backbone, Expense, homeview){\n\n var AppRouter = Backbone.Router.extend({\n ...
javascript
chosen
[ { "from": "system", "value": "Add null metricDAO to QuickbugController.\n" }, { "from": "human", "value": "CLASS({\n name: 'Background',\n package: 'foam.apps.quickbug.controller',\n\n requires: [\n 'foam.apps.quickbug.model.QBug'\n ],\n\n properties: [\n {\n name: 'qb',\n f...
javascript
chosen
[ { "from": "system", "value": "Fix issue of carry over of negative allowances when the feature is OFF\n" }, { "from": "human", "value": "\n'use strict';\n\nconst\n moment = require('moment'),\n Promise= require('bluebird');\n\nconst calculateCarryOverAllowance = ({users}) => {\n\n const\n y...
javascript
chosen
[ { "from": "system", "value": "Update copy for loyalty bonuses modal\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { c } from 'ttag';\nimport { Alert, ConfirmModal, ErrorButton, Paragraph } from 'react-components';\n\nconst LossLoyaltyM...
javascript
chosen
[ { "from": "system", "value": "Fix sample frontend event order\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport { connect } from 'react-redux'\nimport RawViewLink from '../RawView/RawViewLink'\nimport Event from './Event'\nimport './EventLog.css'\n\nconst propTy...
javascript
chosen
[ { "from": "system", "value": "Comment just to prevent the errors\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/yebo-checkout';\n/**\n A single page checkout that reactively responds to changes in the\n `yebo.checkouts` service.\n\n ...
javascript
chosen
[ { "from": "system", "value": "Fix issue with trailing semicolon\n" }, { "from": "human", "value": "'use strict';\n\nvar helpers = require('../helpers');\n\nvar trailingZeroRegex = /^(\\d+\\.|\\.)+(\\d*?[1-9])0+$/;\n\nmodule.exports = {\n 'name': 'no-trailing-zero',\n 'defaults': {\n 'includ...
javascript
chosen
[ { "from": "system", "value": "Convert string double-quotes to single-quotes\n" }, { "from": "human", "value": "'use strict';\n\nvar peg = require('pegjs');\n\nclass PegJsPlugin {\n\n constructor(config) {\n this.config = config.plugins.pegjs;\n // The output of the below peg.generate() fu...
javascript
chosen
[ { "from": "system", "value": "Use ipify.org as a fallback\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Import HTTPS interface module.\n */\nvar protocol = require('https');\n\n/**\n * Save reference to native Promise implementation or import promise module.\n *\n * @type {Promise}...
javascript
chosen
[ { "from": "system", "value": "Fix wrong boolean on account creation\n" }, { "from": "human", "value": "orion.accounts = {};\n\n/**\n * Initialize the profile schema option with its default value\n */\nOptions.init('profileSchema', {\n name: { type: String }\n});\n\n/**\n * Updates the profile s...
javascript
chosen
[ { "from": "system", "value": "Fix passing argument to callback to be status code not a boolean\n" }, { "from": "human", "value": "module.exports = function( options, callback ) {\n\tvar option, spider,\n\t\tstartTime = new Date(),\n\t\tduration = require( \"duration\" ),\n\t\tspawn = require( \"...
javascript
chosen
[ { "from": "system", "value": "Use the engine-types to get the icon\n" }, { "from": "human", "value": "\"use strict\";\n\n// Dependencies\nconst Deffy = require(\"deffy\")\n , Typpy = require(\"typpy\")\n , SubElmId = require(\"./id\")\n ;\n\nclass SubElm {\n /**\n * SubElm\n ...
javascript
chosen
[ { "from": "system", "value": "Fix OR ( || ) in if statement\n" }, { "from": "human", "value": "'use strict';\n\nvar deepFind = function(obj, path) {\n\n if (((typeof obj !== \"object\") && (typeof obj !== \"function\")) | obj === null) {\n\t return undefined;\n }\n if (typeof path === 'strin...
javascript
chosen
[ { "from": "system", "value": "Return an array when it's passed\n" }, { "from": "human", "value": "function truthy(val) { return val; }\nfunction trim(str) { return str.trim(); }\n\nfunction listToArray (str, delimiter) {\n\tif (!str || typeof str !== 'string') {\n\t\treturn [];\n\t}\n\tif (!deli...
javascript
chosen
[ { "from": "system", "value": "Add @xstate/graph to changeset-managed packages\n" }, { "from": "human", "value": "const { exec } = require('@actions/exec');\nconst getWorkspaces = require('get-workspaces').default;\n\nasync function execWithOutput(command, args, options) {\n let myOutput = '';\n...
javascript
chosen
[ { "from": "system", "value": "Add Chapter 06, exercise 3\n" }, { "from": "human", "value": "function ArraySeq(array) {\n this.array = array;\n this.counter = 0;\n}\nObject.defineProperty(ArraySeq.prototype, \"atEnd\", {\n get: function() {\n return this.counter == this.array.leng...
javascript
chosen
[ { "from": "system", "value": "Remove no-longer-necessary line of code\n" }, { "from": "human", "value": "'use strict'\n\nvar isPresent = require('is-present')\nvar hasClass = require('has-class-selector')\nvar SelectorTokenizer = require('css-selector-tokenizer')\n\nmodule.exports = function cla...
javascript
chosen
[ { "from": "system", "value": "Update onNext function in Observer\n" }, { "from": "human", "value": "const Rx = require('rx');\nconst hound = require('hound');\nconst jp = require('jupyter-paths');\n\nconst watcher = hound.watch(jp.paths.runtime[0]);\n\nfunction isKernelJSON(filepath) {\n var ...
javascript
chosen
[ { "from": "system", "value": "Fix amdDefine patch to check for backboneCandidate\n" }, { "from": "human", "value": "// @private\n// Calls the callback passing to it the Backbone object every time it's detected.\n// The function uses multiple methods of detection.\nvar patchDefine = function(call...
javascript
chosen
[ { "from": "system", "value": "Convert en_US to en-US for i18n.js\n" }, { "from": "human", "value": "'use strict';\n\nvar I18n = require('./vendor/i18n');\nvar { RNI18n } = require('react-native').NativeModules;\n\nI18n.locale = RNI18n.locale;\n\nmodule.exports = I18n;" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Add a warning when native code is not loaded.\n" }, { "from": "human", "value": "'use strict';\n\nimport {Platform, NativeModules} from \"react-native\";\nconst DocumentPicker = NativeModules.RNDocumentPicker;\n\n/**\n * Android requires mime types, iOS is a bit mor...
javascript
chosen
[ { "from": "system", "value": "Handle errors and fix code styling\n" }, { "from": "human", "value": "var player = require('chromecast-player')()\n\nplayer.attach(function (err, p) {\n if (err) console.error('An error ocurred while attaching the player: ' + err)\n var playButton = document.query...
javascript
chosen
[ { "from": "system", "value": "Fix pushing the original files back on the stream\n" }, { "from": "human", "value": "var through = require('through2');\nvar gutil = require('gulp-util');\nvar extend = require('extend');\nvar vinylFile = require('vinyl-file');\n\nvar StringDecoder = requir...
javascript
chosen
[ { "from": "system", "value": "Make brfs run after all other transforms" }, { "from": "human", "value": "var browserify = require('browserify')\n , shim = require('browserify-shim')\n , hbsfy = require('hbsfy')\n , envify = require('envify')\n , brfs = require('brfs')\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix \"No tests were run\"\n\nAfter including this packing in our ember app's package.json, was seeing:\r\n\r\n```\r\n1..0\r\n# tests 0\r\n# pass 0\r\n# fail 0\r\n\r\n# ok\r\nNo tests were run, please check whether any errors occurred in the page\r\n```\r\n\r\nConfig in `ember...
javascript
chosen
[ { "from": "system", "value": "Add raw option (even if ignored by esprima 1.1.x)\n" }, { "from": "human", "value": "/**\n * espower-source - Power Assert instrumentor from source to source.\n * \n * https://github.com/twada/espower-source\n *\n * Copyright (c) 2014 Takuto Wada\n * Licensed under ...
javascript
chosen
[ { "from": "system", "value": "Fix proptype for linepath 'defined' prop\n" }, { "from": "human", "value": "import React from 'react';\r\nimport cx from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport { line } from 'd3-shape';\r\n\r\nLinePath.propTypes = {\r\n innerRef: PropTypes.f...
javascript
chosen
[ { "from": "system", "value": "Add user agent & referrer.\n" }, { "from": "human", "value": "var strftime = require('prettydate').strftime;\n\nmodule.exports = function generateCommonLog(request, response)\n{\n var protocol = 'HTTP/' + request.httpVersion;\n var tstamp = '[' + strftime(new...
javascript
chosen
[ { "from": "system", "value": "Add description to command line help\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict'\nconst commitStream = require('commit-stream')\nconst listStream = require('list-stream')\nconst program = require('commander')\nconst split2 = require('split2'...
javascript
chosen
[ { "from": "system", "value": "Fix IP address fetching bug\n" }, { "from": "human", "value": "const express = require('express');\n\nconst app = express();\n\napp.get('/', (req, res) => {\n const ip = req.ip;\n const acceptLanguage = req.get('Accept-Language');\n const userAgent = req.get('Use...
javascript
chosen
[ { "from": "system", "value": "Fix typo in Platform check\n" }, { "from": "human", "value": "'use strict';\n\nimport { NativeEventEmitter, NativeModules, Platform } from 'react-native';\nconst { RNPusherPushNotifications } = NativeModules\nconst rnPusherPushNotificationsEmitter = new NativeEventE...
javascript
chosen
[ { "from": "system", "value": "Access property `default` using bracket notation\n" }, { "from": "human", "value": "/**\n * power-assert.js - Power Assert in JavaScript.\n *\n * https://github.com/power-assert-js/power-assert\n *\n * Copyright (c) 2013-2016 Takuto Wada\n * Licensed under the MIT l...
javascript
chosen
[ { "from": "system", "value": "Remove pikaday.js from fastboot build\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-pikaday',\n\n options: {\n nodeAssets: {\n pikaday: {\n import: ['pikaday.js', 'css/pikaday.css']\n ...
javascript
chosen
[ { "from": "system", "value": "Fix runWithDB not exported correctly\n" }, { "from": "human", "value": "const ObservableQueryPaginator = require(\"./QueryPaginator\").ObservableQueryPaginator\nconst CreateMySQLConnectionFromConfigFile =\n require(\"./ConnectionUtils\").CreateMySQLConnectionFrom...
javascript
chosen
[ { "from": "system", "value": "Use pseudoRandomBytes, which maps to OpenSSL's RAND_pseudo_bytes which for uid generation is fine\n" }, { "from": "human", "value": "/**\n * Module dependencies\n */\n\nvar crypto = require('crypto');\n\n/**\n * 62 characters in the ascii range that can be used in U...
javascript
chosen
[ { "from": "system", "value": "Refactor to use the _read method\n" }, { "from": "human", "value": "\nvar util = require('util')\n , stream = require('stream')\nvar isstream = require('isstream')\n\nutil.inherits(BulkStream, stream.Readable)\nmodule.exports = BulkStream\n\n\nfunction BulkStream (...
javascript
chosen
[ { "from": "system", "value": "Use status model in Jenkins service\n\n" }, { "from": "human", "value": "const logger = require('winston');\nconst request = require('request-promise');\n\nclass Service {\n constructor (options) {\n this.options = options || {};\n }\n\n setup(app) {\n this...
javascript
chosen
[ { "from": "system", "value": "Fix onLoad loading bug if livereactload transformer is not set" }, { "from": "human", "value": "\n\nmodule.exports = {\n\n onLoad: function(callback) {\n if (typeof callback !== 'function') {\n throw new Error('\"onLoad\" must have a callback function');\n ...
javascript
chosen
[ { "from": "system", "value": "fix: Use watch instead of watchFile\n" }, { "from": "human", "value": "#!/usr/bin/env node\nconst express = require('express');\nconst fileExists = require('file-exists');\nconst bodyParser = require('body-parser');\nconst fs = require('fs');\nconst { port = 8123 } ...
javascript
chosen
[ { "from": "system", "value": "Extend block context in order to support additional compilation engines (e.g. Assemble).\n" }, { "from": "human", "value": "/*!\n * helper-markdown <https://github.com/jonschlinkert/helper-markdown>\n *\n * Copyright (c) 2014 Jon Schlinkert, contributors.\n * Licens...
javascript
chosen
[ { "from": "system", "value": "Add support for loud comments" }, { "from": "human", "value": "import postcss from 'postcss';\n\nconst postcssFlexibility = postcss.plugin('postcss-flexibility', () => css => {\n\tcss.walkRules(rule => {\n\t\tconst isDisabled = rule.some(({prop, text}) =>\n\t\t\tpro...
javascript
chosen
[ { "from": "system", "value": "Add props to dynamic components (PR Worthy)\n" }, { "from": "human", "value": "import React from 'react';\nimport loadable from 'react-loadable';\nimport { Components } from './components.js';\n\nexport const dynamicLoader = componentImport => loadable({\n loader: ...
javascript
chosen
[ { "from": "system", "value": "Fix task to output coverage for every files\n" }, { "from": "human", "value": "var es = require(\"event-stream\");\nvar path = require(\"path\");\n\"use strict\";\n\nvar istanbul = require(\"istanbul\");\nvar hook = istanbul.hook;\nvar Report = istanbul.Report;\nvar...
javascript
chosen
[ { "from": "system", "value": "Make rule active with error by default" }, { "from": "human", "value": "module.exports = {\n rules: {\n \"no-loops\": require('./lib/no-loops')\n }\n};\n" }, { "from": "gpt", "value": "module.exports = {\n rules: {\n \"no-loops\": require('./lib...
javascript
chosen
[ { "from": "system", "value": "Remove use of numpCpus lookup\n" }, { "from": "human", "value": "module.exports = createServerCluster\n\nvar http = require('http')\n , clusterMaster = require('clustered')\n , cpus = require('os').cpus()\n , extend = require('lodash.assign')\n\nfunction createSe...
javascript
chosen
[ { "from": "system", "value": "Add new element for enabling student bundle\n" }, { "from": "human", "value": "const config = require('./landing.config'),\n Login = require('./login/login.module');\n\nconst moduleName = 'landing-bundle',\n dependencies = [ Login ];\n\nangular.module(m...
javascript
chosen
[ { "from": "system", "value": "Add option for shell and stdio in execute command\n" }, { "from": "human", "value": "var execSync = require('child_process').execSync;\nvar path = require('path');\n\nvar SEPARATOR = process.platform === 'win32' ? ';' : ':';\nvar env = Object.assign({}, process.env)...
javascript
chosen
[ { "from": "system", "value": "Put comment on seperate line\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';<% if (testType === 'integration') { %>\nimport hbs from 'htmlbars-inline-precompile';<% } %>\n\nmoduleForComponent('<%= componentPathName %>', '<%...
javascript
chosen
[ { "from": "system", "value": "Add blink effect on page title when a new post is added\n" }, { "from": "human", "value": "jQuery(function($){//on document ready\n //autocomplete\n $('input.autocomplete').each(function(){\n var $input = $(this);\n $input.autocomplete($input.attr('data-auto...
javascript
chosen
[ { "from": "system", "value": "Simplify the pattern for matching timestamps\n\nThis new pattern makes less strict assumptions about the structure of the timestamp. But, it also shouldn't accidentally pick up pure numbers (e.g., [22]), nor will it pick up anything with alphanumeric characters.\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Use string action types for redux-logger.\n" }, { "from": "human", "value": "// Socket actions\nexport const SOCKET_SET_OPEN = Symbol(\"SOCKET_SET_OPEN\");\nexport const SOCKET_SET_OPENING = Symbol(\"SOCKET_SET_OPENING\");\nexport const SOCKET_SET_CLOSED ...
javascript
chosen
[ { "from": "system", "value": "Disable scrolling on number fields\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n moj.Modules.Shame = {\n init: function () {\n // Polyfill a given set of elements\n $('details').details();\n $('body').addClass($.fn.details...
javascript
chosen
[ { "from": "system", "value": "Add Content-Type to all requests\n" }, { "from": "human", "value": "// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from 'vue'\nimport App from './App'\nimport r...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary styles in app.js\n" }, { "from": "human", "value": "'use strict';\n\nimport React, {\n AppRegistry,\n Component,\n StyleSheet,\n} from 'react-native';\n\nimport WeatherView from './WeatherView';\n\nclass ReactNativeWeather extends Component {\n...
javascript
chosen
[ { "from": "system", "value": "Enable table controls for WYSIWYG editor\n" }, { "from": "human", "value": "tinyMCE.init({\n\t theme:\"advanced\",\n\t mode:\"none\",\n\t plugins: \"contextmenu,paste,spellchecker,style\",\n\t theme_advanced_styles : \"Heading 1=mce_header1;H...
javascript
chosen
[ { "from": "system", "value": "Fix lodash function import after lodash upgrade\n" }, { "from": "human", "value": "import Mustache from 'mustache'\nlet capitalize = require('lodash/string/capitalize')\n\nlet template = `Dear {{name}},\n\nYour request to download course materials for course {{{cour...
javascript
chosen
[ { "from": "system", "value": "Change type of returning value\n" }, { "from": "human", "value": "'use strict';\n\nconst EventEmitter = require('events');\n\n/**\n * Tracker Manager\n * @interface\n */\nclass ITrackerManager extends EventEmitter {\n\tconstructor() {\n\t\tsuper();\n\n\t\tif (this.c...
javascript
chosen
[ { "from": "system", "value": "Use switch in translate function instead\n" }, { "from": "human", "value": "/* jshint esversion: 6 */\nwindow.onload = () => {\n /* TODO: put in some if (localizationEnabled) block in case people who use non-english browser still wants english extension? */\n tran...
javascript
chosen
[ { "from": "system", "value": "Fix failing build because there was an extra space in JavaScript. Yep, that's right, a build failed because of a space in JavaScript.\n" }, { "from": "human", "value": "// ------------------------------------------------------------------------------\n//\n// ImageP...
javascript
chosen
[ { "from": "system", "value": "Use real facebook id instead of dummy\n" }, { "from": "human", "value": "const getBasicInfo = require('../db/controllers/getUserBasicInfoGivenFBId.js');\nconst getLanguageInfo = require('../db/controllers/getUserLanguageInfoGivenUserId.js');\nconst helpers = require...
javascript
chosen
[ { "from": "system", "value": "Update grunt watch to include sass\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n coffee: {\n compile: {\n options: {\n bare: false,\n join: true\n },\n files: {\n ...
javascript
chosen