conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change testAutoDetection to handle multiple files\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar hljs = require('../build');\nvar utility = require('./utility');\n\nfunction testAutoDetection(language) {\n it('should be det...
javascript
chosen
[ { "from": "system", "value": "js: Fix version check for win-x64\n" }, { "from": "human", "value": ";\n(function (d, n) {\n 'use strict';\n var os = n.platform.match(/(Win|Mac|Linux)/);\n var x = n.userAgent.match(/x86_64|Win64|WOW64/) ||\n n.cpuClass === 'x64' ? 'x64' : 'x86';\n var db = ...
javascript
chosen
[ { "from": "system", "value": "Use gulp dev helper for our own dev task\n" }, { "from": "human", "value": "/*\n gulpfile.js\n ===========\n Each task has been broken out into its own file in build/tasks. Any file in that folder gets\n automatically required by the loop in ./gulp/index.js (req...
javascript
chosen
[ { "from": "system", "value": "Include JS source in distribution build for direct consumption.\n" }, { "from": "human", "value": "module.exports = {\n main: {\n files: [\n { expand: true, src: [\"assets/images/**\"], dest: \"dist/\" },\n { expand: true, src: [\"assets/kss/**\"], des...
javascript
chosen
[ { "from": "system", "value": "Fix directory structure in zip archive\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar $ = require('gulp-load-plugins')();\nvar runSequence = require('run-sequence');\nvar del = require('del');\n\ngulp.task('zip', function () {\n...
javascript
chosen
[ { "from": "system", "value": "Revert \"Fix 'start chat' button\"\n\nThis reverts commit c841eb641b85995bddb235d3db2c779daffe97a1.\n" }, { "from": "human", "value": "/*\nCopyright 2017 Vector Creations Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this ...
javascript
chosen
[ { "from": "system", "value": "Fix paths not working on node 0.6 (hack alert)\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n\"use strict\";\n\nvar path = require('path');\n\n// this must be set before \"server.js\" is loaded\nprocess.env.HARAKA = process.env.HARAKA || path.resolve('.'...
javascript
chosen
[ { "from": "system", "value": "Use the unexpected-dev project on browserstack for Travis \"PR\" builds\n\nhttps://github.com/travis-ci/travis-ci/issues/6652\n" }, { "from": "human", "value": "module.exports = function(config) {\n config.set({\n frameworks: ['mocha'],\n\n exclude: ['build/t...
javascript
chosen
[ { "from": "system", "value": "Destroy language registry and workspace on package deactivation\n" }, { "from": "human", "value": "'use babel';\n\nimport levelsConfig from './levels-config';\nimport levelsServices from './levels-services';\nimport workspaceManager from './workspace-manager';...
javascript
chosen
[ { "from": "system", "value": "Update the target url to npm/npm from npm/support-cli\n" }, { "from": "human", "value": "var opener = require('opener')\nvar template = require('lodash.template')\nvar fs = require('fs')\nvar path = require('path')\nvar md = fs.readFileSync(path.join(__dirname, 'tem...
javascript
chosen
[ { "from": "system", "value": "pluginSetting: Fix calling of change function\n\nA function itself is passed to this - not a pointer to a public plugin\nfunction.\n\nFixes e.g. the bug that the `Preselect` setting in `morph` didn't\ntrigger when you clicked on it.\n" }, { "from": "human", "value":...
javascript
chosen
[ { "from": "system", "value": "Change channel update retry timeout\n" }, { "from": "human", "value": "'use strict'\n\nconst TelegramBot = require('node-telegram-bot-api');\n\nconst config = require('../config');\nconst utils = require('./utils');\nconst Kinospartak = require('./Kinospartak/Kinosp...
javascript
chosen
[ { "from": "system", "value": "Use pluralizationed format function to support also moment.duration objects\n" }, { "from": "human", "value": "module.exports = client => async (key, get, { expire, invalidate } = {}) => {\n let value;\n if (client.getJSON) {\n value = await client.getJSON(key)...
javascript
chosen
[ { "from": "human", "value": "Add code being used from AWS Lambda.\n" }, { "from": "gpt", "value": "'use strict';\nlet http = require('http');\n \nexports.handler = function(event, context, callback) {\n var path = \"\", method = \"POST\";\n\n switch(event.result.metadata.intentName) {\n cas...
javascript
chosen
[ { "from": "system", "value": "Fix bad argument to CarouselCard construction\n" }, { "from": "human", "value": "import { CarouselCard, Carousel } from './carousel';\n\nexport default function init() {\n const projectsContainer = document.getElementsByClassName('projects-container')[0];\n const ...
javascript
chosen
[ { "from": "system", "value": "Replace '本日' with date string\n" }, { "from": "human", "value": "module.exports = (function() {\n return function($record) {\n this.name = $record.find('.item-list__name').html();\n var _info = $record.children('div');\n this.salePrice = _info.eq(1).text()...
javascript
chosen
[ { "from": "system", "value": "Prepare branch for section 2.2 tutorial\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar JsonDB = require('node-json-db');\nvar _ = require('lodash');\n\n// Recipes listing\nrouter.get('/', function (req, res,...
javascript
chosen
[ { "from": "system", "value": "Convert file paths to urls\n" }, { "from": "human", "value": "var Schema = require('./../Schema');\n\nfunction BuildController(mongoose){\n\n var convert = function(build){\n return build\n };\n\n this.get = function (req, res) {\n var Build =...
javascript
chosen
[ { "from": "system", "value": "Revert to name 'website' on error\n" }, { "from": "human", "value": "import { Component } from 'react';\nimport h from 'react-hyperscript';\n\nimport Quote from './components/Quote';\nimport getRandomQuote from './utils/getRandomQuote';\n\nclass App extends Componen...
javascript
chosen
[ { "from": "system", "value": "Check bootdir async and fix static path\n" }, { "from": "human", "value": "\nvar Router = require('routes');\nvar router = new Router();\nvar st = require('st');\nvar fs = require('fs');\n\nvar mount = st({\n path: __dirname + '/static/', // resolved against the pr...
javascript
chosen
[ { "from": "system", "value": "Use AdaptiveStore for cookie fallback if local storage is unavailable\n\ncloses #5829\n- switch application session store to inherit from ESA's `AdaptiveStore` instead of `LocalStorageStore`\n" }, { "from": "human", "value": "import LocalStorageStore from 'ember-sim...
javascript
chosen
[ { "from": "system", "value": "Remove instanceof check for button list\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Selfish Youtube\n// @version 2013-05-06\n// @namespace https://github.com/ASzc/selfish-youtube\n// @description On the...
javascript
chosen
[ { "from": "system", "value": "Make instance() not create new singletons\n" }, { "from": "human", "value": "\"use strict\";\nvar EventEmitter = require(\"events\");\nvar util = require(\"util\");\nvar instance = null;\n\nfunction MockAppService() {\n EventEmitter.call(this);\n}\nutil.inherits(...
javascript
chosen
[ { "from": "system", "value": "Handle the three get cases\n" }, { "from": "human", "value": "\nconst getStorage = () => {\n const data = window.localStorage.getItem('__chrome.storage.sync__')\n if (data != null) {\n return JSON.parse(data)\n } else {\n return {}\n }\n}\n\nconst setStor...
javascript
chosen
[ { "from": "system", "value": "Remove controller from the global namespace.\n" }, { "from": "human", "value": "/* global BackboneWizard, Marionette, Backbone, $ */\n\nwindow.BackboneWizard = {};\n\nvar app = new Marionette.Application();\n\napp.addRegions({\n wizard: '#wizard'\n});\n\napp.addI...
javascript
chosen
[ { "from": "system", "value": "Comment out unused exporter injection. Target has moved anyway\n\ngit-svn-id: 434d687192588585fc4b74a81d202f670dfb77fb@1550 7d457c2a-affb-35e4-300a-418c747d4874\n" }, { "from": "human", "value": "// Client side resources to be injected for gData extension\n\n// Add...
javascript
chosen
[ { "from": "system", "value": "Use combine reducers in test store\n" }, { "from": "human", "value": "import { applyMiddleware, createStore } from 'redux'\nimport reducer from '../../src/reducer'\n\nexport default ({ middleware, initialState = {} }) =>\n createStore(reducer, initialState, applyMi...
javascript
chosen
[ { "from": "system", "value": "Make markdown filter not to throw error for null or undefined\n" }, { "from": "human", "value": "var marked = require('marked');\nvar nunjucks = require('nunjucks');\nvar path = require('path');\n\nmodule.exports = function(options) {\n\n options || (options ...
javascript
chosen
[ { "from": "system", "value": "Fix examples using module templates\n" }, { "from": "human", "value": "/**\n * The default template based URL, used as it by the template cache.\n * @type {string}\n */\nngeo.baseTemplateUrl = '../src/directives/partials';\n" }, { "from": "gpt", "value":...
javascript
chosen
[ { "from": "system", "value": "Add some documentation to the abstract `S2.UI.Base` class." }, { "from": "human", "value": "(function(UI) {\n \n /** section: scripty2 ui\n * class S2.UI.Base\n * includes S2.UI.Mixin.Configurable\n **/\n UI.Base = Class.create(UI.Mixin.Configurable, {\n ...
javascript
chosen
[ { "from": "system", "value": "Move WP.com support to /includes/plugins/jetpack-pro/*.\n" }, { "from": "human", "value": "module.exports = {\n\tpackage: {\n\t\tsrc: [ '<%= paths.tmp %>' ]\n\t},\n\twpcom: {\n\t\tsrc: [\n\t\t\t'<%= paths.wpcom %>/*',\n\t\t\t'!<%= paths.wpcom %>/.svn',\n\t\t\t'!<%= ...
javascript
chosen
[ { "from": "system", "value": "Add route for adding new cabin\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('cabins', {...
javascript
chosen
[ { "from": "system", "value": "Include eresult property in WebAPI errors\n" }, { "from": "human", "value": "var TradeOfferManager = require('./index.js');\n\nvar EResult = require('../resources/EResult.js');\n\nTradeOfferManager.prototype._apiCall = function(httpMethod, method, version, input, ca...
javascript
chosen
[ { "from": "system", "value": "Set default filter to duration 5s\n" }, { "from": "human", "value": "export const DEFAULT_QUERY = 'instrument note';\nexport const DEFAULT_MAX_RESULTS = 60;\nexport const DEFAULT_DESCRIPTOR = 'lowlevel.mfcc.mean';\nexport const DEFAULT_FILTER = 'duration:[0%20TO%202...
javascript
chosen
[ { "from": "system", "value": "Add echoPermission option in PopoverModel\n" }, { "from": "human", "value": "\n// ----------------------------------------------------------------\n// Popover Class\n\nclass PopoverModel extends CommonModel {\n constructor({\n name = 'Popover',\n selector = n...
javascript
chosen
[ { "from": "system", "value": "Update component to pass tests.\n" }, { "from": "human", "value": "var React = require('react'),\n\tDOM = React.DOM;\n\nmodule.exports = React.createClass({\n\n\tpropTypes: {\n\t\tversion: React.PropTypes.string,\n\t\tyear: React.PropTypes.number,\n\t\tauthor: React...
javascript
chosen
[ { "from": "system", "value": "Fix missing globals in PureSpec modules\n" }, { "from": "human", "value": "const _ = require('lodash/fp')\nconst fs = require('fs')\nconst dsl = require('./dsl')\nconst vm = require('vm')\n\nmodule.exports = function (file) {\n return vm.runInNewContext(fs.readFile...
javascript
chosen
[ { "from": "system", "value": "Add automatic pjs module search\n" }, { "from": "human", "value": "const pp = require('./ppublish');\nconst pt = require('./ptalk');\nconst utils = require('../common/utils');\nconst fs = require('fs');\nconst commander = require('commander'...
javascript
chosen
[ { "from": "system", "value": "Replace all broken image links in js\n" }, { "from": "human", "value": "$(document).ready(function() {\n // Set title preview\n $(\"#title\").on('keyup', function(e) {\n $(\"#title-preview\").text($(\"#title\").val());\n $(\"#title-preview\").attr(\"href\", ...
javascript
chosen
[ { "from": "system", "value": "Disable timeout for TypeScript definitions tests\n" }, { "from": "human", "value": "import * as tt from 'typescript-definition-tester'\n\n\ndescribe('TypeScript definitions', () => {\n it('should compile against index.d.ts', (done) => {\n tt.compileDirectory(\n ...
javascript
chosen
[ { "from": "system", "value": "Handle error in case img service is down.\n" }, { "from": "human", "value": "var middleware = require('../middleware');\nvar Router = require('express').Router();\nvar request = require('superagent');\n\nconst IMG_URL = process.env.IMG_URL || 'http://local...
javascript
chosen
[ { "from": "system", "value": "Fix regex for stripping post frontmatter\n" }, { "from": "human", "value": "var fs = require('fs');\n\nmodule.exports = function postContent(post) {\n var fd = fs.openSync(post, 'rs');\n var contents = fs.readFileSync(post, {encoding: 'utf8'});\n contents =...
javascript
chosen
[ { "from": "system", "value": "Fix tokenizing of comment after closing brace of last message\n" }, { "from": "human", "value": "module.exports = function (sch) {\n var noComments = function (line) {\n var i = line.indexOf('//')\n return i > -1 ? line.slice(0, i) : line\n }\n\n var noMult...
javascript
chosen
[ { "from": "system", "value": "Fix back link on filter-common\n" }, { "from": "human", "value": "module.exports = {\n '/':{\n controller: require('../../../controllers/application-country'),\n fields: ['apply-uk', 'application-country'],\n controller: require('../../../controlle...
javascript
chosen
[ { "from": "system", "value": "Fix upgrade script: Check for empty items\n" }, { "from": "human", "value": "/** @namespace H5PUpgrades */\nvar H5PUpgrades = H5PUpgrades || {};\n\nH5PUpgrades['H5P.Agamotto'] = (function ($) {\n return {\n 1: {\n 3: function (parameters, finished) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add clicker to fpl script" }, { "from": "human", "value": "// ==UserScript==\n// @name FPL Iwon scroller\n// @namespace mikemanger\n// @grant none\n// @include https://fplcomps.iwn.io/*/*\n// @updateURL https://raw.githubusercontent.com/mikemang...
javascript
chosen
[ { "from": "system", "value": "Test delegation of options parsing\n" }, { "from": "human", "value": "import test from 'tape'\nimport chunkify from './index'\n\n\ntest('should require an array', t => {\n t.throws(() => {\n chunkify.array()\n }, /Usage: chunkify.array\\(Array array, Function f...
javascript
chosen
[ { "from": "system", "value": "Use relative path for template\n" }, { "from": "human", "value": "import BaseController from 'portia-web/controllers/base-controller';\n\nexport default BaseController.extend({\n breadCrumb: null,\n _breadCrumb: null,\n});\n" }, { "from": "gpt", "v...
javascript
chosen
[ { "from": "system", "value": "Add basic e2e for search field.\n" }, { "from": "human", "value": "describe('idai field app', function() {\n\n function createObject() {\n\n return clickCreateObject()\n .then(selectTypeObject)\n .then(typeInIdentifier)\n ...
javascript
chosen
[ { "from": "system", "value": "Change default language to English\n" }, { "from": "human", "value": "/**\n * Created by Peter on 2016/10/23.\n */\n// CBoard settings\nvar settings = {\n preferredLanguage: \"cn\" // en/cn: Switch language to Chinese\n}\n\n" }, { "from": "gpt", "valu...
javascript
chosen
[ { "from": "system", "value": "Add test for gfx reset on stop\n" }, { "from": "human", "value": "var test = require('tap').test;\nvar RenderedTarget = require('../../src/sprites/rendered-target');\nvar Sprite = require('../../src/sprites/sprite');\n\ntest('clone effects', function (t) {\n // C...
javascript
chosen
[ { "from": "system", "value": "Fix FBTest, the inline editor can be opened async on Mac\n" }, { "from": "human", "value": "function runTest()\n{\n FBTest.sysout(\"issue5504.START\");\n\n FBTest.openNewTab(basePath + \"html/5504/issue5504.html\", function(win)\n {\n FBTest.openFire...
javascript
chosen
[ { "from": "system", "value": "Correct a typo in the new changelog entry" }, { "from": "human", "value": "import { Kettlepaw, Zeboot } from 'CONTRIBUTORS';\nimport { change, date } from 'common/changelog';\n\nexport default [\n change(date(2020, 12, 18), 'Fixed compiler errors affecing FrenziedR...
javascript
chosen
[ { "from": "system", "value": "Read client keys from environment variable rather than hardcoding in source\n" }, { "from": "human", "value": "const RateLimiter = require(\"rolling-rate-limiter\");\nconst prettyMs = require('pretty-ms');\nconst config = require('../config');\n\nconst validKeys = [...
javascript
chosen
[ { "from": "system", "value": "Add unit tests on .add() and .remove()" }, { "from": "human", "value": "var assert = require('assert'),\n manyToManyFixture = require('../../support/fixtures/model/context.manyToMany.fixture'),\n Model = require('../../../lib/waterline/model');\n\ndescribe('in...
javascript
chosen
[ { "from": "system", "value": "Correct local references when loading uncompiled source\n" }, { "from": "human", "value": "/**\n * @fileoverview Bootstrapper for local development.\n *\n * This script can be used during development instead of the compiled firebase-simple-login.js.\n * It pulls in ...
javascript
chosen
[ { "from": "system", "value": "Add decompress to audit exceptions\n" }, { "from": "human", "value": "const exec = require('child_process').exec;\n\nconst AUDIT_EXCEPTIONS = ['handlebars'];\n\nconst execute = (command, callback) => {\n exec(\n command, {\n maxBuffer: 2000 * 1024\n },\n...
javascript
chosen
[ { "from": "system", "value": "Set default log level to 'info' in winston\n" }, { "from": "human", "value": "const winston = require('winston');\n\nmodule.exports = ({\n level,\n transports: transports = [\n {\n type: 'Console',\n options: {\n timestamp: true,\n color...
javascript
chosen
[ { "from": "system", "value": "Fix content height not being set on Safari\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = [\n '$rootScope', '$window', '$timeout',\n function FixContainerHeight($rootScope, $window, $timeout) {\n return {\n restrict: 'A',\n link:...
javascript
chosen
[ { "from": "system", "value": "Fix error in node v0.10 missing Promises.\n" }, { "from": "human", "value": "'use strict';\n\nvar extractCss = require('extract-css'),\n inlineCss = require('./inline-css');\n\nmodule.exports = function inlineContent(src, options) {\n return new Promise(functi...
javascript
chosen
[ { "from": "system", "value": "Add hot module loading plugin for webpack\n" }, { "from": "human", "value": "module.exports = {\n entry: './client/src/index.jsx',\n output: {\n path: './client/dist',\n filename: 'index.bundle.js',\n },\n module: {\n loaders: [{\n test: /\\.jsx?$/...
javascript
chosen
[ { "from": "system", "value": "Fix import file not exists in project.\n" }, { "from": "human", "value": "module.exports = {\n extends: [\n 'airbnb-base',\n './common.js'\n ],\n\n parser: 'babel-eslint',\n\n plugins: [\n 'babel',\n 'import',\n ],\n\n rules: {\n 'func-names': 0...
javascript
chosen
[ { "from": "system", "value": "Add envs to eslint. Fix indentation\n" }, { "from": "human", "value": "module.exports = {\n \"extends\": \"airbnb\",\n \"plugins\": [\n \"react\"\n ]\n};" }, { "from": "gpt", "value": "module.exports = {\n \"extends\": \"airbnb\",\n \"p...
javascript
chosen
[ { "from": "system", "value": "Use nock for request mocking\n" }, { "from": "human", "value": "describe('Redirecter::Http', function() {\n var RedirecterHttp = require('../../../lib/redirecter/http'),\n DummyServer = require('../../support/dummy_server'),\n EasyClient = require('../../...
javascript
chosen
[ { "from": "system", "value": "Remove obsolete entry from eslint config.\n" }, { "from": "human", "value": "module.exports = {\n extends: [\n \"plugin:react/recommended\", // Uses the recommended rules from @eslint-plugin-react\n \"plugin:@typescript-eslint/recommended\", // Uses...
javascript
chosen
[ { "from": "system", "value": "Add mocha env to the eslint config\n" }, { "from": "human", "value": "const config = {\n extends: ['standard', 'prettier', 'prettier/standard'],\n plugins: ['import', 'mocha'],\n rules: {\n 'import/no-extraneous-dependencies': [\n 'error',\n {\n ...
javascript
chosen
[ { "from": "system", "value": "Add setter with lazy multi-dimensional array indexing.\n" }, { "from": "human", "value": "/*exported _*/\n'use strict';\n\nvar _ = {};\n\n_.find = function( array, callback ) {\n var element;\n for ( var i = 0, il = array.length; i < il; i++ ) {\n element = arr...
javascript
chosen
[ { "from": "system", "value": "Revert \"Schema.define could return associated instance\"\n" }, { "from": "human", "value": "export default class EntitySchema {\n constructor(key, options = {}) {\n if (!key || typeof key !== 'string') {\n throw new Error('A string non-empty key is require...
javascript
chosen
[ { "from": "system", "value": "Move to coordinate when clicked\n" }, { "from": "human", "value": "Mapeditor.Minimap = {};\n\nMapeditor.Minimap.loaded = false;\n\nMapeditor.Minimap.loadStatic = function(){\n jQuery('#minimap .content')\n .html('<img />');\n jQuery('#minimap img')\n .attr('...
javascript
chosen
[ { "from": "system", "value": "Fix broken app for clients with react dev tools extension\n" }, { "from": "human", "value": "'use strict';\nwindow.__REACT_DEVTOOLS_GLOBAL_HOOK__ = {};\n\nconst App = require('./components/app.js');\nconst React = require('react');\nconst ReactDom = require('react-d...
javascript
chosen
[ { "from": "system", "value": "Update tooltip on page change\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, ...
javascript
chosen
[ { "from": "system", "value": "Use function component for youtube player container\n" }, { "from": "human", "value": "/*\n *\n * YoutubePlayer\n *\n */\n\nimport React, { Component, PropTypes } from 'react';\nimport { connect } from 'react-redux';\n\nimport YouTube from 'react-youtube';\n\nimport...
javascript
chosen
[ { "from": "system", "value": "Disable width/height resize on image browse selection and use inlnie url for responsive images.\n\nAdd Download URL to images automatically\n" }, { "from": "human", "value": "(function() {\n CKEDITOR.plugins.add('concrete5filemanager', {\n init: function (...
javascript
chosen
[ { "from": "system", "value": "Send plugin_activated event on activation.\n" }, { "from": "human", "value": "/**\n * Activation component.\n *\n * This JavaScript loads on every admin page. Reserved for later.\n *\n * Site Kit by Google, Copyright 2020 Google LLC\n *\n * Licensed under the Apache...
javascript
chosen
[ { "from": "system", "value": "Change port number for production.\n" }, { "from": "human", "value": "module.exports = {\n service: {\n name: 'melodies',\n synopsis: 'thoughts from soundtrack.io',\n icon: 'music'\n },\n database: {\n name: 'blog:soundtrack'\n }\n};\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Stop looping when currentTarget becomes undefined\n" }, { "from": "human", "value": "const EventKit = require('event-kit')\n\nmodule.exports =\nfunction listen (element, eventName, selector, handler) {\n var innerHandler = function (event) {\n if (selector) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use ES2015 feature Set() to store unique robot names\n" }, { "from": "human", "value": "import Robot from './robot-name';\n\ndescribe('Robot', () => {\n let robot;\n\n beforeEach(() => {\n robot = new Robot();\n });\n\n it('has a name', () => {\n expect(ro...
javascript
chosen
[ { "from": "system", "value": "Comment on pem file use\n" }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\nconst env = require('env2');\nenv('./config.env');\n\nconst YotiClient = require('yoti-node-sdk');\nconst CLIENT_SDK_ID = process.env.SDK;\nconst PEM...
javascript
chosen
[ { "from": "system", "value": "Change \"Main Menu\" button to an \"Agree\" button\n" }, { "from": "human", "value": "function initScenes(Q) {\n Q.scene(\"mainMenu\", function(stage) {\n stage.insert(new Q.UI.Button(\n {\n asset: \"play_button.png\",\n x: Q.width / 2 - 55,\n ...
javascript
chosen
[ { "from": "system", "value": "Fix reference version number in demo\n" }, { "from": "human", "value": "require.config({\n urlArgs: \"bust=v\"+(new Date().getTime()), // Comment out/remove to enable caching\n baseUrl: \"js/\",\n paths: {\n colt: 'libs/colt.0.2.7'\n }\n});\n\nde...
javascript
chosen
[ { "from": "system", "value": "Add test for clicking equation\n" }, { "from": "human", "value": "describe('math editor', () => {\n before(waitUntil(() => $('.toolbar').length > 0 && $('.toolbar').is(':hidden')))\n\n describe('initial state', () => {\n it('answer field is contentedit...
javascript
chosen
[ { "from": "system", "value": "Set renderThrottle in synch example to 100 ms\n\nJust to demonstrate that this now works.\n" }, { "from": "human", "value": "/**\n * A simple progressbar with synchronous calls to tick()\n * (i.e. no setTimeout/setInterval)\n */\n\nvar ProgressBar = require('../');\...
javascript
chosen
[ { "from": "system", "value": "fix(util-load): Add module path based on module name if path does not exist.\n" }, { "from": "human", "value": "\nfunction loadModule (newModule) {\n let name = newModule.name ? newModule.name : 'app'\n let module = {\n name,\n controllers: [],\n views: [...
javascript
chosen
[ { "from": "system", "value": "Add Title to Navbar for search screen\n" }, { "from": "human", "value": "import {\n StackNavigator,\n} from 'react-navigation';\nimport SearchScreen from './scenes/SearchScreen';\n\n\nconst GitHubProjects = StackNavigator({\n Search: { screen: SearchScreen },\n});...
javascript
chosen
[ { "from": "system", "value": "Upgrade redux-logger 2.6.1 -> 3.0.6\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { StyleSheet } from 'react-native';\nimport { Provider } from 'react-redux';\nimport { applyMiddleware, createStore } from 'redux';\nimport creat...
javascript
chosen
[ { "from": "system", "value": "Add caching to static files if not in dev mode\n" }, { "from": "human", "value": "const express = require('express');\nconst clientApp = require('../clientapp');\nconst config = require('./lib/config');\nconst nunjucks = require('nunjucks');\nconst path = require('p...
javascript
chosen
[ { "from": "system", "value": "Use textContent as innerText causes issues on IE\n" }, { "from": "human", "value": "window.addEventListener('polymer-ready', function() {\n document.body.classList.remove('loading');\n\n var noflo = require('noflo');\n var graphs = {};\n\n var registerAndStart =...
javascript
chosen
[ { "from": "system", "value": "Add scroll to top on router update\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { Router } from 'react-router-dom'\n\nconst LOCATION_CHANGE = '@@router/LOCATION_CHANGE'\n\nclass ConnectedRouter extends Component {\n constructo...
javascript
chosen
[ { "from": "system", "value": "Make `async-to-gen` work on Now\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// Packages\nconst asyncToGen = require('async-to-gen/register')\nconst updateNotifier = require('update-notifier')\nconst {red} = require('chalk')\nconst nodeVersion = require...
javascript
chosen
[ { "from": "system", "value": "test: Add integration tests of rewiring\n" }, { "from": "human", "value": "import assert from 'power-assert';\nimport rewire from '../../lib/babel-rewire-wrapper';\nimport greeter from './module/greeter';\n\n/**\n * Do actual rewiring to test modules.\n */\ndescribe...
javascript
chosen
[ { "from": "system", "value": "Fix call to incorrect function name\n" }, { "from": "human", "value": "/*\n * Game core for Robots Order BreakOut Trepidation!\n *\n * @canvas = reference to an HTML5 canvas element.\n */\n\n'use strict';\nimport Actors from 'Actors.js';\nimport Collision from 'Coll...
javascript
chosen
[ { "from": "system", "value": "Replace Array.includes with utility function for IE11 compat 🐲" }, { "from": "human", "value": "import { entries } from '../utils/object-utils';\n\nexport const VALID_ATTRIBUTES = [\n 'data-md-text-align'\n];\n\n/*\n * A \"mixin\" to add section attribute support\...
javascript
chosen
[ { "from": "system", "value": "[refactor] Use `utile.requireDirLazy` for loading plugins\n" }, { "from": "human", "value": "/*\n * broadway.js: Top-level include for the broadway module. \n *\n * (C) 2011, Nodejitsu Inc.\n * MIT LICENSE\n *\n */\n\nvar fs = require('fs');\n\nvar broadway = export...
javascript
chosen
[ { "from": "system", "value": "Remove QUnit UI's checkboxes from the DOM during tests to prevent false positives\n\nRefs #373\n" }, { "from": "human", "value": "/* global QUnit, expect, bootlint */\n/* jshint browser: true */\n/*eslint-env browser */\n\n(function () {\n 'use strict';\n\n fu...
javascript
chosen
[ { "from": "system", "value": "Sort movies list by released year\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { browserHistory } from 'react-router';\nimport { ListGroup, ListGroupItem, Alert } from 'react-bootstrap';\nimport { Meteor ...
javascript
chosen
[ { "from": "system", "value": "Change host to respond to `--version` request (for CheckHealth)\n" }, { "from": "human", "value": "#!/usr/bin/env node\nconst Host = require('../src/host');\nconst logger = require('../src/logger');\n\n// node <current script> <rest of args>\nconst [, , ...args] = p...
javascript
chosen
[ { "from": "system", "value": "Use fat arrows instead of that=this. Some foratting fixes\n" }, { "from": "human", "value": "\"use strict\";\n\nconst medium = require('medium-sdk');\n\nclass CamayakMedium {\n constructor(api_key) {\n this.api_key = api_key;\n // Since we use a...
javascript
chosen
[ { "from": "system", "value": "Add process to exit function\n" }, { "from": "human", "value": "'use strict';\n\nconst exec = require('child_process').exec;\nconst path = require('path');\nconst javahome = require('find-java-home');\nconst os = require('os');\n\nconst command = (command) => {\n l...
javascript
chosen
[ { "from": "system", "value": "Add additional logging to init game\n" }, { "from": "human", "value": "/* global angular */\nimport {web3, Chess} from '../../contract/Chess.sol';\nangular.module('dappChess').controller('InitializeGameCtrl',\n function ($rootScope, $scope, accounts) {\n $scope....
javascript
chosen
[ { "from": "system", "value": "Remove opacity from “What is this?” link 💋" }, { "from": "human", "value": "import React from 'react'\nimport Bubbles from './Bubbles'\n\nexport default class Welcome extends React.Component {\n render() {\n const { opacity } = this.props\n\n const container...
javascript
chosen