conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix leaflet marker icon missing\n"
},
{
"from": "human",
"value": "require('leaflet');\nrequire('proj4leaflet');\n\n/*global L:true*/\n/*global assetPath:true*/\n\n// specify the path to the leaflet images folder\nL.Icon.Default.imagePath = assetPath + '/images/leaf... | javascript | chosen |
[
{
"from": "system",
"value": "Set the prefetch to 5 if not setted\n"
},
{
"from": "human",
"value": "require('./lib/boot/logger');\n\nvar defaultConfig = {\n amqpUrl: process.env.AMQP_URL || 'amqp://localhost',\n amqpPrefetch: process.env.AMQP_PREFETCH || 0,\n amqpRequeue: true\n};\n\nmodule.... | javascript | chosen |
[
{
"from": "system",
"value": "Add conditional start/restart logic :construction:\n"
},
{
"from": "human",
"value": "const nodemon = require(\"nodemon\")\nmodule.exports = function () {\n this.nodemon = function (opts) {\n \n }\n}\n"
},
{
"from": "gpt",
"value": "const nodemon = ... | javascript | chosen |
[
{
"from": "system",
"value": "Add missing paren to if statement.\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar assign = Object.assign || require('object.assign');\n\nfunction hasOwnKey(key, object) {\n return object != null && object.hasOwnProperty(key);\n}\n\nfunction objectsHaveOw... | javascript | chosen |
[
{
"from": "system",
"value": "Fix \"isWindows is not a function\" on electron\n\nFix \"isWindows is not a function\" on electron"
},
{
"from": "human",
"value": "/*!\n * global-modules <https://github.com/jonschlinkert/global-modules>\n *\n * Copyright (c) 2015 Jon Schlinkert.\n * Licensed under... | javascript | chosen |
[
{
"from": "system",
"value": "Update API. Not backwards compatible "
},
{
"from": "human",
"value": "\nmodule.exports = {\n\n onLoad: function(callback) {\n if (typeof callback !== 'function') {\n throw new Error('\"onLoad\" must have a callback function');\n }\n\n withLiveReactlo... | javascript | chosen |
[
{
"from": "system",
"value": "Support ConnectedTechnologies and EnabledTechnologies Properties\n"
},
{
"from": "human",
"value": "//var dbus = module.exports = require('node-dbus');\nvar dbus = require('node-dbus');\n\nmodule.exports = function() {\n\tvar self = this;\n\n\tthis.init = function(c... | javascript | chosen |
[
{
"from": "system",
"value": "Create log dir if not available\n"
},
{
"from": "human",
"value": "var winston = require(\"winston\");\n\nvar logger = new winston.Logger({\n transports: [\n new winston.transports.File({\n level: \"error\",\n filename: \"./\" + logDi... | javascript | chosen |
[
{
"from": "system",
"value": "Check if fullscreen is already enabled on mount"
},
{
"from": "human",
"value": "var screenfull = require('screenfull');\n\nvar FullscreenMixin = {\n\n getInitialState: function() {\n return {\n hasFullscreen: false\n };\n },\n\n componentDidMount: fun... | javascript | chosen |
[
{
"from": "system",
"value": "Make plugin work on case-sensitive systems\n\nJSON5 package is published as `json5` not `JSON5` to npm.\r\nRequiring it as `JSON5` make case-sensitive systems fail"
},
{
"from": "human",
"value": "var path = require('path');\nvar gutil = require('gulp-util');\nvar m... | javascript | chosen |
[
{
"from": "system",
"value": "Fix stupid POT/PORT typogit add .git add .\n"
},
{
"from": "human",
"value": "var express = require('express');\nvar app = express();\n\napp.set('port', (process.env.POT || 5000));\n\napp.use(express.static(__dirname + '/public'));\n\napp.get('/', function(request, ... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"Fix backslashes before rendering math\"\n\nThis reverts commit 81daaba69984d9333ebe50e1be3435732ffa94cb.\n"
},
{
"from": "human",
"value": "var katex = require(\"katex\");\nvar cheerio = require(\"cheerio\");\n\nmodule.exports = {\n book: {\n asse... | javascript | chosen |
[
{
"from": "system",
"value": "Disable Hapi debugging only for tests\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst Hapi = require('hapi');\nconst Mongoose = require('mongoose');\n\nconst MONGODB_URI = process.env.MONGOLAB_URI || process.env.MONGODB_URI;\nconst HTTP_PORT = process.env.... | javascript | chosen |
[
{
"from": "system",
"value": "Define Buffer globally if buffer built-in module installed.\n"
},
{
"from": "human",
"value": "var map = require(\"./map.json\");\nvar meteorAliases = {};\n\nObject.keys(map).forEach(function (id) {\n if (typeof map[id] === \"string\") {\n var aliasParts = modul... | javascript | chosen |
[
{
"from": "system",
"value": "Make client should throw if no API key is provided test pass.\n"
},
{
"from": "human",
"value": "/**\n * index.js\n * Client entry point.\n *\n * @author Francis Brito <fr.br94@gmail.com>\n * @license MIT\n */\n'use strict';\n\nvar Client = function Client() {};\n\n... | javascript | chosen |
[
{
"from": "system",
"value": "Use comparision instead of regex.\n"
},
{
"from": "human",
"value": "var stop = /,$/;\nmodule.exports = function list(args) {\n var res = [];\n\n var temp = [];\n var max = args.length;\n for (var i = 0; i < max; i++) {\n var arg = args[i];\n if (stop.test... | javascript | chosen |
[
{
"from": "system",
"value": "Add unique index to name\n"
},
{
"from": "human",
"value": "'use strict'\n\nconst Schema = use('Schema')\n\n\nclass WordSchema extends Schema {\n up () {\n this.create('words', (table) => {\n table.increments()\n table.string('name').notNullable()\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Make codybot shut up for a bit\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar Slack = require('slack-client');\n\nvar token = '' || process.env.SLACK_API_TOKEN;\n\nvar slack = new Slack(token, true, true);\n\nslack.on('open', function () {\n console.log(\"... | javascript | chosen |
[
{
"from": "system",
"value": "Add `err.url` to match `res.url`"
},
{
"from": "human",
"value": "'use strict';\n\nmodule.exports = Response;\n\n/**\n * A response from a web request\n *\n * @param {Number} statusCode\n * @param {Object} headers\n * @param {Buffer} body\n */\nfunction Response(sta... | javascript | chosen |
[
{
"from": "system",
"value": "Set routes if provided in options."
},
{
"from": "human",
"value": "function Plugin(app, chat, options)\n{\n if(!options) {\n throw new Error('No options specified for plugin.');\n }\n\n if(!options.name) {\n throw new Error('No name specified... | javascript | chosen |
[
{
"from": "system",
"value": "Fix opening new tab on directories with spaces"
},
{
"from": "human",
"value": "const { exec } = require('child_process');\n\nlet curPid;\nlet uids = {};\n\nconst setCwd = (pid) =>\n exec(`lsof -p ${pid} | grep cwd | awk '$4 == \"cwd\" {print $9}'`, (err, cwd) => {... | javascript | chosen |
[
{
"from": "system",
"value": "Change argument naming in provisioning callback function\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar fs = require('fs');\nvar exec = require('child_process').exec;\nvar plist = require('simple-plist');\nvar decompress = require('decompress-zip');\nvar wh... | javascript | chosen |
[
{
"from": "system",
"value": "Change indentation to 2 spaces instead of 4\n"
},
{
"from": "human",
"value": "/*global require, module, window, document */\n\n'use strict';\n\nif (!(window && window.getComputedStyle && window.addEventListener)) {\n return;\n}\n\nvar Emitter = require('tiny-emi... | javascript | chosen |
[
{
"from": "system",
"value": "Set the content header to CSV.\n"
},
{
"from": "human",
"value": "var jinaga_app = require('jinaga.app');\nvar Roster = require('./roster/roster');\n\nvar server = jinaga_app.start(__dirname);\nvar app = server.app;\nvar j = server.j;\n\nvar roster = new Roster(j);\... | javascript | chosen |
[
{
"from": "system",
"value": "Stop fetching status from my laptop please\n"
},
{
"from": "human",
"value": "var params = location.hash.slice(1).split(\"/\"),\n url = \"http://localhost:5000\",\n email = params[0],\n ids = params[1].split(\",\");\n\nfunction showError() {\n $(\".alert\"... | javascript | chosen |
[
{
"from": "system",
"value": "Use MessageChannel for console.log, allow time/timeEnd, better handling of Chrome WebWorker console\nShould be quicker than waiting for large queues of requests\n"
},
{
"from": "human",
"value": "define('worker_console', function () {\n var window = this;\n var co... | javascript | chosen |
[
{
"from": "system",
"value": "Change For to lowercase for\n"
},
{
"from": "human",
"value": "/**\n * The client JS file that brings in React and bootstraps the app into the page from the server state.\n */\nimport React from \"react\";\nimport App from \"./app\";\n\n//put React into the global s... | javascript | chosen |
[
{
"from": "system",
"value": "\tMake America cross-platform again (multiplatform install scripts)\n"
},
{
"from": "human",
"value": "const fs = require('fs');\nconst join = require('path').join;\nconst sep = require('path').sep;\n\nconst files = [];\nfunction crawl(location: string) {\n const d... | javascript | chosen |
[
{
"from": "system",
"value": "Whitelist additional elements and attributes\n\nBootstrap 4.3.1 introduced sanitation for HTML popovers / tooltips. The\nrules are rather strict, so we extend the default whitelists with safe\nattributes / tags.\n"
},
{
"from": "human",
"value": "import $ from 'jque... | javascript | chosen |
[
{
"from": "system",
"value": "Fix typo on fs variable name"
},
{
"from": "human",
"value": "var path = require('path');\nvar findParentDir = require('find-parent-dir');\nvar fs = require('fs');\n\nfunction resolve(targetUrl, source) {\n var packageRoot = findParentDir.sync(source, 'node_modules... | javascript | chosen |
[
{
"from": "system",
"value": "Update default formatting for bar chart module\n"
},
{
"from": "human",
"value": "define([\n 'extensions/controllers/module',\n 'common/views/visualisations/bar_chart_with_number',\n 'common/collections/bar_chart_with_number'\n],\nfunction (ModuleController, BarC... | javascript | chosen |
[
{
"from": "system",
"value": "Use body parser parsing request body\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst express = require('express');\nconst APP_CONST = require('../constant/app');\n\nclass Server {\n /**\n * Constructor\n * @param config\n */\n constructor(config) {... | javascript | chosen |
[
{
"from": "system",
"value": "Remove jquery usage & replace with dom apis\n"
},
{
"from": "human",
"value": "import $ from 'jquery';\nimport { later, cancel } from '@ember/runloop';\nimport { inject as service } from '@ember/service';\nimport Router from '../router';\n\nexport default {\n name:... | javascript | chosen |
[
{
"from": "system",
"value": "Correct linting error with order of requires\n"
},
{
"from": "human",
"value": "const merge = require(\"webpack-merge\");\nconst PostCompile = require(\"post-compile-webpack-plugin\");\nconst MiniCssExtractPlugin = require(\"mini-css-extract-plugin\");\nconst Versio... | javascript | chosen |
[
{
"from": "system",
"value": "Add helper function and look for about button class also\n"
},
{
"from": "human",
"value": "// Listen for nav clicks\n\ndocument.body.addEventListener('click', function (event) {\n if (event.target.classList.contains('nav-link')) {\n var viewId = '#' + event.tar... | javascript | chosen |
[
{
"from": "system",
"value": "Support readFile options in getReadFile\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar resolve = require('path').resolve\n , stat = require('fs2/stat')\n , readFile = require('fs2/read-file')\n\n , create = Object.create;\n\nmodule.exports = functio... | javascript | chosen |
[
{
"from": "system",
"value": "Fix failure type on fetch blocks action\n"
},
{
"from": "human",
"value": "import * as t from '../action-types'\nimport { createAction } from './create-action'\nimport AuthSelectors from '~client/account/redux/selectors'\n\nexport default mobilizationId => (dispatch... | javascript | chosen |
[
{
"from": "system",
"value": "Add `now` and lots of time conversions to time library\n"
},
{
"from": "human",
"value": "Elm.Time = function() {\n var every = function(t) {\n t *= 1000;\n var clock = Elm.Signal.constant(0);\n var time = 0;\n setInterval(function() {\n\t ... | javascript | chosen |
[
{
"from": "system",
"value": "Throw error if ember-template-compiler.js not found\n"
},
{
"from": "human",
"value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-cli-hot-loader',\n serverMiddleware: function (config){\n if (config.options.environment =... | javascript | chosen |
[
{
"from": "system",
"value": "Add button to search bar\n"
},
{
"from": "human",
"value": "import React, { Component } from 'react';\nimport { View, TextInput, Text, StyleSheet, TouchableOpacity } from 'react-native';\n\nexport default class SearchBar extends Component {\n render() {\n return... | javascript | chosen |
[
{
"from": "system",
"value": "Add make new xss check func\n"
},
{
"from": "human",
"value": "const express = require('express');\nconst app = express();\n\napp.get('/', function (req, res) {\n res.send('a');\n});\n\nconst server = app.listen(8080, function () {\n const host = server.address().... | javascript | chosen |
[
{
"from": "system",
"value": "Implement addition of stops via function; Sort stops by location;\n"
},
{
"from": "human",
"value": "var color = require(\"color\");\n\nvar Radient = function(obj) {\n if (obj instanceof Radient) return obj;\n\n this.stops = [];\n\n for (var i = 0; i < arguments.... | javascript | chosen |
[
{
"from": "system",
"value": "Add a new gut status\n"
},
{
"from": "human",
"value": "var stati = [\n 'irritable',\n 'gassy',\n 'diuretic',\n 'constipated',\n 'twisted',\n 'cramped',\n 'surly',\n 'churlish',\n 'hungry',\n 'famished'\n // Have another idea? Submit... | javascript | chosen |
[
{
"from": "system",
"value": "Fix bug where vendorTree is undefined\n\nIt turns out that when running `ember release`, the vendor folder is\nremoved from the packaged module before pushing to npm. This causes\n`vendorTree` that is passed in to `treeForVendor` to be undefined which\nblows up.\n\nThis just ch... | javascript | chosen |
[
{
"from": "system",
"value": "Add snippet fetching to HEAD\n"
},
{
"from": "human",
"value": "/* jshint node: true */\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nfunction readSnippet() {\n try {\n // NOTE: expecting addon as a node_module on parent addon or in a... | javascript | chosen |
[
{
"from": "system",
"value": "Change key of of stored boops with refId\n"
},
{
"from": "human",
"value": "const markers = (state = {}, action) => {\n switch (action.type) {\n case 'ADD_MARKER':\n if (Array.isArray(action.newMarker)) {\n var allMarkers = {};\n action.newMar... | javascript | chosen |
[
{
"from": "system",
"value": "Add return UUID,Created,Modified to putQuestionnaire\n"
},
{
"from": "human",
"value": "'use strict'\n\nconst MongoClient = require('mongodb').MongoClient;\nconst ObjectId = require('mongodb').ObjectID;\n\nmodule.exports = (mongodbUrl) => {\n\n async function getQu... | javascript | chosen |
[
{
"from": "system",
"value": "Add github link to footer\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport Gravatar from 'react-gravatar';\n\nconst Footer = () => {\n const author = {\n name: 'Angelo Ocana',\n homeCity: 'Ottawa',\n email: 'angeloocana@gmail.com'\n }... | javascript | chosen |
[
{
"from": "system",
"value": "Rewrite using the latest Jade plugin architecture\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar walk = require('jade-walk');\nvar stringify = require('js-stringify');\n\nmodule.exports = function addLoc (ast) {\n ast = JSON.parse(JSON.stringify(ast));\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Update IIFE to reference window directly\n\nWhen using this polyfill as an ES2015 module (with a tool such as Rollup), it receives this error:\r\n\r\n```\r\nnode_modules\\window.requestanimationframe\\requestanimationframe.js (49:2) The 'this' keyword is equivalent to 'undefine... | javascript | chosen |
[
{
"from": "system",
"value": "Use `var` in source code because Helmet supports Node 0.10\n"
},
{
"from": "human",
"value": "const DEFAULT_PERMITTED_POLICIES = 'none'\nconst ALLOWED_POLICIES = [\n 'none',\n 'master-only',\n 'by-content-type',\n 'all'\n]\n\nmodule.exports = function crossdomai... | javascript | chosen |
[
{
"from": "system",
"value": "Move regex out of the function to improve RAM usage."
},
{
"from": "human",
"value": "/*!\n * is-extglob <https://github.com/jonschlinkert/is-extglob>\n *\n * Copyright (c) 2014-2016, Jon Schlinkert.\n * Licensed under the MIT License.\n */\n\nmodule.exports = funct... | javascript | chosen |
[
{
"from": "system",
"value": "Change example from Null Island to Ha Noi\n"
},
{
"from": "human",
"value": "var explode = require('turf-explode');\nvar point = require('turf-point');\n\n/**\n * Calculates the centroid of a polygon Feature or\n * FeatureCollection using the geometric mean of all v... | javascript | chosen |
[
{
"from": "system",
"value": "Use the environment's port instead of 3000.\n"
},
{
"from": "human",
"value": "var express = require('express'),\n app = express(),\n logger = require('morgan'),\n stylus = require('stylus');\n\napp.use(logger());\n\n// Stylus\napp.use(\n stylus.midd... | javascript | chosen |
[
{
"from": "system",
"value": "Change thrown error to gulputil.PluginError\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar es = require('event-stream');\nvar gutil = require('gulp-util');\nvar ejs = require('ejs');\n\nmodule.exports = function (options, settings) {\n return es.map(func... | javascript | chosen |
[
{
"from": "system",
"value": "Add missing licence header to js file\n"
},
{
"from": "human",
"value": "$(document).ready(function() {\n var body = document.querySelector('body');\n\n var loadScript = function (url) {\n var elt = document.createElement('script');\n elt.setAttribute('src',... | javascript | chosen |
[
{
"from": "system",
"value": "Allow port to be set by env vars\n"
},
{
"from": "human",
"value": "var express = require(\"express\");\n\nvar app = express();\n\napp.use(express.static(\"dist\"));\n\napp.listen(3333);\n"
},
{
"from": "gpt",
"value": "var express = require(\"express\")... | javascript | chosen |
[
{
"from": "system",
"value": "Add basic specs to the main functionality of getColor\n"
},
{
"from": "human",
"value": "/**\n * Load Subject\n */\neval(require('fs').readFileSync('./src/RandomColor.js', 'utf8'));\n\n/**\n * Test suite\n */\ndescribe(\"RandomColor\", function() {\n\n it(\"shoul... | javascript | chosen |
[
{
"from": "system",
"value": "Fix the deleter that was never tested.\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst Promise = require('bluebird');\nconst rmdir = Promise.promisify(require('rimraf'));\nconst db = require('../shared/db');\n\nmodule.exports = function() {\n getOldFold... | javascript | chosen |
[
{
"from": "system",
"value": "Add --no-sandbox flag for testing in Jenkins"
},
{
"from": "human",
"value": "/* eslint-env node */\nmodule.exports = {\n \"framework\": \"qunit\",\n \"test_page\": \"tests/index.html?hidepassed\",\n \"disable_watching\": true,\n \"launch_in_ci\": [\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Update removeExcessSpaces to operate with side effects\n"
},
{
"from": "human",
"value": "var removeExcessSpaces = function(htmlString) {\n\tvar processedString = htmlString.replace(/\\s+</g, '<');\n\tprocessedString = processedString.replace(/>\\s+/g, '>');\n proc... | javascript | chosen |
[
{
"from": "system",
"value": "Disable keyboard support on tree, so it doesn't trap scrolling.\n"
},
{
"from": "human",
"value": "// Auto-magically referenced. Yay.\n\n$(document).ready(function() {\n var rubyFolders = gon.folders;\n if (!rubyFolders) {\n return;\n }\n\n var folders = {}... | javascript | chosen |
[
{
"from": "system",
"value": "Fix calculation of cached requests\n"
},
{
"from": "human",
"value": "const { countBy } = require('lodash');\n\n/**\n * @param {Request[]} requests\n * @return {Object<string, number>}\n */\nfunction countHits(requests) {\n return countBy(requests, (req) => {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use init instead of a bare constructor\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar Reporter = require('./lib/reporter');\nvar DependencyChecker = require('./lib/dependency-checker');\n\nmodule.exports = function emberCliDependencyCheckerAddon(project) {\... | javascript | chosen |
[
{
"from": "system",
"value": "Allow the sampled file to be passed in.\n"
},
{
"from": "human",
"value": "const dotenv = require('dotenv-safe');\nconst fs = require('fs');\nconst DefinePlugin = require('webpack').DefinePlugin;\n\nmodule.exports = DotenvPlugin;\n\nfunction DotenvPlugin(options) {\... | javascript | chosen |
[
{
"from": "system",
"value": "GEN-63: Use pandoc's multiline_tables extension to build table\n"
},
{
"from": "human",
"value": "/*\n * Created brightSPARK Labs\n * www.brightsparklabs.com\n */\n\n'use strict';\n\n// -----------------------------------------------------------------------------\n/... | javascript | chosen |
[
{
"from": "system",
"value": "Fix for instance where on initial app visit close button doesn't work.\n"
},
{
"from": "human",
"value": "angular\n .module('app')\n .factory('history', function($window) {\n return {\n back: function() {\n $window.history.back();\n },\n f... | javascript | chosen |
[
{
"from": "system",
"value": "Add sort by length up\n"
},
{
"from": "human",
"value": "function intersection(setA, setB) {\n return new Set([...setA].filter(x => setB.has(x)))\n}\n\nfunction uniqueArray(array) {\n function isItFirstOccurrence(element, index, array) {\n\treturn index == arr... | javascript | chosen |
[
{
"from": "system",
"value": "Fix error handling when output file is specified\n"
},
{
"from": "human",
"value": "var css = require('./css')\n , less = require('./less')\n , sass = require('./sass')\n , path = require('path')\n , writer = require('write-to-path')\n\nmodule.exports = function... | javascript | chosen |
[
{
"from": "system",
"value": "Throw error (instead of log and exit) on redis connection failure.\n"
},
{
"from": "human",
"value": "var chalk = require('chalk');\n\nvar redisStore;\n\nvar config = {\n\tsecret: 'change-this-fool',\n\tresave: true,\n\tsaveUninitialized: true\n};\n\nvar redisConfig... | javascript | chosen |
[
{
"from": "system",
"value": "Clean up memory on tab close\n"
},
{
"from": "human",
"value": "// Storage\nvar tabs = {}\n\n// Incoming request\nchrome.extension.onRequest.addListener( function( request, sender, response ) {\n\tswitch( request.action ) {\n\t\t\n\t\t// Bird spotted\n\t\tcase 'twit... | javascript | chosen |
[
{
"from": "system",
"value": "Make the version and timeout constants part of the prototype\n\nThey don't need to be set in the constructor\n"
},
{
"from": "human",
"value": "var debug = require( 'debug' )( 'wpcom-vip' );\nvar request = require( './lib/util/request' );\n\n// Modules\n\n... | javascript | chosen |
[
{
"from": "system",
"value": "Annotate Button - Don't remove the element, but hide it so the layout stays intact\n"
},
{
"from": "human",
"value": "(function() {\nvar top = window.top;\n\nfunction passThroughClick(elem, messageKey) {\n elem.bind('click', function() {\n top.postMessage(messag... | javascript | chosen |
[
{
"from": "system",
"value": "Check against `this.cacheable` before running\n\nLooks like that might not be available when using the loader at backend.\nCloses #3.\n"
},
{
"from": "human",
"value": "'use strict';\nvar cheerio = require('cheerio');\nvar he = require('he');\nvar hl = require('high... | javascript | chosen |
[
{
"from": "system",
"value": "Change prompt to just '>'."
},
{
"from": "human",
"value": "function eval_clojure(code) {\n var data;\n $.ajax({\n url: \"eval.json\",\n data: { expr : code },\n async: false,\n success: function(res) { data = res; }\n });\n r... | javascript | chosen |
[
{
"from": "system",
"value": "Fix the flex on panels with buttons\n"
},
{
"from": "human",
"value": "import React from \"react\";\n\nclass IntroWithButton extends React.Component {\n static displayName = \"Panel.IntroWithButton\";\n\n static propTypes = {\n children: React.PropTypes.node.is... | javascript | chosen |
[
{
"from": "system",
"value": "Fix select element global listener\n"
},
{
"from": "human",
"value": "$(function() {\n\n $('.dropdown').each(function() {\n var element = $(this);\n var dropdownList = element.find(\".dropdownList\");\n if(dropdownList.children().length === 0... | javascript | chosen |
[
{
"from": "system",
"value": "Add chapter 4, exercise 2\n"
},
{
"from": "human",
"value": "function reverseArray(array) {\n let newArray = [];\n for (let i = array.length - 1; i >= 0; --i) {\n newArray.push(array[i]);\n }\n return newArray;\n}\n\nfunction reverseArrayInPlace(a... | javascript | chosen |
[
{
"from": "system",
"value": "Adjust font-size of title and create new stacking context for Highlight\n\n"
},
{
"from": "human",
"value": "//@flow\n\nimport styled, { css } from \"styled-components\";\n\nexport const Title = styled.h1`\n\n ${({ theme }: { theme: Theme }) => css`\n \n ${them... | javascript | chosen |
[
{
"from": "system",
"value": "Fix stat named map providers cache count\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst statKeyTemplate = ctx => `windshaft.named-map-provider-cache.${ctx.metric}`;\n\nmodule.exports = class NamedMapProviderReporter {\n constructor ({ namedMapProviderC... | javascript | chosen |
[
{
"from": "system",
"value": "build: Exclude .json files in the build\n"
},
{
"from": "human",
"value": "import gulp from 'gulp';\nimport sourceMaps from 'gulp-sourcemaps';\nimport babel from 'gulp-babel';\nimport path from 'path';\nimport del from 'del';\n\nconst paths = {\n es6Path: './src/**... | javascript | chosen |
[
{
"from": "system",
"value": "Add local: true on slate patches\n"
},
{
"from": "human",
"value": "export default function createLocalStatePatch(state) {\n return {\n type: 'localState',\n value: state\n }\n}\n"
},
{
"from": "gpt",
"value": "export default function createLocal... | javascript | chosen |
[
{
"from": "system",
"value": "Set name for snapshot testing\n"
},
{
"from": "human",
"value": "import {testAndSnapshot} from 'lib/utils/component'\nimport BookmarkChooser from '../bookmark-chooser'\n\ntestAndSnapshot(BookmarkChooser)\n"
},
{
"from": "gpt",
"value": "import {testAndSn... | javascript | chosen |
[
{
"from": "system",
"value": "Update core-js import paths for v3.0.0\n"
},
{
"from": "human",
"value": "'use strict';\n\n// Polyfills for APIs which are not present on all supported\n// versions of Chrome\n\n// ES2015+ polyfills\nrequire('core-js/fn/object/assign'); // Available: Chrome >= 45\nr... | javascript | chosen |
[
{
"from": "system",
"value": "Update thumbnail.js so as to not confuse people\n\nTo my knowledge, the `end` event doesn't give us the files as arguments anymore. \r\n\r\nI just added the `filenames` event to the example."
},
{
"from": "human",
"value": "var ffmpeg = require('../index');\n\nvar p... | javascript | chosen |
[
{
"from": "system",
"value": "Hide commands that have been marked as hidden\n"
},
{
"from": "human",
"value": "module.exports = function(bot){\n\tbot.addCommand('help', 'Shows help', '<command>', USER_LEVEL_NORMAL, false, function(event){\n\t\tvar message = '',\n\t\t\tprefix = bot.CommandManager... | javascript | chosen |
[
{
"from": "system",
"value": "Add get in progress content mehtod\n"
},
{
"from": "human",
"value": "import http from '../http';\n\nexport default class collections {\n\n static get(collectionID) {\n return http.get(`/zebedee/collectionDetails/${collectionID}`)\n .then(respon... | javascript | chosen |
[
{
"from": "system",
"value": "Add `help` command to Antonio.\n"
},
{
"from": "human",
"value": "const logger = require('../../../lib/logger');\n\nconst chat = (bot, message) => {\n logger.debug('Someone said something to me', message);\n const { text, user } = message;\n if ((/h(i|ello)/i).te... | javascript | chosen |
[
{
"from": "system",
"value": "Work around an Ember Data bug.\n"
},
{
"from": "human",
"value": "import resolver from './helpers/resolver';\nimport {\n setResolver\n} from 'ember-qunit';\n\nsetResolver(resolver);\n"
},
{
"from": "gpt",
"value": "import resolver from './helpers/resolv... | javascript | chosen |
[
{
"from": "system",
"value": "Remove extraneous dependency in counter test\n"
},
{
"from": "human",
"value": "import test from 'ava';\nimport React from 'react';\nimport { shallow } from 'enzyme';\nimport sinon from 'sinon';\nimport { rootComponent, Madera } from 'madera';\n\nimport { Counter } ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix uploadFileAndAssign: pass type to File ctor"
},
{
"from": "human",
"value": "'use strict';\n\nexports = module.exports = function (fileData) {\n var binary = atob(fileData.base64);\n var uint8Array = new Uint8Array(binary.length);\n\n for (var i = 0, le... | javascript | chosen |
[
{
"from": "system",
"value": "Paste job definition to clipboard as text and not as HTML.\n\nChange-Id: I158ee4527d74d8cbd03c90d83398c9a6b5a9e2dd\n"
},
{
"from": "human",
"value": "create_tmp_element = function (text) {\n // create temporary textarea in order to copy it's contents.\n var tm... | javascript | chosen |
[
{
"from": "system",
"value": "Add a bit of homepage stuff.\n"
},
{
"from": "human",
"value": "let React = require(\"react\");\n\nexports.Main = React.createClass({\n render: function () {\n return <div>\n Hello, World\n </div>;\n }\n});\n"
},
{
"from": "gpt",
"value": "l... | javascript | chosen |
[
{
"from": "system",
"value": "Test case compatibility with Webpack 4.3+\n"
},
{
"from": "human",
"value": "var SriPlugin = require('webpack-subresource-integrity');\nvar HtmlWebpackPlugin = require('html-webpack-plugin');\nvar ExtractTextPlugin = require('extract-text-webpack-plugin');\nvar crea... | javascript | chosen |
[
{
"from": "system",
"value": "Modules: Change scroll mode to linear for warning module\n"
},
{
"from": "human",
"value": "$(function() {\n\tvar $warning = $('#warning > ul');\n\t// Configure the scrolling area\n\tvar nbItems = $warning.find('li').length;\n\tvar parentWidth = $warning.parent().cs... | javascript | chosen |
[
{
"from": "system",
"value": "Improve url in the test."
},
{
"from": "human",
"value": "/*global describe, beforeEach, module, inject, it, expect*/\n/*jslint nomen: true*/\ndescribe('Post module', function () {\n \"use strict\";\n beforeEach(module('post'));\n\n var PostManager, Post, $... | javascript | chosen |
[
{
"from": "system",
"value": "Change name of loadSources import\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport {Provider} from 'react-redux';\n\nimport './styles/index.css';\nimport {getSources} from './actions/sourcesActions'\nimport App... | javascript | chosen |
[
{
"from": "system",
"value": "Add key handlers for alt+tab/cmd and tab\n"
},
{
"from": "human",
"value": "'use strict';\n\nclass Input {\n\n constructor() {\n this._requestedDirection = 'left';\n this.enterPressed = false;\n this.anyKeyPressed = false;\n }\n\n start... | javascript | chosen |
[
{
"from": "system",
"value": "Call sum endpoint with inqueue§\n"
},
{
"from": "human",
"value": "import { takeLatest } from 'redux-saga'\nimport { call, put, fork } from 'redux-saga/effects'\nimport * as actions from './actions'\nimport 'isomorphic-fetch'\n\nexport default function* root(){\n y... | javascript | chosen |
[
{
"from": "system",
"value": "Use tool separator class for separation.\n"
},
{
"from": "human",
"value": "import Menu from './ToolGroup'\n\n/**\n A component that renders a group of menu items.\n*/\nexport default class MenuGroup extends Menu {\n _getClassNames () {\n return 'sc-menu-group'... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.