conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Update album art size at Yandex.Music\n"
},
{
"from": "human",
"value": "controller = new BasicController({\n supports: {\n playpause: true,\n next: true,\n previous: true,\n favorite: true,\n thumbsDown: false // Changes dynam... | javascript | chosen |
[
{
"from": "system",
"value": "Use runtime.getURL instead of hardcoding\n"
},
{
"from": "human",
"value": "var alreadyExistingTag = document.querySelector(\"script[async][src='chrome-extension://afcmfnlbcoginnfdkokfgpcmooekakhf/content-script-js-accesser.js']\");\nif(!alreadyExistingTag) {\n\tvar... | javascript | chosen |
[
{
"from": "system",
"value": "Use UTF-8 \"word-joiner\" to avoid highlighting"
},
{
"from": "human",
"value": "\nclass Common {\n\n static sanitizeNickname(nickname) {\n return nickname.replace(/[^a-z]/ig, '').toLowerCase();\n }\n\n static avoidHighlighting(nickname) {\n r... | javascript | chosen |
[
{
"from": "system",
"value": "Fix warning from React component prop not being camelCased\n"
},
{
"from": "human",
"value": "const Job = ({ locations, deadline, companyImage, companyName, jobTitle, ingress, jobName }) => {\n if (locations.length >= 2) {\n locations = `${locations.slice(0, -1)... | javascript | chosen |
[
{
"from": "system",
"value": "Add regular expression builder commentary\n"
},
{
"from": "human",
"value": "var irregulars = require('english-irregular-verbs');\n\n// Extract all past participles.\nvar irregularParticiples = [];\nirregulars.forEach(function(verb) {\n verb.participles.forEach(fun... | javascript | chosen |
[
{
"from": "system",
"value": "Remove voice audio after play properly\n"
},
{
"from": "human",
"value": "(function () {\n\nvar eleven = /[\\u4e00-\\u9fbf\\u3040-\\u309f\\u30a0-\\u30ff]/;\n\noneeSama.hook('menuOptions', function (info) {\n\t// TODO use model instead\n\tvar text = $('#' + info.num)... | javascript | chosen |
[
{
"from": "system",
"value": "Use readable stream instead of pass through\n"
},
{
"from": "human",
"value": "'use strict'\n\nconst stream = require('stream')\nconst Transform = stream.Transform\nconst PassThrough = stream.PassThrough\n\n/**\n * Returns a transform stream that branches\n * the in... | javascript | chosen |
[
{
"from": "system",
"value": "Fix base dir in router\n"
},
{
"from": "human",
"value": "var fs = require('fs-extra');\nvar path = require('path');\nvar serveStatic = require('serve-static');\nvar finalhandler = require('finalhandler');\n\nmodule.exports = function(options) {\n options = options... | javascript | chosen |
[
{
"from": "system",
"value": "Change doc style in addEvent()\n"
},
{
"from": "human",
"value": "/* Helper function to add an event listener.\n * @param el The element we want to add an event listener to.\n * @param event The event we want to listen to.\n * @param callback The callback function t... | javascript | chosen |
[
{
"from": "system",
"value": "Add tests for the non-existence of error messages\n"
},
{
"from": "human",
"value": "var Mocha = require('mocha'),\n _ = require('underscore');\n\nmodule.exports = function (browser, module, suite, config, tests) {\n\n suite = Mocha.Suite.create(suite, module.sl... | javascript | chosen |
[
{
"from": "system",
"value": "Add tests for blank lines containing whitespace\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nimport assert from \"assert\";\nimport ftl from \"../src/index\";\n\nsuite(\"blank lines\", function() {\n test(\"leading\", function() {\n assert.equal(\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix module name for UMD\n"
},
{
"from": "human",
"value": "import rollupBabel from \"rollup-plugin-babel\";\n\nconst pkg = require(\"./package.json\");\n\nexport default {\n entry: \"src/index.js\",\n plugins: [\n rollupBabel({\n babelrc: fal... | javascript | chosen |
[
{
"from": "system",
"value": "Add a logging statement for the time being\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar _ = require('underscore');\n\nvar util = require('./util.js');\nvar scan = require('./scan.js');\nvar analyze = require('./analyze.js');\n\nvar cani = function (files,... | javascript | chosen |
[
{
"from": "system",
"value": "Store sidebar status for next session\n"
},
{
"from": "human",
"value": "const default_state = {menu: null, user: {}, sidebar: true, screens: []}\n\nfunction top(state=default_state, action){\n switch(action.type){\n case 'TOP_TOGGLE_MENU':\n if (state.menu... | javascript | chosen |
[
{
"from": "system",
"value": "Replace existing API (no longer used by news-core) with stub containing version number.\n"
},
{
"from": "human",
"value": "const { createWebpackConfig } = require('../config/webpack');\n\nmodule.exports = {\n getDefaultWebpackConfig: createWebpackConfig\n};\n"
},... | javascript | chosen |
[
{
"from": "system",
"value": "Add randomness to the reconnect delay not to flood the server after a worker crash\n"
},
{
"from": "human",
"value": "export const socketOptions = {\n protocol: 'http',\n hostname: 'remotedev.io',\n port: 80,\n autoReconnect: true\n};\n"
},
{
"from": "gp... | javascript | chosen |
[
{
"from": "system",
"value": "Switch from qs to querystring\n\nquerystring is a core node module\n"
},
{
"from": "human",
"value": "var url = require(\"url\");\nvar qs = require(\"qs\");\n\n/**\n * getNextLink\n * @function\n * @param {Object} response A response object returned from calling 'cl... | javascript | chosen |
[
{
"from": "system",
"value": ":shirt: Fix `Prevent missing props validation`\n\nhttps://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport ReactDOM from 'react-dom';\n\nconst Layout = props => <h1>{p... | javascript | chosen |
[
{
"from": "system",
"value": "Add more example in devapp\n"
},
{
"from": "human",
"value": "var Controller = require('../../').Controller;\n\nmodule.exports = Controller.create({\n index(req, res) {\n res.render(\"index\");\n },\n\n socket(req, res) {\n res.render(\"socket... | javascript | chosen |
[
{
"from": "system",
"value": "Modify how the currentPath is retrieved.\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport layout from './template';\n\n/**\n * Modal that provides examples and explanation of Lucene Search syntax\n *\n * ```handlebars\n * {{search-help-modal\n *... | javascript | chosen |
[
{
"from": "system",
"value": "Use aria-current selector instead of className\n"
},
{
"from": "human",
"value": "import React from 'react'\nimport styled from 'styled-components'\nimport { NavLink as Link } from 'react-router-dom'\n\nconst Nav = styled.nav`\n display: flex;\n justify-content: c... | javascript | chosen |
[
{
"from": "system",
"value": "Normalize variable names, and error check for undefined rather than for falsy\n"
},
{
"from": "human",
"value": "/************************************\n * Redis key and channel namespaces *\n ************************************/\n\nmodule.exports = {\n\tgetItemProp... | javascript | chosen |
[
{
"from": "system",
"value": "Make a comment render more nicely"
},
{
"from": "human",
"value": "import restArguments from './restArguments.js';\nimport now from './now.js';\n\n// When a sequence of calls of the returned function ends, the argument\n// function is triggered. The end of a sequenc... | javascript | chosen |
[
{
"from": "system",
"value": "Fix JSHint error with moment\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\n\nexport default Ember.Handlebars.makeBoundHelper(function(value) {\n return moment(value).format('dddd, Do MMMM YYYY, HH:MM A');\n});\n"
},
{
"from": "gpt",
"va... | javascript | chosen |
[
{
"from": "system",
"value": "refactor: Clean up test suite's common variables.\n\nSigned-off-by: Oleksii Fedorov <0263a738e29f7a423bda1d60ddbfb884af6a4010@gmail.com>\n"
},
{
"from": "human",
"value": "describe(\"Tic Tac Toe Game\", function() {\n it(\"makes sure that player One starts\", funct... | javascript | chosen |
[
{
"from": "system",
"value": "Add some debug output for convenience.\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar express = require('express');\nvar router = express.Router();\nvar auth = require('../../passport');\n\nvar restUtils = require('../utils');\n\nvar os = require('os');\n\n... | javascript | chosen |
[
{
"from": "system",
"value": "Allow TimeZone list to be retrieved\n"
},
{
"from": "human",
"value": "(function (angular) {\n 'use strict';\n var InEngineApi = function ($resource, apiUrl) {\n this.$resource = $resource;\n this.apiUrl = apiUrl;\n };\n\n InEngineApi.proto... | javascript | chosen |
[
{
"from": "system",
"value": "Fix escapeTag for non-string values\n"
},
{
"from": "human",
"value": "// https://docs.influxdata.com/influxdb/v1.5/write_protocols/line_protocol_tutorial/#special-characters-and-keywords\n\nexport function stringifyPoints(points) {\n return points.map(_stringifyPo... | javascript | chosen |
[
{
"from": "system",
"value": "Add logging to show store injected into routes is a DS.Store\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n blogData: Ember.inject.service(),\n\n model() {\n return this.get('blogData').posts;\n }\n});\n"... | javascript | chosen |
[
{
"from": "system",
"value": "Fix bug where role change logged on nickname change.\n"
},
{
"from": "human",
"value": "exports.func = (client, oldMember, newMember) => {\n\tif(oldMember.nickname != newMember.nickname) {\n\t\toldFormatted = oldMember.nickname ? `\\`${oldMember.nickname}\\`` : \"_(... | javascript | chosen |
[
{
"from": "system",
"value": "Switch to denydisconnect simply cos early talkers are RUDE!\n"
},
{
"from": "human",
"value": "// This plugin checks for clients that talk before we sent a response\n\nvar constants = require('../constants');\nvar config = require('../config');\n\nexports.registe... | javascript | chosen |
[
{
"from": "system",
"value": "Fix for plug-in : LeBonCoin\n"
},
{
"from": "human",
"value": "var hoverZoomPlugins = hoverZoomPlugins || [];\nhoverZoomPlugins.push({\n name:'Le bon coin',\n version:'0.1',\n prepareImgLinks:function (callback) {\n var res = [];\n hoverZoom.... | javascript | chosen |
[
{
"from": "system",
"value": "Fix missing phone list in WebApp."
},
{
"from": "human",
"value": "'use strict';\n\n/* Controllers */\n\nvar phonecatApp = angular.module('phonecatApp', []);\n\nphonecatApp.controller('PhoneListCtrl', function($scope, $http) {\n $http.get('phone/list').success(func... | javascript | chosen |
[
{
"from": "system",
"value": "Add basic tests for dom.js\n"
},
{
"from": "human",
"value": "//\n// Tests!\n//\n\n'use strict';\n\nvar dom = require('./dom');\nvar assert = require('assert');\n\n//\n// Test 'element' and 'clone'.\n//\n(function() {\n var e = dom.element({name: 'p', contents: '... | javascript | chosen |
[
{
"from": "system",
"value": "Change official reference message wording\n\n"
},
{
"from": "human",
"value": "import React from \"react\";\nimport { connect } from \"react-redux\";\nimport styled from \"styled-components\";\nimport { Box, Button, ExternalLink } from \"../../base\";\nimport { chec... | javascript | chosen |
[
{
"from": "system",
"value": "Fix user VC incrementing on client side.\n"
},
{
"from": "human",
"value": "import {\n commitMutation,\n graphql\n} from 'react-relay/compat'\n\nconst mutation = graphql`\n mutation UpdateVcMutation($input: UpdateVcInput!) {\n updateVc(input: $input) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix sign out to clear local storage\n\nfbshipit-source-id: ab91990\n"
},
{
"from": "human",
"value": "/**\n * Copyright 2015-present 650 Industries. All rights reserved.\n *\n * @providesModule AuthTokenActions\n */\n'use strict';\n\nimport { action } from 'Flux';\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add a check to see if auth is necessary\n"
},
{
"from": "human",
"value": "import Auth0Lock from 'auth0-lock'\n\nexport const lock = new Auth0Lock(process.env.AUTH0_CLIENT_ID, process.env.AUTH0_DOMAIN)\n"
},
{
"from": "gpt",
"value": "import Auth0Lock fr... | javascript | chosen |
[
{
"from": "system",
"value": "Set higher age and buffer length for Next.js pages in dev\n"
},
{
"from": "human",
"value": "const withCSS = require('@zeit/next-css');\n\nconst { ANALYZE } = process.env;\n\n// Use next-compose-plugins if this gets weird\nmodule.exports = withCSS({\n distDir: '..... | javascript | chosen |
[
{
"from": "system",
"value": "Refactor lightweight tags to remove duplication 🐞"
},
{
"from": "human",
"value": "var buildFile = require('./build-file')\nvar runGitCommand = require('./helpers/run-git-command')\n\nvar COMMITHASH_COMMAND = 'rev-parse HEAD'\nvar VERSION_COMMAND = 'describe --alwa... | javascript | chosen |
[
{
"from": "system",
"value": "Use util.request to make authenticated requests\n"
},
{
"from": "human",
"value": "// Dependencies\nvar Config = require(\"../conf\");\n\nvar Artworks = module.exports = {};\n\n// TODO JSDoc\nArtworks.fromArtist = function (user, callback) {\n\n var $ = null\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use double quotes instead of single ones.\n"
},
{
"from": "human",
"value": "var gulp = require('gulp');\nvar tasks = [];\n\n// Browserify\nvar browserify = require('browserify');\nvar vinylSourceStream = require('vinyl-source-stream');\n\nvar makeBrowserify = funct... | javascript | chosen |
[
{
"from": "system",
"value": "Allow blob handling on Cordova\n"
},
{
"from": "human",
"value": "App.info({\n id: 'org.erikdemaine.coauthor',\n name: 'Coauthor',\n version: '1.0.0',\n author: 'Erik Demaine',\n email: 'edemaine+coauthor@mit.edu'\n});\n\nApp.accessRule('*');\n"
},
{
"f... | javascript | chosen |
[
{
"from": "system",
"value": "Allow visiting landing page even when logged in\n"
},
{
"from": "human",
"value": "Router.onBeforeAction(function () {\n if (!Meteor.loggingIn() && !Meteor.userId() && Session.get('resetPassword')) {\n this.redirect('forgotPassword');\n }\n this.next();\n}, { ... | javascript | chosen |
[
{
"from": "system",
"value": "[Flow] Use \"Promise<any>\" instead of \"Promise<*>\" to avoid inference\n\n`Promise<*>` is getting inferred to be `Promise<Map | Set>` but we actually want `Promise<any>`.\n"
},
{
"from": "human",
"value": "// @flow\nimport isPlainObject from 'lodash/isPlainObject'... | javascript | chosen |
[
{
"from": "system",
"value": "Allow a context to be passed into eval\n\nInstead of using the plain javascript eval, abacus-eval is\nnow using node's vm to run the provided function inside\na sandbox with a given context\n\nSee Pivotal Tracker [#106168524]\n"
},
{
"from": "human",
"value": "'use ... | javascript | chosen |
[
{
"from": "system",
"value": "Add svc to sample ctrl\n"
},
{
"from": "human",
"value": "(function() {\n 'use strict';\n \n angular.module('Sample')\n .controller('sampleController', sampleController);\n\n sampleController.$inject = ['commonService'];\n\n function sampleCont... | javascript | chosen |
[
{
"from": "system",
"value": "Update again to cause purge hopefully\n"
},
{
"from": "human",
"value": "importScripts('/importme.mjs');\n\nconst CACHE_NAME = 'ROOT_CACHE';\n\nasync function cacheAllThings() {\n const cache = await caches.open(CACHE_NAME);\n cache.addAll([\n './index.... | javascript | chosen |
[
{
"from": "system",
"value": "Add missing number and object static methods\n\nTook from \"Object static methods\" and \"Number properties\" sections here\n\nhttps://kangax.github.io/compat-table/es6/\n"
},
{
"from": "human",
"value": "'use strict';\n\nmodule.exports = {\n meta: {\n docs: {\n... | javascript | chosen |
[
{
"from": "system",
"value": "[WEB-766] Rework popover to allow width to auto size by default, and be overriden by prop.\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport { default as Base, PopoverProps } from '@material-ui/core/Popover';\nimport styled from 'styled-component... | javascript | chosen |
[
{
"from": "system",
"value": "Remove lingering backlog import that broke things\n"
},
{
"from": "human",
"value": "import { FlowRouter } from 'meteor/kadira:flow-router';\nimport { BlazeLayout } from 'meteor/kadira:blaze-layout';\n// import { AccountsTemplates } from 'meteor/useraccounts:core';\... | javascript | chosen |
[
{
"from": "system",
"value": "Make test name more descriptive\n"
},
{
"from": "human",
"value": "/*global describe, it */\nvar Nut = require('../lib'),\n pfs = require('../lib/pfs'),\n path = require('path'),\n expect = require('chai').expect;\n\nfunction testFile(basename) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Reset char count on post\n"
},
{
"from": "human",
"value": "$(() => {\n $('.js-character-count').each((i, el) => {\n const $el = $(el);\n const $target = $el.siblings($el.attr('data-target'));\n const max = $el.attr('data-max');\n\n $target.on('keyup', ... | javascript | chosen |
[
{
"from": "system",
"value": "Add content submission for file\n"
},
{
"from": "human",
"value": "var fs = require('fs');\nvar tmp = require('tmp');\n\nfunction createCompilationFile(body) {\n var require = \"var assert = require('assert');\";\n fs.appendFile('test.js', require+'\\n'+'\\n'+body... | javascript | chosen |
[
{
"from": "system",
"value": "Add greedSpread to Run Model\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar mongoose = require('mongoose');\n\nvar Schema = mongoose.Schema;\nvar ObjectId = Schema.ObjectId;\n\nvar runSchema = new Schema({\n time: Date,\n participants: [ String ],\n ... | javascript | chosen |
[
{
"from": "system",
"value": "flow: Add a quick reference-comment in that new libdef file.\n"
},
{
"from": "human",
"value": "declare var __TEST__: true | void;\n"
},
{
"from": "gpt",
"value": "// Definitions we want Flow to assume.\n//\n// For docs on the format, see:\n// https://... | javascript | chosen |
[
{
"from": "system",
"value": "Allow deprecated warning to have one prop\n\nand not a new prop\n"
},
{
"from": "human",
"value": "/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n/* eslint-dis... | javascript | chosen |
[
{
"from": "system",
"value": "Allow a default mock user to be identified when running in offline mode.\n"
},
{
"from": "human",
"value": "'use strict';\n\n//TODO: Remove dependency on toastr\n/** Check to see if dependent modules exist */\ntry {\n angular.module('toastr');\n}\ncatch (e) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix expensive transform tests by increasing timeouts to 5000ms.\n"
},
{
"from": "human",
"value": "import assert from \"assert\";\nimport { join } from \"path\";\nimport {\n readdirSync,\n readFileSync,\n statSync,\n} from \"fs\";\nimport { compile, transform } f... | javascript | chosen |
[
{
"from": "system",
"value": "Add additional POST request to create 'In Progress' label on issue\n"
},
{
"from": "human",
"value": "const Request = require('request');\n\nmodule.exports = (options, cb) => {\n const payload = { 'assignees': [ options.userName ] };\n\n Request.post({\n url: o... | javascript | chosen |
[
{
"from": "system",
"value": "Move exported function to end of file\n"
},
{
"from": "human",
"value": "import _ from 'underscore';\n\nconst DATE_FILENAME_MATCHER = /^(?:.+\\/)*(\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]))-(.*)(\\.[^.]+)$/;\nconst FILENAME_MATCHER = /^(.*)(\\.[^.]+)$/;\n\n/... | javascript | chosen |
[
{
"from": "system",
"value": "Throw an error on var declaration\n\n"
},
{
"from": "human",
"value": "module.exports = {\n 'extends': [\n 'eslint:recommended'\n ],\n 'rules': {\n 'indent': [2, 2, {\n 'SwitchCase': 1\n }],\n 'arrow-spacing': [2, {\n 'before': true, 'after'... | javascript | chosen |
[
{
"from": "system",
"value": "Make sure `meteor shell` commands are compiled for Node 8.\n"
},
{
"from": "human",
"value": "ECMAScript = {\n compileForShell(command, cacheOptions) {\n const babelOptions = Babel.getDefaultOptions();\n delete babelOptions.sourceMap;\n delete babelOptions... | javascript | chosen |
[
{
"from": "system",
"value": "Add class to all inputs\n"
},
{
"from": "human",
"value": "$(document).ready(function() {\n\n // put all your jQuery code here\n \n});"
},
{
"from": "gpt",
"value": "$(document).ready(function() {\n\n // Add class to all inputs (input's type attribute... | javascript | chosen |
[
{
"from": "system",
"value": "Use the same accept headers in browsers."
},
{
"from": "human",
"value": "/*! @license ©2013 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */\n/** Browser replacement for the request module using jQuery. */\n\nvar EventEmitter = require('events').Event... | javascript | chosen |
[
{
"from": "system",
"value": "Make test in IE pass\n"
},
{
"from": "human",
"value": "describe('Operations', function () {\n var isNode = typeof module !== 'undefined' && module.exports;\n var Parallel = isNode ? require('../lib/parallel.js') : self.Parallel;\n\n it('should require(), ... | javascript | chosen |
[
{
"from": "system",
"value": "Add `@babel/runtime` to npm dependencies\n\nAs explained in the \"Compiling compiler plugins after installation\" section of https://blog.meteor.com/meteor-1-8-erases-the-debts-of-1-7-77af4c931fe3.\n"
},
{
"from": "human",
"value": "Package.describe({\n name: 'svel... | javascript | chosen |
[
{
"from": "system",
"value": "Comment out actvitiy session logging for now\n"
},
{
"from": "human",
"value": "export function sendActivitySessionInteractionLog(activitySessionUID, data = {}) {\n if (activitySessionUID === 'null' || activitySessionUID == null) {\n return null;\n }\n const u... | javascript | chosen |
[
{
"from": "system",
"value": "Add documentation for each step in the selectionSort process\n"
},
{
"from": "human",
"value": "/**\n * An implementation of selectionSort\n *\n * @name selectionSort\n * @function\n * @param {Array} xs the list to sort\n */\nexport function selectionSort(xs) {\n f... | javascript | chosen |
[
{
"from": "system",
"value": "Add watches on es6 sources\n"
},
{
"from": "human",
"value": "/*eslint-env amd */\nvar gulp = require('gulp');\nvar es6ify = require('es6ify');\nvar eslint = require('gulp-eslint');\nvar browserify = require('browserify');\nvar source = require('vinyl-source-stream'... | javascript | chosen |
[
{
"from": "system",
"value": "Add null guard to mdast-directive-comment util\n"
},
{
"from": "human",
"value": "// @flow\nimport commentMarker from 'mdast-comment-marker'\nimport visit from 'unist-util-visit'\n\nimport type { Parent } from 'unist'\nimport type { HTML } from 'mdast'\nimport type ... | javascript | chosen |
[
{
"from": "system",
"value": "Use node v0.12-compatible features to allow building with that version.\n"
},
{
"from": "human",
"value": "import babel from 'rollup-plugin-babel';\nimport { readFileSync } from 'fs';\n\nconst babelConfig = JSON.parse(readFileSync('.babelrc', { encoding: 'utf8' }));... | javascript | chosen |
[
{
"from": "system",
"value": "Add TODO in Google Provider\n"
},
{
"from": "human",
"value": "import google from 'googleapis';\nimport nconf from '../config';\nimport User from '../models/user';\n\nconst OAuth2 = google.auth.OAuth2;\n\nexport default class GoogleProvider {\n\n constructor(token,... | javascript | chosen |
[
{
"from": "system",
"value": "Call ArrPI and translate that yolo pirate talk\n"
},
{
"from": "human",
"value": "var https = require('https');\n\n"
},
{
"from": "gpt",
"value": "var https = require('https');\n\nvar BASE_URL = 'http://isithackday.com/arrpi.php';\n\nexports.getYoloPirat... | javascript | chosen |
[
{
"from": "system",
"value": "fix(mocks): Fix [$injector:unpr] by using inline array annotation."
},
{
"from": "human",
"value": "/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaDatePicker\n *\n * @description\n * A service for testing datepicker features\n * in an app build with ngCordov... | javascript | chosen |
[
{
"from": "system",
"value": "Speed up webpack a bit\n"
},
{
"from": "human",
"value": "var webpack = require('webpack')\n\nmodule.exports = {\n entry: './js/app.js',\n debug: true,\n devtool: 'source-map',\n output: {\n filename: 'bundle.js'\n },\n plugins: [\n new webpack.ProvidePl... | javascript | chosen |
[
{
"from": "system",
"value": "Add support for jsx in webpack\n\n"
},
{
"from": "human",
"value": "const path = require('path');\n\nmodule.exports = {\n entry: {\n app: ['./src/index.js']\n },\n output: {\n path: path.resolve(__dirname, 'build'),\n publicPath: '/ass... | javascript | chosen |
[
{
"from": "system",
"value": "Exclude node_modules from vue loader\n"
},
{
"from": "human",
"value": "var path = require('path');\nvar ExtractTextPlugin = require(\"extract-text-webpack-plugin\")\n\nmodule.exports = {\n entry: './src/index.js',\n output: {\n path: path.resolve(__dir... | javascript | chosen |
[
{
"from": "system",
"value": "Fix link opened in background tab\n"
},
{
"from": "human",
"value": "function documentClick(event) {\n var target = event.target;\n\n // Open non-javascript links clicked in background tabs.\n var targetClickedIsAnchor = target.nodeName === 'A';\n var an... | javascript | chosen |
[
{
"from": "system",
"value": "Add loaders, plugin and aliases for jquery, jquery-ui\n"
},
{
"from": "human",
"value": "var path = require(\"path\");\n\nmodule.exports = {\n entry: {\n forms: \"./forms.js\",\n headings: \"./headings.js\",\n images: \"./images.js\",\n in... | javascript | chosen |
[
{
"from": "system",
"value": "Add code that generated the sunflower.\n"
},
{
"from": "human",
"value": "var width = 570,\n height = 550;\n\nvar svg = d3.select(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n"
},
{
"from": "gpt",
"value": "// Set up SVG for D3.\... | javascript | chosen |
[
{
"from": "system",
"value": "Return the image url and create load tag\n"
},
{
"from": "human",
"value": "window.ImgLoader = function () {\n throw new Error();\n}\n\nwindow.ImgLoader._count = 0;\n\nwindow.ImgLoader.count = function(inc){\n switch (inc) {\n case '+': window.ImgLoader... | javascript | chosen |
[
{
"from": "system",
"value": "Use port for protocol when none is provided\n\nFixes #245"
},
{
"from": "human",
"value": "\nvar websocket = require('websocket-stream');\nvar URL = require('url');\n\nfunction buildBuilder(client, opts) {\n var host = opts.hostname || 'localhost'\n , port = opt... | javascript | chosen |
[
{
"from": "system",
"value": "Add length to Buffer.concat invoke\n\nAdd length to Buffer.concat invoke.\r\nThat should increase performance according to the node documenation.\r\n\r\nIf totalLength is not provided, it is calculated from the Buffer instances in list. This however causes an additional loop to... | javascript | chosen |
[
{
"from": "system",
"value": "Add thunk middleware to counter\n"
},
{
"from": "human",
"value": "import { createDispatcher } from 'fluorine-lib'\n\nconst dispatcher = createDispatcher({\n logging: true\n})\n\nexport default dispatcher\n\n"
},
{
"from": "gpt",
"value": "import { crea... | javascript | chosen |
[
{
"from": "system",
"value": "Make TryStart recover more gracefully\n\ngit-svn-id: abd770af2affaf62930f25b244f6edafe8ddae5b@269 164481a5-15cb-f69f-4b93-856c5b7754c5\n"
},
{
"from": "human",
"value": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Ve... | javascript | chosen |
[
{
"from": "system",
"value": "Return Largest Numbers in Arrays\n"
},
{
"from": "human",
"value": "function largestOfFour(arr) {\n // You can do this!\n largest=[];\n \n for(var i=0; i<arr.length; i++){\n num=arr[i][0];\n for(var j=0; j<arr[i].length; j++){\n if(arr[i][j]>num){\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Declare function instead of express\n"
},
{
"from": "human",
"value": "table = function () {\n $(\".js-vertical-tab-content\").hide();\n $(\".js-vertical-tab-content:first\").show();\n\n $(\".js-vertical-tab\").click(function(event) {\n event.preventDefault();... | javascript | chosen |
[
{
"from": "system",
"value": "Put both the window URL and the test URL through an anchor.\n\nFixes an inconsistency in IE between a.href and window.location about whether default ports are included or not.\n"
},
{
"from": "human",
"value": "/*global define*/\ndefine(function() {\n \"use stric... | javascript | chosen |
[
{
"from": "system",
"value": "Add point médian to guest title\n"
},
{
"from": "human",
"value": "import React from 'react'\nimport PropTypes from 'prop-types'\n\nconst Guests = (props) => {\n if (props.guests.size > 0) {\n const guests = props.guests.map((guest, index) => {\n return <li... | javascript | chosen |
[
{
"from": "system",
"value": "Fix JSHint issues with template node test file\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar <%= slugname %> = require('../lib/<%= slugname %>.js');\n\n/*\n ======== A Handy Little Nodeunit Reference ========\n https://github.com/caolan/nodeunit\n\n Tes... | javascript | chosen |
[
{
"from": "system",
"value": "Add test specs for basic operation\n"
},
{
"from": "human",
"value": "/*global describe, beforeEach, it*/\n'use strict';\n\nvar path = require('path');\nvar helpers = require('yeoman-generator').test;\n\n\ndescribe('test generator', function () {\n beforeEach(... | javascript | chosen |
[
{
"from": "system",
"value": "Remove un necessary .env load\n"
},
{
"from": "human",
"value": "/**\n * Created by Liam Vovk on 2017-05-04.\n */\n\nrequire('dotenv').config()\nlet mongoose = require('mongoose')\nlet connectionString = require('../config/connection_string')\nmongoose.Promise = req... | javascript | chosen |
[
{
"from": "system",
"value": "Use helma/system.asJavaObject() to prevent allocating new java.lang.Strings in String.toBinary().\n\ngit-svn-id: fac99be8204c57f0935f741ea919b5bf0077cdf6@9703 688a9155-6ab5-4160-a077-9df41f55a9e9\n"
},
{
"from": "human",
"value": "\nvar Binary = exports.Binary = fun... | javascript | chosen |
[
{
"from": "system",
"value": "Work better with identified Ably client\n\nThis avoids warnings when using an Ably \"Realtime\" client instance\nthat uses \"identified\" authentication.\n"
},
{
"from": "human",
"value": "// TODO:\n// - end-to-end test\n// - extract update code, inject it as a func... | javascript | chosen |
[
{
"from": "system",
"value": "Move QueryApi to load before Orm\n"
},
{
"from": "human",
"value": "'use strict';\n\nlet Defiant = undefined;\n\nclass Engine {\n constructor() {\n Defiant = require('./defiant');\n\n // Create registries for plugins.\n this.registry = {};\n\n // Initia... | javascript | chosen |
[
{
"from": "system",
"value": "Change the copy-pasted test suite title\n"
},
{
"from": "human",
"value": "describe('index (public API)', function () {\n 'use strict';\n\n var assert = require('assert'),\n bro = require('jsdom-test-browser'),\n api = require('../index'),\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Send TokenError when we need a refresh\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar async = require('async');\n\nvar retrieve = require('./helpers/retrieve.js');\nvar retrieveCards = retrieve.retrieveCards;\nvar retrieveDeletedCards = retrieve.retrieveDel... | javascript | chosen |
[
{
"from": "system",
"value": "Fix merge problem with map\n"
},
{
"from": "human",
"value": "function initHomeMap (coords){\n\t$(\"h1.logozone\").after(\"<div id='zoneHomeMap'><div id='homeMap'></div><div id='mask'></div></div>\");\n\tvar imgmarker='../img/marker.png';\n\tvar objectMarker = coord... | javascript | chosen |
[
{
"from": "system",
"value": "Add silent start to `Backbone.history.start` call\n"
},
{
"from": "human",
"value": "'use strict';\n\ndefine([\n 'jquery',\n 'underscore',\n 'backbone',\n 'router-front-frontrouter',\n 'router-forum-forumrouter',\n 'router-tag-tagrouter',\n], funct... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.