conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Return blank if not found.\n"
},
{
"from": "human",
"value": "var url = require('url');\nvar express = require('express');\nvar router = express.Router();\nvar request = require(\"request\");\nrouter.get('/', function (req, res) {\n res.render('index', {title: 'G... | javascript | chosen |
[
{
"from": "system",
"value": "Remove workaround for slashes in page title\n\nThis was reported in #22 and has been fixed upstream in electron-userland/electron-packager#308\n"
},
{
"from": "human",
"value": "import axios from 'axios';\nimport cheerio from 'cheerio';\n\nconst USER_AGENT =\n 'Moz... | javascript | chosen |
[
{
"from": "system",
"value": "Rewrite getRoot to use recursion\n"
},
{
"from": "human",
"value": "/* eslint-disable no-unused-vars */\n\nimport 'babel-polyfill'\nimport postcss from 'postcss'\nimport path from 'path'\nimport fs from 'fs'\n\nimport nesting from 'postcss-nesting'\n\n\nconst getRoo... | javascript | chosen |
[
{
"from": "system",
"value": "Read the port option from settings\n"
},
{
"from": "human",
"value": "var path = require('path');\nvar webappengine = require('webappengine');\nvar cncserver = require('./dist/app/cncserver');\nvar options = {\n port: 8000,\n routes: [\n {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use node-style callbacks in through2\n"
},
{
"from": "human",
"value": "'use strict';\nvar defaults = require('defaults'),\n\t\tthrough = require('through2'),\n\t\tgetLicenseTemplate = require('./lib/licenseTemplateStore').get,\n\t\tprefixStream = require('./lib/pre... | javascript | chosen |
[
{
"from": "system",
"value": "Fix traversal to include pseudos\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar uniq = require('lodash.uniq')\n\nvar CssSelectorParser = require('css-selector-parser').CssSelectorParser\nvar cssSelector = new CssSelectorParser()\n\ncssSelector.registerSelec... | javascript | chosen |
[
{
"from": "system",
"value": "Use shed.networkFirst() for /api/ traffic even if there is no X-Cache-Only header set.\n"
},
{
"from": "human",
"value": "function serveFromCacheOrNetwork(request) {\n if (request.headers.get('X-Cache-Only') == 'true') {\n return shed.cacheOnly(request).then(fun... | javascript | chosen |
[
{
"from": "system",
"value": "Use lodash instead of forloop\n"
},
{
"from": "human",
"value": "module.exports = Select;\n\nfunction Select() {}\n\nSelect.prototype.view = __dirname + '/views';\nSelect.prototype.style = __dirname + '/styles';\nSelect.prototype.name = 'select';\nSelect.prototype.c... | javascript | chosen |
[
{
"from": "system",
"value": "Add px to rem convertor\n"
},
{
"from": "human",
"value": "/**\n * Converts breakpoint units in px to rem or em\n * @param {Object} breakpoints - an object containing breakpoint names as keys and the width as value\n * @param {number} [16] ratio - size of 1 rem in p... | javascript | chosen |
[
{
"from": "system",
"value": "Add function support to SVG as well\n"
},
{
"from": "human",
"value": "import { createElement } from './create-element.js';\nimport { parseArguments, isString, isNode } from './util.js';\n\nconst ns = 'http://www.w3.org/2000/svg';\n\nconst svgCache = {};\n\nconst me... | javascript | chosen |
[
{
"from": "system",
"value": "Improve image size replacement regex (part 2)\n"
},
{
"from": "human",
"value": "// Define search and replace terms for image src link\nlet search = /\\/s[0-9]+/g;\nlet replace = 's512';\n\nfunction getProfileImageContainer() {\n // Get profile image containers\n... | javascript | chosen |
[
{
"from": "system",
"value": "Replace const with var (ES5 compatibility)\n"
},
{
"from": "human",
"value": "const Random = require('random-js')\n\nconst stringLength = 16\n\nconst uniqueId = function() {\n const randomEngine = Random.engines.mt19937().autoSeed();\n const randomDistrib = Ra... | javascript | chosen |
[
{
"from": "system",
"value": "Add default size for draft.View\n"
},
{
"from": "human",
"value": "draft.View = class View extends draft.Element {\n /* render(renderer) {\n this['render' + renderer.toUpperCase()]();\n } */\n\n get aspectRatio() {\n var width = draft.px(this.prop('width'))... | javascript | chosen |
[
{
"from": "system",
"value": "[CHORE] Change default port to 5000 to match foreman.\n"
},
{
"from": "human",
"value": "var nconf = require('nconf');\n\nnconf\n .file({ file: './config/config.json' })\n .env();\n\nnconf.defaults({\n 'RIPPLE_REST_API': 'http://localhost:5990',\n 'DATABASE_URL'... | javascript | chosen |
[
{
"from": "system",
"value": "Set a flag when config is loaded on a browser\n"
},
{
"from": "human",
"value": "// Copyright (c) 2014 Readium Foundation and/or its licensees. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are p... | javascript | chosen |
[
{
"from": "system",
"value": "Remove first and last slashes if they exist"
},
{
"from": "human",
"value": "'use strict';\n\nvar through = require('through2');\nvar objectPath = require('object-path');\nvar File = require('vinyl');\nvar deepAssign = require('deep-assign');\nvar path = require('pa... | javascript | chosen |
[
{
"from": "system",
"value": "Add filters module to deps\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar angular = require('angular');\n\n// angular modules\nrequire('angular-ui-router');\nrequire('angular-animate');\nrequire('angular-moment');\nrequire('angular-loading-bar');\nrequire('... | javascript | chosen |
[
{
"from": "system",
"value": "Switch to Jackson for serialising client state\n\nSee the following - Nashorn's JSON object doesn't handle POJOs well.\n\nhttp://www.slideshare.net/SpringCentral/serverside-javascript-with-nashorn-and-spring\n"
},
{
"from": "human",
"value": "function render(templat... | javascript | chosen |
[
{
"from": "system",
"value": "Make sure arrow popups don't overflow to the left\n"
},
{
"from": "human",
"value": "(function($){\n\n $.fn.arrowPopup = function(popupSelector, arrowDirection) {\n var popup = $(popupSelector);\n var offset = $(this).offset();\n arrowDirecti... | javascript | chosen |
[
{
"from": "system",
"value": "Add support for webpack >= 4\n"
},
{
"from": "human",
"value": "var minify = require('html-minifier').minify\n , loaderUtils = require('loader-utils')\n\nmodule.exports = function(source) {\n this.cacheable && this.cacheable()\n var defaultOptions = {\n re... | javascript | chosen |
[
{
"from": "system",
"value": "Use non-circle social icons in footer\n"
},
{
"from": "human",
"value": "import quotes from '../util/quotes.js';\n\nexport default {\n isLoggedIn: false,\n\n showMenu: false,\n circleIcons: true,\n toast: null,\n\n quote: {\n text: null,\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Replace supported hardware link with getting started link\n"
},
{
"from": "human",
"value": "module.exports = [\n {\n \"text\": \"Supported hardware\",\n \"link\": \"/#supported\",\n \"scroll\": \"true\"\n },\n {\n \"modal\": tru... | javascript | chosen |
[
{
"from": "system",
"value": "Add link to the repo page\n"
},
{
"from": "human",
"value": "'use strict';\nrequire('es6-promise').polyfill();\nrequire('whatwg-fetch');\n\nconst url = require('url'),\n querystring = require('querystring').parse,\n githubUrl = require('github-url-from-git... | javascript | chosen |
[
{
"from": "system",
"value": "Return named function (stack traces/debugging)\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar\n server = require('./lib/server'),\n _ = require('lodash'),\n path = require('path'),\n _server = null;\n\nfunction middleware(options, files, metal... | javascript | chosen |
[
{
"from": "system",
"value": "Add both points and envelope polygon to rpl\n"
},
{
"from": "human",
"value": "var extent = require('turf-extent');\nvar bboxPolygon = require('turf-bbox-polygon');\n\n/**\n* Takes a {@link Feature} or {@link FeatureCollection} and returns a rectangular {@link Polyg... | javascript | chosen |
[
{
"from": "system",
"value": "Update interpolator, csrf token, and form submission format\n"
},
{
"from": "human",
"value": "(function(angkot) {\n\nangkot.route.app = angular.module('AngkotRouteEditor', []);\n\n})(angkot);\n\n"
},
{
"from": "gpt",
"value": "(function(angkot) {\n\nvar... | javascript | chosen |
[
{
"from": "system",
"value": "Extend HSTS header max age\n"
},
{
"from": "human",
"value": "var express = require('express');\nvar app = express();\n\nvar PORT = process.env.PORT || 3000;\n\napp.use(function(req, res, next) {\n res.setHeader('Strict-Transport-Security', 'max-age=600');\n res.s... | javascript | chosen |
[
{
"from": "system",
"value": "feat: Allow includes to be added\n"
},
{
"from": "human",
"value": "var fs = require( \"fs\" );\nvar mkdirp = require( \"mkdirp\" );\nvar path = require( \"path\" );\nvar slash = require( \"slash\" );\nvar through = require( \"through2\" );\n\nmodule.expo... | javascript | chosen |
[
{
"from": "system",
"value": "Add login functionality with test\n"
},
{
"from": "human",
"value": "process.env.NODE_ENV = 'test';\n\nconst supertest = require('supertest');\nconst chai = require('chai');\nconst chaiHttp = require('chai-http');\n\nconst app = require('../app.js');\n\nconst reques... | javascript | chosen |
[
{
"from": "system",
"value": "Use default database name is user does not provide one\n"
},
{
"from": "human",
"value": "const Alexa = require('alexa-sdk');\nconst fs = require('fs');\nconst path = require('path');\n\nconst { appId, dbName } = process.env;\n\n// loads all modules in handlers fold... | javascript | chosen |
[
{
"from": "system",
"value": "Rename keyCodes export to keySyms\n"
},
{
"from": "human",
"value": "var NativeExtension = require('bindings')('NativeExtension');\nmodule.exports = NativeExtension;\nmodule.exports.keyCodes = require('./keysymdef');\n"
},
{
"from": "gpt",
"value": "var ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix version number from the cli\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\nglobal.__base = __dirname + '/src/';\n\n// Commands\nvar cli = require('commander');\n\ncli\n .version('0.0.1')\n .option('-p, --port <port>' , 'Change static serv... | javascript | chosen |
[
{
"from": "system",
"value": "Fix keys error and remove `set`\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar Cesium = require('cesium');\nvar fsExtra = require('fs-extra');\nvar nconf = require('nconf');\nvar Promise = require('bluebird');\n\nvar defined = Cesium.defined;\n\nnconf.env('... | javascript | chosen |
[
{
"from": "system",
"value": "Add support for X-Real-IP Header\n"
},
{
"from": "human",
"value": "/**\n * Author: petar bojinov - @pbojinov\n * Date: 9/29/13\n */\n\n/**\n * @method getClientIp\n *\n * Get client IP address\n *\n * Will return 127.0.0.1 when testing locally\n * Useful when you n... | javascript | chosen |
[
{
"from": "system",
"value": "Add scripts and libs folders to the linting task.\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nmodule.exports = function (grunt) {\n grunt.initConfig({\n eslint: {\n options: {\n config: \".eslintrc\"\n },\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add gruntTask. less to css.\n"
},
{
"from": "human",
"value": "module.exports = function (grunt) {\n\n // config\n grunt.initConfig({\n\n less: {\n build: {\n expand: true,\n cwd: 'src/less/',\n sr... | javascript | chosen |
[
{
"from": "system",
"value": "Use typeof to test for function\n"
},
{
"from": "human",
"value": "\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function forEach (obj, fn, ctx) {\n if (typeof obj !== 'object' || obj === null) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add simple implementation of sendMetric with call to getTasksLeft.\n"
},
{
"from": "human",
"value": "var MonitoringPlugin = function () {\n};\n\nMonitoringPlugin.prototype.sendMetrics = function () {\n console.log('Im running:', this.engine.nTasksLeft.toString()... | javascript | chosen |
[
{
"from": "system",
"value": "Handle unparseable log lines properly\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\n\"use strict\";\n\nvar bunyan = require(\"bunyan\");\nvar ss = require(\"stream-splitter\");\n\nvar lineFormat = /(\\d{4})\\/(\\d{2})\\/(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2}... | javascript | chosen |
[
{
"from": "system",
"value": "Add notifyJobSuccess() and notifyJobFailure() mathods.\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst AWS = require('aws-sdk');\nconst codePipeline = new AWS.CodePipeline();\n\nexports.handler = (event, context, callback) => {\n const jobData = event['... | javascript | chosen |
[
{
"from": "system",
"value": "Use default settings for underlying cache.\n"
},
{
"from": "human",
"value": "\"use strict\";\nvar Promise = require(\"bluebird\");\nvar LRU = require(\"lru-cache-plus\");\n\nfunction buildCache() {\n return new LRU({\n length: function (v) {\n return v && ... | javascript | chosen |
[
{
"from": "system",
"value": ":arrow_up: Increase spec timeout to 10 seconds\n"
},
{
"from": "human",
"value": "'use babel'\n\n// Our sugar method that allows us to pass async functions and do await in it\nexport function it(name, callback) {\n global.it(name, function() {\n const value = ca... | javascript | chosen |
[
{
"from": "system",
"value": "Use got for ping command\n"
},
{
"from": "human",
"value": "'use strict'\n\nvar http = require('http')\nvar https = require('https')\nvar url = require('url')\nvar config = require('./config')\n\nfunction ping (cb) {\n if (url.parse(config.registry).protocol === 'h... | javascript | chosen |
[
{
"from": "system",
"value": "Send the origin IP in x-forwarded-for"
},
{
"from": "human",
"value": "var express = require('express');\nvar superagent = require('superagent');\n\nvar constants = require('../constants');\n\n\nvar proxy_headers = [\n 'Accept-Charset',\n 'Accept-Language',\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix proto lang handler to work minified and to use the type style for types like uint32."
},
{
"from": "human",
"value": "// Copyright (C) 2006 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except... | javascript | chosen |
[
{
"from": "system",
"value": "Update grunt tasks for heroku\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nmodule.exports = function (grunt) {\n grunt.initConfig({\n bump: {\n options: {\n files: [\"package.json\"],\n commit: true,\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Remove trailing slash from baseUrl\n\nFixes #7\n"
},
{
"from": "human",
"value": "export default {\n\tbaseUrl: 'https://api.particle.io/',\n\tclientSecret: 'particle-api',\n\tclientId: 'particle-api',\n\ttokenDuration: 7776000, // 90 days\n};\n"
},
{
"from":... | javascript | chosen |
[
{
"from": "system",
"value": "Use bind instead of wrapping the function to forward errors.\n"
},
{
"from": "human",
"value": "\n'use strict';\n\nvar https = require(\"https\"),\n EventEmitter = require('events');\n\n/**\n * Forward an error to another emitter.\n */\nvar forwardError = functio... | javascript | chosen |
[
{
"from": "system",
"value": "Add reconnect code with exponential retry\n"
},
{
"from": "human",
"value": "(function (app, $) {\n app.events = app.events || function () {\n $.connection.hub.start();\n\n var timeout = 0;\n\n // try reconnect if disconnected\n $.con... | javascript | chosen |
[
{
"from": "system",
"value": "Remove po files from gh-pages\n"
},
{
"from": "human",
"value": "module.exports = {\n all: {\n files: [\n {\n expand: true,\n src: [\n 'index.html',\n '404.html',\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use \"jQuery\" instead of \"$\" so JS works even when jQuery.noConflict() has been used.\n"
},
{
"from": "human",
"value": "var init_dashboard = function(id, columns, preferences, url) {\n $('#'+id).dashboard({\n 'columns': columns,\n 'load_preferen... | javascript | chosen |
[
{
"from": "system",
"value": "Clear button now uses onClear function from props. As a result we can get rid of the local clearSearchField function and its associated state, which means the entire constructor can be discarded. All part of STRIPES-97, and *still* not working.\n"
},
{
"from": "human",
... | javascript | chosen |
[
{
"from": "system",
"value": "Comment how to add safemode\n"
},
{
"from": "human",
"value": "//Load Roles\nvar deathCreeps = require('role.deathCreeps');\nvar spawnCreeps = require('role.spawnCreeps');\nvar roleHarvester = require('role.harvester');\nvar roleBuilder = require('role.builder');\nv... | javascript | chosen |
[
{
"from": "system",
"value": "Add an example of TreeBuilder.buildRawHtml()\n"
},
{
"from": "human",
"value": "class View {\n static render(state){\n return TreeBuilder.build(h =>\n h(\"div\", {}\n , h(\"button\", {}, \"OK\")\n , h(\"input\", { type: \"checkbox\" })\n , h(... | javascript | chosen |
[
{
"from": "system",
"value": "Add protection against multiple Fancybox init.\n"
},
{
"from": "human",
"value": "$(document).ready(function () {\n $.fancybox.defaults.locales = $.extend({}, $.fancybox.defaults.locales, {\n ru: {\n CLOSE: Translator.trans('fancybox.close'... | javascript | chosen |
[
{
"from": "system",
"value": "Remove routeChangeSuccess function, automatically call getUserInfo on load\n"
},
{
"from": "human",
"value": "angular.module('bolt.profile', ['bolt.auth'])\n\n.controller('ProfileController', function ($scope, $rootScope, Auth, Profile) {\n $rootScope.user = {};\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add backup as state tree\n"
},
{
"from": "human",
"value": "import { combineReducers } from 'redux';\n\nimport quotes from './quotes';\nimport loading from './loading';\n\nexport default combineReducers({\n\tquotes,\n\tloading\n});"
},
{
"from": "gpt",
"... | javascript | chosen |
[
{
"from": "system",
"value": "Add return value to global check\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar check = require('./check');\n\nmodule.exports = function globalCheck(source, value) {\n var checkResult = check(source, value);\n var error = [];\n if (!checkResult) {\... | javascript | chosen |
[
{
"from": "system",
"value": "Move delay to virtual scheduler method\n"
},
{
"from": "human",
"value": "import { Observable } from 'rxjs/Observable'\nimport { of } from 'rxjs/observable/of'\nimport { merge } from 'rxjs/observable/merge'\nimport { delay } from 'rxjs/operator/delay'\nimport { take... | javascript | chosen |
[
{
"from": "system",
"value": "Fix events drop down list\n"
},
{
"from": "human",
"value": "import PropTypes from 'prop-types';\nimport React from 'react';\nimport Select from '../select';\nimport { getY } from '../../index';\n\nconst choices = currentValue => () =>\n new Promise(resolve => {\... | javascript | chosen |
[
{
"from": "system",
"value": "Remove the unneccessary file extension\n"
},
{
"from": "human",
"value": "// This is a manifest file that'll be compiled into including all the files listed below.\n// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically\n// b... | javascript | chosen |
[
{
"from": "system",
"value": "Add more basic multi-edit tests\n"
},
{
"from": "human",
"value": "(function($) {\n module('Mutli-edit');\n\n test('Basic', function() {\n var multiEdit = {\n fields: {\n fieldA: { label: 'fieldA' },\n fieldB: { label: 'fieldB' },\n ad... | javascript | chosen |
[
{
"from": "system",
"value": "Remove default field from Token\n"
},
{
"from": "human",
"value": "import React from 'react'\n\nimport Base from './Base'\nimport Components from '../constants/QueryComponentConstants'\n\nconst ClickTokens = props => {\n const { field, ...others } = props\n return... | javascript | chosen |
[
{
"from": "system",
"value": "Remove some unneeded sanity checks.\n"
},
{
"from": "human",
"value": "import React, { PropTypes } from 'react'\nimport {\n matchContext as matchContextType\n} from './PropTypes'\n\nclass MatchProvider extends React.Component {\n static propTypes = {\n match: P... | javascript | chosen |
[
{
"from": "system",
"value": "Swap $...$ENV_EXPRESS_PORT and $PORT precedence\n"
},
{
"from": "human",
"value": "module.exports = (function() {\n const environment = process.env.NODE_ENV || 'production';\n\n const prefixGet = function(body) {\n let id = `VOLONTARIO_${environment}_${body}`;\... | javascript | chosen |
[
{
"from": "system",
"value": "Add two tests to Jest\n"
},
{
"from": "human",
"value": "import React from 'react'\nimport Search from './Search'\nimport { shallow } from 'enzyme'\nimport { shallowToJson } from 'enzyme-to-json'\n\ntest('Search snapshot test', () => {\n const component = shallow(<... | javascript | chosen |
[
{
"from": "system",
"value": "Add climate vulnerability to compare sections\n"
},
{
"from": "human",
"value": "import ClimateVulnerability from 'components/country-compare/country-compare-climate-vulnerability/country-compare-climate-vulnerability';\n\nexport default [\n {\n hash: 'ghg-emiss... | javascript | chosen |
[
{
"from": "system",
"value": "Change CNTL to new loader format"
},
{
"from": "human",
"value": "define(['mac/roman'], function(macintoshRoman) {\n\n 'use strict';\n \n return function(resource) {\n var dv = new DataView(resource.data.buffer, resource.data.byteOffset, resource.data.byteLeng... | javascript | chosen |
[
{
"from": "system",
"value": "Use `page.content` instead of `page.sections`\n"
},
{
"from": "human",
"value": "var cheerio = require('cheerio');\nvar _ = require('lodash');\nvar slug = require('github-slugid');\n\n// insert anchor link into section\nfunction insertAnchors(content) {\n var $ =... | javascript | chosen |
[
{
"from": "system",
"value": "Remove default format as it is now part of html-validator itself\n"
},
{
"from": "human",
"value": "var es = require('event-stream');\nvar path = require('path');\nvar htmlv = require('html-validator');\n\nmodule.exports = function(options) {\n\n if (!options) opti... | javascript | chosen |
[
{
"from": "system",
"value": "Print error stack on error.\n"
},
{
"from": "human",
"value": "const Promise = require('bluebird');\nconst argvSplit = require('argv-split');\nconst execa = require('execa');\nconst fs = Promise.promisifyAll(require('fs'));\nconst path = require('path');\n\nfunction... | javascript | chosen |
[
{
"from": "human",
"value": "Create handler. but most simple.\n"
},
{
"from": "gpt",
"value": "'use streict';\n\nmodule.exports.handle = (event, context, callback) => {\n console.log('eventObject: %s', JSON.stringify(event, null, 2));\n callback(null, event);\n};\n"
}
] | javascript | chosen |
[
{
"from": "system",
"value": "Save bound data to `userData`\n\n* As ReferenceError occurred, moved config_path to the top\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst {app, BrowserWindow, ipcMain} = require('electron');\nconst fs = require('fs');\nconst path = require('path');\n\nap... | javascript | chosen |
[
{
"from": "system",
"value": "Add commands and config to client + minor token protection\n"
},
{
"from": "human",
"value": "const discord = require('discord.js')\nconst fs = require(\"fs\")\nconst config = require('./config.json')\n\nconst client = new discord.Client()\n\nvar commands = ne... | javascript | chosen |
[
{
"from": "system",
"value": "Add fixed command name to usage format in -h\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\nconst chalk = require('chalk');\nconst yargs = require('yargs');\n\n// ./modules\nconst rocketLaunch = require('./lib/modules/rocketLaunch');\n\nvar argv = yargs\n... | javascript | chosen |
[
{
"from": "system",
"value": "Terminate MS Edge via taskkill\n"
},
{
"from": "human",
"value": "// Karma Edge Launcher\n// =================\n\n// Constructor\nfunction EdgeBrowser (baseBrowserDecorator) {\n baseBrowserDecorator(this)\n\n this._getOptions = function (url) {\n return [url, '... | javascript | chosen |
[
{
"from": "system",
"value": "Add the chance to select the logger.\n"
},
{
"from": "human",
"value": "module.exports = function logger() {\n return (ctx, next) => {\n const { username, first_name: firstName, last_name: lastName, id } = ctx.from;\n let content = null;\n\n switch (ctx.up... | javascript | chosen |
[
{
"from": "system",
"value": "Set default argument for times\n"
},
{
"from": "human",
"value": "'use strict'\n\nvar emoji = require('node-emoji')\n\n/**\n * Returns a string surrounded by the poop emoji (poomoji)\n * @param string\n */\n\nmodule.exports = function (string) {\n var string = stri... | javascript | chosen |
[
{
"from": "system",
"value": "Switch to ES2015, remove now useless replace\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst { NativeModules } = require('react-native');\nconst { RNI18n } = NativeModules;\nlet I18n = require('i18n-js');\n\nI18n.locale = (RNI18n) ? RNI18n.locale.replace(/... | javascript | chosen |
[
{
"from": "system",
"value": "Add option , parse with JSON.parse by default\n"
},
{
"from": "human",
"value": "var dataModule = require('data-module');\nvar gutil = require('gulp-util');\nvar through2 = require('through2');\n\nvar DataModuleError = gutil.PluginError.bind(null, 'gulp-data-module'... | javascript | chosen |
[
{
"from": "system",
"value": "Remove -beta.n suffix from less before republishing.\n"
},
{
"from": "human",
"value": "Package.describe({\n name: 'less',\n version: '2.7.9-beta.1',\n summary: 'Leaner CSS language',\n documentation: 'README.md'\n});\n\nPackage.registerBuildPlugin({\n name: \"... | javascript | chosen |
[
{
"from": "system",
"value": "[GREEN] Send data of null for successful delete requests\n"
},
{
"from": "human",
"value": "/*jslint node:true indent:2 */\n'use strict';\n\nmodule.exports = function (req, res, next) {\n\n function sendResponse(code, json) {\n return res.status(code).json(json)... | javascript | chosen |
[
{
"from": "system",
"value": "Remove jasmine pretty-printing monkeypatches in favor of jasmine.MAX_PRETTY_PRINT_DEPTH\n"
},
{
"from": "human",
"value": "// don't include object's inherited properties in pretty printed output\njasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use a chrome window to provide a better notification fallback on OSX when growl isn't installed.\n"
},
{
"from": "human",
"value": "var EXPORTED_SYMBOLS = [\"GM_notification\"];\n\nvar Cc = Components.classes;\nvar Ci = Components.interfaces;\n\n// The first time th... | javascript | chosen |
[
{
"from": "system",
"value": "Comment out javaValidateObj on phone number\n"
},
{
"from": "human",
"value": "/**\n * @license\n * Copyright 2017 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\nfoam.CLASS({\n package: 'foam.nanos.auth',\n name: 'Phone... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"find out redis URL\"\n\nThis reverts commit 96f0a89954273a6e5e53a675f47b5357fd9823bc.\n"
},
{
"from": "human",
"value": "var express = require('express');\nvar app = express();\nvar redis = require('redis').createClient(process.env.REDIS_URL);\n\nconsole.lo... | javascript | chosen |
[
{
"from": "system",
"value": "Use promise-form of less call and improve error reporting\n"
},
{
"from": "human",
"value": "'use strict';\nvar Filter = require('broccoli-filter');\nvar RSVP = require('rsvp');\nvar less = require('less');\n\nfunction LessFilter(inputTree, options) {\n\tif (!(this ... | javascript | chosen |
[
{
"from": "system",
"value": "FIX: Check for fillOpacity when fill is undefined\n\nFix for condition where both fill and fillOpacity properties are\nundefined\n"
},
{
"from": "human",
"value": "import rgba from './rgba';\nimport {\n ART\n} from 'react-native';\n\nlet {\n LinearGradient,\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Change masses of all dancers\n"
},
{
"from": "human",
"value": "const makeDancer = (mass, x, y, z) => ({ mass, position: [x, y, z] });\nconst dancerData = [\n makeDancer(100, -3, 4, -8),\n makeDancer(200, -2, -1, -12),\n makeDancer(700, 3, 2, -8),\n makeDancer(1... | javascript | chosen |
[
{
"from": "system",
"value": "Fix stack trace bug on safari\n"
},
{
"from": "human",
"value": "var util = require('util');\nvar extend = require('extend');\n\nfunction RippleError(code, message) {\n switch (typeof code) {\n case 'object':\n extend(this, code);\n break;\n case ... | javascript | chosen |
[
{
"from": "system",
"value": "Add SCSS support.\nnode-sass already support SCSS but this plugin only allows SASS file extension.\n"
},
{
"from": "human",
"value": "var Q = require('q');\nvar _ = require('lodash');\nvar path = require('path');\nvar fs = require('fs');\nvar sass = require('node-sa... | javascript | chosen |
[
{
"from": "system",
"value": "Put games xhr in background\n"
},
{
"from": "human",
"value": "import { request } from '../../http';\n\nexport function follow(userId) {\n return request('/rel/follow/' + userId, { method: 'POST' });\n}\n\nexport function unfollow(userId) {\n return request('/rel/... | javascript | chosen |
[
{
"from": "system",
"value": "Test: Use Webpack 2 performance budget to test bundle size\n\nIn case we put something huge into it, or UglifyJS will not work again.\n"
},
{
"from": "human",
"value": "const loaders = require('loaders');\nmodule.exports = {\n\tcomponents: 'lib/components/**/[A-Z]*.... | javascript | chosen |
[
{
"from": "system",
"value": "Allow LoadingScreen to be optional and not default\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport { TabNavigator } from 'react-navigation';\nimport BaseNavigator from './BaseNavigator'\n\n\nconst ReactovaNavigator = (navigationSchema,LoadingSc... | javascript | chosen |
[
{
"from": "system",
"value": "fix: Add style to required radio button group\n"
},
{
"from": "human",
"value": "export default ({ className, onCommit, property, value }) => {\n function getValue(checked, newValue) {\n if (!property.isArray) {\n return newValue\n }\n\n const values ... | javascript | chosen |
[
{
"from": "system",
"value": "Use server-side collname in event payloads\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst { getReason } = require('../../error');\nconst { MODEL_TYPES } = require('../../constants');\nconst { DEFAULT_FORMAT } = require('../../formats');\nconst { normalize... | javascript | chosen |
[
{
"from": "system",
"value": "fix(docs): Fix import issue from node_modules\n"
},
{
"from": "human",
"value": "const path = require('path')\nconst material = path.resolve('node_modules/@material')\n\nmodule.exports = {\n title: 'Material Components Vue',\n description: 'Material Design compone... | javascript | chosen |
[
{
"from": "system",
"value": "Remove react native web view components from layout components\n"
},
{
"from": "human",
"value": "import React from \"react\";\nimport { View } from \"react-native-web\";\n\nimport styles from \"./Layout.module.scss\";\n\nconst layoutWidth = {\n small: 480,\n medi... | javascript | chosen |
[
{
"from": "system",
"value": "Check if the App namespace exists before defining it."
},
{
"from": "human",
"value": "module.exports = (function() {\n var Router = require('router');\n\n require('lib/config');\n require('lib/helpers');\n\n window.App = {};\n\n App.Router = new Router();\n\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Remove chmod call from copySync\n"
},
{
"from": "human",
"value": "var fs = require('graceful-fs')\n\nvar BUF_LENGTH = 64 * 1024\nvar _buff = new Buffer(BUF_LENGTH)\n\nfunction copyFileSync (srcFile, destFile, options) {\n var clobber = options.clobber\n var prese... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.