conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add command to flush out the database\n"
},
{
"from": "human",
"value": "var restify = require('restify');\n\nvar messenger = require('./lib/messenger');\nvar session = require('./lib/session');\n\nvar server = restify.createServer();\n\nserver.use(restify.queryPars... | javascript | chosen |
[
{
"from": "system",
"value": "Switch bookkeeping to record line offsets instead of line lengths.\n\nThis should be simpler and more efficient.\n"
},
{
"from": "human",
"value": "type SourceLocation = {\n line: number,\n column: number\n};\n\nexport default class LinesAndColumns {\n constructo... | javascript | chosen |
[
{
"from": "system",
"value": "Handle errors emitted from PBKDF2\n"
},
{
"from": "human",
"value": "var pbkdf2 = require('crypto').pbkdf2\n , randomBytes = require('crypto').randomBytes;\n\nexports.verify = function(password, hash, callback) {\n hashParts = hash.split('$');\n var iterations = ... | javascript | chosen |
[
{
"from": "system",
"value": "Allow all cross-origin requests to /sayhello\n"
},
{
"from": "human",
"value": "var express = require('express');\nvar app = express();\n\napp.get('/', function(req, res){\n res.send('hello world');\n});\n\napp.get('/sayhello', function (req, res){\n res.setHeader... | javascript | chosen |
[
{
"from": "system",
"value": "Use es6 syntax in node\n"
},
{
"from": "human",
"value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-power-select',\n\n included: function(appOrAddon) {\n var app = appOrAddon.app || appOrAddon;\n if (!app.__emberPowerSelectI... | javascript | chosen |
[
{
"from": "system",
"value": "Use xsel instead of xclip\n\nPrevents indefinite hang on linux"
},
{
"from": "human",
"value": "/*!\n * to-clipboard <https://github.com/jonschlinkert/to-clipboard>\n *\n * Copyright (c) 2015, Jon Schlinkert.\n * Licensed under the MIT License.\n */\n\n'use strict';... | javascript | chosen |
[
{
"from": "system",
"value": "Handle undefined destination in merge, target c for immutability\n"
},
{
"from": "human",
"value": "var package = require('package')\nvar join = require('path').join\n\nfunction merge (a, b) {\n for(var k in b) {\n a[k] = b[k]\n }\n return a\n}\n\nmodule.expor... | javascript | chosen |
[
{
"from": "system",
"value": "Allow files to be exlcuded\n"
},
{
"from": "human",
"value": "/*jslint node:true */\nvar RequireAll = (function () {\n 'use strict';\n \n var fs = require('fs'),\n\n excludeDirectory = function (excludeDirs, dirname) {\n return excludeDirs... | javascript | chosen |
[
{
"from": "system",
"value": "Add test for fpga main db\n"
},
{
"from": "human",
"value": "var assert = require('assert');\ndescribe('Angularjs', function() {\n describe('test', function() {\n it('always true', function() {\n\tassert(1)\n });\n });\n});\n"
},
{
"from": "gpt",
... | javascript | chosen |
[
{
"from": "system",
"value": "Fix modifying of constant functions\n"
},
{
"from": "human",
"value": "'use strict';\n\nmodule.exports = toMDAST;\n\nvar minify = require('rehype-minify-whitespace')();\nvar xtend = require('xtend');\nvar one = require('./one');\nvar handlers = require('./handlers')... | javascript | chosen |
[
{
"from": "system",
"value": "Fix when the url value contains parentheses"
},
{
"from": "human",
"value": "/*\n extract url or data-url from css\n - value - css value\n*/\nfunction urldata(value){\n if(!value){\n return;\n }\n var result = [];\n var urlCursor = value.indexOf(\"url\");\n... | javascript | chosen |
[
{
"from": "system",
"value": "Fix zero buffer issues for node 0.10.25\n"
},
{
"from": "human",
"value": "var dgram = require('dgram');\n\nconst PORT = 5050\nconst PING_PAYLOAD = \"dd00000a000000000000000400000002\"\nconst POWER_PAYLOAD = \"dd02001300000010\"\n\nmodule.exports = Xbox;\n\nfunction... | javascript | chosen |
[
{
"from": "system",
"value": "Add support for a single string destination\n"
},
{
"from": "human",
"value": "/* jshint node: true */\nvar PLUGIN_NAME = 'gulp-multi-dest';\nvar through = require('through2');\nvar gulp = require('gulp');\nvar async = require('async');\n\nmodule.exports = function(... | javascript | chosen |
[
{
"from": "system",
"value": "Fix issue with date format causing order creation to fail\n"
},
{
"from": "human",
"value": "'use strict';\n\napp.controller('CheckoutCtrl', function($scope, Basket, Order, AuthenticationService) {\n $scope.basket = Basket;\n $scope.currentUser = AuthenticationSer... | javascript | chosen |
[
{
"from": "system",
"value": "Move function metadata logic to setMetadata function\n"
},
{
"from": "human",
"value": "var Matcher = require('minimatch').Minimatch;\n\n/**\n * Sets the given metadata on the file object\n *\n * @param file {Object}\n * @param metadata {Object}\n * @private\n */\nf... | javascript | chosen |
[
{
"from": "system",
"value": " Add comment with jsdoc style\n"
},
{
"from": "human",
"value": "//Require Module\nvar log4js = require('log4js');\nvar logger = log4js.getLogger('Logging');\n\nfunction sendAliveMail (connection,opt,callback){\n\n logger.debug('Sending Alive Mail......');\n\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Check for null exception on getSearchQuery"
},
{
"from": "human",
"value": "// Backbone.Collection.search-ajax v0.2\n// by Joe Vu - joe.vu@homeslicesolutions.com\n// For all details and documentation:\n// https://github.com/homeslicesolutions/backbon... | javascript | chosen |
[
{
"from": "system",
"value": "Use sourcemaps from elixir config\n"
},
{
"from": "human",
"value": "var elixir = require('laravel-elixir');\nvar compile = require('./ingredients/commands/CompileCSS');\nvar _ = require('underscore');\n\nelixir.extend('compass', function (src, output, options) {\n\... | javascript | chosen |
[
{
"from": "system",
"value": "Add setHue and setSaturation methods\n"
},
{
"from": "human",
"value": "HueLight = function(bridge, id, params) {\n this.bridge = bridge;\n this.id = id;\n this.params = params;\n}\n\nHueLight.prototype = {\n\n updateState: function(key, val) {\n let state = ... | javascript | chosen |
[
{
"from": "system",
"value": "Test server boots on port 4000\n"
},
{
"from": "human",
"value": "const express = require('express');\nconst app = express();\nconst opn = require('opn')\n\nconst { execSync } = require('child_process')\n// Can't use __dirname while /spec is a symlink\nconst cwd = e... | javascript | chosen |
[
{
"from": "system",
"value": "Move inquirer choices into own const\n\n"
},
{
"from": "human",
"value": "var inquirer = require('inquirer');\n\ninquirer.prompt([\n {\n name: 'q1',\n message: 'Which author details would you like to use with this repository?',\n type: 'list'... | javascript | chosen |
[
{
"from": "system",
"value": "Fix points color and hover size\n"
},
{
"from": "human",
"value": "// Initial dot attributes\nfunction dot_init (selection, scales) {\n selection\n\t.style(\"fill\", \"rgb(31, 119, 180)\")\n .attr(\"class\", function(d,i) {\n\t return \"dot\"; \n ... | javascript | chosen |
[
{
"from": "system",
"value": "FIX calling loadJuno in place of handleKernel on kernel, session creation\n"
},
{
"from": "human",
"value": "function load_ipython_extension() {\n\n var extensionLoaded = false;\n\n function loadScript( host, name ) {\n var script = document.createElement( 'scr... | javascript | chosen |
[
{
"from": "system",
"value": "Fix mode naming in status bar\n\nThanks S.N. for spotting this.\n"
},
{
"from": "human",
"value": "function create_VIM_VIEW(environment, messager, context) {\n var executor = environment.executor;\n\n // ignores ids that listenTo returns (no need to remove listeni... | javascript | chosen |
[
{
"from": "system",
"value": "Send message to user with fixed id\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nvar shared = require(\"./shared.js\");\nvar UserPages = require(\"./UserPages.js\");\nvar fs = require(\"fs\");\nvar exec = require(\"sync-exec\");\nvar EC = protractor.Expected... | javascript | chosen |
[
{
"from": "system",
"value": "Remove onChange check. this is taken care of in getDefaultProps."
},
{
"from": "human",
"value": "'use strict';\n\nvar React = require('react');\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[... | javascript | chosen |
[
{
"from": "system",
"value": "Add support for formated text to /echo\n\nRuns unformat aka tomd before echoing to replace formatting\nwith markdown producing that formatting,\nwhich allows the bot to reproduce that formatting.\n"
},
{
"from": "human",
"value": "'use strict'\n\nexports.init = (bot... | javascript | chosen |
[
{
"from": "system",
"value": "Move stdout/stderr null warning out\n"
},
{
"from": "human",
"value": "'use strict'\nconst path = require('path')\nconst {spawnSync} = require('child_process')\nconst {\n env: {\n STANDARDJS_EXECUTABLE,\n STANDARDJS_ARGV,\n SKIP_CODE_STYLE_CHECKING\n }\n}... | javascript | chosen |
[
{
"from": "system",
"value": "Expand example to use done()\n"
},
{
"from": "human",
"value": "\nvar async = require('async');\nvar timetree = require('../');\nvar util = require('util');\n\nvar timer = timetree('example');\n\nreturn async.waterfall(\n [\n function(callback) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Change location of value assignment\n\n"
},
{
"from": "human",
"value": "const chalk = require('chalk')\nconst format = require('./lib/format')\nconst game = require('./lib/game')\nconst input = require('./lib/input')\nconst log = console.log\nconst output = require... | javascript | chosen |
[
{
"from": "system",
"value": "Replace \"24\" by \"0\" in timestrings\n\n"
},
{
"from": "human",
"value": "/* eslint-disable radix */\n// eslint-disable-next-line import/prefer-default-export\nexport const getTimeStringMinutes = (timeStr) => {\n const parts = timeStr.split(':');\n\n const h... | javascript | chosen |
[
{
"from": "system",
"value": "Replace usage of `formatMessage(findTranslationByKey` with `t`\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport ValidatorsMessages from 'ember-cp-validations/validators/messages';\n\nconst { Logger:logger } = Ember;\n\nexport default function() ... | javascript | chosen |
[
{
"from": "system",
"value": "Add access to native methods\n\n"
},
{
"from": "human",
"value": "var Core = require('./libs/core');\nvar Members = require('./libs/members');\nvar Topics = require('./libs/topics');\nvar Posts = require('./libs/posts');\n\nmodule.exports = Ipboard;\n\nfunction Ipbo... | javascript | chosen |
[
{
"from": "system",
"value": "Use final URL (i.e. URL after redirects) when storing cookies."
},
{
"from": "human",
"value": "var denodeify = require('es6-denodeify')(Promise)\nvar tough = require('tough-cookie')\n\nmodule.exports = function fetchCookieDecorator (fetch, jar) {\n fetch = fetch |... | javascript | chosen |
[
{
"from": "system",
"value": "feat: Add Content-Language header, always 'en'\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 app = express();\n\n/... | javascript | chosen |
[
{
"from": "system",
"value": "Fix typo \"this\" => \"self\"\n"
},
{
"from": "human",
"value": "// Requires\nvar Q = require('q');\nvar _ = require('underscore');\n\nvar qClass = require('qpatch').qClass;\n\n// Etcd client\nvar Etcd = qClass(require('node-etcd'), ['watcher']);\n\n\n// Since etcd ... | javascript | chosen |
[
{
"from": "system",
"value": "Switch to more robust remaining semantic.\n"
},
{
"from": "human",
"value": "var ByteBuffer = require('bytebuffer');\nvar ProtoBuf = require('protobufjs');\n\nvar path = require('path');\n\nvar ChunkData = \n ProtoBuf\n .loadProtoFile(path.join(__dirname, 'Chunk... | javascript | chosen |
[
{
"from": "system",
"value": "Add css file for katex fonts\n"
},
{
"from": "human",
"value": "var katex = require(\"katex\");\nvar cheerio = require(\"cheerio\");\n\nmodule.exports = {\n book: {\n assets: \"./book\",\n js: []\n },\n hooks: {\n page: function(page) {... | javascript | chosen |
[
{
"from": "system",
"value": "Remove lexer from the public API\n"
},
{
"from": "human",
"value": "import parser from \"./parser\";\n\nexport {default as Token} from \"./lexer/token\";\nexport {default as Node} from \"./lexer/node\";\n\nexport default {\n\tparse: parser\n};\n"
},
{
"from"... | javascript | chosen |
[
{
"from": "system",
"value": "Switch amazon-product-api to use promises\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar amazon = require('amazon-product-api');\nvar client = amazon.createClient({\n awsId: process.env.AWS_ID,\n awsSecret: process.env.AWS_SECRET,\n awsTag: process.env.A... | javascript | chosen |
[
{
"from": "system",
"value": "Remove references to items that have been pulled out into their own\nmodules.\n"
},
{
"from": "human",
"value": "var pkg = require(\"./package.json\");\n\nmodule.exports = {\n build: require(\"./lib/build\"),\n create: require(\"./lib/create\"),\n compiler: requi... | javascript | chosen |
[
{
"from": "system",
"value": "Add configuration option to exclude all CSS\n\nThis can be used together with PostCSS or other processors which support importing from node_modules to consume the unmangled CSS, which can be useful in modern environments.\n"
},
{
"from": "human",
"value": "'use stri... | javascript | chosen |
[
{
"from": "system",
"value": "Make data zoom match place zoom\n"
},
{
"from": "human",
"value": "import React, { PropTypes } from 'react'\nimport Map from '../home/map'\nimport LayerKey from './layer-key'\n\nconst PrimaryDataset = ({ dataset, lngLat }) => {\n if (!dataset) return null\n const ... | javascript | chosen |
[
{
"from": "system",
"value": "Check for view function in objects.\n"
},
{
"from": "human",
"value": "var solarflare = function (rays) {\n\tvar $element = document.createElement('div');\n\n\tif (Array.isArray(rays)) {\n\t\trays.forEach(function (e, i) {\n\t\t\tif (i === 0 && typeof e === 'string'... | javascript | chosen |
[
{
"from": "system",
"value": "Add jsonFilter in export for HTTP setup\n"
},
{
"from": "human",
"value": "import {\n cacheClient,\n jsonCodec\n} from '@scola/api';\n\nimport Server from './src/server';\n\nexport {\n Server,\n cacheClient,\n jsonCodec\n};\n"
},
{
"from": "gpt",
"v... | javascript | chosen |
[
{
"from": "system",
"value": "Fix path issues and this scoping issues.\n"
},
{
"from": "human",
"value": "const tmp = require('tmp');\nconst fs = require('fs');\n\nfunction isReactComponent(source = '') {\n return source.indexOf('(_react.Component)') > -1;\n}\n\nfunction WebpackAccessibilityPlu... | javascript | chosen |
[
{
"from": "system",
"value": "Use stderr.isTTY instead of stdout.isTTY\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar EventEmitter = require('events').EventEmitter;\nvar Console = require('./console');\n\nvar hostname = require('os').hostname();\nvar pid = process.pid;\n\nvar emitt... | javascript | chosen |
[
{
"from": "system",
"value": "Add map argument to PostCSSPlugin constructor\n\nAnd simplify the default options\n"
},
{
"from": "human",
"value": "var PostcssCompiler = require('broccoli-postcss');\nvar checker = require('ember-cli-version-checker');\n\nfunction PostCSSPlugin (plugins, options) ... | javascript | chosen |
[
{
"from": "system",
"value": "Print fallback warning to stderr rather than stdout"
},
{
"from": "human",
"value": "\ntry {\n module.exports = require('./build/Release/node_sleep.node');\n} catch (e) {\n console.log('sleep: using busy loop fallback');\n\n module.exports = {\n sleep: functio... | javascript | chosen |
[
{
"from": "system",
"value": "Fix jest error: undefined overwriteWith().\n\n"
},
{
"from": "human",
"value": "'use strict';\n\n/**\n * Export all prototypes.\n * (C) 2013 Alex Fernández.\n */\n\n// requires\nrequire('./lib/string.js');\nrequire('./lib/array.js');\nvar mathLib = require('./lib/ma... | javascript | chosen |
[
{
"from": "system",
"value": "Put fastboot guard into correct file\n"
},
{
"from": "human",
"value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-cli-nouislider',\n\n included: function(app) {\n this._super.included(app);\n\n app.import({\n developmen... | javascript | chosen |
[
{
"from": "system",
"value": "Use options.path instead of absoluteImagePath\n"
},
{
"from": "human",
"value": "// dependencies\nvar jipics = \"http://jipics.net/\"\n , Request = require(\"request\")\n , fs = require(\"fs\")\n ;\n\n/**\n * Upload method\n *\n * Arguments\n * @option... | javascript | chosen |
[
{
"from": "system",
"value": "Add common handler for run completion messages\n"
},
{
"from": "human",
"value": "\n/* jshint esnext: true, node: true */\n'use strict';\n\nvar rollbar = require('rollbar');\nvar log = require('loglevel');\n\nrollbar.init(process.env.ROLLBAR_TOKEN, {environment: pro... | javascript | chosen |
[
{
"from": "system",
"value": "refactor: Move package details to more function\n"
},
{
"from": "human",
"value": "const Assert = require('assert')\nconst Child = require('child_process')\nconst Fs = require('fs')\nconst Path = require('path')\n\nconst packagePath = Path.join(process.cwd(), 'packa... | javascript | chosen |
[
{
"from": "system",
"value": "Remove import of mousetrap global plugin\n"
},
{
"from": "human",
"value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-keyboard-shortcuts',\n\n included: function(app, parentAddon) {\n let target = (parentAddon || app);\n tar... | javascript | chosen |
[
{
"from": "system",
"value": "fix: Replace Mongoose promise support with another Q's\n"
},
{
"from": "human",
"value": "const express = require('express');\nconst helmet = require('helmet');\nconst winston = require('winston');\nconst bodyParser = require('body-parser');\nconst env = require('./... | javascript | chosen |
[
{
"from": "system",
"value": "Return statusCode 0 if request was aborted\n"
},
{
"from": "human",
"value": "var BufferList = require('bl');\nvar onFinished = require('on-finished');\n\nmodule.exports = function bufferResponse(res, cb) {\n\tvar write = res.write;\n\tvar end = res.end;\n\tvar buf ... | javascript | chosen |
[
{
"from": "system",
"value": "Make Alloy initialization work on blank and existing values\n"
},
{
"from": "human",
"value": "import React, {Component} from 'react'\n\nimport AlloyEditor from 'alloyeditor/dist/alloy-editor/alloy-editor-no-react'\nimport 'alloyeditor/dist/alloy-editor/assets/alloy... | javascript | chosen |
[
{
"from": "system",
"value": "Support for enter/tab key to add new property line.\n"
},
{
"from": "human",
"value": "var app = angular.module(\"EAG_Home\", [\"Controllers\"]);\n"
},
{
"from": "gpt",
"value": "var app = angular.module(\"EAG_Home\", [\"Controllers\"]);\n\napp.directive... | javascript | chosen |
[
{
"from": "system",
"value": "Fix not opening watchlist entries in browser\n"
},
{
"from": "human",
"value": "angular.module('proxtop').service('open', ['ipc', 'settings', '$state', function(ipc, settings, $state) {\n const self = this;\n ['Anime', 'Manga'].forEach(function(name) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add test for get skill by id\n"
},
{
"from": "human",
"value": "/* global describe, it, before */\n\nvar requirejs = require(\"requirejs\");\nvar assert = require(\"assert\");\nvar should = require(\"should\");\nvar jsdom = require('mocha-jsdom');\nvar skill = requi... | javascript | chosen |
[
{
"from": "system",
"value": "Add markers with mock data to the map on home page\n"
},
{
"from": "human",
"value": " \n google.maps.event.addDomListener(window, 'load', initialize);\n\n function initialize() {\n\t var myLatlng = new google.maps.LatLng(-25.363882,131.044922);\n\t var mapOpti... | javascript | chosen |
[
{
"from": "system",
"value": "Fix location of URL definition\n"
},
{
"from": "human",
"value": "\"use strict\";\nconst RequestResults = require(\"../constants/RequestResults\");\nconst Utils = require(\"../utils/Utils\");\n\nlet _token = null;\nlet _requester = null;\n\nmodule.exports = {\n\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add doc comments for HTML rules\n"
},
{
"from": "human",
"value": "// Rules from eslint-plugin-html\nmodule.exports = {\n \"plugins\": [\"html\"],\n \"settings\": {\n \"html\": {\n // \"html-extensions\": [],\n // \"xml-extensions\... | javascript | chosen |
[
{
"from": "system",
"value": "Address group recipient link issue\n"
},
{
"from": "human",
"value": "import extract from 'flarum/common/utils/extract';\nimport username from 'flarum/common/helpers/username';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/G... | javascript | chosen |
[
{
"from": "system",
"value": "Stop is not called \"move stop\". Woops.\n"
},
{
"from": "human",
"value": "\n\n/**\n * Load all external dependencies\n * We use var so it's global available : ) ( not let,const)\n */\nvar fs = require('fs');\nvar _ = require('lodash');\n\n\n/**\n * Load all i... | javascript | chosen |
[
{
"from": "system",
"value": "Add ping to keep connection alive\n"
},
{
"from": "human",
"value": "var fs = require('fs');\nvar path = require('path');\nvar xec = require('xbmc-event-client');\n\nvar keyboard = require('./lib/keyboard');\n\n\nvar kodikeys = function(opt) {\n\n var defaults = {\... | javascript | chosen |
[
{
"from": "system",
"value": "Return new date by default\n"
},
{
"from": "human",
"value": "'use strict'\n\nconst ExtDate = require('./src/date')\nconst Bitmask = require('./src/bitmask')\n\nconst { parse } = require('./src/parser')\n\nconst types = [\n 'Date', 'Year', 'Season', 'Interval', 'Se... | javascript | chosen |
[
{
"from": "system",
"value": "Refactor for changes in retext\n"
},
{
"from": "human",
"value": "'use strict';\n\n/**\n * Dependencies.\n */\n\nvar phonetics;\n\nphonetics = require('double-metaphone');\n\n/**\n * Define `doubleMetaphone`.\n */\n\nfunction doubleMetaphone() {}\n\n/**\n * Change h... | javascript | chosen |
[
{
"from": "system",
"value": "Fix lib file reference in main actionpack file\n"
},
{
"from": "human",
"value": "var actionpack = {\n Action: require('./lib/action'),\n Route: require('./lib/route')\n};\n\nmodule.exports = actionpack;"
},
{
"from": "gpt",
"value": "var actionpack = ... | javascript | chosen |
[
{
"from": "system",
"value": "Handle streams without a resume method\n\nCloses #9\n"
},
{
"from": "human",
"value": "'use strict'\n\nvar toArray = require('stream-to-array')\nvar Promise = require('bluebird')\n\nmodule.exports = streamToPromise\n\nfunction streamToPromise (stream) {\n if (strea... | javascript | chosen |
[
{
"from": "system",
"value": "Use Assets key as Manifest Key Instead\n"
},
{
"from": "human",
"value": "var path = require('path'),\n fs = require('fs');\n\nfunction AssetManifestPlugin(output, keyRoot) {\n this.output = output;\n this.keyRoot = keyRoot;\n}\n\nAssetManifestPlugin.prototype.... | javascript | chosen |
[
{
"from": "system",
"value": "Use https for license link.\n"
},
{
"from": "human",
"value": "/*!\n * docdown v0.3.0\n * Copyright 2011-2016 John-David Dalton <http://allyoucanleet.com/>\n * Available under MIT license <http://mths.be/mit>\n */\n'use strict';\n\nvar _ = require('lodash'),\n fs... | javascript | chosen |
[
{
"from": "system",
"value": "Use request library to hit the giphy api, passing serialized params object.\n"
},
{
"from": "human",
"value": "'use strict';\n\n/**\n * @description\n * A tool that downloads a given number of pug images to the directory where it is run.\n *\n * @example\n * node pu... | javascript | chosen |
[
{
"from": "system",
"value": "Fix unexpected var, use let or const instead"
},
{
"from": "human",
"value": "'use strict'\n\nconst markdownIt = require('markdown-it')\n\nexports.name = 'markdown-it'\nexports.outputFormat = 'html'\nexports.inputFormats = ['markdown-it', 'markdown', 'md']\n\nexport... | javascript | chosen |
[
{
"from": "system",
"value": "Make it work for node <= 5"
},
{
"from": "human",
"value": "var path = require('path');\n\nmodule.exports = class BowerResolvePlugin {\n constructor(options) {\n this.options = options;\n }\n\n apply(resolver) {\n resolver.plugin('existing-dir... | javascript | chosen |
[
{
"from": "system",
"value": "Handle case where package.json exists but not .dat\n"
},
{
"from": "human",
"value": "var path = require('path')\nvar meta = require(path.join(__dirname, 'lib', 'meta.js'))\n\nmodule.exports = Dat\n\n// new Dat(cb)\n// new Dat({foo: bar})\n// new Dat({foo: bar}, cb)... | javascript | chosen |
[
{
"from": "system",
"value": "Add sender method to library\n"
},
{
"from": "human",
"value": "var models = require('./lib/models');\nvar config = require('./config/gateway.config');\nvar dirty = require('dirty');\nvar db = dirty(config.datasource || './data/messages.db');\n\nvar storedMessages ... | javascript | chosen |
[
{
"from": "system",
"value": "Return full paths not file names"
},
{
"from": "human",
"value": "var fs = require(\"fs\")\n\nvar isJavascript = /\\.js$/\n\nmodule.exports = allFiles\n\nfunction allFiles(uri, regex) {\n var stat = fs.statSync(uri)\n regex = regex || isJavascript\n\n if (s... | javascript | chosen |
[
{
"from": "system",
"value": "Adjust port to use nconf\n"
},
{
"from": "human",
"value": "var bodyParser = require('body-parser')\nvar dataUriToBuffer = require('data-uri-to-buffer')\nvar express = require('express')\nvar app = express()\n\n/**\n * This is your custom transform function\n * move... | javascript | chosen |
[
{
"from": "system",
"value": "Replace req.url with req.originalUrl to fix trim bug\n"
},
{
"from": "human",
"value": "var parseUrl = require('url').parse;\nvar isSecure = function(req) {\n if (req.secure) {\n return true;\n } else if (\n req.get('X-Forwarded-Proto') &&\n req.get('X-Fo... | javascript | chosen |
[
{
"from": "system",
"value": "Use CommonJS module style for improved compatibility\n"
},
{
"from": "human",
"value": "import Dexie from 'dexie'\n\nconst Promise = Dexie.Promise\n\nexport default class DexieBatch {\n constructor(opts = { batchSize: 20 }) {\n this.opts = opts\n }\n\n each(co... | javascript | chosen |
[
{
"from": "system",
"value": "Make uids valid for use in URLs\n"
},
{
"from": "human",
"value": "/**\n * Module dependencies\n */\n\nvar crypto = require('crypto');\n\n/**\n * The size ratio between a base64 string and the equivalent byte buffer\n */\n\nvar ratio = Math.log(64) / Math.log(256);\... | javascript | chosen |
[
{
"from": "system",
"value": "Add address and port parameters to run()\n\n"
},
{
"from": "human",
"value": "const FileSystemBackend = require('./src/backend/FileSystemBackend')\nconst FileSystemBuffer = require('./src/backend/FileSystemBuffer')\n\nconst host = require('./src/host/singletonHost')... | javascript | chosen |
[
{
"from": "system",
"value": "Fix late throwed exception in stylus when silent mode enabled\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar stylus = require('stylus'),\n gutil = require('gulp-util'),\n PluginError = gutil.PluginError,\n log = g... | javascript | chosen |
[
{
"from": "system",
"value": "Allow process to exit naturally\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\n\nvar http = require('http')\nvar opn = require('opn')\nvar rc = module.require('rc')\nvar argv = require('optimist').argv\nvar config = rc('hcat', {}, argv)\n\nif (argv.usage)... | javascript | chosen |
[
{
"from": "system",
"value": "Use `'html'` as output format\n\nPer jstransformers/jstransformer#3.\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar mustache = require('mustache');\n\nexports.name = 'mustache';\nexports.outputFormat = 'xml';\nexports.render = function (str, options, locals... | javascript | chosen |
[
{
"from": "system",
"value": "Remove bug that was generating invalid XML\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar fs = require('fs');\n\nfunction reset() {\n exports.out = [];\n exports.xmlEmitter = null;\n exports.opts = {};\n} reset();\n\n/**\n * Load a formatter\n * @p... | javascript | chosen |
[
{
"from": "system",
"value": "Add fall back to source code when built code is not available.\n"
},
{
"from": "human",
"value": "/*\nCopyright (c) 2015-2018 Claude Petit\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentatio... | javascript | chosen |
[
{
"from": "system",
"value": "Convert to ES5 compatible code\n"
},
{
"from": "human",
"value": "import { randomBytes } from 'crypto';\n\n// Crockford's Base32\n// https://en.wikipedia.org/wiki/Base32\nconst ENCODING = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"\n\nfunction strongRandomNumber() {\n ret... | javascript | chosen |
[
{
"from": "system",
"value": "Add optional _ character to displayNameReg.\n\nBabel, at least in my configuration, transpiles to \"function _class\", so we need to catch that too."
},
{
"from": "human",
"value": "var excludeMethods = [\n /^constructor$/, \n /^render$/, \n /^component[A-Za-z]+$... | javascript | chosen |
[
{
"from": "system",
"value": "Include `highlight.js`-styles into less file.\n\nFixes bootprint/bootprint#16\n\nThis commit ensures that the styling of examples in bootprint-openapi is\nvisible.\n"
},
{
"from": "human",
"value": "var path = require('path')\n\n// Export function to create new conf... | javascript | chosen |
[
{
"from": "system",
"value": "Support usage as nested addon\n"
},
{
"from": "human",
"value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-virtual-scrollkit',\n included: function(app) {\n app.import('vendor/zynga-scroller/Animate.js');\n app.import('vendo... | javascript | chosen |
[
{
"from": "system",
"value": "Fix ES6 hook to work in node_modules\n"
},
{
"from": "human",
"value": "var path = require('path');\n\nvar root = __dirname.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\nvar escape = function (str) {\n return str.replace(/[\\-\\[... | javascript | chosen |
[
{
"from": "system",
"value": "ENYO-1648: Change endHold from onMove to onLeave in configureHoldPulse\n\nIssue:\n- The onHoldPulse event is canceled too early when user move mouse abound.\n\nFix:\n- We are using onLeave instead of onMove.\n- Now it is cancel hold when it leaves control.\n\nDCO-1.1-Signed-Off... | javascript | chosen |
[
{
"from": "system",
"value": "Fix hotloading by correctly disposing of the Cycle app\n"
},
{
"from": "human",
"value": "import Cycle from '@cycle/core';\nimport {makeDOMDriver} from '@cycle/dom';\n\nimport slides from './src/slides';\n\nconst drivers = {\n DOM: makeDOMDriver('.app')\n};\n\nif (... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"server: ensures we are not listening on the public interface\"\n\nThis reverts commit 272b9fdec7eadfa83ec57b7563788611ecdc5534.\n"
},
{
"from": "human",
"value": "var express = require('express');\nvar haml = require('hamljs');\nvar path =... | javascript | chosen |
[
{
"from": "system",
"value": "Fix a mistake.(repeated variable assign; var str = str = ...) Concentrate unnecessary line to another.\n"
},
{
"from": "human",
"value": "function r() {\n\tvar strings = arguments[0];\n\tvar values = Array.prototype.slice.call(arguments, 1);\n\t\n\tvar str = str = s... | javascript | chosen |
[
{
"from": "system",
"value": "Add a state-of-art API all\n"
},
{
"from": "human",
"value": "// Entry point of data fetching\n\n"
},
{
"from": "gpt",
"value": "// Entry point of data fetching\nconst request = require('superagent');\nconst path = require('path');\nconst url = require('... | javascript | chosen |
[
{
"from": "system",
"value": "Fix typo cleanInput => cleanDump\n"
},
{
"from": "human",
"value": "// Requires\nvar Q = require('q');\nvar _ = require('underscore');\n\nvar qClass = require('qpatch').qClass;\n\n// Etcd client\nvar Etcd = qClass(require('node-etcd'), ['watcher']);\n\n\n// Since et... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.