conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Enable German, Greek, Portuguese, and Russian translations\n" }, { "from": "human", "value": "module.exports = {\n i18n: {\n defaultLocale: 'en',\n locales: ['en', 'es', 'fr', 'lt', 'nb-NO']\n },\n react: {\n useSuspense: false\n }\n}\n" }, { "f...
javascript
chosen
[ { "from": "system", "value": "Add an `error` listener to the Redis client.\n\nThis is probably the cause of `ETIMEDOUT` errors crashing cb_server. When the Redis connection fails for any reason (Redis being restarted, etc.), the node_redis client throws an exception instead of reconnecting unless there is a...
javascript
chosen
[ { "from": "system", "value": "Check if resp.totalCount is number instead of truthy.\n" }, { "from": "human", "value": "var app = require('ridge');\n\nmodule.exports = Backbone.Collection.extend({\n\tconstructor: function(attributes, options) {\n\t\tvar _collection = this;\n\n\t\tBackbone.Collect...
javascript
chosen
[ { "from": "system", "value": "Add function addAnimation() & restart loop on adding animation\n" }, { "from": "human", "value": "/**\n * Animable.js\n *\n * https://github.com/JWhile/Animable.js\n *\n * Animable.js\n */\n\n(function(){ // namespace\n\n// class Animation\nfunction Animation(from, ...
javascript
chosen
[ { "from": "system", "value": "Add test for find string\n" }, { "from": "human", "value": "var Trie = require('../app/trie');\n\ndescribe('Trie', function() {\n var trie;\n\n beforeEach(function() {\n trie = new Trie();\n });\n\n it('should be an object', function() {\n expect(trie).to....
javascript
chosen
[ { "from": "system", "value": "Allow partial updates to settings\n" }, { "from": "human", "value": "var express = require('express');\n\nmodule.exports = function(settings) {\n var app = express.Router();\n\n app.get('/settings.json', settingsIndex);\n app.post('/settings.json', settingsUpdat...
javascript
chosen
[ { "from": "system", "value": "Implement first simple version of OBJ exporter\n" }, { "from": "human", "value": "import stream from 'stream'\n\nexport function toObj () {\n\n}\n\nexport default class Json2obj extends stream.Transform {\n\n\tconstructor (\n\t\t{writableObjectMode, readableObjectMo...
javascript
chosen
[ { "from": "system", "value": "Set migrate to default safe to skip a step when running 'sails lift' in terminal\n" }, { "from": "human", "value": "/**\n * Default model configuration\n * (sails.config.models)\n *\n * Unless you override them, the following properties will be included\n * in each ...
javascript
chosen
[ { "from": "system", "value": "Support html classes through meta\n" }, { "from": "human", "value": "'use strict';\n\nvar assign = require('es5-ext/object/assign')\n , mixin = require('es5-ext/object/mixin')\n , d = require('d')\n , autoBind = require('d/auto-bin...
javascript
chosen
[ { "from": "system", "value": "Rewrite parse() to process an array of businesses objects, each of which holds an array of individual businesses. (Also, filter out duplicate businesses)\n" }, { "from": "human", "value": "'use strict';\n\nvar Backbone = require('backbone');\nvar $ = require('jquery...
javascript
chosen
[ { "from": "system", "value": "Fix test to match ColorUtils behavior\n" }, { "from": "human", "value": "var assert = require('chai').assert;\nvar ColorUtils = require('../lib/ColorUtils');\n\nfunction assertRGBEqualsHSL(rgb, hsl) {\n var actualHsl = ColorUtils.RGBtoHSL(rgb);\n assert.closeT...
javascript
chosen
[ { "from": "system", "value": "chore(tests): Remove console logging during test run.\n" }, { "from": "human", "value": "/* Any copyright is dedicated to the Public Domain.\n * http://creativecommons.org/publicdomain/zero/1.0/ */\n\nrequire('ass')\nvar dbServer = require('fxa-auth-db-server')\nvar...
javascript
chosen
[ { "from": "system", "value": "Add a directory and clean and clobber tasks.\n" }, { "from": "human", "value": "\nvar Path = require(\"path\"),\n futil = require(\"sake/file-utils\"),\n files = new FileList(\"**/*\", \"some/non-existing/file.js\")\n;\n\nrequire(\"sake/clean\");\nrequi...
javascript
chosen
[ { "from": "system", "value": "Install npm packages for client/server before building\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar tslint = require('gulp-tslint');\nvar shell = require('gulp-shell')\n\nvar serverFiles = {\n src: 'server/src/**/*.ts'\n};\n\nvar clientFile...
javascript
chosen
[ { "from": "system", "value": "Add missing params argument to addNpmScript deploy\n" }, { "from": "human", "value": "import { addNpmScriptMemory } from '../utils';\n\nexport default async function generateDeployment(params) {\n switch (params.deployment) {\n case 'heroku':\n if (params.t...
javascript
chosen
[ { "from": "system", "value": "Fix spec failing over year with default options\n" }, { "from": "human", "value": "var banner = require('./');\nvar chai = require('chai');\nvar expect = chai.expect;\n\ndescribe('banner', function() {\n\n var FILEPATH = 'test-target.js';\n\n context('without opti...
javascript
chosen
[ { "from": "system", "value": "Fix manageId typo causing error when creating on dashboard\n" }, { "from": "human", "value": "/// <reference path=\"../Services/AccountService.js\" />\n/// <reference path=\"../Services/PollService.js\" />\n(function () {\n angular\n .module('GVA.Creation...
javascript
chosen
[ { "from": "system", "value": "Divide by 1.2 as described in BH1750 datasheet. Additionally divide by 2 when in high-resolution mode2\n" }, { "from": "human", "value": "var i2c = require('i2c');\nvar _ = require('lodash');\nvar utils = require('./utils');\n\nvar BH1750 = function (opts) {\n th...
javascript
chosen
[ { "from": "system", "value": "Rename env var to BUNNYMQ_URL instead of AMQP_URL\n" }, { "from": "human", "value": "\nvar defaultConfig = {\n amqpUrl: process.env.AMQP_URL || 'amqp://localhost',\n prefetch: process.env.AMQP_PREFETCH || 1,\n isRequeueEnabled: true\n};\n\nmodule.exports = functi...
javascript
chosen
[ { "from": "system", "value": "Drop console.logs from entry point\n\nIdeally core wouldn't contain any. Better to have these outside.\n" }, { "from": "human", "value": "'use strict';\nrequire('coffee-script/register');\n\nvar devServer = require('./devServer.coffee');\nvar build = require('./buil...
javascript
chosen
[ { "from": "system", "value": "Update version string to 2.6.0-pre.16\n" }, { "from": "human", "value": "'use strict';\n\nvar\n\tplatform = require('enyo/platform'),\n\tdispatcher = require('enyo/dispatcher'),\n\tgesture = require('enyo/gesture');\n\nexports = module.exports = require('./src/optio...
javascript
chosen
[ { "from": "system", "value": "Use destructuring for command and params\n" }, { "from": "human", "value": "\nconst Discord = require('discord.js');\nconst client = new Discord.Client();\n\nconst config = require('./config.json');\nconst commands = require('./commands.js')\n\nclient.on('ready', ()...
javascript
chosen
[ { "from": "system", "value": "Update comments to be more descriptive of the props\n" }, { "from": "human", "value": "import * as React from \"react\";\n\n/**\n * Main List Element to be displayed on the Navigation.\n */\nconst NavigationItem = props => <li><a href={props.href}>{props.innerText}...
javascript
chosen
[ { "from": "system", "value": "Print Preview: Hook up the cancel button.\n\nBUG=57895\nTEST=manual\nReview URL: http://codereview.chromium.org/5151009\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@66822 0039d316-1c4b-4281-b951-d872f2087c98\n" }, { "from": "human", "value": "// Copyright...
javascript
chosen
[ { "from": "system", "value": "Fix regular expressions for disp.cc and moptt.tw\n" }, { "from": "human", "value": "'use strict';\n\nvar selector = document.location.pathname.startsWith('/m/') ? '.fgG0' : '.record';\nvar elements = document.querySelectorAll(selector);\nif (elements.length) {\n va...
javascript
chosen
[ { "from": "system", "value": "Increase resetDB test timeout to 45 seconds\n\nIt takes <1.5 seconds on my system, but it's taking over 30 seconds on\nTravis. Might not be worth running it there, since almost anything that\nwould cause that to fail would cause the initialization to fail in the\nfirst place.\n...
javascript
chosen
[ { "from": "system", "value": "Fix resolution of revision steps\n" }, { "from": "human", "value": "// BusinessProcess processing steps resolution\n\n'use strict';\n\nvar memoize = require('memoizee/plain')\n , defineMultipleProcess = require('../lib/multiple-process')\n , de...
javascript
chosen
[ { "from": "system", "value": "Fix if statement in logger config\n" }, { "from": "human", "value": "var Good = require(\"good\");\nvar goodConsole = require(\"good-console\");\nvar moment = require(\"moment\");\n\nvar LOG_PATH = process.env.LOG_PATH ||\n \"./logs/log-\" + moment().format(\"YYYYM...
javascript
chosen
[ { "from": "system", "value": "Fix an issue which caused notifications to persist after being dismissed\n" }, { "from": "human", "value": "'use babel';\n\nimport _ from 'lodash';\n\nfunction addProgressNotification(message) {\n atom.notifications.addInfo(message, {\n dismissable: true,\n });...
javascript
chosen
[ { "from": "system", "value": "Use var so that we can build in node v0.12.\n" }, { "from": "human", "value": "import babel from 'rollup-plugin-babel';\nimport babelrc from 'babelrc-rollup';\n\nconst pkg = require('./package.json');\nconst external = Object.keys(pkg.dependencies);\n\nexport defaul...
javascript
chosen
[ { "from": "system", "value": "Bump recommended scrypt `n` to 2^12" }, { "from": "human", "value": "var kdfParams = module.exports;\n\nkdfParams.show = function(req,res,next) {\n res.status(200).send({ \n algorithm: 'scrypt',\n bits: 256,\n n: Math.pow(2,11),\n r: 8,\n p: 1,\n })...
javascript
chosen
[ { "from": "system", "value": "Remove casting in favor of implicit boolean value\n" }, { "from": "human", "value": "var VOWELS = /[aeiou]/gi;\nvar VOWELS_AND_SPACE = /[aeiou\\s]/g;\n\nexports.parse = function parse(string, join){\n if(typeof string !== 'string'){\n throw new TypeError('Expe...
javascript
chosen
[ { "from": "system", "value": "Add new scope for every film element, to avoid rewriting genre massive.\n" }, { "from": "human", "value": "app.directive('film', function() {\n return{\n restrict: 'E',\n controller: function($scope){\n $scope.genres = [];\n \n...
javascript
chosen
[ { "from": "system", "value": "Fix Unicode of emoji 'heart'" }, { "from": "human", "value": "import emojione from 'emojione';\n\nconst newEmojiListWithOutPriorityList = (priorityList) => {\n const list = {};\n for (const key in emojione.emojioneList) { // eslint-disable-line no-restricted-synta...
javascript
chosen
[ { "from": "system", "value": "Remove unused variable for challenge name\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2014-2020 Bjoern Kimminich.\n * SPDX-License-Identifier: MIT\n */\n\nconst chai = require('chai')\nconst sinonChai = require('sinon-chai')\nconst expect = chai.expect\n...
javascript
chosen
[ { "from": "system", "value": "Complete rename from WebApp to TopCube\n\nChange-Id: Iae49c5b66fe2fcfa44c1708bc485c512a7778f15\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar Http = require('http'),\n Stack = require('stack'),\n Creationix = require('creationix'),\n WebApp =...
javascript
chosen
[ { "from": "system", "value": "Fix help information not showing up\n" }, { "from": "human", "value": "import commander from 'commander';\nimport containerInit from './init';\nimport fs from 'fs';\nimport path from 'path';\n\ncommander\n .command('serve')\n .alias('s')\n .description('serve ap-...
javascript
chosen
[ { "from": "system", "value": "Remove sw.js from public folder\n" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\nconst rimraf = require('rimraf');\nconst configuration = require('../config');\nconst ROOT = require('../config/path-helper').ROOT;\n\nconst removeDire...
javascript
chosen
[ { "from": "system", "value": "Add missing @ngInject annotation that's required so that we don't have to use the long-form strict-di.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc directive\n * @name hmdaPilotApp.directive:FileMetadata\n * @description\n * # File Metadata dir...
javascript
chosen
[ { "from": "system", "value": "Update amd filter to new .rule format" }, { "from": "human", "value": "\"use strict\";\n\nvar sha1 = require('git-sha1');\nvar pathJoin = require('pathjoin');\nvar parallel = require('carallel');\nvar binary = require('bodec');\n\nvar mime = \"text/cache-manifest\";...
javascript
chosen
[ { "from": "system", "value": "Remove useless wrapper function and cleanup WebView a bit\n\nSigned-off-by: Victor Porof <7d8eebacd0931807085fa6b9af29638ed74e0886@mozilla.com>\n" }, { "from": "human", "value": "/*\nCopyright 2016 Mozilla\n\nLicensed under the Apache License, Version 2.0 (the \"Lic...
javascript
chosen
[ { "from": "system", "value": "chore(parser-getter-setter): Remove hello from the karma output\n" }, { "from": "human", "value": "var fs = require('fs');\nvar sys = require('sys');\nvar exec = require('child_process').exec;\n\nvar generateParser = function(logger) {\n var log = logger.create('ge...
javascript
chosen
[ { "from": "system", "value": "[prettier] Change max width to 100\n" }, { "from": "human", "value": "module.exports = {\n semi: false,\n trailingComma: \"all\",\n singleQuote: true,\n printWidth: 120,\n tabWidth: 4\n};\n" }, { "from": "gpt", "value": "module.exports = {\n semi...
javascript
chosen
[ { "from": "system", "value": "Fix the frontend production build\n" }, { "from": "human", "value": "\n\"use strict\";\n\nmodule.exports = (converter) => {\n return () => {\n var args = Array.from(arguments);\n\n return require('through2').obj(function(file, enc, cb) {\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add space parameters to avatar\n" }, { "from": "human", "value": "import styled from 'styled-components';\n\nconst Avatar = styled.a`\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n width: ${...
javascript
chosen
[ { "from": "system", "value": "Add resave and saveUninitialized settings for express-session\n" }, { "from": "human", "value": "\"use strict\";\n\nlet session = require('express-session'),\n auth = module.exports = {\n passport: require('passport'),\n init: function(app, db) {\n ...
javascript
chosen
[ { "from": "system", "value": "Enable proper websocket support in webpack proxy\n" }, { "from": "human", "value": "const merge = require('webpack-merge');\nconst config = require('./webpack.config');\n\nconst host = process.env.SDF_HOST || 'localhost';\nconst port = process.env.SDF_PORT || '8080'...
javascript
chosen
[ { "from": "system", "value": "Change redirect after success login from projects to dashboard.\n\n– SAAS-125\n" }, { "from": "human", "value": "'use strict';\n\n(function() {\n angular.module('ncsaas')\n .controller('AuthController', ['$location', '$auth', 'authService', AuthController]);\n\n...
javascript
chosen
[ { "from": "system", "value": "Add in `value` count, leaving non-interactive as the final parameter\n" }, { "from": "human", "value": "// Extension to track errors using google analytics as a data store.\n(function() {\n\n \"use strict\";\n var trackJavaScriptError = function (e) {\n v...
javascript
chosen
[ { "from": "system", "value": "Set referer policy of upgrade notifcation to \"strict-origin-when-cross-origin\"\n\n- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy\n- Since Django 3.1, all Wagtail admin responses have been given a referer-policy: same-origin header. See: https://ch...
javascript
chosen
[ { "from": "system", "value": "Check if observer is actually a function\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('cloudnode.service.history', [\n])\n\n.factory('HistoryService', function ($rootScope) {\n var history = [];\n var historyObserver = {};\n\n $rootS...
javascript
chosen
[ { "from": "system", "value": "Update code style of doc generator\n" }, { "from": "human", "value": "var fs = require('fs')\n , markdox = require('markdox');\n\nvar sources = [\n '../src/index.js',\n '../src/apis/users.js',\n '../src/apis/organizations.js',\n '../src/apis/memberships...
javascript
chosen
[ { "from": "system", "value": "Fix index bench read range\n" }, { "from": "human", "value": "const Benchmark = require('benchmark');\nconst benchmarks = require('beautify-benchmark');\nconst fs = require('fs-extra');\n\nconst Suite = new Benchmark.Suite('index');\nSuite.on('start', () => fs.empty...
javascript
chosen
[ { "from": "system", "value": "Exclude main index.js from mutation testing\n" }, { "from": "human", "value": "module.exports = function(config) {\n config.set({\n files: [\n {\n pattern: \"src/**/*.js\",\n mutated: true,\n included: false\n },\n \"test/**/*...
javascript
chosen
[ { "from": "system", "value": "Fix bug in endpoint test opn heroku\n" }, { "from": "human", "value": "import express from 'express';\nimport logger from 'morgan';\nimport bodyParser from 'body-parser';\n\nimport routes from './routes';\n\nconst app = express();\nconst port = process.env.PORT || 3...
javascript
chosen
[ { "from": "system", "value": "Put watch on the lights var\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('QSD.Tardis')\n\n .directive('tardisTrafficLight', function() {\n\n console.log( \"Initializing the traffic light\");\n\n return {\n restrict: 'AEC',\n sc...
javascript
chosen
[ { "from": "system", "value": "Add config for country of birth for homeoffice countries component\n" }, { "from": "human", "value": "\nmodule.exports = {\n componentDefaults: {\n homeOfficeCountries: [\n 'nationality',\n 'former-nationality',\n 'dual-nationality',\n 'nomin...
javascript
chosen
[ { "from": "system", "value": "Use a fixed width for the output snippets on the documentation site.\n" }, { "from": "human", "value": "/*global global*/\nvar argv = require('minimist')(process.argv.slice(2));\n\nglobal.require = require;\nvar unexpected = require('unexpected').clone().installPlug...
javascript
chosen
[ { "from": "system", "value": "Use <label /> for a label\n" }, { "from": "human", "value": "/*\n * Localisation Manager\n *\n * @author: Nils Hörrmann, post@nilshoerrmann.de\n * @source: http://github.com/symphonists/localisationmanager\n */\n(function($) {\n\t$(document).ready(function() {\n\t\n...
javascript
chosen
[ { "from": "system", "value": "Add test to check whether a variable is a number.\n" }, { "from": "human", "value": "function AppViewModel() {\n this.statStrength = ko.observable();\n this.statEndurance = ko.observable();\n this.statAgility = ko.observable();\n this.statSpeed = ko.obse...
javascript
chosen
[ { "from": "system", "value": "Send create account notification on account create\n" }, { "from": "human", "value": "'use strict';\n\nvar assign = require('es5-ext/object/assign');\n\n// Common\nassign(exports, require('../user/server'));\n\n// Add user\nexports['user-add'] = require('mano-auth/c...
javascript
chosen
[ { "from": "system", "value": "Enable GPU hardware acceleration by default" }, { "from": "human", "value": "/**\n * Default user preferences. End-users can change these parameters by editing config.json\n * @param {number} version - Scheme version. (Not application version)\n */\nconst defaultPre...
javascript
chosen
[ { "from": "system", "value": "Fix sorting on FOLV settings example\n" }, { "from": "human", "value": "import ListFormRoute from 'ember-flexberry/routes/list-form';\n\nexport default ListFormRoute.extend({\n /**\n Name of model projection to be used as record's properties limitation.\n\n @...
javascript
chosen
[ { "from": "system", "value": "Allow space,dash,apostrophe in name searches\n\n" }, { "from": "human", "value": "'use strict';\n\nlet content = require('./content.js');\n\nfunction validateInputs(err, obj) {\n\n err.items = [];\n\n let errCount = 0;\n\n if (obj.forename && !isString(obj....
javascript
chosen
[ { "from": "system", "value": "Add PhantomJS to the standard developer unit tests\n" }, { "from": "human", "value": "module.exports = function(config){\n config.set({\n basePath : '../../',\n\n files : [\n 'bower_components/jquery/jquery.js',\n 'bower_components/angular/angular.j...
javascript
chosen
[ { "from": "system", "value": "Add before and after hooks for socket testing\n" }, { "from": "human", "value": "var expect = require('chai').expect;\nvar io = require('socket.io-client');\nvar localServerUri = 'http://127.0.0.1:3000/';\nvar connection;\n\ndescribe('Socket Server', function() {\n\...
javascript
chosen
[ { "from": "system", "value": "Use ES6 way of exporting default.\n" }, { "from": "human", "value": "/**\n * GET /\n * Home page.\n */\nimport { match } from 'react-router';\nimport Application from '../../application/HelloWorld';\n\nexports.home = (req, res) => {\n match({\n routes: Applicati...
javascript
chosen
[ { "from": "system", "value": "Fix bug where info name was not sanitzed before comitting\n" }, { "from": "human", "value": "const sanitize = (name) => {\n return name\n .replace(':', '')\n}\n\nexport default {\n set (state, { key, value }) {\n state.info[sanitize(key)] = value\n },\n ad...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary things from slider example.\n" }, { "from": "human", "value": "(function () {\n\n new SliderBarr({\n el : $('#slider'),\n value : 15,\n step : 1\n });\n\n new SliderBarr({\n el : $('#sliderTwo'),\n ...
javascript
chosen
[ { "from": "system", "value": "Fix potentially broken selfcheck if two errors occur\n" }, { "from": "human", "value": "/*\n The Company module exposes functionality needed in the company section\n of the dashboard.\n*/\n\nvar Inventory = (function ($, tools) {\n\n // Perform self check, ...
javascript
chosen
[ { "from": "system", "value": "Implement Input component state for controlling current text input value\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport styles from './Input.css';\n\nclass Input extends Component {\n constructor(props) {\n super(...
javascript
chosen
[ { "from": "system", "value": "test: Write tests for saga helpers\n" }, { "from": "human", "value": "import { expect, } from 'chai'\n\nimport * as JobActions from '../../actions/JobActions'\nimport * as JobActionTypes from '../../constants/JobActionTypes'\nimport * as JobApiActionTypes from '../....
javascript
chosen
[ { "from": "system", "value": "[BACKLOG-18075] Check for empty values before setting selection\n" }, { "from": "human", "value": "/*!\n * Copyright 2017 Pentaho Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this fil...
javascript
chosen
[ { "from": "system", "value": "Increase threshold to account for Chrome downloadbar\n\nFixes #2" }, { "from": "human", "value": "// devtools-detect\n// by Sindre Sorhus\n// MIT License\n(function (window) {\n\t/*global CustomEvent */\n\t'use strict';\n\tvar devtools = window.devtools = { open: fa...
javascript
chosen
[ { "from": "system", "value": "Add methods to player class\n" }, { "from": "human", "value": "/*\n* Blaze object. Inherits GameObject.\n */\nfunction Blaze(coordinate) {\n console.log(\"Blaze constructor.\")\n GameObject.call(this, coordinate);\n}\n\nBlaze.prototype = new GameObject();\n\...
javascript
chosen
[ { "from": "system", "value": "Fix load failure in firefox when indexedDB is disabled\n" }, { "from": "human", "value": "var matrixcs = require(\"./lib/matrix\");\nmatrixcs.request(require(\"browser-request\"));\n\n// if our browser (appears to) support indexeddb, use an indexeddb crypto store.\n...
javascript
chosen
[ { "from": "system", "value": "Remove unused require for gulp-postcss.\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar stylus = require('gulp-stylus');\nvar nib = require('nib');\nvar ignore = require('gulp-ignore');\nvar config = require('../util/config');\nv...
javascript
chosen
[ { "from": "system", "value": "Add extra gunk to payload\n" }, { "from": "human", "value": "javascript:function fx(str){return encodeURIComponent(str).replace(/[!'()*]/g, function(c){return '%' + c.charCodeAt(0).toString(16);});};var captureLink=function(){var s=fx(window.getSelection().toString(...
javascript
chosen
[ { "from": "system", "value": "Call e.respondWith() in fetch event handler.\n" }, { "from": "human", "value": "this.addEventListener('install', function(event) {\n event.waitUntil(\n caches.open('v1').then(function(cache) {\n return cache.addAll([\n '/sw-test/',\n '/sw-test...
javascript
chosen
[ { "from": "system", "value": "Update cookies to use universal-cookie\n" }, { "from": "human", "value": "import cookie from 'react-cookie';\n\nimport { Meteor } from 'meteor/meteor';\n\nimport { getRenderContext } from './render_context.js';\n\nfunction setToken(loginToken, expires) {\n if (logi...
javascript
chosen
[ { "from": "system", "value": "Add another test commit for changing login\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Text, Image, View } from 'react-native';\nimport styles from './styles/ActorsMoviesStyle';\nimport ActorImage from '../components/ActorI...
javascript
chosen
[ { "from": "system", "value": "Change for 0.2 to use generic hash streams" }, { "from": "human", "value": "'use strict';\nvar crypto = require('crypto')\nvar Transform = require('stream').PassThrough\nvar util = require('util')\n\n\n\n/**\n * Constructor\n * @constructor\n * @param {object} optio...
javascript
chosen
[ { "from": "system", "value": "Add chapter 5, exercise 4\n" }, { "from": "human", "value": "function dominantDirection(text) {\n let scripts = countBy(text, char => {\n let script = characterScript(char.codePointAt(0));\n return script ? script.direction : \"none\";\n }).filte...
javascript
chosen
[ { "from": "system", "value": "Update config file for gh-pages assests path\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'dummy',\n environment: environment,\n baseURL: '/',\n locationType: 'auto'...
javascript
chosen
[ { "from": "system", "value": "Allow minification of JS in production\n" }, { "from": "human", "value": "/*jshint node:true*/\n/* global require, module */\n\nvar EmberApp = require( 'ember-cli/lib/broccoli/ember-app' );\n\nmodule.exports = function( defaults ) {\n\n\tvar app = new EmberApp( defa...
javascript
chosen
[ { "from": "system", "value": "Fix bug where long arrays were treated as objects\n" }, { "from": "human", "value": "const maxWidth = process.argv[2] || 80\n\nconst stdin = process.stdin,\n stdout = process.stdout,\n inputChunks = []\n\nstdin.resume()\nstdin.setEncoding('utf8')\n\nstdin....
javascript
chosen
[ { "from": "system", "value": "Set instance to null if client is closed\n" }, { "from": "human", "value": "import { MongoClient } from 'mongodb';\n\nconst MONGODB_URI = process.env.MONGODB_URI;\n\n// Database Name\nconst dbName = 'cofacts';\n\nexport default class CofactsMongoClient {\n /**\n ...
javascript
chosen
[ { "from": "system", "value": "Allow post urls without slugs to be transformed\n\n * Modify for post_id -> post_ident in route dynamic segment\n" }, { "from": "human", "value": "App.RawTransform = DS.Transform.extend({\n deserialize: function(serialized) {\n return serialized;\n },\n serial...
javascript
chosen
[ { "from": "system", "value": "Replace logo to top box\n" }, { "from": "human", "value": "'use strict';\n\nconst template = require('../views/index.hbs');\nconst Logo = require('./components/Logo.js');\nconst CurrentWeather = require('./pages/CurrentWeather.js');\nconst ForecastWeather = require(...
javascript
chosen
[ { "from": "system", "value": "Allow 'staging' as an env name for non-clustered run\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/*\n* SQL API loader\n* ===============\n*\n* node app [environment] \n*\n* environments: [development, test, production]\n*\n*/\nvar _ = require('undersco...
javascript
chosen
[ { "from": "system", "value": "Fix invalid bitmask for release archives\n" }, { "from": "human", "value": "var eventStream = require('event-stream'),\n gulp = require('gulp'),\n chmod = require('gulp-chmod'),\n zip = require('gulp-zip'),\n tar = require('gulp-tar'),\n gzip = requir...
javascript
chosen
[ { "from": "system", "value": "Add better error message formatting\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar program = require('../../parser/program.js');\nvar Parsimmon = require('parsimmon');\n\nmodule.exports = readJSigAST;\n\nfunction readJSigAST(fileNam...
javascript
chosen
[ { "from": "system", "value": "Disable old android by default\n" }, { "from": "human", "value": "'use strict';\n\nexports.filterPlatforms = filterPlatforms;\nfunction filterPlatforms(platform) {\n var browser = platform.browserName;\n var version = platform.version;\n if (version === 'dev' || ...
javascript
chosen
[ { "from": "system", "value": "Use upper case when testing for HTTP request type\n" }, { "from": "human", "value": "document.addEventListener('click', function(event) {\n var form, input, method, element;\n\n element = event.target;\n\n if (matches.call(element, 'a[data-method]')) {\n if (m...
javascript
chosen
[ { "from": "system", "value": "Add `minify` to gulp watch\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar less = require('gulp-less');\nvar cleancss = require('gulp-clean-css');\nvar csscomb = require('gulp-csscomb');\nvar concat = require('gulp-concat');\nvar rename = require...
javascript
chosen
[ { "from": "system", "value": "Update gulp to watch scripts and html\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar bs = require('browser-sync').create();\n\ngulp.task('default', function() {\n bs.init({\n server: {\n baseDir: \"./app\",\n routes: {\n \"/...
javascript
chosen
[ { "from": "system", "value": "Add a 'not found' message to not found error\n" }, { "from": "human", "value": "function NotFoundError(message) {\n this.name = 'Not found';\n this.message = message || '';\n this.status = 404;\n}\n\nNotFoundError.prototype = Error.prototype;\n\nmodule.exports = ...
javascript
chosen
[ { "from": "system", "value": "Add a DataSelector creation convenience method\n" }, { "from": "human", "value": "var Montage = require(\"montage\").Montage;\n\n/**\n * Defines the criteria that objects must satisfy to be included in a data set\n * as well as other characteristics the data set mus...
javascript
chosen
[ { "from": "system", "value": "Use port 80 to get around firewalls\n" }, { "from": "human", "value": "import uuid from 'node-uuid'\n\nconst id = uuid.v4()\n\nif (typeof window === 'undefined') {\n var peer = { id: id }\n} else {\n let Peer = require('peerjs')\n var peer = new Peer(id, {\n h...
javascript
chosen
[ { "from": "system", "value": "Add AwsS3 to the dist bundle.\n" }, { "from": "human", "value": "const Core = require('./core/index.js')\n\n// Parent\nconst Plugin = require('./plugins/Plugin')\n\n// Orchestrators\nconst Dashboard = require('./plugins/Dashboard/index.js')\n\n// Acquirers\nconst Du...
javascript
chosen