conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Clean directory contents without removing the directory\n" }, { "from": "human", "value": "var\n path = require(\"path\");\n\nvar\n gulp = require(\"gulp\"),\n del = require(\"del\");\n\nvar\n config = require(\"../../project.config\");\n\ngulp.task(\"frontend-c...
javascript
chosen
[ { "from": "system", "value": "Add null guard to isPromise\n" }, { "from": "human", "value": "/**\n Utility Functions\n @description a collection of utility functions, aka junk drawer\n @exports {function} isCacheableRequest\n**/\n\n/**\n @name isCacheableRequest\n @desc determines if the re...
javascript
chosen
[ { "from": "system", "value": "Add debugContext action for wit.ai\n" }, { "from": "human", "value": "'use strict';\n\nconst Wit = require('node-wit').Wit;\nconst myActions = require('./my-wit-actions');\n\n/**\n * Handles wit.ai integration\n * @param event\n */\nconst init = event => new Promise...
javascript
chosen
[ { "from": "system", "value": "Change 'Subscribed' button text to 'Unsubscribe'\n" }, { "from": "human", "value": "var nest = require('depnest')\nvar { h, when, send } = require('mutant')\n\nexports.gives = nest('channel.html.subscribeToggle')\nexports.needs = nest({\n 'intl.sync.i18n': 'first',...
javascript
chosen
[ { "from": "system", "value": "Update generator tests for travis-cli\n" }, { "from": "human", "value": "/*global describe, beforeEach, it*/\n'use strict';\n\nvar path = require('path');\nvar helpers = require('yeoman-generator').test;\n\n\ndescribe('digitaria generator', function () {\n bef...
javascript
chosen
[ { "from": "system", "value": "Add Marketing section in Storybook\n" }, { "from": "human", "value": "export const INTRODUCTION = '1. Introduction';\nexport const PRIMITIVES = '2. Primitives';\nexport const FOUNDATION = '3. Foundation';\nexport const LOW_LEVEL_BLOCKS = '4. Low level blocks';\nexpo...
javascript
chosen
[ { "from": "system", "value": "Fix a problem where scrolling wouldn't work for screen reader users.\n" }, { "from": "human", "value": "/*!\n * Start Bootstrap - Agency Bootstrap Theme (http://startbootstrap.com)\n * Code licensed under the Apache License v2.0.\n * For details, see http://www.apac...
javascript
chosen
[ { "from": "system", "value": "Drop unnecessary wrapper element in time-machine-links\n" }, { "from": "human", "value": "import select from 'select-dom';\nimport {h} from 'dom-chef';\n\nimport * as icons from '../libs/icons';\nimport {getRepoURL} from '../libs/page-detect';\n\nexport default asyn...
javascript
chosen
[ { "from": "system", "value": "Move slice iterator helper out of primary call\n\nAvoids overhead of instantiating the helper on each call to the slice to array helper." }, { "from": "human", "value": "(function (arr, i) {\n // Broken out into a separate function to avoid deoptimizations due to t...
javascript
chosen
[ { "from": "system", "value": "Use this as a globalObject in webpack\n" }, { "from": "human", "value": "const path = require('path');\n\nmodule.exports = {\n entry: {\n main: './src/js/index.js',\n },\n output: {\n path: path.resolve(__dirname, './lib'),\n filename: 'ReactWeather.js',...
javascript
chosen
[ { "from": "system", "value": "Add navigation service to the plugin sdk\n" }, { "from": "human", "value": "import DCOSStore from './stores/DCOSStore';\nimport ResourceTableUtil from './utils/ResourceTableUtil';\nimport RoutingService from './routing';\n\nmodule.exports = {\n DCOSStore,\n Resour...
javascript
chosen
[ { "from": "system", "value": "Fix bug about not displaying injected prestations\n\nIn previous implem, if a prestation was injected in one test, it would never be displayed in other tests\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nvar periods = require('./periods');\nvar PR...
javascript
chosen
[ { "from": "system", "value": "Sort lifetime chart data by date of first run\n" }, { "from": "human", "value": "var genericLoader = require('./generic_report_loader');\n\nvar AGGREGATION_STEPS = [\n { $project: { instanceId: 1, date: 1, active: 1, _id: 0 } },\n { $group: { _id: \"$instanceId\",...
javascript
chosen
[ { "from": "system", "value": "TIdy up main script file and add comments.\n" }, { "from": "human", "value": "var EventEmitter = require('events').EventEmitter;\ntry {\n var midi = require('./build/Release/midi_addon');\n} catch(e) {\n try {\n var midi = require('./build/default/midi_...
javascript
chosen
[ { "from": "system", "value": "Extend from image instead of sprite\n" }, { "from": "human", "value": "import Phaser from 'phaser';\n\nimport { tile, nextTile, alignToGrid, pixelToTile } from '../../tiles';\nimport { clone } from '../../utils';\n\nimport tween from './tween';\n\nexport default cla...
javascript
chosen
[ { "from": "system", "value": "Define vars TOP_LEFT & WIDTH\n\nTOP_LEFT = the location of the top-left node of the graph\nWIDTH = the width of the graph\n" }, { "from": "human", "value": "/* Helper function for creating point objects\n * \n * Each point has fields x & y hodling coordinates\n */\n...
javascript
chosen
[ { "from": "system", "value": "Implement the font size selector.\n" }, { "from": "human", "value": "\n( function( $, d, undefined )\n{\n d._ = window.console.debug.bind( window.console );\n \n var m = new d.Manager();\n \n m.initialize( function()\n {\n var v = new d.View...
javascript
chosen
[ { "from": "system", "value": "Remove es5 option to make travis happy\n" }, { "from": "human", "value": "/*jshint es5:true */\ndefine(function (require, exports, module) {\n var playlist = require(\"text!../playlist.json\");\n // TODO: we need wraparound for the case that we run out of tracks\n...
javascript
chosen
[ { "from": "system", "value": "Add alternative to browser opening on headless servers\n" }, { "from": "human", "value": "module.exports = function () {\n var browser = require('openurl');\n var config = require('./config');\n var REDIRECT_URI = 'https://rogeriopvl.github.com/downstagram'...
javascript
chosen
[ { "from": "system", "value": "Check for state presence as well\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport Channel from 'jschannel';\n\nconst CHANNEL_NOT_READY = 'CHANNEL_NOT_READY';\n\nclass Seed extends Component {\n\n componentWillUnmount() {\n thi...
javascript
chosen
[ { "from": "system", "value": "Test correct script elements are appended to body\n" }, { "from": "human", "value": "describe('googleGrecaptcha provider', function (){\n beforeEach(module('noCAPTCHA'));\n\n var googleGrecaptcha;\n\n beforeEach(inject(function (_googleGrecaptcha_){\n googleGr...
javascript
chosen
[ { "from": "system", "value": "Fix crash when no project opened\n" }, { "from": "human", "value": "'use babel';\n\nconst path = require('path');\nconst fs = require('fs');\n\n/**\n * Gets first root folder opened in Atom\n *\n * @todo Support multiple root folders etc.\n */\nexports.getRootFolder...
javascript
chosen
[ { "from": "system", "value": "Switch to _name for MiniMongo.Collection name to mimick production, store indexes created\n" }, { "from": "human", "value": "\n\nexport const MiniMongo = {}\n\nif (global.Mongo) {\n MiniMongo.Collection = class MiniMongoCollection extends global.Mongo.Collection {\...
javascript
chosen
[ { "from": "system", "value": "Add basics to get last results\n" }, { "from": "human", "value": "'use strict';\n\nvar items = require('../data/items');\nvar express = require('express');\nvar router = express.Router();\n\nvar data = {\n title: 'Football Peek - The quickest access to football r...
javascript
chosen
[ { "from": "system", "value": "DE33083: Insert iframe-resizer content window js script instead of requiring\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(resizerOptions) {\n\tfunction resizer(client) {\n\t\twindow.iFrameResizer = {\n\t\t\ttargetOrigin: client._targ...
javascript
chosen
[ { "from": "system", "value": "Hide msg when no random market\n" }, { "from": "human", "value": "// temporary script to show message about Random renamed to Volatile on trading page\n\npjax_config_page('trading', function(){\n return {\n onLoad: function() {\n var tempMsgKey ...
javascript
chosen
[ { "from": "system", "value": "Raise error when plugin is not configured\n" }, { "from": "human", "value": "'use strict';\n\nconst async = require('async');\nconst _ = require('lodash');\n\nmodule.exports = function(env, callback) {\n const environments = env.config.environments || {};\n const ...
javascript
chosen
[ { "from": "system", "value": "[DAEF-146] Add linux support for logger\n" }, { "from": "human", "value": "import path from 'path';\n\nexport default (platform, env, appName) => {\n switch (platform) {\n case 'darwin': {\n return path.join(env['HOME'], 'Library', 'Application Support', ap...
javascript
chosen
[ { "from": "system", "value": "Fix base theme homepage link\n" }, { "from": "human", "value": "import React, { PropTypes } from \"react\"\nimport { Link } from \"phenomic\"\nimport Svg from \"react-svg-inline\"\n\nimport twitterSvg from \"../icons/iconmonstr-twitter-1.svg\"\nimport gitHubSvg from...
javascript
chosen
[ { "from": "system", "value": "Fix static directory path in server\n" }, { "from": "human", "value": "/**\n * index.js - delish\n *\n * Licened under MIT license.\n * Copyright (C) 2017 Karim Alibhai.\n */\n\nconst path = require('path')\n , express = require('express')\n , app = express()\...
javascript
chosen
[ { "from": "system", "value": "Use vm.runInThisContext for executing the template" }, { "from": "human", "value": "var parser = require(__dirname+\"/../lib/parser.js\").parser.parse;\nvar compiler = require(__dirname+\"/../lib/compiler.js\").compiler;\nvar _ = require(\"./vendor/underscore\");\...
javascript
chosen
[ { "from": "system", "value": "Use protocols to parse the protocols\n" }, { "from": "human", "value": "/**\n * IsSsh\n * Checks if an input value is a ssh url or not.\n *\n * @name IsSsh\n * @function\n * @param {String} input The input url.\n * @return {Boolean} `true` if the input is a ssh url,...
javascript
chosen
[ { "from": "system", "value": "Remove default value for createSleepPromise options\n" }, { "from": "human", "value": "// Store a reference to the global setTimeout,\n// in case it gets replaced (e.g. sinon.useFakeTimers())\nconst cachedSetTimeout = setTimeout;\n\nfunction createSleepPromise(timeo...
javascript
chosen
[ { "from": "system", "value": "Remove unused functionality from isOn detector.\n" }, { "from": "human", "value": "// This module exists to help determine the\n// status of a network device / service.\n\n'use strict';\n\nfunction isOn() {\n\n // This function is designed to return true if all\n...
javascript
chosen
[ { "from": "system", "value": "Add argument to generation to create doctype\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar builder = require('xmlbuilder');\n\nvar utils = require('./utils');\nvar generate = require('./generate');\nvar parse = require('./parse');\n\nfunction XM...
javascript
chosen
[ { "from": "system", "value": "Fix crash on start when documents doesn't exists\n" }, { "from": "human", "value": "var fs = require('fs');\n\nvar storage = [];\n\nmodule.exports = {\n init: (config, callback) => {\n var directories = fs.readdirSync('.');\n if (directories.indexOf(config.di...
javascript
chosen
[ { "from": "system", "value": "Support for Watchify. We hook onto the pipeline on every reset and a new through object gets created.\n" }, { "from": "human", "value": "/* jshint -W040 */\n'use strict';\n\nvar path = require('path'),\n through = require('through');\n\nmodule.exports = source...
javascript
chosen
[ { "from": "system", "value": "Use apply instead of call.\n" }, { "from": "human", "value": "// Dependencies\nvar wkeypress = require(\"./keypress\");\n\n/**\n * init\n *\n * @name init\n * @function\n * @return {undefined}\n */\nexports.init = function () {\n var conf = this._config;\n var...
javascript
chosen
[ { "from": "system", "value": "Use custom request and update to ES2015.\n" }, { "from": "human", "value": "/*global JSON */\n\n\"use strict\";\n\nvar request = require(\"request\");\n\nfunction rCall(command, args, callback, options) {\n var opts = options || {},\n url,\n method ...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix a crash on invalid request\n" }, { "from": "human", "value": "\n\n\"use strict\";\nvar\n CPP = new (require('childprocess-promise')),\n RedisProto = require('redis-proto'),\n SupportedEvents = null;\n\nclass Worker{\n constructor(Socket){\n this.Soc...
javascript
chosen
[ { "from": "system", "value": "Improve error message and use correct status\n" }, { "from": "human", "value": "var basicAuth = require('basic-auth');\n\n/**\n * Simple basic auth middleware for use with Express 4.x.\n *\n * Based on template found at: http://www.danielstjules.com/2014/08/03/basic...
javascript
chosen
[ { "from": "system", "value": "Add meta refresh in wrapper instead of vdom\n" }, { "from": "human", "value": "const h = require('virtual-dom/h');\n\nmodule.exports = function (data) {\n const {gameID, game} = data;\n return h('div', {className: 'room'}, [\n game.playing ? h('meta', {httpEqui...
javascript
chosen
[ { "from": "system", "value": "Add utility to get app name based on package.json\n" }, { "from": "human", "value": "/**\n * Receives a camel or pascal cased string, hyphenates it and makes it lowercase.\n * E.g. myString -> my-string, MyString -> my-string\n * @param {string} str The string to...
javascript
chosen
[ { "from": "system", "value": "Allow init DB via env variable\n" }, { "from": "human", "value": "'use strict';\n\n// Production specific configuration\n// ==================================\nvar production = {\n server: {\n staticDir : '/../../dist'\n },\n\n // MongoDB connection ...
javascript
chosen
[ { "from": "system", "value": "Copy index.js on package generation" }, { "from": "human", "value": "var childProcess = require('child_process'),\n fs = require('fs'),\n path = require('path'),\n dirname = path.dirname;\n\nmodule.exports = {\n currentBranch: function(path, callback) {\...
javascript
chosen
[ { "from": "system", "value": "Add ability to bind with FileUpload view\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.TextField.extend({\n type: 'file',\n attributeBindings: ['name'],\n classNames: ['hidden'],\n\n change: function(evt) {\n var input ...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary PropTypes from PageSignUp\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport withRoot from '../utils/withRoot';\nimport Head from 'next/head';\nimport OnlyFormFrame from '../components/OnlyFo...
javascript
chosen
[ { "from": "system", "value": "Make browserAction link to /messages\n" }, { "from": "human", "value": "let username = \"\"\nconst init = () => {\n console.log(\"Starting...\");\n\n chrome.alarms.create(\"checkmessages\", {\n periodInMinutes: 1\n })\n\n console.log(\"Alarm created!\");\n\n ...
javascript
chosen
[ { "from": "system", "value": "Change \"best\" to \"the best\"\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = defineRules;\n\nvar competitivePhrases = [\n 'best', 'compete', 'competition', 'competitive', 'cutting edge', 'fail', 'forefront',\n 'superstar', 'top', 'win'\...
javascript
chosen
[ { "from": "system", "value": "Add test code for mercury switch\n" }, { "from": "human", "value": "const express = require('express');\nconst app = express();\nconst gpio = require('wiring-pi');\nconst socket = require('express-ws')(app);\n\n// setup pi connection\ngpio.wiringPiSetup();\ngpio.pin...
javascript
chosen
[ { "from": "system", "value": "Add a basic test to show mutation can be done\n" }, { "from": "human", "value": "import { test, module } from 'qunit';\nimport ModelDouble from '../helpers/model-double';\nimport StoreDouble from '../helpers/store-double';\nimport Compiler from 'graphql-adapter/comp...
javascript
chosen
[ { "from": "system", "value": "Update Array.removeItem to provide actionable return values.\n" }, { "from": "human", "value": "// helper.js\n//\n// a collection of helper and convenience functions for PickSix\n\n(function() {\n\n /** Array Extensions **/\n\n // Array Remove - By John Resig (MIT...
javascript
chosen
[ { "from": "system", "value": "Convert sketch to instance mode\n" }, { "from": "human", "value": "var socket;\n\nfunction setup() {\n socketSetup(socket);\n createCanvas(windowWidth, windowHeight);\n}\n\nfunction draw() {\n background(0);\n fill(0,0,220);\n noStroke();\n ellipse(windowWidth...
javascript
chosen
[ { "from": "system", "value": "Add body headings to the Example site component\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOMServer from 'react-dom/server'\nimport Prism from 'prismjs'\nimport PrismCode from 'react-prism'\nimport pretty from 'pretty'\nimport 'prismj...
javascript
chosen
[ { "from": "system", "value": "Change of port for heroku\n" }, { "from": "human", "value": "var connect = require('connect');\nvar http = require('http');\n\nvar url = require('url');\nvar proxy = require('proxy-middleware');\n\nvar app = connect()\n .use(connect.logger('dev'))\n .use(connect.s...
javascript
chosen
[ { "from": "system", "value": "Allow only non falsy header values in toObject method\n" }, { "from": "human", "value": "\nfunction Headers (headers) {\n for (var key in headers) {\n this[key] = headers[key]\n }\n}\n\nHeaders.prototype.get = function (header) {\n return this._value(header)\n...
javascript
chosen
[ { "from": "system", "value": "Add drag and drop to main window - rather than just sub-windows\n" }, { "from": "human", "value": "function allowDrop(panel) {\n var holder = editors[panel].win;\n\n if (typeof window.FileReader !== 'undefined') {\n holder.ondragover = function () { \n ret...
javascript
chosen
[ { "from": "system", "value": "Use the Accept-Encoding header for the cache key" }, { "from": "human", "value": "var SyncCache = require('active-cache/sync');\nvar filesizeParser = require('filesize-parser');\n\nfunction key(req) {\n\treturn req.z+','+req.x+','+req.y+','+req.layer+','+req.filenam...
javascript
chosen
[ { "from": "system", "value": "Backup and restore the entire require cache\n" }, { "from": "human", "value": "\"use strict\";\nvar path = require(\"path\")\n\nmodule.exports = function (toLoad, mocks) {\n // Inject all of our mocks\n Object.keys(mocks).forEach(function(name){\n var path = re...
javascript
chosen
[ { "from": "system", "value": "Update vector layer name to wikidata\n" }, { "from": "human", "value": "mapboxgl.accessToken = 'pk.eyJ1IjoicGxhbmVtYWQiLCJhIjoiY2l2dzVxbzA3MDAwNDJzbDUzMzVzbXc5dSJ9.WZ4_UtVvuVmOw4ofNMkiJw';\nvar map = new mapboxgl.Map({\n container: 'map',\n style: 'mapbox://st...
javascript
chosen
[ { "from": "system", "value": "Use this.ui.write instead of console.log.\n" }, { "from": "human", "value": "/* eslint-env node */\n\n'use strict';\nvar path = require('path');\nvar process = require('process');\n\nlet TsPreprocessor;\ntry {\n TsPreprocessor = require('./lib/typescript-prepr...
javascript
chosen
[ { "from": "system", "value": "Set input file name and fix indent\n" }, { "from": "human", "value": "var loaderUtils = require('loader-utils');\nvar autoprefixer = require('autoprefixer-core');\n\nmodule.exports = function (source) {\n if (this.cacheable) {\n this.cacheable();\n }\n\n var p...
javascript
chosen
[ { "from": "system", "value": "Add a export default to the file that gets required by node\n\n - Maintains compatibility with direct require('i18next') for plain EcmaScript\n - Adds support for a default import, which fixes the problem with the TypeScript types currently misrepresenting the actual code in a ...
javascript
chosen
[ { "from": "system", "value": "Use args for ready state\n" }, { "from": "human", "value": "module.exports = Ready;\n\nfunction Ready() {\n var ready = false;\n var listeners = [];\n var args;\n\n onReady.emit = onReady;\n\n return onReady;\n\n function onReady(callback) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add CORS proxy\nClean code\n" }, { "from": "human", "value": "var request = require('request');\nvar express = require('express');\nvar app = express();\nvar bodyParser = require('body-parser');\nvar querystring = require('querystring');\n\nvar port...
javascript
chosen
[ { "from": "system", "value": "refactor: Add proper default handling for uninitialized err.messages\n" }, { "from": "human", "value": "\"use strict\"\n\nconst express = require('express');\nconst HTTPStatus = require('http-status-codes');\n\nvar scraper = require('./app/routes/scraper');\n\nconst...
javascript
chosen
[ { "from": "system", "value": "Change global vars to CAPS\n" }, { "from": "human", "value": "var page = new WebPage();\r\nvar url = '';\r\nvar retryCount = 100;\r\n\r\n// TODO - Calculate url based on current date\r\nurl = 'https://offthegrid.com/event/the-lot/2017-9-20-11am';\r\n\r\npage.open(ur...
javascript
chosen
[ { "from": "system", "value": "Add components to export and alphebetize\n" }, { "from": "human", "value": "var Button = require('./dist/components/Button.js').default;\nvar Title = require('./dist/components/Title.js').default;\nvar Divider = require('./dist/components/...
javascript
chosen
[ { "from": "system", "value": "Rewrite Folsom to be a searchable cache\n" }, { "from": "human", "value": "// folsom.js\n// version : 0.0.1\n// author : Tim Hudson\n// license : MIT\n\n(function() {\n\n\tvar cache = {};\n\n\tfunction folsom(key, value) {\n\t\tif (value === undefined) return cache[...
javascript
chosen
[ { "from": "system", "value": "Update tests with more files." }, { "from": "human", "value": "/*global describe, beforeEach, it*/\n'use strict';\n\nvar path = require('path');\nvar helpers = require('yeoman-generator').test;\n\n\ndescribe('starttter generator', function () {\n beforeEach(func...
javascript
chosen
[ { "from": "system", "value": "Return some actionNames for hotkeys\n\nThis is a temporary addition to help me test STRPCORE-2. I will remove\nor replace this before the next release. (But at worst it does no\nharm.)\n" }, { "from": "human", "value": "// We have to remove node_modules/react to avo...
javascript
chosen
[ { "from": "system", "value": "Add support for plain strings\n" }, { "from": "human", "value": "'use strict';\n\nvar setPrototypeOf = require('es5-ext/object/set-prototype-of')\n , d = require('d')\n , SiteTree = require('site-tree')\n\n , defineProperty = Object.definePrope...
javascript
chosen
[ { "from": "system", "value": "Use GitBook 3 page.content instead of deprecated page.sections\n" }, { "from": "human", "value": "'use strict';\nvar cheerio = require('cheerio');\nvar _ = require('underscore');\nvar multiline = require('multiline');\n\nvar template = _.template(multiline(function(...
javascript
chosen
[ { "from": "system", "value": "Support class names conflict with function properties\n\nPreviously if we have a css class named `.name` or `.length`, the `css[style] = locals[style]` will fail to override `Function.name` or `Function.length` property since they are not writable, however we can override them ...
javascript
chosen
[ { "from": "system", "value": "Clean up main file a bit\n" }, { "from": "human", "value": "'use strict';\n\nconst app = require('app'),\n BrowserWindow = require('browser-window'),\n path = require('path'),\n window = require('./scripts/app-window');\n\n// Various tasks to do befor...
javascript
chosen
[ { "from": "system", "value": "Change bbox values in example\n" }, { "from": "human", "value": "var polygon = require('turf-polygon');\n\n/**\n* Takes a bbox and returns the equivalent polygon feature.\n*\n* @module turf/bbox-polygon\n* @param {Array} bbox - Array of bounding box coordinates in t...
javascript
chosen
[ { "from": "system", "value": "Fix `null` being returned for empty strings\n" }, { "from": "human", "value": "module.exports = function(value) {\n var caps = 0;\n\n var index = -1;\n var length = value.length;\n while (++index < length) {\n var chr = value[index];\n if (chr.toLowerCase(...
javascript
chosen
[ { "from": "system", "value": "Trim even if there's no latest doc\n" }, { "from": "human", "value": "var README_MAXLEN = 64 * 1024\n\nmodule.exports = readmeTrim\n\nfunction readmeTrim(doc) {\n var changed = false\n var readme = doc.readme || ''\n var readmeFilename = doc.readmeFilename || ''\...
javascript
chosen
[ { "from": "system", "value": "Add support for testing in the browser\n" }, { "from": "human", "value": "'use strict';\n\nfunction ChangesStub() {\n var self = this;\n var changes = {};\n\n self.addInitialChange = function(name, value) {\n return change(name, value, undefined, true);\n };\...
javascript
chosen
[ { "from": "system", "value": "Remove version, clone and extend properties from Q.\n" }, { "from": "human", "value": "'use strict';\n\n// Module dependencies\nvar clone = require('clone'),\n extend = require('extend'),\n inherits = require('inherits'),\n EventEmitter = require('EventEmit...
javascript
chosen
[ { "from": "system", "value": "Use routeCount rather than routes (TDD)\n" }, { "from": "human", "value": "module.exports = (function() {\n function chimneypot(opts) {\n if (!opts || !isOptionsValid(opts)) {\n throw new Error(\"Required options: port, path, secret\");\n }\n\n this.o...
javascript
chosen
[ { "from": "system", "value": "Add constructor to NewError instances\n" }, { "from": "human", "value": "function ErrorMaker(name, ParentError) {\n var NewError = function NewError(message) {\n if (!(this instanceof NewError))\n return new NewError(message)\n\n // get stack\n try {\...
javascript
chosen
[ { "from": "system", "value": "Use this.project.addonPackages to resolve head of addon path\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar path = require('path');\nvar mergeTrees = require('broccoli-merge-trees');\n\nmodule.exports = {\n name: 'lodash',\n\n tre...
javascript
chosen
[ { "from": "system", "value": "Set to exports object rather than xml property\n" }, { "from": "human", "value": "\"use strict\";\n\nvar xml2js = require('xml2js');\nvar xmlParser = new xml2js.Parser({explicitArray: false});\n\nexports.xml = function (parser, callback) {\n return function xmlHt...
javascript
chosen
[ { "from": "system", "value": "Update to beautify HTML output from Jade\n" }, { "from": "human", "value": "// set up ======================================================================\n// get all the tools we need\nvar express = require('express');\nvar app = express();\nvar port = ...
javascript
chosen
[ { "from": "system", "value": "Check for default values in dropdowns\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport FormGroup from '../forms/FormGroup'\nimport Select from '../forms/Select'\n\nconst SelectStackOption = ({ label, name, valu...
javascript
chosen
[ { "from": "system", "value": "Apply sorting only if order by is setup\n" }, { "from": "human", "value": "import AppError from '../infrastructure/error';\nimport {orderBy} from '../services/utility';\nimport {key as getKey, direction as getDirection} from '../sort/sort.service';\nimport {find} fr...
javascript
chosen
[ { "from": "system", "value": "Add sending start and context from config\n" }, { "from": "human", "value": "var createJob = require('./createJob');\n\nmodule.exports = function (sails) {\n return {\n jobs: {},\n\n defaults: {cron: {}},\n\n initialize: function (cb) {\n var config =...
javascript
chosen
[ { "from": "system", "value": "Load script using current protocol\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar integration = require('analytics.js-integration');\nvar when = require('when');\n\n/**\n * Expose `Parsely` integration.\n */\n\nvar Parse...
javascript
chosen
[ { "from": "system", "value": "Save user in req after authentication\n" }, { "from": "human", "value": "const jwt = require('jsonwebtoken');\nconst User = require('mongoose').model('User');\n\n/**\n * The Auth Checker middleware function.\n */\nmodule.exports = (req, res, next) => {\n // Author...
javascript
chosen
[ { "from": "system", "value": "Comment out old tree js files.\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/javascripts,...
javascript
chosen
[ { "from": "system", "value": "Improve water all confirmation conditionals\n" }, { "from": "human", "value": "// Place all the behaviors and hooks related to the matching controller here.\n// All this logic will automatically be available in application.js.\n\n$(document).on(\"ajax:success\", \"f...
javascript
chosen
[ { "from": "system", "value": "Convert 'Go Back' from clickable span to button\n" }, { "from": "human", "value": "import React, {PropTypes} from 'react';\nimport {browserHistory} from 'react-router';\nimport {HOME_PAGE_URI} from '../../utils/constants';\n\nclass Footer extends React.Component {\n...
javascript
chosen
[ { "from": "system", "value": "Fix addColorizer and add isColorizer in gS\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.core').service('globalSettings', [\n 'configurator',\n 'plugins',\n function(configurator, plugins) {\n var self = this;\n\n // Need t...
javascript
chosen
[ { "from": "system", "value": "Make column width responsive to device\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { connect } from 'react-redux'\nimport { Grid } from 'semantic-ui-react'\n\nimport './Column.css'\nimport Company from '../../components/Compan...
javascript
chosen
[ { "from": "system", "value": "Use the $PORT so we can run in heroku\n" }, { "from": "human", "value": "exports.hashtagXchange = function() {\n var restify = require('restify');\n\n\tfunction respond(req, res, next) {\n\t res.send('hello ' + req.params.name);\n\t next();\n\t}\n\n\tvar server =...
javascript
chosen
[ { "from": "system", "value": "Add xbox not found message on LinuxConnector constructor\n" }, { "from": "human", "value": "var joystick = require('joystick'),\n chalk = require('chalk'),\n Stick = require('./stick');\n\n/**\n * Event \"xboxButton\" only on linux\n*/\nfunction LinuxConnector(opt...
javascript
chosen
[ { "from": "system", "value": "Add get function - retrieving domain information\n" }, { "from": "human", "value": "var domains = function (tools) {\n return {\n\n create: function (domain, ip_address, callback) {\n var body = {\n name: domain,\n ip_address: ip_address\n ...
javascript
chosen
[ { "from": "system", "value": "Correct editTotalQuantity action creator type string\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\n/**\n * Actions for use with a data table reducer\n */\n\nexport const editTotalQuantity = (value, rowKey,...
javascript
chosen
[ { "from": "system", "value": "Revert \"JSHTTP: Remove extra comments\"\n\nThis reverts commit 4a696d70a19f9d03b5a3b01159fc4abc3d654718.\n" }, { "from": "human", "value": "module.exports = function(context, req) {\n context.log('JS_ HTTP trigger function processed a request. RequestUri=%s', re...
javascript
chosen