conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Allow class attribute to be an object\n"
},
{
"from": "human",
"value": "'use strict';\n\n/*\n * Outputs objs into key=\"value\" string\n */\nmodule.exports = function attributes(obj) {\n if (!obj) return '';\n\n let str = '';\n\n Object.keys(obj).forEach((key) =... | javascript | chosen |
[
{
"from": "system",
"value": "Make database connections more robust against missing mongodb server\n"
},
{
"from": "human",
"value": "const mongoose = require('mongoose');\nconst MONGO_URL = process.env.MONGO_URL || 'mongodb://localhost:3101/meteor';\n\nmongoose.Promise = global.Promise;\nmongoo... | javascript | chosen |
[
{
"from": "system",
"value": "Set node value to true\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nmodule.exports = {\n \"env\": {\n \"node\": false\n },\n \"rules\": {\n // enforces error handling in callbacks (node environment)\n \"handle-callback-err\": 0,\n // disallow... | javascript | chosen |
[
{
"from": "system",
"value": "Add filter for browsers returning incorrect type and values for formatToParts function\n"
},
{
"from": "human",
"value": "angular\n .module('confRegistrationWebApp')\n .filter('localizedCurrency', function($locale) {\n return function(number, currencyCode) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add methods to individually compare width and height to Size.\n"
},
{
"from": "human",
"value": "/**\n * @constructor\n * @param {number} width\n * @param {number} height\n */\nwebfont.Size = function (width, height) {\n this.width = width;\n this.height = height;... | javascript | chosen |
[
{
"from": "system",
"value": "Allow method PATCH in cors\n"
},
{
"from": "human",
"value": "require('babel-register')\n\nimport Koa from 'koa'\nimport cors from 'koa2-cors'\nimport Router from 'koa-router'\nimport bodyParser from 'koa-bodyparser'\nimport serve from 'koa-static'\nimport mongoose ... | javascript | chosen |
[
{
"from": "system",
"value": "Transform state to JS object for redux-logger\n\nThis makes it log the state as a plain JS object instead of an\nImmutable.JS map which will make it more readable.\n"
},
{
"from": "human",
"value": "import RootReducer from './reducers/RootReducer';\nimport { applyMi... | javascript | chosen |
[
{
"from": "system",
"value": "Fix path error in npm installation\n"
},
{
"from": "human",
"value": "var exec = require('child_process').exec;\n\nvar path = './node_modules/prebuild-install/bin.js';\nvar platform = process.platform;\nvar arch = process.arch;\n\nif (platform === 'linux' && arch ==... | javascript | chosen |
[
{
"from": "system",
"value": "Use JSX to initialize AppContainer\n"
},
{
"from": "human",
"value": "/**\n * Main application file of Fittable\n * - Requires React.js to be loaded before loading this\n */\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport Counterpart from '... | javascript | chosen |
[
{
"from": "system",
"value": "Add more ES6 code in example\n"
},
{
"from": "human",
"value": "import {a,b} from 'module2.js';\nimport {jquery} from 'https://code.jquery.com/jquery-2.1.3.min.js';\nimport {d as foo2} from 'sub1/sub1.js';\n\nvar e = 10,\n f = 20;\n\nfunction c () {\n return 3... | javascript | chosen |
[
{
"from": "system",
"value": "Use the kinvey-phonegap-sdk Kinvey class with ngKinveyProvider\n"
},
{
"from": "human",
"value": "import { Kinvey as CoreKinvey } from 'kinvey-javascript-sdk-core';\nimport { NetworkRack } from 'kinvey-javascript-sdk-core/es5/rack/rack';\nimport { KinveyHttpMiddlewa... | javascript | chosen |
[
{
"from": "system",
"value": "Add __get__ to sys.stderr and stdout\n"
},
{
"from": "human",
"value": "var $module=(function($B){\n\n return {\n modules :\n {'__get__':function(){return $B.builtins.dict($B.JSObject($B.imported))},\n '__set__':0 // data descriptor,... | javascript | chosen |
[
{
"from": "system",
"value": "Remove require(...) for 3Dmol from main app\n"
},
{
"from": "human",
"value": "var angular = require('angular')\n\nrequire('angular-aria')\nrequire('angular-animate')\nrequire('angular-material')\nrequire('angular-material/angular-material.css')\nrequire('angular-ro... | javascript | chosen |
[
{
"from": "system",
"value": "Bring me to your event title\n"
},
{
"from": "human",
"value": "/**\n* Contact. Send messages\n*/\nconst express = require('express')\nconst router = express.Router()\nconst _ = require('lodash')\n\nconst content = require('../content/english/contact.json')\n\n// Ro... | javascript | chosen |
[
{
"from": "system",
"value": "Hotfix: Remove unnecessarily injected resource from AnalysisReport\n"
},
{
"from": "human",
"value": "(function() {\n 'use strict';\n\n angular.module('PDRClient')\n .controller('AnalysisReportCtrl', AnalysisReportCtrl);\n\n AnalysisReportCtrl.$inject = [\n... | javascript | chosen |
[
{
"from": "system",
"value": "Define the PRODUCTION variable in production.\n"
},
{
"from": "human",
"value": "const merge = require('webpack-merge');\nconst UglifyJsPlugin = require('uglifyjs-webpack-plugin');\n\nconst devConfig = require('./webpack.website-dev.js');\n\nmodule.exports = merge(d... | javascript | chosen |
[
{
"from": "system",
"value": "Update builder test to include a test of the produced api\n"
},
{
"from": "human",
"value": "import {build} from './builder';\n\nconst config = {\n user: {\n ttl: 300,\n api: {\n getUsers: (x) => x,\n deleteUser: (x) => x,\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Change import method so components show up\n"
},
{
"from": "human",
"value": "var RouteHandler = require( 'react-router' ).RouteHandler,\n Header = require( './header' ),\n Modal = require( './modal' ),\n classNames = require('classnames'),\... | javascript | chosen |
[
{
"from": "system",
"value": "Add workaround for innerText in Jest\n"
},
{
"from": "human",
"value": "import Vue from 'vue';\nimport Translate from '~/vue_shared/translate';\nimport axios from '~/lib/utils/axios_utils';\nimport { initializeTestTimeout } from './helpers/timeout';\n\n// wait for p... | javascript | chosen |
[
{
"from": "system",
"value": "Update front end error message\n"
},
{
"from": "human",
"value": "$(\"#submit-all\").attr(\"disabled\", true);\n$(\"#submit-all\").hide();\n\nDropzone.options.uploadDropzone = {\n autoProcessQueue: false,\n init: function() {\n var submitButton = document.query... | javascript | chosen |
[
{
"from": "system",
"value": "Use a terse doc comment. [skip ci]\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nvar $ = require(\"gulp-load-plugins\")();\nvar gulp = require(\"gulp\");\nvar notify = require(\"./gulp/utils/notify\");\n\n/**\n * Load all tasks from the gulp directory.\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"check defaultPrevented when intercepting link clicks\"\n"
},
{
"from": "human",
"value": "/* global window */\n'use strict'\n\nvar win = typeof window === 'undefined' ? null : window\n\nexports.routeFromLocation = function routeFromLocation (event, router) ... | javascript | chosen |
[
{
"from": "system",
"value": "Update gulp dev task to no longer build scripts\n"
},
{
"from": "human",
"value": "var gulp = require('gulp');\n\nvar browserify = require('gulp-browserify');\nvar jshint = require('gulp-jshint');\nvar mocha = require('gulp-mocha');\nvar uglify = require('gulp-uglif... | javascript | chosen |
[
{
"from": "system",
"value": "Use toFixed for bigjs filter\n"
},
{
"from": "human",
"value": "'use strict';\nangular.module('omniFilters', [])\n .filter('bigjs', ['$sce', function ($sce) {\n return function (input, format, noZerosTrimming) {\n var dropFraction = false;\n\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix implementation of \"wait\" block\n"
},
{
"from": "human",
"value": "function Scratch3ControlBlocks(runtime) {\n /**\n * The runtime instantiating this block package.\n * @type {Runtime}\n */\n this.runtime = runtime;\n}\n\n/**\n * Retrieve the ... | javascript | chosen |
[
{
"from": "system",
"value": "Add from parameter in handleNewMessage\n"
},
{
"from": "human",
"value": "import React, { Component } from 'react';\nimport ChatMessages from './ChatMessages';\nimport ChatFooter from './ChatFooter';\n\nclass Chatbody extends Component {\n constructor(props) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add member avatars and move phone link\n\n"
},
{
"from": "human",
"value": "import React, {PropTypes} from 'react'\nimport {List, ListItem} from 'material-ui/List'\nimport Divider from 'material-ui/Divider'\n\nconst TeamListItem = props => {\n let memberCount = pro... | javascript | chosen |
[
{
"from": "system",
"value": "Add nospacing attribute to Grid\n"
},
{
"from": "human",
"value": "import m from 'mithril';\nimport attributes from './attributes';\n\nexport let Grid = {\n\tview(ctrl, args, ...children) {\n\t\targs = args || {};\n\t\tlet attr = attributes(args);\n\n\t\tattr.class.... | javascript | chosen |
[
{
"from": "system",
"value": "Update jvanbruegge additions according to XO rules\n"
},
{
"from": "human",
"value": "\nimport h from 'snabbdom/h'\nimport extend from 'extend'\n\nconst sanitizeProps = (props) => {\n\n props = props === null ? {} : props\n\n Object.keys(props).map((prop) => {\n\n... | javascript | chosen |
[
{
"from": "system",
"value": "Remove unnecessary template string literal.\n"
},
{
"from": "human",
"value": "import { forEach, isObject, assign, camelCase } from 'lodash';\n\nconst nested = (input, ...keys) => {\n const obj = {};\n forEach(input, (value, key) => {\n if (isObject(value)) {\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add retries to sample data init\n"
},
{
"from": "human",
"value": "import Promise from 'bluebird';\nimport process from 'process';\nimport util from 'util';\nimport { withRetries } from 'killrvideo-nodejs-common';\nimport { Scheduler } from './scheduler';\nimport * ... | javascript | chosen |
[
{
"from": "human",
"value": "Make it possible to read and write a file\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env node\nvar fs = require('fs');\n\nvar source = process.argv.splice(2)[0];\nvar target = source.substring(0, source.lastIndexOf('.')) + '.css';\n\nfs.readFile(source, 'utf-8', fun... | javascript | chosen |
[
{
"from": "system",
"value": "Fix a bug: Called getTime on date that couldn't be parsed.\n"
},
{
"from": "human",
"value": "import chrono from 'chrono-node'\n\nconst BEFORE_REGEX = /before \"(.*?)\"/\nconst AFTER_REGEX = /after \"(.*?)\"/\n\n// Takes in query as a string and extracts startDate a... | javascript | chosen |
[
{
"from": "system",
"value": "Rename unit tests to story book\n"
},
{
"from": "human",
"value": "describe( 'AppCtrl', function() {\n describe( 'dummyTest', function() {\n var AppCtrl, $location, $scope;\n\n beforeEach( module( 'angularTemplate' ) );\n\n beforeEach( inject( function( $c... | javascript | chosen |
[
{
"from": "system",
"value": "Switch to camelCase and use completly safe obfuscation\n\nNot even NSA hackers can deduce the isFine value!"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\nvar is_fine = true;\n\n// is everything fine?\nconsole.log('[INFO] Test started');\nif (is_fine) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add name validation, require script in Package model\n"
},
{
"from": "human",
"value": "module.exports = function ( mongoose ) {\n var Packages = new mongoose.Schema({\n name : { type: String, required: true, unique: true, index: true },\n repo : { type: Stri... | javascript | chosen |
[
{
"from": "system",
"value": "Remove help value from tasks\n\nSigned-off-by: Nathan Stier <013f9af474b4ba6f842b41368c6f02c1ee9e9e08@gmail.com>\n"
},
{
"from": "human",
"value": "var command = process.argv[2]\nvar target = process.argv[3]\n\nvar concerns = require('./cfg/concerns.json')\nvar type... | javascript | chosen |
[
{
"from": "system",
"value": "Fix a tab/space issue coming up on github\n"
},
{
"from": "human",
"value": "/**\n * Has Vowels\n * \n * hasVowel tests if the String calling the function has a vowels\n * \n * @param {void}\n * @return {Boolean} returns true or false indicating if the string\n * ha... | javascript | chosen |
[
{
"from": "system",
"value": "Fix some errors in number/isFinite docs\n\nCloses #217.\n"
},
{
"from": "human",
"value": "/**\nIs a number finite?\n\n@module number/isfinite\n@param {Number} num The number to check.\n@returns {bool} Is `num` positive or negative `Infinity`?\n@example\nvar isFinit... | javascript | chosen |
[
{
"from": "system",
"value": "Use `modules: false` for client-side code\n"
},
{
"from": "human",
"value": "module.exports = {\n presets: [\n ['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage' }],\n '@babel/preset-react',\n '@babel/preset-flow',\n ],\n plugins: [\n ... | javascript | chosen |
[
{
"from": "system",
"value": "gh-439: Allow IE11 compilation and more\n"
},
{
"from": "human",
"value": "module.exports = {\n presets: [\n [\n '@babel/env',\n {\n modules: process.env.MODULE ? false : 'commonjs',\n targets: ['>0.25%',... | javascript | chosen |
[
{
"from": "system",
"value": "Add identifier constants for form select component\n"
},
{
"from": "human",
"value": "const REQUEST_STATUSES = [\n {\n value: 'Unassigned',\n label: 'Unassigned'\n },\n {\n value: 'Assigned',\n label: 'Assigned'\n },\n {\n value: 'Contacted',\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use a new valid appId and appCode\n"
},
{
"from": "human",
"value": "/** @namespace */\nvar here = window.here || {};\n\nhere.builder = {\n config: {\n shareURL: 'https://share.here.com/',\n PBAPI: \"https://places.api.here.com/places/v1/\",\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Update job properties in sendJobState\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar url = require('url');\n\nvar lodash = require('lodash');\nvar Promise = require('digdug/node_modules/dojo/Promise');\nvar DigdugSauceLabsTunnel = require('digdug/SauceLabsT... | javascript | chosen |
[
{
"from": "system",
"value": "Update Border Colour for ClassicButtonToggle\n"
},
{
"from": "human",
"value": "import { css } from 'styled-components';\nimport { THEMES } from '../../style/themes';\n\nexport default ({ theme }) => theme.name === THEMES.classic && css`\n height: 47px;\n font-wei... | javascript | chosen |
[
{
"from": "system",
"value": "Use jtml and not slim. Add new error for invalid DOM or selector\n"
},
{
"from": "human",
"value": "export default {\n\tshouldWarn: false,\n\tbeVerbose: false,\n\t_consolePrefix: `Slim Templates: `,\n\twarnings: {\n\t\tmissingTypeAttribute: `An attribute called \"ty... | javascript | chosen |
[
{
"from": "system",
"value": "Fix copyright notice in source file\n"
},
{
"from": "human",
"value": "/**\n * JavaScript Utm Extractor v0.1.0\n * https://github.com/ertrade/js-utm-extractor\n *\n * Copyright Anton Vakhrushev, 2016\n * Released under the MIT license\n */\n(function (factory) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Disable contextual menu (not very useful, exposes features we don't want to expose)\n"
},
{
"from": "human",
"value": "YAHOO.xbl.fr.Tinymce.DefaultConfig = {\n\tmode:\t\t \"exact\",\n language: \"en\",\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix usage of electron.app in auto-launcher\n"
},
{
"from": "human",
"value": "import Plist from 'launchd.plist';\nimport fs from 'fs-extra-promise';\nimport {app} from 'electron';\nimport path from 'path';\n\nimport BaseAutoLauncher from 'browser/components/auto-lau... | javascript | chosen |
[
{
"from": "system",
"value": "Allow user to be retrieved from JWT with passport (req.user)\n"
},
{
"from": "human",
"value": "var passport = require('passport');\nvar passportJWT = require('passport-jwt');\nvar ExtractJwt = passportJWT.ExtractJwt;\nvar Strategy = passportJWT.Strategy;\nvar jwtSe... | javascript | chosen |
[
{
"from": "system",
"value": "Allow for Authorization URL to already contain '?'\n\nThis will allow to use an authorization URL that already contains a query string as it checks when adding the OAuth2 parameter whether a '?' is already present on the authorization URL and will use the appropriate append cha... | javascript | chosen |
[
{
"from": "system",
"value": "Make default port to 3000\n"
},
{
"from": "human",
"value": "'use strict';\nconst path = require('path');\n\nconst DEFAULT_PORT = 3360;\nconst DEFAULT_DIRECTORY = '';\nconst HELP_FLAG = '--help';\nconst HELP_SHORTHAND_FLAG = '-h';\nconst SILENT_FLAG = '--silent';\nc... | javascript | chosen |
[
{
"from": "system",
"value": "Fix naive stream reading implementation.\n"
},
{
"from": "human",
"value": "import CodeGenerator from './code-generator';\nimport {CodeGeneratorRequest} from \"google-protobuf/google/protobuf/compiler/plugin_pb.js\";\n\nconst generateCode = (serializedRequest) => {\... | javascript | chosen |
[
{
"from": "system",
"value": "Fix mistake in form element errors test.\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport { moduleForComponent } from 'ember-qunit';\nimport { formFeedbackClass, test } from '../../../../helpers/bootstrap-test';\nimport hbs from 'htmlbars-inline... | javascript | chosen |
[
{
"from": "system",
"value": "Add specs for backbone shim config\n"
},
{
"from": "human",
"value": "define([\n 'combo-map',\n 'module-constructor',\n 'mutable-shim',\n 'non-cmd',\n 'plugin-combo',\n 'plugin-nocache',\n 'plugin-shim',\n 'plugin-text',\n 'plugin-warning'\n])\n\n"
},
{... | javascript | chosen |
[
{
"from": "system",
"value": "Add deleteKey to Rules model\n"
},
{
"from": "human",
"value": "'use strict'\n\nconst ElectronConfig = require('electron-config')\nconst storage = new ElectronConfig()\nconst rulesStorageKey = 'rules'\n\nclass Rules {\n static findAll() {\n if (storage.has(rules... | javascript | chosen |
[
{
"from": "system",
"value": "Add return to prevent multiple uploads\n"
},
{
"from": "human",
"value": "/* global MAXFILESIZE */\nimport { bytes } from './utils';\n\nexport default function(state, emitter) {\n window.addEventListener('paste', event => {\n if (state.route !== '/' || state.upl... | javascript | chosen |
[
{
"from": "system",
"value": "Check the original error is thrown when a regex does not match.\n"
},
{
"from": "human",
"value": "var assert = require('../lib/assertTheUnexpected');\nvar expect = require('unexpected');\n\ndescribe('assertTheUnexpected', function () {\n describe('deepEqual', func... | javascript | chosen |
[
{
"from": "system",
"value": "Check if response is valid object\n"
},
{
"from": "human",
"value": "import test from 'ava'\nimport names from '../dist'\n\nconst isObject = obj => typeof obj === 'object' && obj !== null\n\ntest.beforeEach('requesting data', async t => {\n let list\n\n try {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix series callback issue with downloading\n"
},
{
"from": "human",
"value": "var child = require('child_process')\n\nvar series = require('run-series')\n\nvar util = require('./util')\n\nseries([\n function (cb) {\n child.exec('which codesign', cb)\n },\n fun... | javascript | chosen |
[
{
"from": "system",
"value": "Add test for href option\n"
},
{
"from": "human",
"value": "var path = require('path');\nvar tester = require('gitbook-tester');\nvar assert = require('assert');\n\ndescribe('superscript', function() {\n it('should correctly replace by sup html tag', function() {... | javascript | chosen |
[
{
"from": "system",
"value": "Update tests for new versions\n"
},
{
"from": "human",
"value": "const koa = require(\"koa\"),\n expect = require(\"expect\"),\n uncapitalize = require(\"../\"),\n app = koa();\n\napp.use(uncapitalize);\napp.use(function* (next) {\n if (this.path.toLowerCase() !... | javascript | chosen |
[
{
"from": "system",
"value": "Fix emoji picker on firefox :ok_hand:\n"
},
{
"from": "human",
"value": "/* globals Template chatMessages*/\nTemplate.messageBox.events({\n\t'click .emoji-picker-icon'(event) {\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\t\tif (RocketChat.EmojiPicke... | javascript | chosen |
[
{
"from": "system",
"value": "tec: Allow trailing comma (js linter)\n"
},
{
"from": "human",
"value": "module.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOptions: {\n sourceType: 'module'\n },\n // https://github.com/feross/standard/blob/master/RULES.md#javascript-standar... | javascript | chosen |
[
{
"from": "system",
"value": "web: Add shutdown button to interface\n"
},
{
"from": "human",
"value": "/** @jsx React.DOM */\n/* global module, require */\n(function() {\n 'use strict';\n var React = require('react/addons');\n\n module.exports = React.createClass({\n render: function() {\n... | javascript | chosen |
[
{
"from": "system",
"value": "Fix and improve FluxFM connector\n\nFix FluxFM connector.\nAdd album field.\nAdd coverart.\n"
},
{
"from": "human",
"value": "'use strict';\n\n/* global Connector */\n\nConnector.playerSelector = '#player_song';\n\nConnector.artistSelector = '#player_artist';\n\nCon... | javascript | chosen |
[
{
"from": "system",
"value": "Modify Class model to include url\n"
},
{
"from": "human",
"value": "const mongoose = require('mongoose');\nconst Schema = mongoose.Schema;\n\nconst classSchema = new Schema({\n courseName: { type: String, unique: true }\n});\n\nmodule.exports = mongoose.model('cla... | javascript | chosen |
[
{
"from": "system",
"value": "Add submissions folder to form asset definition\n"
},
{
"from": "human",
"value": "module.exports = function context (asset) {\n return function form (name, opts) {\n if (typeof name !== 'string') {\n opts = name\n name = undefined\n }\n\n if (!o... | javascript | chosen |
[
{
"from": "system",
"value": "Transform Q and A variables to an Object\n"
},
{
"from": "human",
"value": "//On load, .contentBox should contain question #1\n\n// When user enters Answer and hits submit, ask if\n//answer matches stored Answer\n\n// An array containing questions and answers\n//\nv... | javascript | chosen |
[
{
"from": "system",
"value": "Add basic question handlers to Computer\n"
},
{
"from": "human",
"value": "var QUESTION_TYPES = /who|how|what|when|why|where/;\n\nComputer = function() {\n return this;\n}\nComputer.prototype.answerQuestion = function(question) {\n var types = question.match(QUEST... | javascript | chosen |
[
{
"from": "system",
"value": "Modify secret key for travis\n"
},
{
"from": "human",
"value": "import jwt from 'jsonwebtoken';\n\nconst userOneId = '1';\nconst userTwoId = '2';\n\nconst users = [{\n id: userOneId,\n email: 'someemail@email.com',\n password: 'somepassword',\n username: 'someus... | javascript | chosen |
[
{
"from": "system",
"value": "Fix NWjs bug not triggering process exit event\n\nCall process.exit() directly instead of using nwApp.quit().\nFixes gdbus child process not being terminated on exit.\n"
},
{
"from": "human",
"value": "import {\n\tget,\n\tinject,\n\tService\n} from \"ember\";\nimpor... | javascript | chosen |
[
{
"from": "system",
"value": "Make user input get encoded\n"
},
{
"from": "human",
"value": "chrome.contextMenus.create(\n {\n \"title\": \"Define \\\"%s\\\"\",\n \"contexts\":[\"selection\"],\n \"onclick\": function(info, tab){\n chrome.tabs.create(\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use escape byte encoded in hex and not in octal"
},
{
"from": "human",
"value": "var CLI = require('../lib/clui.js'),\n clc = require('cli-color');\n\nvar Line = CLI.Line;\n Progress = CLI.Progress;\n\nvar statuses = [0, 0, 0, 0, 0];\nvar len... | javascript | chosen |
[
{
"from": "system",
"value": "Add config object for consts\n"
},
{
"from": "human",
"value": "// NetVis defines global object NetVis that wraps up everything else \n\n// constructor for NetVis class\nfunction NetVis(DOMelement) {\n\tvar self = this;\n\tself.DOMelement = DOMelement || \"#chart\";... | javascript | chosen |
[
{
"from": "system",
"value": "Fix stupid hash loop syntax\n"
},
{
"from": "human",
"value": "// distance.js\n// Finds the closest user match with n dimensions of compatability\n\n// Expects a tag:count map from the user and a tag:count map from a blog\nmodule.exports = {\n\tmatch: function(userT... | javascript | chosen |
[
{
"from": "system",
"value": "Improve the assert, make sure the output actually contains coverage data.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\nvar assert = require('../lib/assert').getAssertModule();\nvar exec = require('child_process').exec;\n\nvar sprintf = require('sprintf'... | javascript | chosen |
[
{
"from": "system",
"value": "Update comment interface to better match the Text one.\n\nEventually we should probably base this off a common interface.\n"
},
{
"from": "human",
"value": "const { Node } = require('./Node');\n\nconst Comment = class extends Node {\n get outerHTML() {\n return ... | javascript | chosen |
[
{
"from": "system",
"value": "Format raw numbers with commas\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n update: function() {\n this.set('value', this.get('data.firstObject.value'));\n }.observes('data')\n});\n"
},
{
"fr... | javascript | chosen |
[
{
"from": "system",
"value": "Add CRUD methods for Category in Angular.\n"
},
{
"from": "human",
"value": "'use strict';\n\nangular.module('categories').controller('CategoriesController', ['$scope',\n\tfunction($scope) {\n\t\t// Controller Logic\n\t\t// ...\n\t}\n]);"
},
{
"from": "gpt",... | javascript | chosen |
[
{
"from": "system",
"value": "Add different color for topic tags in tag list (proof of concept)\n"
},
{
"from": "human",
"value": "import React from 'react';\n\nclass TagList extends React.Component {\n constructor(props) {\n super(props);\n }\n\n onTagDelete(tag) {\n this... | javascript | chosen |
[
{
"from": "system",
"value": "Reduce JSON indentation to two spaces.\n"
},
{
"from": "human",
"value": "/*globals exports, JSON */\n\n'use strict';\n\nexports.format = format;\n\nfunction format (reports) {\n return JSON.stringify(reports, undefined, 4);\n}\n\n"
},
{
"from": "gpt",
... | javascript | chosen |
[
{
"from": "system",
"value": "Increase watch speed by adding spawn:false\n"
},
{
"from": "human",
"value": "module.exports = function (grunt) {\n\n 'use strict';\n\n grunt.initConfig({\n jshint: {\n files: [\n 'Gruntfile.js',\n 'generators/**... | javascript | chosen |
[
{
"from": "system",
"value": "Add watch config for rebuilding dist.\n"
},
{
"from": "human",
"value": "module.exports = function(grunt) {\n\tgrunt.initConfig({\n\t\tpkg: grunt.file.readJSON('package.json'),\n\t\tconcat: {\n\t\t\tdist: {\n\t\t\t\tsrc: 'canvas/**/*.js',\n\t\t\t\tdest: '<%= pkg.nam... | javascript | chosen |
[
{
"from": "system",
"value": "Use list reporter so we know which test failed.\n"
},
{
"from": "human",
"value": "\n'use strict';\n\nmodule.exports = function( grunt )\n{\n grunt.initConfig( {\n\n jshint: {\n options: {\n jshintrc: '.jshintrc'\n },\n gruntfile: {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add error message for data load failure to comp page\n"
},
{
"from": "human",
"value": "import React from \"react\";\nimport classes from \"./RankingsList.module.css\";\n\nimport RankingsListRow from \"./RankingsListRow/RankingsListRow\";\nimport RankingsListTitleRo... | javascript | chosen |
[
{
"from": "system",
"value": "Update popup window / icon\n"
},
{
"from": "human",
"value": "\n// Update tick\nfunction update() {\n setTimeout(update, REFRESH_AMOUNT * 1000);\n\n Twitch.getStatus(function(err, status) {\n\n if (!status.authenticated) {\n Twitch.login({\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Rename task. Add templates folder to watch\n"
},
{
"from": "human",
"value": "var gulp = require('gulp'),\n scssLint = require('sass-lint'),\n sass = require('gulp-sass'),\n sassdoc = require('sassdoc');\n\ngulp.task('watch', function() {\n gulp.watch(['... | javascript | chosen |
[
{
"from": "system",
"value": "Fix glob used in Gulp task\n"
},
{
"from": "human",
"value": "'use strict';\nvar path = require('path');\nvar gulp = require('gulp');\nvar eslint = require('gulp-eslint');\nvar excludeGitignore = require('gulp-exclude-gitignore');\nvar mocha = require('gulp-mocha')... | javascript | chosen |
[
{
"from": "system",
"value": "Support searching by value, not just alias\n"
},
{
"from": "human",
"value": "'use strict';\n\n// MODULES //\n\nvar DOCS = require( './docs.js' );\n\n\n// MAIN //\n\n/**\n* Returns help information.\n*\n* @private\n* @param {string} alias - variable alias\n*/\nfunct... | javascript | chosen |
[
{
"from": "system",
"value": "Implement Expo entry point for mobile bundles\n"
},
{
"from": "human",
"value": "console.log('Hello, from React Native!');"
},
{
"from": "gpt",
"value": "import Expo from 'expo';\nimport React from 'react';\nimport { View } from 'react-native';\n\nconst ... | javascript | chosen |
[
{
"from": "system",
"value": "Use live endpoint even on dev\n\nIt seems kind of okay"
},
{
"from": "human",
"value": "// const ENDPOINT = \"https://api.cojs.co/v0\"\nconst ENDPOINT = 'http://localhost:3000'\n\n\n// Maybe \"Connection\" might be better\nclass Session {\n\n constructor(id) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add helper for game requests\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst config = require(`${__dirname}/../config/init`);\n\n/**\n * makeAllRowRequestBody(str)\n * @param string field Field to query parameters from.\n * @param string from Date to query... | javascript | chosen |
[
{
"from": "system",
"value": "Set up continuous integration script\n"
},
{
"from": "human",
"value": "/*global desc, task, jake, fail, complete */\n(function() {\n \"use strict\";\n\n task(\"default\", [\"lint\"]);\n\n desc(\"Lint everything\");\n task(\"lint\", [], function() {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use select method to filter return data when retrieving a user's stats.\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst Promise = require('bluebird');\nconst UserStats = require('../models/UserStats');\n\nmodule.exports = function() {\n const create = fun... | javascript | chosen |
[
{
"from": "system",
"value": "Add \"Open-all\" and \"Close-all\" button.\n"
},
{
"from": "human",
"value": "require([\n 'domReady',\n 'jquery',\n 'bootstrap',\n], function(domReady, $, bootstrap) {\n\n $.noConflict();\n\n $('.collapse-node-toggle').on('click', function(evt) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add util function to retrieve favicons\n"
},
{
"from": "human",
"value": "(function() {\n this.ColorUtil = (function() {\n function ColorUtil() {}\n\n ColorUtil.changeLuminance = function(hex, lum) {\n \n\t\t// validate hex string\n\t\thex = String(hex).... | javascript | chosen |
[
{
"from": "system",
"value": "Remove the requestbin test fetching\n"
},
{
"from": "human",
"value": "var http = require(\"http\");\n\nmodule.exports = function keepMeAwake() {\n setInterval(function() {\n http.get(\"http://jounis-camino-tracker.herokuapp.com\");\n http.get(\"http://reques... | javascript | chosen |
[
{
"from": "system",
"value": "Make the example camera matrices sane\n"
},
{
"from": "human",
"value": "window.addEvent(\"domready\", function() {\n var BasicApp = new Class({\n Extends: App,\n initialize: function(element, options) {\n this.parent(element, options);\n... | javascript | chosen |
[
{
"from": "system",
"value": "Update to validator 3.0 api.\n"
},
{
"from": "human",
"value": "/*jslint node: true*/\n\"use strict\";\n\nvar validator = require('validator');\n\nvar protocol_regex = /^(?=.*:\\/\\/)/;\nvar http_regex = /^(?=http(s?):\\/\\/)/i;\n\nfunction add_protocol(site){\n if... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.