conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Modify parseErrorResponse to return JSON API compatible array\n" }, { "from": "human", "value": "import DS from 'ember-data';\n\nconst VALIDATION_ERROR_STATUSES = [400, 422];\n\nexport default DS.RESTAdapter.extend({\n namespace: 'api',\n\n isInvalid: function(sta...
javascript
chosen
[ { "from": "system", "value": "Add version constraint for underscore-deep\n" }, { "from": "human", "value": "Package.describe({\n name: 'hubaaa:easy-meteor-settings',\n version: '0.1.0',\n // Brief, one-line summary of the package.\n summary: \"Easily read deep values from Meteor.settings usi...
javascript
chosen
[ { "from": "system", "value": "Add parentheses to clarify operations\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar matrix = require( './matrix.js' );\n\n\n// MAIN //\n\n/**\n* Calculate weighted average of two matrices.\n*\n* @param {Matrix} A - first matrix\n* @param {...
javascript
chosen
[ { "from": "system", "value": "Reduce dispatcher to non-modified instance.\n" }, { "from": "human", "value": "/**\n * This file is provided by Facebook for testing and evaluation purposes\n * only. Facebook reserves all rights not expressly granted.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WIT...
javascript
chosen
[ { "from": "system", "value": "Accumulate props object in partitionEventHandlers instead of cloning the input object.\n" }, { "from": "human", "value": "\n\n/**\n * Partition an object between event handlers and non-event handlers.\n * @param {Object} props An object with keys that may...
javascript
chosen
[ { "from": "system", "value": "Handle the No Data case.\n" }, { "from": "human", "value": "/**\n * Created by mgab on 14/05/2017.\n */\nimport React,{ Component } from 'react'\nimport Title from './common/styled-components/Title'\n\nimport Lottery from './Lottery'\n\n\nexport default class Lotter...
javascript
chosen
[ { "from": "system", "value": "Make sure array buffer does not leak across vm.\n" }, { "from": "human", "value": "var bs58 = require('bs58')\n\nfunction serialize(data) {\n // Using == on purpose.\n if (data == null) {\n return null\n }\n\n if (data instanceof Error) {\n data = {\n ...
javascript
chosen
[ { "from": "system", "value": "Make gulp build just build the js.\n\nOther functionality coming back later.\n" }, { "from": "human", "value": "var gulp = require('gulp')\nvar coffee = require('gulp-coffee')\nvar concat = require('gulp-concat')\nvar prepend = require('gulp-insert').prepend\nvar sh...
javascript
chosen
[ { "from": "system", "value": "Add Bitters partials to Gulp paths to watch for changes\n\nCloses #207\n" }, { "from": "human", "value": "var gulp = require(\"gulp\"),\n autoprefix = require(\"gulp-autoprefixer\"),\n sass = require(\"gulp-sass\"),\n connect = require(\"gulp-connect\"),\n bourb...
javascript
chosen
[ { "from": "system", "value": "Fix small bugs in FreeDOM shim.\n" }, { "from": "human", "value": "/**\n * @param {freedomWindow} The window in which the freedom module resides\n */\nvar FreedomCommunication = function(freedomWindow) {\n var contextWindows = [];\n freedomWindow.port.on('freedom_...
javascript
chosen
[ { "from": "system", "value": "[master] Add auth and simple post retrieve\n" }, { "from": "human", "value": "\nmodule.exports = new Importer();\n\nfunction Importer() {}\n\nImporter.prototype.import = function () {\n console.log('import!');\n};\n" }, { "from": "gpt", "value": "\nco...
javascript
chosen
[ { "from": "system", "value": "Prepare postMessage env for receicing info from client.\n" }, { "from": "human", "value": "\nimport React from 'react';\nimport PureComponent from 'react-pure-render/component';\nimport ReactDOM from 'react-dom';\n\nimport Qustom from '../../src/index';\n\nclass App...
javascript
chosen
[ { "from": "system", "value": "Add debug output to console in onBeforeSendRequestHeaders callback\n" }, { "from": "human", "value": "/*\n Author: mythern\n \n Copyright (C) 2014, MIT License\n http://www.opensource.org/licenses/mit-license.php\n\n Adressaway is provided free of cha...
javascript
chosen
[ { "from": "system", "value": "Fix small issues with example\n" }, { "from": "human", "value": "import Cycle from '@cycle/xstream-run';\nimport {makeDOMDriver} from '@cycle/dom';\nimport {timeDriver} from '@cycle/time';\nimport {restartable, rerunner} from '../../';\n\nimport main from './main';\...
javascript
chosen
[ { "from": "system", "value": "Simplify AccordionItemBody with recompose's fromRenderProps\n" }, { "from": "human", "value": "// @flow\n\nimport React, { Component } from 'react';\nimport type { ElementProps } from 'react';\n\nimport {\n Consumer as AccordionConsumer,\n type AccordionContai...
javascript
chosen
[ { "from": "system", "value": "Set Convict up to pick up on env variables\n" }, { "from": "human", "value": "var convict = require('convict');\nvar fileExists = require('file-exists');\n\nvar conf = convict({\n env: {\n doc: \"The application environment.\",\n format: [\"prod\", \"dev\", \...
javascript
chosen
[ { "from": "system", "value": "Make objectPool and its current size available to avoid having to duplicate arrays in order to render the scene\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n function ObjectPoolMaker(Constructor, size) {\n var objectPool = [],\n n...
javascript
chosen
[ { "from": "system", "value": "fix(link): Use gatsby Link for CTA button\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Button } from 'react-bootstrap';\n\nimport './login.css';\n\nfunction Login({ children, ...restProps }) {\n return...
javascript
chosen
[ { "from": "system", "value": "Add JS Gerrit.on() hook on submit button\n\nChange-Id: I78b9db7e41d745e9f671f2c28fac36a1a83e4b5d\n" }, { "from": "human", "value": "// Copyright (C) 2013 The Android Open Source Project\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// yo...
javascript
chosen
[ { "from": "system", "value": "Add options -l in deploy command\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst program = require('commander')\nconst fs = require('fs')\nconst path = require('path')\n\nconst { deployCommand, modulesCommand } = require('../src/commands')\n\nconst {...
javascript
chosen
[ { "from": "system", "value": "Remove unused and unprotected methods\n" }, { "from": "human", "value": "if (Meteor.isServer) {\n Meteor.methods({\n Neo4jRun: function(uid, query, opts, date, callback) {\n return neo4j.run(uid, query, opts, date, callback);\n },\n Neo4jPut: function...
javascript
chosen
[ { "from": "system", "value": "Fix expression vs statement mistake in JS AST\n" }, { "from": "human", "value": "var helpersFor = require(\"../helpers-for\");\nvar fileWrapper = require(\"../file-wrapper\");\nvar ast = require(\"../ast\");\nvar es = require(\"../es\");\n\nfunction makeExportsFor(t...
javascript
chosen
[ { "from": "system", "value": "Disable join button before contest enrolment started\n" }, { "from": "human", "value": "import React from 'react';\nimport moment from 'moment';\nimport Button from 'material-ui/Button';\nimport { Link } from 'react-router';\n\nimport { FormattedMessage } from 'reac...
javascript
chosen
[ { "from": "system", "value": "Allow case insensitive artist search\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar mongoose = require('mongoose'),\n\tJamendoArtist = mongoose.model('JamendoArtist'),\n\tMagnatuneArtist = mongoose.model('MagnatuneArtist')...
javascript
chosen
[ { "from": "system", "value": "Implement mongo and redis adapters. Create function for run services. Create middlewares and layer for transmit dependency.\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\n\nvar CurrentUser = require('../Architecture/Curre...
javascript
chosen
[ { "from": "system", "value": "tests/acceptance/categories: Use \"category\" factory instead of fixtures\n" }, { "from": "human", "value": "import { test } from 'qunit';\nimport moduleForAcceptance from 'cargo/tests/helpers/module-for-acceptance';\nimport hasText from 'cargo/tests/helpers/has-tex...
javascript
chosen
[ { "from": "system", "value": "Update test to match changes for provider show\n" }, { "from": "human", "value": "import { module, test } from 'qunit';\nimport { setupRenderingTest } from 'ember-qunit';\nimport { setupFactoryGuy, make } from 'ember-data-factory-guy';\nimport { render } from '@embe...
javascript
chosen
[ { "from": "system", "value": "Update the TestSwarm URL to point to the new jQuery swarm location.\n" }, { "from": "human", "value": "jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.\n\n// load testswarm agent\n(function() {\n\tvar url = window.location.search;\n\turl = ...
javascript
chosen
[ { "from": "system", "value": "Revert \"hmr for store and reducer\"\n\nThis reverts commit 4483c3ccabccf532431bee84d298fee633a3358f.\n" }, { "from": "human", "value": "\nimport { createStore, applyMiddleware, compose } from 'redux'\n\nimport { logger } from '../middleware'\nimport rootReducer fro...
javascript
chosen
[ { "from": "system", "value": "Add tests for security HTTP headers\n" }, { "from": "human", "value": "/*jslint node: true */\n\nvar frisby = require('frisby');\n\nvar URL = 'http://localhost:3000';\n\nfrisby.create('GET response must contain CORS header allowing all origins')\n .get(URL + \"/d...
javascript
chosen
[ { "from": "system", "value": "Fix syntax error on tests\n" }, { "from": "human", "value": "describe('Charts', function () {\n\n describe('Chart(), Flow(), Basic()', function () {\n\n it('throws a \"Missing constructor parameters\" if the data parameter is missing',() => {\n assert.throw...
javascript
chosen
[ { "from": "system", "value": "Load pause value in the hook, so it is auto-reloaded\n" }, { "from": "human", "value": "// This plugin checks for clients that talk before we sent a response\n\nexports.register = function() {\n this.pause = this.config.get('early_talker.pause', 'value');\n th...
javascript
chosen
[ { "from": "system", "value": "Change STRIPES_IFACE environment variable to STRIPES_HOST.\n" }, { "from": "human", "value": "var path = require('path');\nvar express = require('express');\nvar webpack = require('webpack');\nvar config = require('./webpack.config.cli.dev');\n\nvar app = express();...
javascript
chosen
[ { "from": "system", "value": "Fix issue with toggling in queries with dropdown menu\n" }, { "from": "human", "value": "import { inject, bindable } from 'aurelia-framework';\nimport { EventAggregator } from 'aurelia-event-aggregator';\n\n@inject(EventAggregator, Element)\nexport class UiDropdownM...
javascript
chosen
[ { "from": "system", "value": "Use function instead of object of function" }, { "from": "human", "value": "const fountain = require('fountain-generator');\n\nmodule.exports = fountain.Base.extend({\n writing: {\n src() {\n const src = [\n 'src/index.css',\n 'src/index.js',\...
javascript
chosen
[ { "from": "system", "value": "Rename menu item: Report App Stats and Crashes\n" }, { "from": "human", "value": "import $ from 'browser/menus/expressions';\n\nexport default {\n label: 'Privacy',\n submenu: [{\n type: 'checkbox',\n label: '&Report Stats and Crashes',\n click: $.setPref...
javascript
chosen
[ { "from": "system", "value": "Add validation event handling for grid binders\n" }, { "from": "human", "value": "define(['override', 'jquery',], function(override, $) {\n \"use strict\";\n\n return function(grid, pluginOptions) {\n override(grid, function($super) {\n retur...
javascript
chosen
[ { "from": "system", "value": "Load user feed url from chrome storage\n" }, { "from": "human", "value": "({\n init: function() {\n debugger;\n this.urlChanged();\n },\n\n feedUrl: \"\",\n\n urlChanged: function() {\n chrome.storage.onChanged.addListener(function(changes, namespace) {...
javascript
chosen
[ { "from": "system", "value": "Update template request in set interface task\n" }, { "from": "human", "value": "// Copyright 2016, EMC, Inc.\n\n'use strict';\n\nmodule.exports = {\n friendlyName: 'Set Interfaces',\n injectableName: 'Task.Set.Interfaces',\n implementsTask: 'Task.Base.Linu...
javascript
chosen
[ { "from": "system", "value": "Remove example text from microservice\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports.Server = require('./server').Server;\n\n/*\n\n// server example\nlet server = new Server(config.server);\nlet service = new Service(server.events);\nyield server...
javascript
chosen
[ { "from": "system", "value": "Set content type for GitHub API requests\n" }, { "from": "human", "value": "const rootEndpoint = \"https://api.github.com\";\nconst unirest = require(\"unirest\");\nconst url = require(\"url\");\nconst unirestHandler = require(\"../helper/unirestHandler\");\nconst Q...
javascript
chosen
[ { "from": "system", "value": "Add compressed style to sass build\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar gulpUtil = require('gulp-util');\n\nvar gulpIf = require('gulp-if');\nvar browserSync = require('browser-sync').create();\nvar uglify ...
javascript
chosen
[ { "from": "system", "value": "Add functions for creating/removing databases, return statements\n" }, { "from": "human", "value": "var Q = require('q'),\n _ = require('lodash');\n\n// Constants\nvar VALID_DB_TYPES = ['rethinkdb'];\n\nfunction ThrowawayDB(options) {\n var self = this;\n s...
javascript
chosen
[ { "from": "system", "value": "Allow icons in radio lists\n" }, { "from": "human", "value": "/** @jsx React.DOM */\n\nvar React = require('react'),\n\tTappable = require('react-tappable');\n\nmodule.exports = React.createClass({\n\tdisplayName: 'RadioList',\n\n\tpropTypes: {\n\t\toptions: React.P...
javascript
chosen
[ { "from": "system", "value": "Make isVisual a resolved result\n" }, { "from": "human", "value": "// Are we in visual interface (or maybe it's just programmatical document generator)\n\n'use strict';\n\nmodule.exports = function () {\n\tif ((typeof window !== 'object') || !window) return false;\n...
javascript
chosen
[ { "from": "system", "value": "Fix sqlite not actually being optional.\n" }, { "from": "human", "value": "module.exports = {\n Framework: require('./struct/Framework'),\n Command: require('./struct/commands/Command'),\n Inhibitor: require('./struct/inhibitors/Inhibitor'),\n Listener: ...
javascript
chosen
[ { "from": "system", "value": "Send return values back correctly\n" }, { "from": "human", "value": "// @flow\n\n/**\n * Transform a Promise-returning function into a function that can optionally\n * take a callback as the last parameter instead.\n *\n * @param {Function} fn a functi...
javascript
chosen
[ { "from": "system", "value": "Fix defaultConfig() method (add return)\n" }, { "from": "human", "value": "import fs from 'fs'\nimport path from 'path'\n\nimport _ from 'lodash'\nimport postcss from 'postcss'\nimport stylefmt from 'stylefmt'\n\nimport substituteResetAtRule from './lib/substituteRe...
javascript
chosen
[ { "from": "system", "value": "Add ability to add behavior to capsule\n" }, { "from": "human", "value": "define(['jquery', 'eventmap'], function($, EventMap) {\n\n var Capsule = function(target, factory) {\n EventMap.mixin(this, Capsule);\n\n this.$target = (target instanceof $) ? target :...
javascript
chosen
[ { "from": "system", "value": "Stop lying about port numbers\n" }, { "from": "human", "value": "import server from './lib/server';\n\nconst PORT = 80;\n\nserver.start(PORT).then(() => {\n /* eslint-disable no-console */\n console.log('The consus server is now listening on port 80.');\n});\n...
javascript
chosen
[ { "from": "system", "value": "BUGFIX: Disable the jsx-a11y/label-has-for rule since it is unstable and we cover the case via prop-types anyway\n" }, { "from": "human", "value": "module.exports = {\n parser: 'babel-eslint',\n extends: [\n 'standard',\n 'standard-react',\n 'plugin:flowt...
javascript
chosen
[ { "from": "system", "value": "Resolve tabbing inconsistency (use two spaces)\n" }, { "from": "human", "value": "(function() {\n var autoIncrement = 0,\n intervals = {};\n\n window.setCorrectingInterval = function (func, delay, minDelay /* optional */) {\n var id = autoIncreme...
javascript
chosen
[ { "from": "system", "value": "Resolve failing test \"should allow string input for execution\"\n" }, { "from": "human", "value": ";(function(global, factory) {\n // Use UMD pattern to expose exported functions\n if (typeof exports === 'object') {\n // Expose to Node.js\n module.exports =...
javascript
chosen
[ { "from": "system", "value": "Return autoload of shortcut samples\n" }, { "from": "human", "value": "/* User click in the addon icon */\nbrowser.browserAction.onClicked.addListener(_ => {\n browser.tabs.create({\n 'url': './public/config.html'\n });\n});\n\n// when the used add or delete ...
javascript
chosen
[ { "from": "system", "value": "Fix help and make version an alias of bump\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nprocess.title = 'fusepm'\nvar program = require('commander');\nvar install = require('../lib/install');\nvar bump = require('../lib/bump');\nvar fixunoproj = require...
javascript
chosen
[ { "from": "system", "value": "Remove specific SASS cache directory\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n sass: {\n dist: {\n options: {\n ...
javascript
chosen
[ { "from": "system", "value": "Use plumber to prenvent babel from crashing gulp\n" }, { "from": "human", "value": "/* eslint-disable import/no-commonjs */\n\nconst fs = require('fs');\nconst gulp = require('gulp');\nconst babel = require('gulp-babel');\nconst del = require('del');\n\nconst babelR...
javascript
chosen
[ { "from": "system", "value": "Fix loop delay measurement scaling\n" }, { "from": "human", "value": "import { getStatsDClient } from './statsd';\n\nconst defaultSampleInterval = 60;\n\nexport function startSampling(metricName, sampleInterval = defaultSampleInterval) {\n\tvar statsd = getStatsDCli...
javascript
chosen
[ { "from": "system", "value": "Clean up the gulp file further\n" }, { "from": "human", "value": "/* ============================================================ *\\\n SETUP\n\\* ============================================================ */\n\n/*jslint node: true */\n'use strict';\n\n// Gulp\...
javascript
chosen
[ { "from": "system", "value": "Include subfolders of `demo` and `test` folders for linting\n" }, { "from": "human", "value": "'use strict';\nvar gulp = require('gulp');\nvar eslint = require('gulp-eslint');\nvar htmlExtract = require('gulp-html-extract');\nvar stylelint = require('gulp-stylelint'...
javascript
chosen
[ { "from": "system", "value": "build(lint): Drop Gulp ES Lint for now.\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp'),\n eslint = require('gulp-eslint'),\n uglify = require('gulp-uglify'),\n rename = require('gulp-rename'),\n size = require('gulp-size'),\n jas...
javascript
chosen
[ { "from": "system", "value": "Update landing page using react-bootstrap components\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Link } from 'react-router-dom';\nimport { PageHeader } from 'react-bootstrap'\nexport default class LandingPage extends Compon...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect import in CLI file\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/* eslint-disable no-negated-condition */\n\n'use strict';\n\nconst meow = require('meow');\nconst chalk = require('chalk');\nconst scow = require('.');\n\nconst cli = meow(`\...
javascript
chosen
[ { "from": "system", "value": "Fix up dry run functionality\n" }, { "from": "human", "value": "const isMaster = require('./isMaster').isMaster;\n\nmodule.exports.isDryRun = () => !isMaster();\n" }, { "from": "gpt", "value": "module.exports.isDryRun = () => process.env.HAMMERTIME_DRY_R...
javascript
chosen
[ { "from": "system", "value": "Use `String.prototype.startsWith` method instead of the regular expression\n" }, { "from": "human", "value": "$(function () {\n\n var setText = function (textarea, text) {\n var range;\n textarea.focus();\n if (typeof textarea.selectionStart === 'number') ...
javascript
chosen
[ { "from": "system", "value": "Remove the DOM at the right time\n" }, { "from": "human", "value": "const assign = require('object-assign');\nconst find = require('array-find');\nconst drop = require('this-drop');\n\nexport default (tape) => {\n const tapeCss = (...args) => {\n // Determine ar...
javascript
chosen
[ { "from": "system", "value": "Add comment that zalgo cb's get re-queued even in the event of a throw\n" }, { "from": "human", "value": "var wrappy = require('wrappy')\nvar reqs = Object.create(null)\nvar once = require('once')\n\nmodule.exports = wrappy(inflight)\n\nfunction inflight (key, cb) {...
javascript
chosen
[ { "from": "system", "value": "Add value to JS viewmodel\n" }, { "from": "human", "value": "hqDefine(\"app_manager/js/settings/translations\", function () {\n var appTranslationsModel = function (options) {\n hqImport(\"hqwebapp/js/assert_properties\").assertRequired(options, ['baseUrl'...
javascript
chosen
[ { "from": "system", "value": "feat(admin): Add more information to docs detail form\n\nThe new form `DmsResource_detail` contains display expressions instead\nof legacy custom data providers, so they will be rendered in the\nnew client, too.\n\nSee https://git.tocco.ch/c/nice2/+/39800\n\nRefs: TOCDEV-3120\n...
javascript
chosen
[ { "from": "system", "value": "Fix the execution sequence of onmessage callbacks\n" }, { "from": "human", "value": "var Webtail = {\n run: function(port) {\n var self = this;\n\n jQuery(function($) {\n var socket = new (WebSocket || MozWebSocket)('ws://localhost:' + port),\n ...
javascript
chosen
[ { "from": "system", "value": "Remove iFrame sandbox from Modernizr\n" }, { "from": "human", "value": "/*\n * MODERNIZR: Modernizr builder\n */\nmodule.exports = {\n /*\n * TARGET: Build custom Modernizr\n */\n prepare: {\n devFile: 'remote',\n outputFile: '<%= path.t...
javascript
chosen
[ { "from": "system", "value": "Disable comma-dangle for function parameters\n" }, { "from": "human", "value": "module.exports = {\n extends: [\n `eslint-config-airbnb-base`,\n ].map(require.resolve),\n parserOptions: {\n ecmaVersion: 7,\n sourceType: `module`,\n },\n rules: {\n s...
javascript
chosen
[ { "from": "system", "value": "Fix even more legacy mongo compatability\n" }, { "from": "human", "value": "/* global db, ObjectId */\n\nvar addedActions = [];\n\ndb.cooperatives.find({}).forEach(function (cooperative) {\n var actions = [];\n\n if (cooperative.actions) {\n cooperative.actions...
javascript
chosen
[ { "from": "system", "value": "Include in the document.ready function a workaround for browser console\nwarnings produced by a bad interaction between webkit and JQuery versions\nless than 1.7 (and alleged by some to be present in 1.7, as well).\n" }, { "from": "human", "value": "/* Stub translat...
javascript
chosen
[ { "from": "system", "value": "Convert AppComponent constructor to oninit\n" }, { "from": "human", "value": "import m from 'mithril';\nimport GameComponent from './game.js';\nimport UpdateNotificationComponent from './update-notification.js';\nimport SWUpdateManager from 'sw-update-manager';\n\nc...
javascript
chosen
[ { "from": "human", "value": "Complete creation of Asteroids and generateAsteroid function\n" }, { "from": "gpt", "value": "\nvar asteroid = function(){\n id: 0;\n cell: 0;\n row: 0;\n}\n\nvar generateAsteroid = function(){\n //generate an asteroid and return asteroid object\n new_asteroid =...
javascript
chosen
[ { "from": "system", "value": "Change message sent to Discord on connect\n" }, { "from": "human", "value": "const eris = justcord.eris;\nconst config = justcord.config;\nconst chat = justcord.chat;\n\neris.on(\"ready\", () => {\n console.log(\"Justcord ready!\"); // TODO: Add logging utility f...
javascript
chosen
[ { "from": "system", "value": "Support browser history on backend\n" }, { "from": "human", "value": "module.exports = function(server) {\n var router = server.loopback.Router();\n router.get('/', (req, res) => res.render('index'));\n server.use(router);\n};\n" }, { "from": "gpt", "...
javascript
chosen
[ { "from": "system", "value": "Update protection warrior for soft mitigation check damage schools.\n" }, { "from": "human", "value": "import CoreMitigationCheck from 'parser/shared/modules/MitigationCheck';\nimport SPELLS from 'common/SPELLS';\n\n\nclass MitigationCheck extends CoreMitigationChec...
javascript
chosen
[ { "from": "system", "value": "Add limit of 6(arbitrary) to each key in Active Errors\n" }, { "from": "human", "value": "Meteor.methods({\n 'logKeyError': function (keyID, vCode, errorType, message) {\n Errors.update(\n { keyID: keyID },\n {\n $set: {\n keyID: keyID,...
javascript
chosen
[ { "from": "system", "value": "Clean up test code a little more\n" }, { "from": "human", "value": "/*\n Configure nock interceptor for backend service\n */\n\nimport features from '../fixtures/features.js';\nimport client from '../fixtures/client.js';\nimport productArea from '../fixtures/product...
javascript
chosen
[ { "from": "system", "value": "Convert normalize to receive a set of maps\n" }, { "from": "human", "value": "// distance.js\n// Finds the closest user match with n dimensions of compatability\n\n// Expects a tag:count map from the user and a tag:count map from a blog\nmodule.exports = {\n\tmatch:...
javascript
chosen
[ { "from": "system", "value": "Support debug logging for gocd\n" }, { "from": "human", "value": "\nvar path = require('path');\nvar yaml_config = require('node-yaml-config');\nvar _ = require('lodash');\n\nfunction ymlHerokuConfigModule() {\n\n var HEROKU_VARS_SUPPORT = [\n 'user', 'password'...
javascript
chosen
[ { "from": "system", "value": "Increase delay of clean_concourse plugin to 2s\n\nThis plugin assumes that all the elements are present and the page\nrendered after 10ms, and if not, it fails because it cannot find the\nright DOM elements.\n\nThe new version of concourse 2.4.0 takes longer to completely rende...
javascript
chosen
[ { "from": "system", "value": "FIX compilation of node_modules & dist\n" }, { "from": "human", "value": "import { includePaths } from '../config/utils';\n\nexport default () => ({\n test: /\\.(mjs|tsx?|jsx?)$/,\n use: [\n {\n loader: 'babel-loader',\n options: {\n presets: [...
javascript
chosen
[ { "from": "system", "value": "Append missing slash to fix expert request URL.\n" }, { "from": "human", "value": "// @ngInject\nexport default function expertRequestsService(baseServiceClass, $q, $http, ENV) {\n let ServiceClass = baseServiceClass.extend({\n filterByCustomer: false,\n\n in...
javascript
chosen
[ { "from": "system", "value": "Fix path (just happened to work on Win7, fails on Win8)" }, { "from": "human", "value": "/*\n * Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this sof...
javascript
chosen
[ { "from": "system", "value": "Add individual curated set lookup\n" }, { "from": "human", "value": "\"use strict\";\n\nvar querystring = require(\"querystring\");\nvar SdkException = require(\"./sdkexception.js\");\nvar WebHelper = require(\"./webhelper.js\");\nvar GettyApiRequest = require(\"./b...
javascript
chosen
[ { "from": "system", "value": "Enable the ability for a tag attribute value to be an empty string and get set on the html tag\n" }, { "from": "human", "value": "const singletonTags = [\n 'area',\n 'base',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'keygen',\n...
javascript
chosen
[ { "from": "system", "value": "Send full target URL as scenario description" }, { "from": "human", "value": "var ACCEPTANCE_TESTS_ENDPOINT = 'http://localhost:9000/api/acceptance-tests',\n\tACCEPTANCE_TESTS_GUI_URL = 'http://localhost:9000/tests/';\n\nfunction createTest() {\n\tvar formattedResul...
javascript
chosen
[ { "from": "system", "value": "Add dedicated writer for string result\n" }, { "from": "human", "value": "const repl = require(\"repl\");\n\nconst Console = require('./console.js');\n\nclass REPL {\n constructor(options) {\n this.env = options.env;\n this.plugins = options.plugins;\n thi...
javascript
chosen
[ { "from": "system", "value": "Check cid before setting hidden cid property\n" }, { "from": "human", "value": ";(function(Agent) {\n\n /**\n Some backbone and marionette objects don't have cids (gasp)\n When that happens we go in and add this property __marionette_inspector__cid\n with a s...
javascript
chosen
[ { "from": "system", "value": "Comment out dependency for now\n" }, { "from": "human", "value": "'use strict';\n\nvar AutoprefixPlugin = require('less-plugin-autoprefix');\nvar CleanCSSPlugin = require('less-plugin-clean-css');\nvar extend = require('extend');\nvar path = require('path');\nvar ru...
javascript
chosen
[ { "from": "system", "value": "Update template away from legacy variation setting\n\n\nFormer-commit-id: 79522c8565f4c21c0536f106532295321a0f7b07\nFormer-commit-id: 8be9e6f171ae33ab163b02dee0d4b5b4449ece03" }, { "from": "human", "value": "$(function () {\n // We move the background image and c...
javascript
chosen
[ { "from": "system", "value": "Add standard timing for test runs.\n\nI'm trying not to optimize every single Lore program I write, but I like\nto at least have some overview of the general speed of different\nprograms.\n" }, { "from": "human", "value": "import { test } from '../lore-program.js';\...
javascript
chosen
[ { "from": "system", "value": "Add dummy sidebar pane for elements panel\n" }, { "from": "human", "value": "console.log('devtools.js');\n\nchrome.devtools.panels.create('Backbase', 'backbase.png', 'panel.html', function(panel) {\n console.log('Panel created', panel);\n});\n" }, { "from...
javascript
chosen
[ { "from": "system", "value": "Fix typo (but who cares amirite?)\n" }, { "from": "human", "value": "// utility functions for generator-jhipster-db-helper\n\nconst chalk = require('chalk');\n\nmodule.exports = {\n // use this as a DEBUG logger\n _dbhDebugLog : function (pString) {\n i...
javascript
chosen
[ { "from": "system", "value": "Allow declaring next value on Node constructor\n" }, { "from": "human", "value": "'use strict';\n\nvar Node = function(value){\n\n\tthis.value = value;\n\tthis.next = null;\n\n\tthis.hasNext = function(){\n\t\treturn this.next !== null;\n\t}\n\n\tthis.getValue = fun...
javascript
chosen
[ { "from": "system", "value": "Reset State context after async returns\n" }, { "from": "human", "value": "var http = require('http');\nvar Navigation = require('../../../build/dist/Navigation');\nvar NavigateServer = require('./NavigateServer');\n\nvar server = http.createServer(function(req, res...
javascript
chosen
[ { "from": "system", "value": "Add use strict for node@<6\n" }, { "from": "human", "value": "const sinon = require('sinon');\nlet _stub;\nconst stub = lib => {\n if (lib) {\n if (typeof lib.stub !== 'function') {\n throw new Error(`Could not set stub lib. Expected a \"stub\" method, foun...
javascript
chosen