conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use APPEND_STRICT as update action for the Orion CB.\n" }, { "from": "human", "value": "var Orion = require('fiware-orion-client')\nvar NgsiHelper = require('fiware-orion-client/ngsi-helper').NgsiHelper\nvar objectAssign = require('object-assign')\nvar ContextElemen...
javascript
chosen
[ { "from": "system", "value": "Reset the padding on the background articles\n" }, { "from": "human", "value": "(function() {\n var root = this,\n Peeler = function() {},\n articles = document.querySelectorAll(\"article\"),\n viewportWidth = root.innerWidth,\n aspectRatio = 12...
javascript
chosen
[ { "from": "system", "value": "Check url before trying to load image\n" }, { "from": "human", "value": "/* istanbul ignore next */\nvar DOMURL = window.URL || window.webkitURL || window\n\n/**\n * Get an image's width and height\n * @param {(File|blob|string)} File, blob, or URL string\n * @retur...
javascript
chosen
[ { "from": "system", "value": "Allow custom version commands as well 👯" }, { "from": "human", "value": "var buildFile = require('./build-file')\nvar runGitCommand = require('./helpers/run-git-command')\n\nvar commithashCommand = 'rev-parse HEAD'\nvar versionCommand = 'describe --always'\n\nfunct...
javascript
chosen
[ { "from": "system", "value": "Add coverage in test execution\n" }, { "from": "human", "value": "module.exports = {\n setupFilesAfterEnv: ['./jest.setup.js'],\n moduleDirectories: ['<rootDir>/node_modules', 'node_modules'],\n collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],\n transf...
javascript
chosen
[ { "from": "system", "value": "chore(utils): Fix console warning when running tests\n\n* Don’t use ‘write’ alias as it changes ‘this’ to ‘undefined’\n" }, { "from": "human", "value": "/* @flow */\nconst jsdiff = require('diff');\nrequire('colors');\n\nexport default function logDiff(label: string...
javascript
chosen
[ { "from": "system", "value": "Convert question to promise interface\n" }, { "from": "human", "value": "var chalk = require('chalk');\nvar readline = require('readline');\nvar sprintf = require('sprintf-js').sprintf;\n\nfunction timestamp() {\n return chalk.dim('[' + new Date().toLocaleString() ...
javascript
chosen
[ { "from": "system", "value": "Allow options initialization from any method\n" }, { "from": "human", "value": "\nfunction API (config, custom) {\n this.options = {}\n\n var api = {}\n\n var wrap = {\n method: (key) => ((url) => {\n this.options.method = key.toUpperCase()\n this.op...
javascript
chosen
[ { "from": "system", "value": "Handle network errors instead of failing silently\n" }, { "from": "human", "value": "var xml = require('libxmljs'),\n request = require('request')\n\nvar Client = exports.Client = function Client(appKey) {\n this.appKey = appKey\n}\n\nClient.prototype.query = fu...
javascript
chosen
[ { "from": "system", "value": "Fix loader on empty config\n" }, { "from": "human", "value": "var loaderUtils = require('loader-utils');\nvar postcss = require('postcss');\n\nmodule.exports = function (source, map) {\n if ( this.cacheable ) this.cacheable();\n\n var file = loaderUtils...
javascript
chosen
[ { "from": "system", "value": "Update up to changes in html-template-to-dom\n" }, { "from": "human", "value": "'use strict';\n\nvar validDocument = require('dom-ext/html-document/valid-html-document')\n , htmlToDom = require('dom-ext/html-document/#/html-to-dom')\n , tokensToDom ...
javascript
chosen
[ { "from": "system", "value": "Fix | Adicionando status code na validação do token\n" }, { "from": "human", "value": "var ormDic = require('../../util/ormDic');\n\nclass OrmProxy {\n constructor() {\n this._orm = null;\n }\n\n setOrm(string) {\n this._orm = ormDic[string];\...
javascript
chosen
[ { "from": "system", "value": "Use dependument to read and write\n" }, { "from": "human", "value": "var Dependument = require('dependument').Dependument;\n\nvar d = new Dependument({\n source: ' ',\n output: 'bla.txt'\n});\n\nd.writeOutput();\n" }, { "from": "gpt", "value": "var Dep...
javascript
chosen
[ { "from": "system", "value": "Remove stringify from log in create callback\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar program = require('commander');\n\nprogram\n .version('0.0.1');\n\nprogram\n .command('create <taskName>')\n .description('Create a new task')\n .action(crea...
javascript
chosen
[ { "from": "system", "value": "Reduce threshold until optimization appears to 1s\n" }, { "from": "human", "value": "/* eslint-env browser */\n\n/* global i18n: false */\n\n\nconst OPTIMIZATION_MESSAGE_DISPLAY_THRESHOLD = 2000; // milliseconds\n\n// type Canceler = () => Eff Unit\n//\n// setMes...
javascript
chosen
[ { "from": "system", "value": "Add param to return summarized data\n" }, { "from": "human", "value": "/*jslint browser: true, undef: true, white: false, laxbreak: true *//*global Ext,Slate*/\nExt.define('SlateAdmin.model.person.ProgressReport', {\n extend: 'Ext.data.Model',\n fields: [\n ...
javascript
chosen
[ { "from": "system", "value": "Add empty object to $resource\n" }, { "from": "human", "value": "// js/services/user.service\n\n(function() {\n \"use strict\";\n\n angular.module(\"NoteWrangler\")\n .factory(\"User\", UserFactory);\n\n UserFactory.$inject = [\"$routeParams\", \"$resource\"];...
javascript
chosen
[ { "from": "system", "value": "Add props and methods to lib wrap\n" }, { "from": "human", "value": "module.exports = {\n \n};\n" }, { "from": "gpt", "value": "module.exports = {\n // Library\n read: require('./read'),\n\n // Internal props / methods\n _cache: {},\n _parse: JSON....
javascript
chosen
[ { "from": "system", "value": "Remove Parser, export Encoder and Decoder\n" }, { "from": "human", "value": "\n/**\n * Library version.\n */\n\nexports.version = '0.0.1';\n\n/**\n * Constructors.\n */\n\nexports.Batch = require('./batch');\nexports.Parser = require('./parser');\nexports.Socket = r...
javascript
chosen
[ { "from": "system", "value": "Add function to apply autocomplete to dynamically created Step forms, after document.ready\n" }, { "from": "human", "value": "var autocomplete_options = {\n source: '/city-autocomplete',\n dataType: 'json',\n minLength: 1,\n select: function (event, ui) ...
javascript
chosen
[ { "from": "system", "value": "Remove anonymous flag to force user to enter name" }, { "from": "human", "value": "(function() {\n\n // Creates an iframe with an embedded HipChat conversation window.\n //\n // Options:\n // url - The url to the room to embed; required\n // e...
javascript
chosen
[ { "from": "system", "value": "Fix pathing for directory creation\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar program = require('commander')\n , gulp = require('gulp')\n , chalk = require('chalk')\n , exec = require('exec')\n\nvar strings = {\n creat...
javascript
chosen
[ { "from": "system", "value": "Check if Backbone.history matches a route when started. [rev:\nalex.scown]\n\nBaseApp starts Backbone.History. It now checks the return value of\nBackbone.history.start to see if a route was matched, if not, it\nnavigates to the default route.\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Clean up config in constructor\n" }, { "from": "human", "value": "'use strict';\n\nconst colors = require('ansicolors');\nconst fs = require('fs');\nconst pluralize = require('pluralize');\nconst CLIEngine = require('eslint').CLIEngine;\n\nclass ESLinter {\n constr...
javascript
chosen
[ { "from": "system", "value": "Add `browser-core` functions to `ioFuncs`\n" }, { "from": "human", "value": "const ioFuncs = {\n 'putLine': true,\n 'getLine': true,\n 'readFile': true,\n 'writeFile': true,\n 'IO': true\n}\n\nconst ioMeths = {\n 'maybeErr': true,\n 'maybeTrue': true,\n 'may...
javascript
chosen
[ { "from": "system", "value": "Replace for in loop with forEach.\n" }, { "from": "human", "value": "var detective = require('detective');\nvar unique = require('array-unique');\nvar recursive = require('recursive-readdir');\nvar fs = require('fs');\nvar core = require('is-core-module');\nvar loca...
javascript
chosen
[ { "from": "system", "value": "Exclude minified bundle from unit tests.\n" }, { "from": "human", "value": "module.exports = function(config) {\r\n config.set({\r\n frameworks: [\"jasmine\"],\r\n browsers: [\"PhantomJS\"],\r\n phantomjsLauncher: {\r\n exitOnResourceError: true\r\n ...
javascript
chosen
[ { "from": "system", "value": "Revert to export method from 869dd50\n\nThis maintain backwards compatibility with versions before `v0.4.3`" }, { "from": "human", "value": "import t from './lib';\nimport i18n from './lib/i18n/en';\nimport templates from './lib/templates/bootstrap';\nimport stylesh...
javascript
chosen
[ { "from": "system", "value": "Remove quotes in `args` since `execFile` adds them automatically\n\nFixes #3.\n" }, { "from": "human", "value": "'use strict';\nvar execFile = require('child_process').execFile;\nvar wifiName = require('wifi-name');\n\nfunction getPassword(ssid, cb) {\n\tvar cmd = '...
javascript
chosen
[ { "from": "system", "value": "Call API for sending SMS and build data object\n" }, { "from": "human", "value": "const pushbullet = require('./pushbullet');\nconst client = new pushbullet.PushbulletClient();\n\nconsole.log(\"Starting the Pushbullet client!\");\n\n/*\n* Pushbullet client makes a r...
javascript
chosen
[ { "from": "system", "value": "Remove parentheses from around arrow function arg" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\nconst fs = require('fs');\n\nconst beautifyText = require('beautify-text');\nconst glob = require('glob');\nconst through2 = require('through2');...
javascript
chosen
[ { "from": "system", "value": "Remove __dirname and preloadWindow: true\n" }, { "from": "human", "value": "'use strict';\n\nvar menubar = require('menubar');\nvar app = require('app');\nvar ipc = require('ipc');\n\nvar mb = menubar({\n dir: __dirname,\n width: 600,\n height: 480,\n icon: 'Ico...
javascript
chosen
[ { "from": "system", "value": "Switch inline styles from body to documentElement\n" }, { "from": "human", "value": "var scrollbarSize;\n\nfunction getScrollbarSize() {\n if (typeof scrollbarSize !== 'undefined') return scrollbarSize;\n\n var dummyScroller = document.createElement('div');\n dum...
javascript
chosen
[ { "from": "system", "value": "Change virtual path because nginx\n" }, { "from": "human", "value": "// Create an app\nvar path = require(\"path\")\nvar fs = require(\"fs\")\n\nvar server = require(\"diet\")\nvar app = server()\nvar auth = require('diet-auth')(app)\n \napp.listen(\"http://loca...
javascript
chosen
[ { "from": "system", "value": "Move the API to /api\n" }, { "from": "human", "value": "const express = require('express');\nconst morgan = require('morgan');\n\nconst app = express();\napp.use(morgan('combined'));\napp.get('/', (request, response) => {\n response.status(501).json(null);\n});\n\n...
javascript
chosen
[ { "from": "system", "value": "Set a presence message that's useful\n" }, { "from": "human", "value": "'use strict';\n\nconst Discord = require('discord.js');\nconst client = new Discord.Client();\nconst winston = require('winston');\n\nrequire('dotenv').config();\n\nwinston.configure({\n transp...
javascript
chosen
[ { "from": "system", "value": "Add env line to run from bin\n" }, { "from": "human", "value": "var command = process.argv[2]\nvar target = process.argv[3]\n\ntry {\n require('./tasks/' + command)(target)\n} catch (e) {\n\tconsole.log(\"No task was found for command [\" + command + \"] and target...
javascript
chosen
[ { "from": "system", "value": "Revert \"Added the toJSON that was accidentally deleted in last release!\"\n\nThis reverts commit c11a1cf814020509d4692962b703fedac48c5a6a.\n" }, { "from": "human", "value": "var stacktrace = require('stack-trace'),\n hash = require('object-hash'),\n uuid = re...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect argument to notify function\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar program = require('commander')\n , gulp = require('gulp')\n , chalk = require('chalk')\n , exec = require('exec')\n , pjson = requi...
javascript
chosen
[ { "from": "system", "value": "Enable strict mode for Node\n" }, { "from": "human", "value": "#!/usr/bin/env node\nconsole.log(\"Starting bert. Type 'exit' when you're done.\")\n// TODO: run file watcher\n\n// TODO: add command line option to specify logs location\nlet logDir = resolveHome('~/.be...
javascript
chosen
[ { "from": "system", "value": "Add http request with required params\n" }, { "from": "human", "value": "var fs = require('fs');\nvar argv = require('yargs')\n .option('c', {\n alias: 'client',\n type: 'array'\n })\n .option('s', {\n alias: 'search',\n type: 'string'\n })\n .optio...
javascript
chosen
[ { "from": "system", "value": "Select top most version if non selected for top crashers\n" }, { "from": "human", "value": "$(document).ready(function () {\n var url_base = $(\"#url_base\").val(),\n url_site = $(\"#url_site\").val(),\n product,\n product_version,\n r...
javascript
chosen
[ { "from": "system", "value": "Make imports work for nested addons and engines\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ui-slider',\n description: 'A flexible UI slider for ambitious Ember apps',\n included: function(app) {\n a...
javascript
chosen
[ { "from": "system", "value": "Fix a logic error in path normalization\n" }, { "from": "human", "value": "'use strict';\nvar _ = require( 'lodash' );\nvar path = require( 'path' );\nvar gutil = require( 'gulp-util' );\nvar through = require( 'through2' );\n\nvar File ...
javascript
chosen
[ { "from": "system", "value": "Fix: Set chokidar option ignoreIntial: true by default\n" }, { "from": "human", "value": "'use strict';\n\nvar util = require('util');\nvar Undertaker = require('undertaker');\nvar vfs = require('vinyl-fs');\nvar chokidar = require('chokidar');\n\nfunction Gulp() {\...
javascript
chosen
[ { "from": "system", "value": "Fix deleting of empty obj\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Require modules.\n */\n\nvar isObject = require('is-object');\n\n/**\n * Pick values from object except the given keys.\n *\n * @param {object} obj\n * @param {array|string}\n *\n ...
javascript
chosen
[ { "from": "system", "value": "Change redirect URI to github project page\n" }, { "from": "human", "value": "var browser = require('openurl');\nvar config = require('./config');\n\nvar REDIRECT_URI = '';\n\n\nconsole.log('\\n********** DOWNSTAGRAM OAUTH SETUP **********');\nconsole.log('\\n To us...
javascript
chosen
[ { "from": "system", "value": "Remove stuff from local storage\n" }, { "from": "human", "value": "ResourceManager = {};\n\nResourceManager._store = window.localStorage;\n\nResourceManager.get = function(key) {\n return ResourceManager._store.getItem(key);\n};\nResourceManager.save = function(key...
javascript
chosen
[ { "from": "system", "value": "Create queues with smarter delay\n" }, { "from": "human", "value": "module.exports = function scheduler(conn, opt) {\n opt = opt || {};\n opt.separator = opt.separator || '.';\n opt.prefix = opt.prefix || 'schedule';\n opt.threshold = opt.threshold || 10000;\n ...
javascript
chosen
[ { "from": "system", "value": "Add support for Ember FastBoot \n\nAs per http://www.ember-fastboot.com/docs/addon-author-guide" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-flatpickr',\n included: function(app) {\n this._super.in...
javascript
chosen
[ { "from": "system", "value": "Switch to green at the end if all tests succeeded.\n" }, { "from": "human", "value": "'use strict';\n\nvar Blink1 = require('node-blink1');\n\nmodule.exports = function (options) {\n var self = this;\n\n this.jasmineStarted = function (suiteInfo) {\n tr...
javascript
chosen
[ { "from": "system", "value": "Add merge to to global package exports\n" }, { "from": "human", "value": "'use strict'\n\nconst LiteralProvider = require('./lib/providers/literal-provider');\nconst CliProvider = require('./lib/providers/cli-provider');\nconst FileProvider = require('./lib/provider...
javascript
chosen
[ { "from": "system", "value": "Move import statements into the transform function" }, { "from": "human", "value": "// requirish\n// Copyright 2014 Enrico Stara 'enrico.stara@gmail.com'\n// Released under the MIT License\n// https://github.com/enricostara/require-mainify\n\n// Impo...
javascript
chosen
[ { "from": "system", "value": "Make it work in recursion too\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Require modules.\n */\n\nvar isObject = require('is-object');\nvar clone = require('clone');\n\n/**\n * Pick values from object except the given keys.\n *\n * @param {object} o...
javascript
chosen
[ { "from": "system", "value": "Deal with exceptions more cleanly." }, { "from": "human", "value": "\"use strict\";\nvar t0 = Date.now();\n\nvar express = require(\"express\"),\n xhub = require('express-x-hub');\n\nif (process.env.NODE_ENV === \"dev\") {\n // Load local env variables\n re...
javascript
chosen
[ { "from": "system", "value": "Test fix for port location\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\nvar http = require('http').Server(app);\n\napp.use(express.static('src'));\napp.use('/js/vendor', express.static('node_modules'));\n\n\napp.get('/'...
javascript
chosen
[ { "from": "system", "value": "fix: Add credit to original module\n" }, { "from": "human", "value": "module.exports = function russellView (literals, ...substs) {\n return literals.raw.reduce(function reducelit (acc, lit, i) {\n var subst = substs[i - 1]\n if (Array.isArray(subst)) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix date format: should be 24-hour.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n// Dependencies\nvar moment = require(\"moment\");\nvar sugar = require(\"sugar\");\nvar colors = require(\"colors\");\nvar exec = require(\"child_process\").exec;\n\n// Chec...
javascript
chosen
[ { "from": "system", "value": "Add rejectUnauthorized = false property in https-request\n" }, { "from": "human", "value": "'use strict';\n\nvar https = require('https');\n\n/**\n * Checks SSL Expiry date\n * @param {string} host\n * @param {string} method\n * @param {number} port\n * @return {obj...
javascript
chosen
[ { "from": "system", "value": "Use assert module for assertion\n" }, { "from": "human", "value": "const assert = require('assert')\nconst path = require('path')\nconst Config = require('./models/config')\nconst util = require('./util')\n\nfunction loadConfig (configPath) {\n const options = {}\n...
javascript
chosen
[ { "from": "system", "value": "[applicaiton] Fix selector bug in unmounting component.\n" }, { "from": "human", "value": "\"use strict\";\n/*global document*/\n var React = require('react');\n/**\n * Map containing all the mounted components.\n * @type {Object}\n */\n var mountedComponents = {};\...
javascript
chosen
[ { "from": "system", "value": "Fix wrong name of decorated method of online serializer\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport isObject from '../../utils/is-object';\n\n/*\n * Extend serializer so that we can use local serializer when local adater is\n * used.\n */\n...
javascript
chosen
[ { "from": "system", "value": "Add support for multiple shows, many recordings per.\n" }, { "from": "human", "value": "var Maki = require('maki');\nvar config = require('./config');\nvar decentral = new Maki( config );\n\nvar mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\nvar Obj...
javascript
chosen
[ { "from": "system", "value": "Set max listeners for redis client connection.\n" }, { "from": "human", "value": "var redis = require('redis');\nvar util = require('util');\n\n\n// ### Errors ###\n\nfunction RedisConnectionError(error) {\n\tthis.name = 'RedisConnectionError';\n\tthis.message = err...
javascript
chosen
[ { "from": "system", "value": "Add status, author and slug column to pages migration file\n" }, { "from": "human", "value": "\r\nexports.up = function(knex, Promise) {\r\n return knex.schema.createTable('pages', function (table) {\r\n table.increments('id').primary()\r\n table.string('titl...
javascript
chosen
[ { "from": "system", "value": "Make tasks running in sequence\n\nTasks after \"Clean\" will be running parallel with \"Clean\" if there are a lot of files in \"build\" directory." }, { "from": "human", "value": "'use strict';\n\nvar config = require('../config');\nvar gulp = require('gulp');\nv...
javascript
chosen
[ { "from": "system", "value": "Set track labels in demo\n" }, { "from": "human", "value": "var pileup = require(\"pileup\");\n\nvar sources = [\n {\n viz: pileup.viz.genome(),\n isReference: true,\n data: pileup.formats.twoBit({\n url: 'http://www.biodalliance.org/datasets/hg19.2bi...
javascript
chosen
[ { "from": "system", "value": "Handle download csv button click\n" }, { "from": "human", "value": "const csvGenerator = {\n\n}\n\nexport default csvGenerator;" }, { "from": "gpt", "value": "const csvGenerator = {\n\tinit() {\n\t\tconst downloadCsvBtnEl = document.querySelector(\".js-d...
javascript
chosen
[ { "from": "system", "value": "Remove unneccessary commented out code\n" }, { "from": "human", "value": "// @flow\n// complist reducers\nimport { ADD_COMPONENTS, ADD_TO_PROJECT } from '../actions/complist';\nimport getComponentLibrary from '../components/VisComponents/dataExporter';\n\ntype actio...
javascript
chosen
[ { "from": "system", "value": "Convert notify store to new pattern\n" }, { "from": "human", "value": "/**\n * Notify Store\n *\n * The notifications. Essentially a log to emit events.\n */\n\n// Requires\nimport {ActionTypes} from '../constants/JWConstants.js';\nimport {register} from 'janeswalk/...
javascript
chosen
[ { "from": "system", "value": "Move to got notation following JS hinting\n" }, { "from": "human", "value": "\n// N E T W O R K S E R V I C E\n\ndescribe('NetworkService Unit Tests', function(){\n beforeEach(module('starter.services'));\n\n beforeEach(inject(function (_$rootScope_, _NetworkSe...
javascript
chosen
[ { "from": "system", "value": "Use phantomjs for snippets testing\n\n" }, { "from": "human", "value": "const syrup = require('../../');\n\nsyrup.enableDebug()\n .config(`${__dirname}/config.yaml`)\n .scenario({\n name: 'snippets - 1',\n entrypoint: `${__dirname}/test-snippets`...
javascript
chosen
[ { "from": "system", "value": "Fix strictness error when using node 4\n" }, { "from": "human", "value": "// report.js -- Report of the results of a batch and its sub-batches\n//\n// Copyright 2017 fuzzy.ai <evan@fuzzy.ai>\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n...
javascript
chosen
[ { "from": "system", "value": "Check for array before forEach\n" }, { "from": "human", "value": "var config = require('../settings.json'),\n log4js = require('log4js').getLogger(),\n fs = require('fs');\n\nmodule.exports = {\n logger: {\n debug: (log) => {\n log4js.debu...
javascript
chosen
[ { "from": "system", "value": "Fix error typo and changed post request to use expected request body\n" }, { "from": "human", "value": "import { EventEmitter } from 'events'\nimport axios from 'axios'\n\nexport default class RoomService extends EventEmitter {\n constructor() {\n super()\n }\n...
javascript
chosen
[ { "from": "system", "value": "Add DOM's `change` event for client-side UJS handlers.\n" }, { "from": "human", "value": "/**\n * Assigns handlers/listeners for `[data-action]` links.\n *\n * Actions associated with a link will be invoked via Wire with the jQuery\n * event object as an argument...
javascript
chosen
[ { "from": "system", "value": "Change load date to be constant per loading event\n" }, { "from": "human", "value": "'use strict';\nvar through = require('through2');\nvar formatAddress = require('../lib/formatAddress');\n\n\nmodule.exports = function(addr, city, state, zip){\n if(!addr) throw ne...
javascript
chosen
[ { "from": "system", "value": "Rename 'util' to 'GipsyUtil' in overlay.\n" }, { "from": "human", "value": "{\r\n let util = {};\r\n Components.utils.import(\"resource://gipsy/util.jsm\", util);\r\n\r\n let myId = \"gipsy-button\"; // ID of button to add\r\n let afterId = \"search-c...
javascript
chosen
[ { "from": "system", "value": "Add height is not absoulte note\n" }, { "from": "human", "value": "var WebPage = require('webpage');\nvar System = require('system');\naddress = System.args[1];\nvar index = 0;\n\nvar screenshots = [\n {\"dimensions\" : [975,500],\n \"filename\": './screenshots/sc...
javascript
chosen
[ { "from": "system", "value": "Add validation for the key submitted in the POST body.\n" }, { "from": "human", "value": "import {encrypt} from '../../kms';\n\nexport default async (req, res, next) => {\n const plaintext = req.body.secret;\n let keyObj;\n\n try {\n keyObj = JSON.parse(req.bo...
javascript
chosen
[ { "from": "system", "value": "Change app name. Added getItems method\n" }, { "from": "human", "value": "// app.shoppingListService.js\n\n(function() {\n \"use strict\";\n\n angular.module(\"MyApp\")\n .service(\"ShoppingListService\", ShoppingListService);\n\n ShoppingListService.$inject =...
javascript
chosen
[ { "from": "system", "value": "Clean up the tests a bit to read easier. Also DRY.\n" }, { "from": "human", "value": "describe(\"Pages publication\", function() {\n beforeEach(function (done) {\n Meteor.call('fixtures/reset', done);\n });\n\n it('should return regular data but not premiumCon...
javascript
chosen
[ { "from": "system", "value": "Fix pagination when sorting by option\n" }, { "from": "human", "value": "import FilterableList from '~/filterable_list';\n\nexport default class GroupFilterableList extends FilterableList {\n constructor(form, filter, holder, store) {\n super(form, filter, holde...
javascript
chosen
[ { "from": "system", "value": "Send current track information to remote control\n" }, { "from": "human", "value": "\"use strict\";\n\n(function() {\n\nvar REMOTE_URL = \"http://localhost:48278/\";\n\nmusicd.RemoteControl = function(player) {\n this._player = player;\n this._player.state.sub...
javascript
chosen
[ { "from": "system", "value": "Save the scroll position more often\n" }, { "from": "human", "value": "function rememberScrollPosition() {\n function rememberScrollPositionForElement(element) {\n var id = element.getAttribute('id');\n var scrollTimer;\n element.onscroll = f...
javascript
chosen
[ { "from": "system", "value": "Update the comment ranges to reflect the new replacements.\n" }, { "from": "human", "value": "import getFreeBinding from '../utils/getFreeBinding';\n\n/**\n * Convert binary existential operators, e.g. `a ? b` into `if` expressions\n * using unary existential operat...
javascript
chosen
[ { "from": "system", "value": "Switch to using a dgram socket\n" }, { "from": "human", "value": "var _ = require('lodash'),\n net = require('net');\n\nfunction Client (opts) {\n opts = _.defaults(_.pick(opts, Object.keys(Client.defaults)), Client.defaults);\n\n for (var key in opts) {\n Obj...
javascript
chosen
[ { "from": "system", "value": "Add Freeze and Hail changes" }, { "from": "human", "value": "function clampIntRange(num, min, max) {\n num = Math.floor(num);\n\tif (num < min) num = min;\n\tif (typeof max !== 'undefined' && num > max) num = max;\n\treturn num;\n}\nexports.BattleStatuses = {\n};\n...
javascript
chosen
[ { "from": "system", "value": "Set up handlers for shell-command-on-url.\n" }, { "from": "human", "value": "// Time-stamp: \"2018-04-14 21:07:05 phil\"\n\ndumpln(\"50os.linux\");\n\ncontent_handlers.set(\"application/pdf\", content_handler_save);\n\nexternal_content_handlers.set(\"image/*\", \"xd...
javascript
chosen
[ { "from": "system", "value": "Add sc.end() to exit after results. Suggested by @tfauck.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar sc = require('skale-engine').context();\n\nvar file = process.argv[2] || '/etc/hosts';\n\nsc.textFile(file)\n .flatMap(line => line.split(' '))\n...
javascript
chosen
[ { "from": "system", "value": "Add default case for switch statement\n" }, { "from": "human", "value": "const DEFAULT_STATE = {\n searchTerm: ''\n}\n\nconst rootReducer = (state = DEFAULT_STATE, action) => {\n switch (action.type) {\n\n }\n}\n\nexport default rootReducer\n" }, { "from"...
javascript
chosen
[ { "from": "system", "value": "Fix linting issue after updating mocha-eslint.\n" }, { "from": "human", "value": "var stringUtil = require('ember-cli-string-utils');\nvar SilentError = require('silent-error');\nvar pathUtil = require('ember-cli-path-utils');\n\nmodule.exports = {\n descriptio...
javascript
chosen
[ { "from": "system", "value": "Make jquery datetimepicker work on my computer:)" }, { "from": "human", "value": "jQuery(document).ready(function() {\n \n jQuery('.kitabu-datetime-field').datetimepicker();\n})\n" }, { "from": "gpt", "value": "jQuery(document).ready(function() {\n...
javascript
chosen
[ { "from": "system", "value": "Add comparator to sort listings in reverse chronological order.\n" }, { "from": "human", "value": "define(['jquery', 'underscore', 'backbone', 'model_want', 'utils'], function($, _, Backbone, Models, Utils) {\n\tModels.Wants = Backbone.Collection.extend({\n\t\tmodel...
javascript
chosen
[ { "from": "system", "value": "Fix \"clear completed\" button to actually work\n\nAs it stands, the \"clear completed\" button fails to work as intended. This is because the array is mutated during the traversal. An item which immediately follows a completed item will not be checked. The fix is to travers...
javascript
chosen
[ { "from": "system", "value": "Revert \"Add newline to end of file.\"\n\nThis reverts commit 97800b7c2e7b7b54213d82bf4c80a23c2ca6d972.\n" }, { "from": "human", "value": "import delegate from 'delegate';\nimport {stageChangeToAnnotation, isEditable, editAnnotationHandle, setFocus, stagePreviousCon...
javascript
chosen
[ { "from": "system", "value": "Include API middleware in the store\n\nI missed this step when I added redux-api-middleware to the project in\n#24.\n" }, { "from": "human", "value": "import { applyMiddleware, compose, createStore } from 'redux'\nimport { createHistory } from 'history'\nimport { sy...
javascript
chosen
[ { "from": "system", "value": "Improve the error messaging for using the wrong CLI script.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconsole.error(\"The CLI has been moved into the package `babel-cli`. See http://babeljs.io/docs/usage/cli/\");\nprocess.exit(1);\n" }, { "fr...
javascript
chosen
[ { "from": "system", "value": "Use angular-ui keypress handling for aliases\n" }, { "from": "human", "value": "// Globals\nvar angular = angular;\nvar nOrg = nOrg;\nangular.module('nOrg', ['ui.bootstrap', 'ui.keypress'])\n\n .controller('NOrgCtrl', function NOrgCtrl($scope, $http, $log) {\n $...
javascript
chosen
[ { "from": "system", "value": "Fix for intel routing changes" }, { "from": "human", "value": "// ==UserScript==\n// @id iitc-plugin-drawtools-sync@hansolo669\n// @name IITC plugin: drawtools sync\n// @category Tweaks\n// @version 0.1.0\n// @namespace https:...
javascript
chosen