conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Exclude aws-sdk to make deployment package smaller.\n" }, { "from": "human", "value": "const path = require('path');\n// eslint-disable-next-line import/no-unresolved\nconst slsw = require('serverless-webpack');\n\nmodule.exports = {\n entry: slsw.lib.entries,\n t...
javascript
chosen
[ { "from": "system", "value": "Remove inexistent option on css-loader\n" }, { "from": "human", "value": "const path = require('path');\n\nmodule.exports = {\n context: path.resolve('src'),\n entry: {\n app: './index.jsx'\n },\n mode: 'production',\n output: {\n path: path.resolve('dist...
javascript
chosen
[ { "from": "system", "value": "Fix platform typo from phonegap to html5\n" }, { "from": "human", "value": "import packageJSON from '../package.json';\n\nexport class Html5Device {\n static toJSON() {\n const userAgent = global.navigator.userAgent.toLowerCase();\n const rChrome = /(chrome)\...
javascript
chosen
[ { "from": "system", "value": "Use a custom printer to fix printing issues.\n" }, { "from": "human", "value": "function skewer() {\n $.get(\"/skewer/get\", function (str) {\n var request = JSON.parse(str);\n var result = {\"id\": request.id, \"callback\": request.callback};\n ...
javascript
chosen
[ { "from": "system", "value": "Change some function type to static in BCBProcess\n\nIt is...\n static initProcess()\n static initPopover()\n static initEvent()\n" }, { "from": "human", "value": "\nclass BCBProcess extends CommonProcess {\n constructor() {\n super({\n name: `${Project....
javascript
chosen
[ { "from": "system", "value": "Add missing api key in product picker.\n\nFixes #6185\n" }, { "from": "human", "value": "$.fn.productAutocomplete = function (options) {\n 'use strict';\n\n // Default options\n options = options || {};\n var multiple = typeof(options.multiple) !== 'undefined' ?...
javascript
chosen
[ { "from": "system", "value": "Add babel polyfills as a direct dependency\n" }, { "from": "human", "value": "/**\n * Main application file of Fittable\n * - Requires React.js to be loaded before loading this\n *\n * @author Marián Hlaváč\n */\n\nimport React from 'react';\nimport Fittable from ...
javascript
chosen
[ { "from": "system", "value": "Fix issue with gulp sequence\n\nSigned-off-by: Matt Stratton <39982728c5a806c113d54b69a3f65ecf65602e8a@gmail.com>\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n htmlmin = require('gulp-htmlmin'),\n imgRetina = require('gulp-img-retina');\n ...
javascript
chosen
[ { "from": "system", "value": "Make all spacings consistent to all other files" }, { "from": "human", "value": "const config = require('../config.js')\nconst routes = require('express').Router()\nconst uploadController = require('../controllers/uploadController')\nconst galleryController = requir...
javascript
chosen
[ { "from": "system", "value": "Use better convention for the version file.\n" }, { "from": "human", "value": "var assign = require('object-assign');\nvar cwd = process.cwd();\nvar fs = require('fs');\nvar gat = require('gulp-auto-task');\nvar path = require('path');\nvar pkg = require(path.join(c...
javascript
chosen
[ { "from": "system", "value": "Update normalize.css path to bower directory\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar less = require('gulp-less');\nvar prefix = require('gulp-autoprefixer');\nvar concat = require('gulp-concat');\nvar browserSync = require('browser-sync')...
javascript
chosen
[ { "from": "system", "value": "Make dummy device pass timestamp, so it actually generates audio\n" }, { "from": "human", "value": "/**\n * @depends AbstractAudioletDevice.js\n */\n\nvar DummyDevice = new Class({\n Extends: AbstractAudioletDevice,\n initialize: function(audiolet) {\n ...
javascript
chosen
[ { "from": "system", "value": "Make sticky header react to resize events.\n" }, { "from": "human", "value": "(function($) {\n\n// http://stackoverflow.com/a/6625189/199100\n// http://css-tricks.com/persistent-headers/\nfunction translate(element, x, y) {\n var translation = \"translate(\" + x ...
javascript
chosen
[ { "from": "system", "value": "Use on('exit') instead of on('close')\n" }, { "from": "human", "value": "var assert = require(\"chai\").assert;\nvar path = require(\"path\");\nvar compiler = require(path.join(__dirname, \"..\"));\nvar childProcess = require(\"child_process\");\nvar _ = require(\"l...
javascript
chosen
[ { "from": "system", "value": "Fix deprecated collections declaration for Bets from Meteor.collection to Mongo.collection\n" }, { "from": "human", "value": "Bets = new Meteor.Collection(\"bets\");\n// { title: \"\", wager: \"\", status: \"winner OR paid\",\n// challenger_id: _id, defender_id: _id...
javascript
chosen
[ { "from": "system", "value": "Fix FCM URL for stage\n" }, { "from": "human", "value": "/**\n * @description\n * This module sets all configuration\n *\n * policyCompassConfig is exposed as a global variable in order to use it in\n * the main app.js file. If there's a way to do the same with depe...
javascript
chosen
[ { "from": "system", "value": "Fix an issue where has property returns an error in IE\n" }, { "from": "human", "value": "define([\n], function () {\n /**\n * Checks whether an object has the given properties\n *\n * @exports has-property\n *\n * @param {Object} obj Object t...
javascript
chosen
[ { "from": "system", "value": "Add basename field to File model\n" }, { "from": "human", "value": "import {DataTypes as t} from \"sequelize\"\n\nimport mime from \"mime-types\"\n\n/**\n * @const schema\n *\n * @type {import(\"sequelize\").ModelAttributes}\n */\nconst schema = {\n id: {\n type...
javascript
chosen
[ { "from": "system", "value": "Fix typo: protcols -> protocols\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies\n */\nimport prominence from 'prominence';\nimport git from 'git-last-commit';\n\n/**\n * @swagger\n * /meta:\n * post:\n * summary: Show the misske...
javascript
chosen
[ { "from": "system", "value": "Remove certain files from build\n" }, { "from": "human", "value": "const cssStandards = require('spike-css-standards');\nconst latest = require('babel-preset-latest');\nconst reshape = require('reshape');\nconst include = require('reshape-include');\nconst layouts =...
javascript
chosen
[ { "from": "system", "value": "Deal with errors in a more humane way\n" }, { "from": "human", "value": "// Require the http module and the proxy module\nvar http = require('http'),\n httpProxy = require('http-proxy'),\n routes = require('./config/routes');\n\nconsole.log(routes);\n/...
javascript
chosen
[ { "from": "system", "value": "Handle spaces and multiple parameters\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\nvar cons = require('consolidate'); // Templating library adapter for Express\n\napp.engine('html', cons.swig);\napp.set('view engine', '...
javascript
chosen
[ { "from": "system", "value": "Handle cells with undefined data\n" }, { "from": "human", "value": "class CSV {\n\tconstructor(data) {\n\t\tthis.data = data;\n\t}\n\ttoString() {\n\t\tconst regexp = /\"/g;\n\t\treturn this.data.map(l => l.map(c => '\"' + c.replace(regexp, '\"\"') + '\"').join(',')...
javascript
chosen
[ { "from": "system", "value": "Add dummy webserver to keep server alive on heroku\n" }, { "from": "human", "value": "var Botkit = require('botkit');\nvar controller = Botkit.slackbot();\nvar answers = require('./lib/answers');\n\nvar janitor = controller.spawn({\n token: process.env.token\n});\n...
javascript
chosen
[ { "from": "system", "value": "Update: Update command from 'organize it' to 'organize files'\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nconst yargs = require('yargs');\nconst chalk = require('chalk');\nconst Helper = require('./Helper');\nconst formats = require('....
javascript
chosen
[ { "from": "system", "value": "Disable Google Analytics unless production\n" }, { "from": "human", "value": "\"use strict\";\n\nconst isCi = require('is-ci');\n\nconst jwtSigningKeyB64 = process.env.jwtSigningKeyB64 || 'RhvV5pbdUOHL0Rns4mX9YgCZ23kvoLqlB6eFau-QIXkxjK4Tx4qFISuzCOg4lmR_';\nlet postg...
javascript
chosen
[ { "from": "system", "value": "Add initial and refactored solutions\n" }, { "from": "human", "value": "// Separate Numbers with Commas in JavaScript **Pairing Challenge**\n\n\n// I worked on this challenge with: .\n\n// Pseudocode\n\n\n\n// Initial Solution\n\n\n\n\n// Refactored Solution\n\n\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix copy & paste naming mistake for country mapping function\n" }, { "from": "human", "value": "const Promise = require('bluebird')\nconst request = require('request-promise')\nconst yaml = Promise.promisifyAll(require('js-yaml'))\n\nfunction fetchChallenges (challe...
javascript
chosen
[ { "from": "system", "value": "Fix call to addMatchers in the spec helper\n" }, { "from": "human", "value": "beforeEach(function () {\n jasmine.Expectation.addMatchers({\n toBePlaying: function () {\n return {\n compare: function (actual, expected) {\n ...
javascript
chosen
[ { "from": "system", "value": "Enable time travel for dev only versions\n" }, { "from": "human", "value": "'use strict'\n/* @flow */\n\nimport { combineReducers } from 'redux'\nimport login from './login'\n// $FlowFixMe login2 isnt typed\nimport login2 from './login2'\nimport devices from './devi...
javascript
chosen
[ { "from": "system", "value": "Add one more test for checking if hash is exists\n" }, { "from": "human", "value": "var assert = require('chai').assert;\nvar HashService = require('../');\nvar BCryptHash = require('../lib/BCryptHash');\n\ndescribe('HashService', function () {\n it('Should properl...
javascript
chosen
[ { "from": "system", "value": "Update test: Add simple read & write tests\n" }, { "from": "human", "value": "var BlockDevice = require( '..' )\nvar assert = require( 'assert' )\nvar util = require( './util' )\n\ndescribe( 'BlockDevice', function() {\n\n var device = null\n\n before( util.setup ...
javascript
chosen
[ { "from": "system", "value": "Send the search object back\n" }, { "from": "human", "value": "var Lien = require(\"../lib/index\");\n\nvar app = new Lien({\n host: \"localhost\"\n , port: 9000\n});\n\napp.on(\"request\", function (lien) {\n lien.end({\n foo: \"bar\"\n });\n});\n"...
javascript
chosen
[ { "from": "system", "value": "Add message to httpError for logging\n" }, { "from": "human", "value": "function HttpError(response) {\n this.name = 'HTTP_ERR';\n this.response = response || {};\n this.stack = (new Error()).stack;\n}\nHttpError.prototype = Object.create(Error.prototype);\...
javascript
chosen
[ { "from": "system", "value": "Add meta object containing `fixable` options\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(context) {\n return {\n VariableDeclaration: function(node) {\n if (node.kind !== 'const') {\n return;\n }\n\n if (no...
javascript
chosen
[ { "from": "system", "value": "markdownDisplay: Update error message to reflect current usage\n\nUsed by narratives too, not just the dataset footer. About to be used\nin the fine print component as well.\n" }, { "from": "human", "value": "import React from \"react\";\nimport { parseMarkdown } f...
javascript
chosen
[ { "from": "system", "value": "feat(webapp): Add basic stuff for the dashboard container\n" }, { "from": "human", "value": "/*\n * Dashboard\n */\nimport React from 'react';\nimport UnderconstructionPage from \"components/UnderconstructionPage\";\n\nexport default class Dashboard extends React.Co...
javascript
chosen
[ { "from": "system", "value": ":new: Add env variable to debug resolutions\n" }, { "from": "human", "value": "// @flow\n\nimport path from 'path'\nimport flatten from 'lodash/flatten'\nimport browserResolve from 'browser-resolve'\nimport { createFileResolver } from 'pundle-api'\n\nimport manifest...
javascript
chosen
[ { "from": "system", "value": "[ADD] Add API version to S3\n" }, { "from": "human", "value": "import S3 from 'aws-sdk/clients/s3';\n\n\nconst AWS_S3_UPLOAD_BUCKET = process.env.AWS_S3_UPLOAD_BUCKET;\n\nconst s3 = new S3({\n\taccessKeyId: process.env.AWS_S3_USER_ACCESS_KEY_ID,\n\tsecretAccessKey: ...
javascript
chosen
[ { "from": "system", "value": "Convert to ArrayBuffer for when fs gives back Node buffers.\n" }, { "from": "human", "value": "export const build = false\n\nexport function fetch (load) {\n if (load.address.substr(0, 8) === 'file:///') {\n return System.import('fs').then(function (fs) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use loose comparison for detecting perspective matrix in fragment shader\n" }, { "from": "human", "value": "export default /* glsl */`\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\tgl_FragDepthEXT = vIsPerspective == 1.0 ? log2( vFragDepth )...
javascript
chosen
[ { "from": "system", "value": "[RN] Remove no longer needed fetch API fallback\n" }, { "from": "human", "value": "/**\n * Loads a script from a specific URL. React Native cannot load a JS\n * file/resource/URL via a &lt;script&gt; HTML element, so the implementation\n * fetches the specified src ...
javascript
chosen
[ { "from": "system", "value": "Break the example into multiple lines\n\n" }, { "from": "human", "value": "import React from 'react';\nimport { storiesOf } from '@storybook/react';\nimport { withInfo } from '@storybook/addon-info';\n\n// For props table\nimport Modal from '@ichef/gypcrete/src/Moda...
javascript
chosen
[ { "from": "system", "value": "Fix: Remove extra margin before paragraph\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport Styled from 'rsg-components/Styled';\n\nexport const styles = ({ space, fontFamily, color }) => ({\n\tpara: {\n\t\tma...
javascript
chosen
[ { "from": "system", "value": "Add login redirect handling to rating JS.\n" }, { "from": "human", "value": "$(function() {\n $('.arrows a').click(function() {\n var arrow = $(this);\n var i = arrow.find('i').hasClass('icon-arrow-up') ? 1 : 0;\n var container = arrow.parent...
javascript
chosen
[ { "from": "system", "value": "Fix for unit test issue\n" }, { "from": "human", "value": "// ----------------------------------------------------------------------------\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// -------------------------------------------------------------...
javascript
chosen
[ { "from": "system", "value": "Add view-only mode to GA4 activation banner.\n" }, { "from": "human", "value": "/**\n * EntityBannerNotifications component.\n *\n * Site Kit by Google, Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n...
javascript
chosen
[ { "from": "system", "value": "Move runService function to WebService. Add comments. Get possibility set port via process.argv.\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\n\nvar CurrentUser = require('../Architecture/CurrentUser').CurrentUser;\nvar ...
javascript
chosen
[ { "from": "system", "value": "Remove dead error check from user agent.\n\nRemove an error test from an earlier verion of the user agent that used\na different library. Axios will raise an exception on error.\n\nCloses #485.\n" }, { "from": "human", "value": "const stream = require('stream')\ncon...
javascript
chosen
[ { "from": "system", "value": "Remove references to disconnection and leave events in the signaller\n" }, { "from": "human", "value": "// create a new signaller, connecting to the target switchboard\nvar signaller = require('..')('//switchboard.rtc.io/');\n\n// when a new peer is announced, log i...
javascript
chosen
[ { "from": "system", "value": "Make a single io service, not one per run.\n" }, { "from": "human", "value": "Components.utils.import('resource://greasemonkey/util.js');\n\nvar EXPORTED_SYMBOLS = ['uriFromUrl'];\n\nfunction uriFromUrl(url, base) {\n var ioService = Components.classes[\"@mozilla.o...
javascript
chosen
[ { "from": "system", "value": "Clarify what the code is for\n" }, { "from": "human", "value": "$(function(){\n setup_table();\n});\n\nfunction setup_table() {\n $('#dists').DataTable({\n paging: false,\n autoWidth: false,\n scrollX: false,\n info: false,\n ...
javascript
chosen
[ { "from": "system", "value": "Annotate object array with the object types, and handle specified settings\n" }, { "from": "human", "value": "import Fuse from 'fuse.js';\n\nconst annotateType = type => tab => Object.assign({}, tab, { type });\n\nexport default function filterResults(\n query,\n ...
javascript
chosen
[ { "from": "system", "value": "Adjust night rainbow theme colors\n" }, { "from": "human", "value": "function NightRainbowTheme () {\n this.paletteBuilder = new SingleColorPaletteBuilder(new HSL(180, 60, 29));\n}\n\nNightRainbowTheme.prototype.colors = [\n new HSL(0, 100, 84),\n new HSL(25, 100...
javascript
chosen
[ { "from": "system", "value": "Add age of onset and diagnosis\n\nFixes #179\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n var app = angular.module('radar.filters');\n\n app.filter('ageFormat', [function() {\n return function ageFormat(seconds) {\n var output;\n\n...
javascript
chosen
[ { "from": "system", "value": "Add support for project assets like parallax and other files\n" }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\nconst express = require('express');\n\nconst router = express.Router();\n\nrouter.get('/', function (req, res) {...
javascript
chosen
[ { "from": "system", "value": "Remove ngCookies as a dependency (we won't need it anymore)\n" }, { "from": "human", "value": "'use strict';\n\nvar eventsApp = angular.module('eventsApp', ['ngResource', 'ngCookies'])\n\t.factory('myCache', function($cacheFactory) {\n\t\treturn $cacheFactory('myCac...
javascript
chosen
[ { "from": "system", "value": "Add integration test for recording service form\n" }, { "from": "human", "value": "(function() {\n window.shared || (window.shared = {});\n var Simulate = React.addons.TestUtils.Simulate;\n\n /* Sugar for common test setup and interactions */ \n var SpecSugar =...
javascript
chosen
[ { "from": "system", "value": "Customize acorn walk with JSX." }, { "from": "human", "value": "(function(mod) {\r\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\r\n return mod(require(\"tern/lib/infer\"), require(\"tern/lib/tern\"), require(\"acorn/dist/a...
javascript
chosen
[ { "from": "system", "value": "Add App with Router, Route\n" }, { "from": "human", "value": "import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport jQuery from \"jquery\";\nimport { CommentBox } from \"./components/comment-box\";\n\nimport { Router, Route } from 'react-router';...
javascript
chosen
[ { "from": "system", "value": "Fix copy and paste naming error" }, { "from": "human", "value": "function initMocha(files) {\n files.push({pattern: __dirname + '/src/circus-init.js', included: true, served: true, watched: false});\n}\n\ninitMocha.$inject = ['config.files'];\n\nmodule.exports = {\...
javascript
chosen
[ { "from": "system", "value": "Create the dir if missing\n" }, { "from": "human", "value": "var fs = require('fs'),\n levelup = require('levelup'),\n leveldown = require('leveldown'),\n key = require('./lib/key.js');\n\nvar dbs = fs.readdirSync('./ldb/').filter(function(item) {\n retur...
javascript
chosen
[ { "from": "system", "value": "Fix cordova requires in releaseReadyWait method\n" }, { "from": "human", "value": "// Copyright (c) 2013 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexports.r...
javascript
chosen
[ { "from": "system", "value": "Add test to make sure nocache calls `next()`\n" }, { "from": "human", "value": "var nocache = require('..')\n\nvar assert = require('assert')\nvar connect = require('connect')\nvar request = require('supertest')\n\ndescribe('nocache', function () {\n it('sets heade...
javascript
chosen
[ { "from": "system", "value": "Use plugins to import modules from `node_modules`\n" }, { "from": "human", "value": "export default {\n input: 'js/app.js',\n output: {\n file: 'dist/index.js',\n format: 'umd'\n }\n};\n" }, { "from": "gpt", "value": "import nodeResolve from 'ro...
javascript
chosen
[ { "from": "system", "value": "Check if field is missing\n" }, { "from": "human", "value": "import test from 'ava'\nimport names from '../dist'\n\nconst isObject = obj => typeof obj === 'object' && obj !== null\n\ntest.beforeEach('requesting data', async t => {\n let list\n\n try {\n list = ...
javascript
chosen
[ { "from": "system", "value": "Refactor domain parsing into separate method\n" }, { "from": "human", "value": "const router = require('express').Router();\n\n/* GET users listing. */\nrouter.get('/*', (req, res, next) => {\n const urlPath = req.originalUrl;\n const domainName = urlPath.split('/...
javascript
chosen
[ { "from": "system", "value": "Put export back to previous pattern.\n" }, { "from": "human", "value": "import app from '../app';\n\nconst polyT = function (...args) {\n return app.polyglot.t(...args);\n};\n\nexport {\n polyT,\n};\n\n" }, { "from": "gpt", "value": "import app from '....
javascript
chosen
[ { "from": "system", "value": "Return string instead of array" }, { "from": "human", "value": "module.exports = function(content) {\n this.cacheable();\n return content + '\\nmodule.exports = [module.exports[0][1]]';\n};\n" }, { "from": "gpt", "value": "module.exports = function(con...
javascript
chosen
[ { "from": "system", "value": "Fix typo accessing q's promise constructor\n" }, { "from": "human", "value": "var q = require('q');\nmodule.exports = {\n waitFor: function(condition, timeout, frequency){\n timeout = timeout || 1000\n frequency = frequency || 10\n return new q.Promise(fun...
javascript
chosen
[ { "from": "system", "value": "Use var instead of let\n" }, { "from": "human", "value": "function escapeCarriageReturn(txt) {\n txt = txt.replace(/\\r+\\n/gm, '\\n'); // \\r followed by \\n --> newline\n while (txt.search(/\\r/g) > -1) {\n let base = txt.match(/^.*\\r+/m)[0].replace(/\\r/, '...
javascript
chosen
[ { "from": "system", "value": "Remove webpack configuration for externalising react\n\nSince already we use the `@apollo/client/core` import, `react` won't be\nincluded in the build.\n\nCloses https://github.com/ember-graphql/ember-apollo-client/issues/389\n" }, { "from": "human", "value": "'use ...
javascript
chosen
[ { "from": "system", "value": "Fix Asset Keys For Hashed Assets\n\nResources seems to be a better property to pull in for the key. But we\nneed to pass the asset root in as configuration to keep only the part we\nwant for the manifest key.\n" }, { "from": "human", "value": "var path = require('pa...
javascript
chosen
[ { "from": "system", "value": "Add thorough comments explaining the organization and execution of the main file\n" }, { "from": "human", "value": "let debug = require( 'debug' )( 'metalsmith-nested-collections' );\nlet collections = require( 'metalsmith-collections' );\nlet addCollectionLinks = r...
javascript
chosen
[ { "from": "system", "value": "Make code for options.escape cleaner\n" }, { "from": "human", "value": "/*!\n * word-wrap <https://github.com/jonschlinkert/word-wrap>\n *\n * Copyright (c) 2014-2015, Jon Schlinkert.\n * Licensed under the MIT License.\n *\n * Adapted from http://james.padolsey.com...
javascript
chosen
[ { "from": "system", "value": "Resolve paths instead of joining\n" }, { "from": "human", "value": "var rimraf = require('rimraf')\nvar path = require('path');\nvar join = path.join;\n\nfunction Plugin(paths, context) {\n // determine webpack root\n this.context = context || path.dirname(module....
javascript
chosen
[ { "from": "system", "value": "Reimplement using the end stream\n" }, { "from": "human", "value": "var flyd = require('flyd')\n\nmodule.exports = function (stream$) {\n var executed = false\n return flyd.combine(function (s$, self) {\n if (!executed) {\n executed = true\n self(s$()...
javascript
chosen
[ { "from": "system", "value": "Put a form as a fallback\n" }, { "from": "human", "value": "'use strict';\nrequire('whatwg-fetch');\n\nvar path = require('path'),\n querystring = require('querystring').parse;\n\nvar registry = 'http://npm-registry-cors-proxy.herokuapp.com/';\n\n\nvar name = que...
javascript
chosen
[ { "from": "system", "value": "Replace spacing option with delimiter\n" }, { "from": "human", "value": "'use strict';\n\nvar fio = require('imacros-fio');\nvar vsprintf = require('format').vsprintf;\nvar formatDate = require('isolocaldateformat');\n\nfunction FileTransport ( options ){\n options...
javascript
chosen
[ { "from": "system", "value": "Make it actually work, remove `create` method as it is not really used.\n" }, { "from": "human", "value": "var Factory = require('factory-girl'),\n Adapter = Factory.Adapter;\n\nvar SequelizeAdapter = function() {};\nSequelizeAdapter.prototype = new Adapter();\nS...
javascript
chosen
[ { "from": "system", "value": "Return the config, don't hit the callback\n" }, { "from": "human", "value": "var http = require('http');\nvar yaml = require('js-yaml');\nvar fs = require('fs');\nvar spawn = require('child_process').spawn;\nvar chimneypot = require('chimneypot');\n\n(function() {\n...
javascript
chosen
[ { "from": "system", "value": "Initialize AWS SDK and CodePipeline client.\n" }, { "from": "human", "value": "'use strict';\n\nexports.handler = (event, context, callback) => {\n // TODO implement\n callback(null, 'Hello from Lambda');\n};" }, { "from": "gpt", "value": "'use str...
javascript
chosen
[ { "from": "system", "value": "Add error message for &quot;\n" }, { "from": "human", "value": "'use strict';\n\nvar kmp = require('kmp-matcher').kmp;\n\n\nmodule.exports = function (query) {\n if (!query.length) {\n return [];\n }\n\n var xpathResult = document.evaluate('//text()[contains(....
javascript
chosen
[ { "from": "system", "value": "Switch doc to closure compiler templating\n" }, { "from": "human", "value": "/**\n * Takes coordinates and properties (optional) and returns a new {@link Point} feature.\n *\n * @module turf/point\n * @category helper\n * @param {number[]} coordinates longitude, lat...
javascript
chosen
[ { "from": "system", "value": "Improve the Node version warning because why not\n\nThis makes the warning look nice and consistent with the other logs we display, while being safe to never break if a dependency/loaded file is not compatible with this version of Node.\nNote that there is some ES6 syntax (`let...
javascript
chosen
[ { "from": "system", "value": "Change window tools to 1 line arrow function.\n" }, { "from": "human", "value": "'use strict';\n\nconst $ = require('jquery'),\n remote = require('remote');\n\nlet main = remote.getCurrentWindow();\n\n$(function(){\n $('.tools > div').on('click', function(e){\...
javascript
chosen
[ { "from": "system", "value": "Add timestamp to log ⌚️" }, { "from": "human", "value": "const fs = require('fs-extra')\nconst path = require('path')\n\nconst logPath = path.join(__dirname, '../log/results.log')\nfs.ensureFileSync(logPath)\n\nmodule.exports = result =>\n new Promise((resolve, rej...
javascript
chosen
[ { "from": "system", "value": "Remove extraneous OSC message listener in SoundTestController\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('core').controller('SoundTestController', ['$scope', 'TrialData',\n function($scope, TrialData) {\n\n /* global io */\n var socket...
javascript
chosen
[ { "from": "system", "value": "Test proxy to strongloop for inputFiles Test\n\nFor #93\n" }, { "from": "human", "value": "var express = require('express')\nvar app = express()\nvar bodyParser = require('body-parser')\nvar jsonParser = bodyParser.json()\n\n\nvar bauhausui = require('./index.js')\n...
javascript
chosen
[ { "from": "system", "value": "Add required prop in CategoryColumn test\n" }, { "from": "human", "value": "import React from \"react\"\nimport { shallow } from \"enzyme\"\nimport { expect } from \"chai\"\n\nimport CategoryColumn from \"../../web/static/js/components/category_column\"\n\ndescribe(...
javascript
chosen
[ { "from": "system", "value": "Fix select outside code area.\n" }, { "from": "human", "value": "$(function () {\n function restore() {\n $(\".ghs-highlight\").removeClass(\"ghs-highlight\");\n $(\".ghs-partial-highlight\").contents().unwrap();\n }\n\n $(\"body\").mouseup(fu...
javascript
chosen
[ { "from": "system", "value": "Handle failure to toggle light\n\nHandle it by reloading the entire page. A little crude, sure, but it\ndoes at least work.\n" }, { "from": "human", "value": "function lightswitch()\n{\n id = this.id.replace(\"light_\", \"\");\n $.post(\"/lightswitch\", { id: ...
javascript
chosen
[ { "from": "system", "value": "Make a deep clone before modifying the object\n" }, { "from": "human", "value": "import deepAssign from 'deep-assign';\n\n\nexport default function defaultconfig(config) {\n return function factory(...configs) {\n return deepAssign(config, ...configs);\n };\n}\...
javascript
chosen
[ { "from": "system", "value": "Check DB adapter before allowing it to be used.\n" }, { "from": "human", "value": "function Store(options) {\n var Adapter = require('./db/' + options.adapter);\n this.adapter = new Adapter(options[options.adapter]);\n}\n\n// Methods that should be supported by ad...
javascript
chosen
[ { "from": "system", "value": "Create a file for common methods\n" }, { "from": "human", "value": "'use strict';\n\nconst chalk = require('chalk');\nconst { version } = require('../package.json');\n\n// Prints version of preact-init\nmodule.exports.showVersion = () => {\n console.log(`v${version...
javascript
chosen
[ { "from": "system", "value": "Add send data ajax function\n" }, { "from": "human", "value": "var mode = 0; //primary\n\nfunction calc_mode() {\n\tvar modes = [\"primary\", \"secondary\", \"tertiary\"];\n\treturn modes[mode];\n}\n\n$(function() {\n\t$(\".add\").button();\n\t$(\".edit\").button();...
javascript
chosen
[ { "from": "system", "value": "Add Empty and made Everything in test Empty\n" }, { "from": "human", "value": "var Block = {\nTest: function(d) {\n\t\td.drawImage(document.getElementById(\"image\"),0,0,20,20);\n},\nTestB: function(d) {\n\td.fillStyle(\"#00FF00\").fillRect(0, 0, 20, 20);\n},\nTestA...
javascript
chosen
[ { "from": "system", "value": "Add description in deprecated function\n" }, { "from": "human", "value": "export const ENVIRONMENTS = {\n DEVELOPMENT: 'DEVELOPMENT',\n ACCEPTATION: 'ACCEPTATION',\n PRE_PRODUCTION: 'PRE_PRODUCTION',\n PRODUCTION: 'PRODUCTION'\n};\n\nexport const HOSTS = {\n PR...
javascript
chosen
[ { "from": "system", "value": "Add and track video-end time\n" }, { "from": "human", "value": "$('video').each( function() {\n var video = this;\n var nodes = [];\n var time = 0;\n $('.videosync').not('video').each(function(){\n var $this = $(this);\n $this.hide();...
javascript
chosen
[ { "from": "system", "value": "Increase mocha timeout to 60000s\n\nFix #13090\n" }, { "from": "human", "value": "module.exports = {\n recursive: true,\n reporter: 'spec',\n slow: 0,\n timeout: 50000,\n ui: 'bdd',\n extension: 'js',\n};\n" }, { "from": "gpt", "value":...
javascript
chosen