conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add export for ES Modules\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function () {};\n" }, { "from": "gpt", "value": "<% if ( !esModules ) { %>'use strict';\n\nmodule.exports = function () {};<% } else { %>export default functio...
javascript
chosen
[ { "from": "system", "value": "Add note about getNextMove() returning a promise\n" }, { "from": "human", "value": "import Player from './player.js';\n\n// A player whose moves are not determined through local user interaction, but\n// rather, by a asynchronous getNextMove method that AsyncPlayer ...
javascript
chosen
[ { "from": "system", "value": "Remove CSS loader as it is not installed and would just fail" }, { "from": "human", "value": "module.exports = {\n entry: './client/main.js',\n output: {\n path: __dirname + '/public',\n filename: 'bundle.js'\n },\n module: {\n loaders: [\n { test:...
javascript
chosen
[ { "from": "system", "value": "Fix call to observe_if_calendar_available() from window.setTimeout\n" }, { "from": "human", "value": "var calendar_grid = document.querySelector('div[role=\"grid\"]');\nvar body = document.querySelector('body');\n\nvar disable_scroll = function () {\n// Get a handle...
javascript
chosen
[ { "from": "system", "value": "Build up nested helper tree.\n\nThis step builds a object tree from the nested paths provided to helpers and attaches it to the _helpers object.\n\nexample:\n// For the following call\ncollectionName.helpers({\n \"rootHelper\": function A(){}, // will be attached to document ...
javascript
chosen
[ { "from": "system", "value": "Replace reserved token if address already exists\n" }, { "from": "human", "value": "import { observable, action } from 'mobx';\n\nclass ReservedTokenStore {\n\n @observable tokens;\n\n constructor(tokens = []) {\n this.tokens = tokens;\n }\n\n @action addToke...
javascript
chosen
[ { "from": "system", "value": "Fix reference to model factory\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (mongoose, properties, schemaExtensions) {\n if (!schemaExtensions) {\n schemaExtensions = {};\n }\n\n if (!schemaExtensions.Account) {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary check for error\n" }, { "from": "human", "value": "var fs = require('fs')\n , findExec = require('find-exec')\n , child_process = require('child_process')\n , players = [\n 'mplayer',\n ...
javascript
chosen
[ { "from": "system", "value": "Remove `version` from default preferences\n" }, { "from": "human", "value": "pref(\"extensions.rspamd-spamness.header\", \"x-spamd-result\");\npref(\"extensions.rspamd-spamness.display.column\", 0);\npref(\"extensions.rspamd-spamness.display.messageScore\", true);\n...
javascript
chosen
[ { "from": "system", "value": "Fix condition to only target `parseInt`\n" }, { "from": "human", "value": "'use strict';\n\nvar tk = require('rocambole-token');\nvar rocambole = require('rocambole');\n\n\nexports.transformBefore = transformBefore;\nfunction transformBefore(ast) {\n rocambole.moon...
javascript
chosen
[ { "from": "system", "value": "Move chores notice to debug level\n" }, { "from": "human", "value": "const Quest = require('./quest')\n\nconst winston = require('winston')\n\nclass CommunityManager {\n static start() {\n if (this.choreTimer) { return winston.info('Community manager alrea...
javascript
chosen
[ { "from": "system", "value": "Use fewer slices in while loop\n\nShould boost performance significantly for larger incoming buffers.\n" }, { "from": "human", "value": "'use strict'\n\nvar through = require('pull-through')\nvar Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function bl...
javascript
chosen
[ { "from": "system", "value": "Add more informations about hooks and add hook \"page\"\n" }, { "from": "human", "value": "module.exports = {\n book: {\n assets: \"./book\",\n js: [\n \"test.js\"\n ],\n css: [\n \"test.css\"\n ]\n },\n...
javascript
chosen
[ { "from": "system", "value": "Add support for CSS requires, and support to output json when required\n" }, { "from": "human", "value": "var sizeOf = require('image-size');\nvar loaderUtils = require('loader-utils');\n\nmodule.exports = function(content) {\n this.cacheable && this.cacheable();\n...
javascript
chosen
[ { "from": "system", "value": "Add labeled and unlabeled functions\n" }, { "from": "human", "value": "var port = process.env.PORT || 3000;\nvar data;\n\nvar app = require('express')();\nvar myParser = require(\"body-parser\");\napp.use(myParser.json());\n\nvar server = require('http').Server(app)...
javascript
chosen
[ { "from": "system", "value": "Move func to module exports\n\n" }, { "from": "human", "value": "'use strict';\n\nconst getRepos = require('./lib/getRepos');\nconst parseReposToMd = require('./lib/parseReposToMd');\nconst saveToFile = require('./lib/saveToFile');\n\nlet username = 'frenchbread';\n...
javascript
chosen
[ { "from": "system", "value": "Add a bunch of cgi scripts\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = [\n 'testproxy.php', // open proxy test\n 'tmunblock.cgi',\n 'getheaders9.php',\n 'getheaders2.php',\n 'cgi-bin/common/attr', // open proxy test\n 'scri...
javascript
chosen
[ { "from": "system", "value": "Remove console logs, fix bug\n" }, { "from": "human", "value": "const Octokat = require('octokat')\nconst open = require('open')\nconst Promise = require('bluebird')\nvar octo, organization, repository\n\nmodule.exports = function openNotifications (input, opts, tok...
javascript
chosen
[ { "from": "system", "value": "Remove config node, add node properties" }, { "from": "human", "value": "module.exports = function(RED) {\n \"use strict\";\n var osc = require('osc');\n var dgram = require('dgram');\n \n function QlabIn(config) {\n RED.nodes.createNode(this,c...
javascript
chosen
[ { "from": "system", "value": "Disable the YUICompressor and closure compiler tests\n\nThey're annoying because the fail on Travis half of the time.\n" }, { "from": "human", "value": "var vows = require('vows'),\n assert = require('assert'),\n AssetGraph = require('../lib');\n\nvows.describ...
javascript
chosen
[ { "from": "system", "value": "Adjust tests for the new interface\n" }, { "from": "human", "value": "'use strict';\n\nvar expect = require('chai').expect;\n\nvar floraCluster = require('../');\n\ndescribe('flora-cluster', function () {\n it('should be an object', function () {\n expect(...
javascript
chosen
[ { "from": "system", "value": "Update Kerbin textures to new textures\n" }, { "from": "human", "value": "export var bodies = {\n\t_atmDensity: 1.2230948554874,\n\n\tKerbin: {\n\t\tname: 'Kerbin',\n\t\tradius: 600000,\n\t\trotPeriod: 21600,\n\t\tatmosphere: 70000,\n\t\tatmosphereScaleHeight: 5600,...
javascript
chosen
[ { "from": "system", "value": "Fix api usage in script parse test.\n" }, { "from": "human", "value": "'use strict';\n\nlet assert = require('assert'),\n path = require('path'),\n parser = require('../lib/support/browserScript');\n\nconst TEST_SCRIPTS_FOLDER = path.resolve(__dirname, 'browserscr...
javascript
chosen
[ { "from": "system", "value": "Add test around group not being found\n" }, { "from": "human", "value": "var tgr = require(\"__buttercup/classes/commands/command.tgr.js\");\n/*\nmodule.exports = {\n failMe: {\n failmeplease: function(test) {\n console.log(tgr);\n test.fail();\n ...
javascript
chosen
[ { "from": "system", "value": "Test that the comment is correct (test case one)\n" }, { "from": "human", "value": "var cmm = require(\"__buttercup/classes/commands/command.cmm.js\");\n\nmodule.exports = {\n setUp: function(cb) {\n this.command = new cmm();\n (cb)();\n },\n\n ...
javascript
chosen
[ { "from": "system", "value": "Revert assign for 2.4 failures\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport Application from '../../app';\nimport config from '../../config/environment';\n\nexport default function startApp(attrs) {\n let application;\n\n // use defaults, ...
javascript
chosen
[ { "from": "system", "value": "Remove debug information when we are not in debug mode\n" }, { "from": "human", "value": "/**\n * This file provides the \"app\" namespace, which is the\n * application's main namespace. And it defines the application's Angular\n * module.\n */\ngoog.provide('app');...
javascript
chosen
[ { "from": "system", "value": "Update copyright comments in JS files (part 13)\n\nReviewed By: bhamodi\n\nDifferential Revision: D32686335\n\nfbshipit-source-id: a0b6f1b26ff95ebe642625109aad34329b4ed7d7\n" }, { "from": "human", "value": "/**\n * (c) Facebook, Inc. and its affiliates. Confidential...
javascript
chosen
[ { "from": "system", "value": "Configure ESLint to parse ES2017 by default" }, { "from": "human", "value": "module.exports = {\n root: true,\n parserOptions: {\n ecmaVersion: 6,\n sourceType: 'module'\n },\n extends: 'eslint:recommended',\n env: {\n browser: true\n },\n rules: {\n...
javascript
chosen
[ { "from": "system", "value": "Fix Header Tests - now need to be wrapped in a router\n" }, { "from": "human", "value": "import React from 'react';\nimport { shallow } from 'enzyme';\n\nimport Header from './Header';\n\ndescribe('Component: Header', () => {\n const props = {};\n\n it('renders w...
javascript
chosen
[ { "from": "system", "value": "Synchronize tables not yet in the database\n" }, { "from": "human", "value": "import express from 'express';\nimport logger from 'morgan';\nimport bodyParser from 'body-parser';\nimport passport from 'passport';\nimport http from 'http';\nimport routes from './serve...
javascript
chosen
[ { "from": "system", "value": "Simplify event command for single message parameter\n" }, { "from": "human", "value": "var express = require('express'),\n bodyParser = require('body-parser'),\n app = express(),\n server = require('http').Server(app),\n router = express.Router(),\n r...
javascript
chosen
[ { "from": "system", "value": "Create routes endpoints for stats and containers list\n" }, { "from": "human", "value": "require('./config/config');\n\nvar express = require('express'),\n app = express(),\n DockerRemote = require(__services + 'docker_remote');\n\napp.get('/', function(req, res){...
javascript
chosen
[ { "from": "system", "value": "Kill process if DB not reachable\n" }, { "from": "human", "value": "const mongoose = require('mongoose');\n\nmongoose.connect('localhost', 'muffin');\n\nconst db = mongoose.connection;\ndb.on('error', console.error.bind(console, 'Connection error:'));\n\nmodule.expo...
javascript
chosen
[ { "from": "system", "value": "[LEADERBOARD/USERDATA] Add userinfo getter, fix typo in class name\n" }, { "from": "human", "value": "const LEADERBOARD_SIZE = 10;\n\nclass leaderboard {\n\n constructor () {\n this.db = fbApp.database();\n }\n\n refreshScores (callback) {\n t...
javascript
chosen
[ { "from": "system", "value": "Complete happy path for About You form" }, { "from": "human", "value": "describe('Mini test', function() {\n it('should work', function () {\n cy.visit(\"https://lga-1543-install-and-integra.staging.checklegalaid.service.gov.uk/start\")\n\n cy.contains('Choos...
javascript
chosen
[ { "from": "system", "value": "Add hashbang so command line works.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar backup = require(\"../lib/backup\");\n\nfunction main(argv) {\n\tvar args = argv.slice(2);\n\tif (args.length !== 2) {\n\t\tconsole.error(\"Usage: github-backup username pa...
javascript
chosen
[ { "from": "system", "value": "Use asynchronous child_process and fs apis\n\nso that we don’t have to exit the process from this module;\ninstead, take callbacks and call them with errors like good\njavascript hackers do.\n" }, { "from": "human", "value": "module.exports = function(configLocalDb)...
javascript
chosen
[ { "from": "system", "value": "Add code snippets with copy to clipboard\n" }, { "from": "human", "value": "import unified from 'unified';\nimport parse from 'remark-parse';\nimport remark2react from 'remark-react';\n\nexport function convertMarkdownToReact(markdown) {\n const content = unified()...
javascript
chosen
[ { "from": "system", "value": "Speed up build time when there are no yaml files\n\njs-yaml module takes a while to load. Moving it inside condition can speed up loading of readfile.js by ~7000 times." }, { "from": "human", "value": "var path = require('path');\nvar yaml = require('js-yaml');\nvar...
javascript
chosen
[ { "from": "system", "value": "Throw errors that are not ENOENT\n" }, { "from": "human", "value": "var fs = require('fs');\n\nexports.directory = function(path) {\n var stats;\n\n try {\n stats = fs.statSync(path);\n } catch (err) {\n if (err.code === 'ENOENT') {\n ...
javascript
chosen
[ { "from": "system", "value": "Switch back to using query instead of body\n" }, { "from": "human", "value": "var express = require('express');\nvar Global = require('../global');\nvar search = require('../commands/search');\n\nvar router = express.Router();\n\nrouter.get('/*', function(req, res) ...
javascript
chosen
[ { "from": "system", "value": "Put the zonename into the healthcheck output\n" }, { "from": "human", "value": "exports.ping = function ping (req, res) {\n return res.send('OK', 200);\n}\n\nvar package = require('../package.json')\n\nexports.status = function status (req, res) {\n return res.jso...
javascript
chosen
[ { "from": "system", "value": "Add method for setting cookies\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Kurahen Premium\n// @namespace karachan.org\n// @version 1.0\n// @include http://www.karachan.org/*\n// @include http://karachan.org/*\n// @exclude ...
javascript
chosen
[ { "from": "system", "value": "Add content CSS inline to settings\n" }, { "from": "human", "value": "var tinymce = require('./index.js');\nmodule.exports = tinymce;\n\nrequire('./plugins/autoresize/plugin.js');\nrequire('./plugins/table/plugin.js');\nrequire('./plugins/paste/plugin.js');\nrequire...
javascript
chosen
[ { "from": "system", "value": "Use path module instead of http\n" }, { "from": "human", "value": "const http = require('http');\n\nconst createPath = filePath => http.resolve(__dirname, '..', filePath);\n\nconst paths = {\n indexHtml: createPath('server/public/index.html'),\n publicDir: createP...
javascript
chosen
[ { "from": "system", "value": "Allow reassigning to function parameters here\n\nShould probably turn this off globally.\n" }, { "from": "human", "value": "import passport from 'passport';\nimport LocalStrategy from 'passport-local';\n\nimport {User} from '../models';\nimport log from './logger';\...
javascript
chosen
[ { "from": "system", "value": "Increase the buffer to satisfy appmanifest\n" }, { "from": "human", "value": "\nvar phantom = require(\"phantomjs\")\n, execFile = require(\"child_process\").execFile\n, jn = require(\"path\").join\n, u = require(\"url\")\n, querystring = require(\"querystri...
javascript
chosen
[ { "from": "system", "value": "Add Korean translation \"today, meridiem\"\n" }, { "from": "human", "value": "/**\n * Korean translation for bootstrap-datetimepicker\n * Gu Youn <http://github.com/guyoun>\n */\n;(function($){\n\t$.fn.datetimepicker.dates['kr'] = {\n\t\tdays: [\"일요일\", \"월요일\", \"화...
javascript
chosen
[ { "from": "system", "value": "Add profile to user limit middleware\n" }, { "from": "human", "value": "module.exports = function timeoutLimits (metadataBackend) {\n return function timeoutLimitsMiddleware (req, res, next) {\n const { user, authenticated } = res.locals;\n\n metada...
javascript
chosen
[ { "from": "system", "value": "Connect to heroku postgres in production\n" }, { "from": "human", "value": "const Sequelize = require('sequelize');\n\nlet db;\n\nif (process.env.DATABASE_URL) {\n db = new Sequelize(process.env.DATABASE_URL, {\n dialect: 'postgres',\n protocol:'postgres',\n ...
javascript
chosen
[ { "from": "system", "value": "Fix colt reference version number\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.5'\n }\n});\n\ndefin...
javascript
chosen
[ { "from": "system", "value": "Make it possible to override `useNullAsDefault`\n\nrefs #6623, #6637\n\n- this was supposed to be in the original\n" }, { "from": "human", "value": "var knex = require('knex'),\n config = require('../../config'),\n dbConfig = config.database,\n knexIn...
javascript
chosen
[ { "from": "system", "value": "Convert promise chain to async await.\n" }, { "from": "human", "value": "import Twitter from 'twitter'\nimport S3TweetRepository from './lib/s3-tweet-repository'\nimport slscrypt from '../node_modules/serverless-crypt/dists/slscrypt'\n\nconst tweetRepository = new S...
javascript
chosen
[ { "from": "system", "value": "Add chapter 8, exercise 1\n" }, { "from": "human", "value": "function reliableMultiply(a, b) {\n for (;;) {\n try {\n return primitiveMultiply(a, b);\n } catch (error) {\n if (!(error instanceof MultiplicatorUnitFailure)) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use equal width grid to so that, in the future, we can use four column retro formats without changing the code\n" }, { "from": "human", "value": "import React, { Component } from \"react\"\n\nimport UserList from \"./user_list\"\nimport CategoryColumn from \"./categ...
javascript
chosen
[ { "from": "system", "value": "Allow for passing in a simple string as the name of a logger\n" }, { "from": "human", "value": "var std = require('std')\n\n// TODO Send email on error\nmodule.exports = std.Class(function() {\n\n\tvar defaults = {\n\t\tname: 'Logger'\n\t}\n\n\tthis._init = function...
javascript
chosen
[ { "from": "system", "value": "Allow dropdown to select work site\n" }, { "from": "human", "value": "//= require signature_pad\n$( document ).ready(function() {\n var wrapper = document.getElementById(\"Signature\"),\n clearButton = document.getElementById(\"clear\"),\n saveButton = wr...
javascript
chosen
[ { "from": "system", "value": "Disable now-unused Sentry performance traces\n" }, { "from": "human", "value": "/* eslint no-console:0 */\n// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application...
javascript
chosen
[ { "from": "system", "value": "Remove console.log statement causing an error in browser console.\n" }, { "from": "human", "value": "const Utils = require('utils');\nconst defaults = require('lodash/defaults');\n\nconsole.log(Util);\n\nconst defaultConfig = {\n baseUrl: '/',\n};\n\nclass JSONAP...
javascript
chosen
[ { "from": "system", "value": "Use stage 0 when loaded via isparta\n" }, { "from": "human", "value": "\"use strict\";\n/**\n * Webpack frontend test (w/ coverage) configuration.\n */\nvar _ = require(\"lodash\");\nvar testCfg = require(\"./webpack.config.test\");\n\nmodule.exports = _.merge({}, t...
javascript
chosen
[ { "from": "system", "value": "Make it work on flusspferd.\n" }, { "from": "human", "value": "exports.setup = function(Tests){\n\nvar Suite = require('lib/suite').Suite;\n\nTests.describe('Suites', function(it, setup){\n\n\tsetup('beforeEach', function(){\n\n\t});\n\n\tit('should error out if no ...
javascript
chosen
[ { "from": "system", "value": "Make mouseover/mouseout work with anchors that nest\n" }, { "from": "human", "value": "// Add the mouse listeners for the above functions\nfunction linkHover() {\n\twindow.onmouseover = function(event) {\n\t\tif (event.target.matches('a')) {\n\t\t\twindow.webkit.mes...
javascript
chosen
[ { "from": "system", "value": "Make the selector more restrictive\n" }, { "from": "human", "value": "$(document).ready(function() {\n var height = $(\"#page-header\").height()\n $(\"a\").click(function(e) {\n e.preventDefault();\n var href = $(this).attr(\"href\");\n $('html, bo...
javascript
chosen
[ { "from": "system", "value": "Stop hiding inbox instead of closing\n\nThis behavior was intended to help keep the websocket alive, but keeping\nthe inbox window around can cause some stale frontend state. Also we now\nhave a keepalive alarm to check for new messages once a minute.\n" }, { "from": "h...
javascript
chosen
[ { "from": "system", "value": "[lib] Reduce AutoReload ping to 3s.\n" }, { "from": "human", "value": "<script type=\"text/javascript\">\n//\n// Reload the app if server detects local change\n//\n(function() {\n\n function checkForReload() {\n var xhr = new XMLHttpRequest;\n xhr.o...
javascript
chosen
[ { "from": "system", "value": "Add controller, controllerAs fields for /users route\n" }, { "from": "human", "value": "// js/routes\n\n(function() {\n \"use strict\";\n\n angular.module(\"NoteWrangler\")\n .config(config);\n\n function config($routeProvider) {\n $routeProvider\n .wh...
javascript
chosen
[ { "from": "system", "value": "Resolve path names relatives to cwd when using via CLI\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar express = require('express')\nvar app = express()\nvar dafuq = require('./')\n\nvar argv = require('yargs')\n\t.usage('$0 Leverages command-based api')...
javascript
chosen
[ { "from": "system", "value": "Replace calls to goog.define with assignments to the result of goog.define.\n\nBackground: To support goog.define within modules, it will soon stop exporting the named variable on the global object. In preparation for this, we need to manually export the names instead. This is ...
javascript
chosen
[ { "from": "system", "value": "refactor: Add isDefault property for each setting\n\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Controller.extend({\n init () {\n Ember.run.schedule('afterRender', () => {\n componentHandler.upgradeAllRegistered();\...
javascript
chosen
[ { "from": "system", "value": "Add comment to adjustClasses function\n\nKB-419\n" }, { "from": "human", "value": "'use strict';\n\nconst helpers = require('../../shared/helpers');\n\nfunction adjustClasses() {\n if (helpers.isMobile($) === true) {\n $('body').addClass('is-mobile').removeClass...
javascript
chosen
[ { "from": "system", "value": "Fix in how the contents is determined.\n" }, { "from": "human", "value": "define(function (require, exports, module) {\n'use strict';\n\nvar Mode = require(\"../../mode\").Mode;\nvar util = require(\"../../util\");\nvar oop = require(\"../../oop\");\nvar GenericDeco...
javascript
chosen
[ { "from": "system", "value": "Add subscription to all roles except admin\n" }, { "from": "human", "value": "Template.resident.created = function () {\n // Get reference to template instance\n var instance = this;\n\n // Get Resident ID from router\n instance.residentId = Router.current().par...
javascript
chosen
[ { "from": "system", "value": "Add props to the MyTitle class.\n" }, { "from": "human", "value": "/* global React ReactDOM */\nvar div = React.DOM.div\nvar h1 = React.DOM.h1\n\nvar MyTitle = React.createClass({\n render () {\n return (\n div(null,\n h1(null, 'A...
javascript
chosen
[ { "from": "system", "value": "Add some extra characters in\n" }, { "from": "human", "value": "const config = require('config');\nconst crypto = require('crypto');\n\nmodule.exports.info = {\n\tname: 'Rate and Rank',\n\tdescription: 'Interprets and determines the relevant rank for a query',\n\tca...
javascript
chosen
[ { "from": "system", "value": "Upgrade to ew editor API\n" }, { "from": "human", "value": "var CodeMirror = require('codemirror')\n , bindCodemirror = require('gulf-codemirror')\n\nmodule.exports = setup\nmodule.exports.consumes = ['editor']\nmodule.exports.provides = []\nfunction setup(plugin, ...
javascript
chosen
[ { "from": "system", "value": "Use JSON.stringify() instead of .join() to avoid key collision\n" }, { "from": "human", "value": "import {GLOBAL_VERSION} from \"./constants\";\nimport events from \"./events\";\n\nexport function makeKey({\n\tname,\n\tversion,\n}, args){\n\tconst pieces = [\n\t\tGL...
javascript
chosen
[ { "from": "system", "value": "Make sure two overlays can't be open at the same time\n" }, { "from": "human", "value": "/**\n @ngdoc service\n * @name umbraco.services.overlayService\n *\n * @description\n * <b>Added in Umbraco 8.0</b>. Application-wide service for handling overlays.\n */\n(funct...
javascript
chosen
[ { "from": "system", "value": "Fix issue with pulling users with FAQs\n" }, { "from": "human", "value": "//----------------------------------------------------------------------------//\nvar express = require('express');\nvar router = express.Router();\nvar pg = require('pg');\nvar connectionStri...
javascript
chosen
[ { "from": "system", "value": "Add children handling to visibility queue\n" }, { "from": "human", "value": "/* ***********************************************************************************************\n\n Unify Project\n\n Homepage: unify-project.org\n License: MIT + Apache (V2)\n ...
javascript
chosen
[ { "from": "system", "value": "Fix js snippet to not use async/await\n" }, { "from": "human", "value": "// If you are requiring twilio-video from CommonJS,\n//\n// const Video = require('twilio-video');\n//\n// If you are including twilio-video.js from a <script> tag,\n//\n// const Video...
javascript
chosen
[ { "from": "system", "value": "Include loader.css dependency in the build process\n" }, { "from": "human", "value": "const normalize = require('path').normalize;\nconst root = 'angular/';\n\nmodule.exports = {\n appRoot: require('path').resolve(__dirname, '..'),\n assetsPath: 'public/assets...
javascript
chosen
[ { "from": "system", "value": "Remove animation tests to fix build\n" }, { "from": "human", "value": "var AnimationModule = require('../src/js/visuals/animation/index');\nvar PromiseAnimation = AnimationModule.PromiseAnimation;\nvar Animation = AnimationModule.Animation;\nvar Q = require('q');\n\...
javascript
chosen
[ { "from": "system", "value": "Remove remaining hints of jquery" }, { "from": "human", "value": "\n'use strict';\n\ndefine(['../../../src/client/config'], function(config) {\n\n config.baseUrl = '/';\n\n config.paths.jquery = 'bower_components/jquery/dist/jquery';\n config.paths['thehelp-test'...
javascript
chosen
[ { "from": "system", "value": "Use a TypedArray instead of a number\n" }, { "from": "human", "value": "var assert = require('assert');\n\nfunction BitRing(capacity) {\n assert.ok(capacity < 32, 'Capacity must be less than 32');\n this.capacity = capacity;\n this.bits = 0;\n this.pos =...
javascript
chosen
[ { "from": "human", "value": "Add user stories and refactor to telephone.\n" }, { "from": "gpt", "value": "// inputs will be:\nvar oddList = [1, 2, 3, 4, 5, 5, 7]\nvar evenList = [4, 4, 5, 5, 6, 6, 6, 7]\n\n//Our functions are:\nfunction Sum(list) {\n for (var length = list.length, counter = 0, ...
javascript
chosen
[ { "from": "system", "value": "Fix http forwarding response logging.\n" }, { "from": "human", "value": "/* globals console */\n/* eslint no-console: 0 */\nimport http from 'http';\nimport { get } from 'lodash';\n\nimport { ENV } from 'config';\nimport { stringifyObjectValues, setResponse, httpReq...
javascript
chosen
[ { "from": "system", "value": "Set the timeout back to 300 instead of 3000 which was used for debugging\n" }, { "from": "human", "value": "// This alert was to test to see if the JavaScript was loaded :)\n// alert(\"Hello World\")\n\n$(document).ready(function() {\n\n\tfunction myFunction() {\n\t...
javascript
chosen
[ { "from": "system", "value": "Add more methods for weave's intersection\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport '../styles/WeaveElement.css';\nimport '../styles/Scheme4.css';\n\nclass WeaveElement extends Component {\n constructor() {\n super();\n...
javascript
chosen
[ { "from": "system", "value": "Revert \"Bundle the position service with the lib for now so users dont have to depend on ng2-bootstrap\"\n\nThis reverts commit 807a45bfcc7140124271e7e0e47e6fb4a22093b0.\n" }, { "from": "human", "value": "module.exports = {\n entry: './angular2-bootstrap-confirm.t...
javascript
chosen
[ { "from": "system", "value": "Set the Default Storage_Engine to RocksDB\n" }, { "from": "human", "value": "\"use strict\";\nconst aim = require(\"arangodb-instance-manager\");\n\nexports.create = () => {\n let pathOrImage;\n let runner;\n if (process.env.RESILIENCE_ARANGO_BASEPATH) {\n pat...
javascript
chosen
[ { "from": "system", "value": "Set workshop list order to distance when coming to page\n" }, { "from": "human", "value": "// Imports\nimport UserRoles from '../../core/auth/constants/userRoles';\nimport WorkshopListController from './workshop-list.controller';\nimport WorkshopListHeaderController...
javascript
chosen
[ { "from": "system", "value": "Set colors back to auto\n" }, { "from": "human", "value": "var util = require(\"util\");\nvar tty = require(\"tty\");\n\nvar opts = {\n depth: null,\n // colors: tty.isatty(process.stdin),\n colors: true,\n};\n\nfunction inspect(x) {\n return util.inspec...
javascript
chosen
[ { "from": "system", "value": "Refactor to avoid dynamic module resolution\n" }, { "from": "human", "value": "'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.\n*\n* @module @std...
javascript
chosen
[ { "from": "system", "value": "Add basic proxy for api from webpack dev server\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar devConfig = require('../webpack.dev.config.js');\n\n// If the node_env is NOT set to production, run the webpackdev server\n// Uses the webpack....
javascript
chosen
[ { "from": "system", "value": "Add listen and forward methods.\n\nWe are adding noops to the root state (ie: not in the child states),\nbecause we only need an implementation in the Initial state.\n\nFuture calls to these functions will no longer result in any\nchange of the object.\n" }, { "from": "...
javascript
chosen
[ { "from": "system", "value": "Make the title screen work.\n" }, { "from": "human", "value": "window.addEventListener('load', function() {\n var context = document.getElementById('display').getContext('2d');\n var display = new Display(context);\n //var game = new Snake(display);\n va...
javascript
chosen
[ { "from": "system", "value": "Add placeholder functions matching endpoint expectations\n" }, { "from": "human", "value": "var Genre = require( './genres' );\n\nmodule.exports = {\n\n\t/*insert methods here*/\n\n};\n" }, { "from": "gpt", "value": "var Genre = require( './genres' );\n\...
javascript
chosen
[ { "from": "system", "value": "Allow cleanup to be a promise.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar fs = require('fs');\nvar path = require('path');\nvar chalk = require('chalk');\nvar rimraf = require('rimraf');\nvar helpers = require('broccoli-kitchen-sin...
javascript
chosen
[ { "from": "system", "value": "Add the default values to the parameters.\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = function (filename, encoding) {\n\n}\n" }, { "from": "gpt", "value": "'use strict'\n\n\nmodule.exports = function (filename, encoding) {\n var ...
javascript
chosen