conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix regex for external url matching\n" }, { "from": "human", "value": "/* ==========================================================================\n External Site Redirect\n Used on all pages.\n Adds listener that redirects to /external-site/\n if clicked ...
javascript
chosen
[ { "from": "system", "value": "Remove reporter from gulp mocha options\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst util = require('gulp-util');\nconst babel = require('gulp-babel');\nconst mocha = require('gulp-mocha');\nconst eslint = require('gulp-eslint');\nconst co...
javascript
chosen
[ { "from": "system", "value": "Add better python path description\n" }, { "from": "human", "value": "var path = require('path');\nvar fs = require('fs');\n\nmodule.exports = function() {\n verifyNode();\n verifyPython27();\n};\n\nfunction verifyNode() {\n var nodeVersion = process.versions.nod...
javascript
chosen
[ { "from": "system", "value": "Use environment variable instead of specifying the port.\n" }, { "from": "human", "value": "var app = require('express')();\nvar bodyParser = require('body-parser');\n\napp.use(bodyParser.json()); \n\napp.post('/', function (req, res) {\n console.log(req.bo...
javascript
chosen
[ { "from": "system", "value": "Fix ENONET error found by galusben" }, { "from": "human", "value": "//load zip csv into memory into a format we can easily iterate over\n//executed when gps2zip is required\nvar fs = require('fs');\nvar zips = [];\ntry {\n\tvar data = fs.readFileSync('zips.json', 'a...
javascript
chosen
[ { "from": "system", "value": "Change the default port to 5000\n" }, { "from": "human", "value": "var api = require('./lib/api');\nvar http = require('http');\nvar log = require('./lib/log');\nvar port = process.env.PORT || 80;\n\n// Create and run the server\n\nhttp\n .createServer(api)\n .lis...
javascript
chosen
[ { "from": "system", "value": "Change static file serving and index file name." }, { "from": "human", "value": "var express = require(\"express\");\nvar app = express();\n\n\n// Static files directory\napp.use(express.static('public'));\n\n// Request handlers\napp.get('/', function(req, res) {\n ...
javascript
chosen
[ { "from": "system", "value": "Make sure tests pass before building\n" }, { "from": "human", "value": "const gulp = require('gulp')\nconst babel = require('gulp-babel')\nconst mocha = require('gulp-mocha')\n\ngulp.task('build', () => {\n return gulp\n .src('index.js')\n .pipe(bab...
javascript
chosen
[ { "from": "system", "value": "Fix undefined port in pushState support\n" }, { "from": "human", "value": "/*eslint-disable*/\n\nvar path = require('path');\nvar express = require('express');\nvar request = require('request');\nvar webpack = require('webpack');\nvar devMiddleware = require('webpac...
javascript
chosen
[ { "from": "system", "value": "Change http code to 201 on success posts\n" }, { "from": "human", "value": "'use strict';\n\nvar express = require('express')\n , bodyParser = require('body-parser')\n , mongoose = require('mongoose')\n , cors = require('./cors')\n , app = express();\n\nrequire(...
javascript
chosen
[ { "from": "system", "value": "Fix syntax error in generator\n" }, { "from": "human", "value": "module.exports = {\n description: 'Who knows'\n\n normalizeEntityName: function() {\n },\n\n afterInstall: function(options) {\n return this.addBowerPackagesToProject([\n { name: 'localfora...
javascript
chosen
[ { "from": "system", "value": "Add a few more slick carousel configs\n" }, { "from": "human", "value": "$(document).ready(function(){\n $('.multiple-items').slick({\n infinite: true,\n slidesToShow: 3,\n slidesToScroll: 3,\n dots: true,\n pauseOnDotsHover: tr...
javascript
chosen
[ { "from": "system", "value": "Add default FS root to new FS objects\n" }, { "from": "human", "value": "/*\n *\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\...
javascript
chosen
[ { "from": "system", "value": "Handle situation where someone just tries inputting in two commas in the same row\n" }, { "from": "human", "value": "$(document).ready(function(){\n $(\"#textarea1\").focus();\n Materialize.toast('Listening for tweets...');\n $(\".toast\").hide();\n var map = in...
javascript
chosen
[ { "from": "system", "value": "Add sample video view impl\n" }, { "from": "human", "value": "import { getGrpcClientAsync } from 'killrvideo-nodejs-common';\nimport { STATS_SERVICE } from '../services/stats';\n\n/**\n * Adds a view to a video.\n */\nexport function addSampleVideoView() {\n return...
javascript
chosen
[ { "from": "system", "value": "Convert node list to array before looping through\n" }, { "from": "human", "value": "window.embetter.activeServices = [\n window.embetter.services.youtube,\n window.embetter.services.vimeo,\n window.embetter.services.soundcloud,\n window.embetter.services.dailym...
javascript
chosen
[ { "from": "system", "value": "Add in message remover for memedog\n" }, { "from": "human", "value": "import BaseWatcher from './BaseWatcher';\n\nimport config from '../config';\n\n/**\n * This checks for people spamming cool dog crap.\n */\nclass CoolDogSpamWatcher extends BaseWatcher {\n cons...
javascript
chosen
[ { "from": "system", "value": "Fix spelling mistake in comments\n\nShould be themselves not themselfs." }, { "from": "human", "value": "// Kreativgebiet GmbH\n//\n// Require all gulp tasks from the subfolder\n// and let them call themselfes\n\nrequire('require-dir')('./tasks', { recurse: true });...
javascript
chosen
[ { "from": "system", "value": "refactor: Replace process.env with env module reference\n" }, { "from": "human", "value": "const mongoClient = require('mongodb').MongoClient\n\nconst URI = process.env.MONGOLAB_URI || 'mongodb://localhost:27017/review-bot';\n\nmodule.exports = {\n _db: null,\n\n ...
javascript
chosen
[ { "from": "system", "value": "feat(model): Include Account in the query for Users\n" }, { "from": "human", "value": "module.exports = function(Model, config) {\n return Model.extend('Account',\n {\n type : config['clever-accounts'].driver || 'ORM',\n softDeletable : true...
javascript
chosen
[ { "from": "system", "value": "Fix safari not showing login screen when server down\n\n" }, { "from": "human", "value": "define(\n [\n 'service/serviceBase'\n ],\n function (ServiceBase) {\n 'use strict';\n\n function UserService() {\n ServiceBase.call(thi...
javascript
chosen
[ { "from": "system", "value": "Sort alphabetical + new languages" }, { "from": "human", "value": "import LANGUAGES from './languages';\n\nconst SUPPORTED_LANGUAGES = {\n en: LANGUAGES.en[1],\n pl: LANGUAGES.pl[1],\n id: LANGUAGES.id[1],\n de: LANGUAGES.de[1],\n fr: LANGUAGES.fr[1],\n sk: LA...
javascript
chosen
[ { "from": "system", "value": "Switch project view when user picks a different project.\n" }, { "from": "human", "value": "Application.Directives.directive(\"sidebarProjects\", sidebarProjectsDirective);\n\nfunction sidebarProjectsDirective() {\n return {\n restrict: \"AE\",\n re...
javascript
chosen
[ { "from": "system", "value": "Remove .user to appease Leon" }, { "from": "human", "value": "module.exports = {\n\t\n name: \"Member Nickname Changed MOD\",\n \n isEvent: true,\n \n fields: [\"Temp Variable Name (stores new nickname):\", \"Temp Variable Name (stores member object):...
javascript
chosen
[ { "from": "system", "value": "Add stubs for missing acceptance tests\n" }, { "from": "human", "value": "var assert = require('assert');\nvar request = require('supertest');\nvar app = request(require('../../'));\n\ndescribe('GET /api/v1/cabin', function() {\n it('returns list of cabins', functi...
javascript
chosen
[ { "from": "system", "value": "Fix testing if element exists." }, { "from": "human", "value": "$(function() {\n var cookieName = '_wheelmap_splash_seen';\n var setCookie = function() {\n $.cookie(cookieName, true, { expires: 1000 });\n };\n\n if(!$.cookie(cookieName)) {\n var width = 60...
javascript
chosen
[ { "from": "system", "value": "Upgrade meteor-babel dependency to 0.4.5\n" }, { "from": "human", "value": "Package.describe({\n name: \"babel-compiler\",\n summary: \"Parser/transpiler for ECMAScript 6+ syntax\",\n // Tracks the npm version below. Use wrap numbers to increment\n // without i...
javascript
chosen
[ { "from": "system", "value": "Remove getMethodName(); optional HTTP status code.\n" }, { "from": "human", "value": "function Ensure(meteor, st) {\n this.meteor = meteor;\n this.st = st;\n this.middleware = [];\n this.message = \"Permission denied.\"\n}\n\n// Set the default error message (i...
javascript
chosen
[ { "from": "system", "value": "Enable to call gc() in performance tests of BlinkGC.\nIn case of GCController cannot be used.\n\nBUG=465997,457982,438074\nTEST=./tools/perf/run_benchmark run oilpan_gc_times.blink_perf_stress --browser=content-shell-release\n\nReview URL: https://codereview.chromium.org/971683...
javascript
chosen
[ { "from": "system", "value": "Test for Angular Object literal with returns of directiveFactory\n" }, { "from": "human", "value": "// plugin=angular\n// environment=browser\n// environment=jquery\n// loadfiles=config.js, filters.js\n\nangular.module('sample', ['ngResource', 'sample.config', 'samp...
javascript
chosen
[ { "from": "system", "value": "Use new API to register defs.\n\nSee https://github.com/ternjs/tern/blob/master/plugin/requirejs.js#L263" }, { "from": "human", "value": "/* global define, tern */\n\n;(function (mod) {\n if (typeof exports === 'object' && typeof module === 'object') { // CommonJS\...
javascript
chosen
[ { "from": "system", "value": "refactor: Change function param name, spacing\n" }, { "from": "human", "value": "var path = require('path');\nvar fs = require('fs-extra');\nvar scantree = require('scantree');\nvar globArray = require('glob-array');\n\nvar helpersApi = {};\n\nfunction getJsConfigFr...
javascript
chosen
[ { "from": "system", "value": "Use dynamic forms to constraint workflow\n" }, { "from": "human", "value": "$(window).on('entity:view:add entity:view:update', function (e, data) {\n $('#div_id_message_sentinel').prop('hidden', true);\n $('#div_id_message_supervisor').prop('hidden', true);\n ...
javascript
chosen
[ { "from": "system", "value": "Add test checking you can cancel RoundTripMessage.\n" }, { "from": "human", "value": "import RoundTripMessageWrapper from \"./RoundTripMessageWrapper\"\n\ndescribe(\"RoundTripMessageWrapper\", function(){\n it(\"sth\", function(done){\n var onMessageFn = n...
javascript
chosen
[ { "from": "system", "value": "Make accesskey and label globally localizable in XUL\n" }, { "from": "human", "value": "import { Localization } from './base';\nimport { overlayElement } from './overlay';\n\nexport { contexts } from './base';\n\nconst ns = 'http://www.mozilla.org/keymaster/gatekeep...
javascript
chosen
[ { "from": "system", "value": "Return stdout on resolve promise\n" }, { "from": "human", "value": "import execa from 'execa'\nimport { validateJsonPath } from './utils'\n\nconst buildNullInputParams = (filter, json) => {\n return [\n '--null-input',\n `${filter} | ${JSON.stringify(json)}`\...
javascript
chosen
[ { "from": "system", "value": "Use childAt in unit tests\n" }, { "from": "human", "value": "import React from 'react';\nimport { shallow } from 'enzyme';\n\nimport Header from './Header';\nimport styles from './Header.css';\n\n\ndescribe('<Header>', () => {\n it('should render the default markup...
javascript
chosen
[ { "from": "system", "value": "Fix for illegal invocation caused by Uglify\n" }, { "from": "human", "value": "let func\nif(typeof window === 'undefined')\n // for unit testing in Node\n func = (callback => setTimeout(callback, 1000 / 60))\nelse\n func = (\n window.requestAnimation...
javascript
chosen
[ { "from": "system", "value": "Write test to verify enhancer\n" }, { "from": "human", "value": "import enhancer from '../src/enhancer'\nimport createMockStorage from './utils/testStorage'\n\ndescribe('enhancer', () => {\n it('returns enhanced store with initial storage state', () => {\n const...
javascript
chosen
[ { "from": "system", "value": "Fix getting wallet service when receiving stealth.\n" }, { "from": "human", "value": "define(['./module', 'darkwallet'], function (controllers, DarkWallet) {\n 'use strict';\n controllers.controller('ReceiveStealthCtrl', ['$scope', 'notify', function($scope, notif...
javascript
chosen
[ { "from": "system", "value": "Add a repository for people\n" }, { "from": "human", "value": "/*jslint indent: 2, nomen: true, maxlen: 100 */\n/*global require, applicationContext */\n\n(function () {\n \"use strict\";\n var FoxxGenerator = require('./foxx_generator').Generator,\n generator;...
javascript
chosen
[ { "from": "system", "value": "Remove commented out episodes route\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport config from './config/environment';\n\nvar Router = Ember.Router.extend({\n location: config.locationType\n});\n\nRouter.map(function() {\n this.route('search...
javascript
chosen
[ { "from": "system", "value": "Rewrite listener to use async/await\n" }, { "from": "human", "value": "\nfunction nt (newtab) {\n\tfunction waitForURL(tabId, changeInfo, tab) {\n\t\tif (changeInfo.title === '@NewTab') {\n\t\t\tbrowser.storage.local.get('newtaburl').then((ntu) => {\n\t\t\t\tbrowser...
javascript
chosen
[ { "from": "system", "value": "Update at Tue Apr 30 21:47:19 PDT 2013\n" }, { "from": "human", "value": "var shell = require('./shell.js');\nfor (var cmd in shell)\n global[cmd] = shell[cmd];\n" }, { "from": "gpt", "value": "var shell = require('./shell.js');\nfor (var cmd in shell)\...
javascript
chosen
[ { "from": "system", "value": "Add support for `skipNested` field option.\n\n+ The `skip` option removes `N` elements from the top-level list.\n This works fine for a simple list but does not work for nested lists,\n e.g. for `Classification` which is a list of hierarchies.\n+ Now `skipNested` wiill remove...
javascript
chosen
[ { "from": "system", "value": "Fix Chrome exiting when running `ember-test`\n" }, { "from": "human", "value": "module.exports = {\n test_page: 'tests/index.html?hidepassed',\n disable_watching: true,\n launch_in_ci: [\n 'Chrome'\n ],\n launch_in_dev: [\n 'Chrome'\n ],\n browser_args:...
javascript
chosen
[ { "from": "system", "value": "Update traffic limit to 10GB" }, { "from": "human", "value": "var usedTraffic = null,\n\tquotaPerDay = 5 * 1024 * 1024,\n\tmaxQuota = quotaPerDay * 21;\n\n/** Resets all modified values to their defaults. */\nfunction clearState() {\n\tchrome.browserAction.setIcon({...
javascript
chosen
[ { "from": "system", "value": "Add implemented interfaces to rule history\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2019 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfoam.CLASS({\n package: 'foam.nanos.ruler',\n name: 'Rul...
javascript
chosen
[ { "from": "system", "value": "Change port to be process.env.PORT in production\n" }, { "from": "human", "value": "// Bring in our dependencies\nconst app = require('express')();\nconst routes = require('./routes');\n\n// Connect all our routes to our application\napp.use('/', routes);\n\n// Tur...
javascript
chosen
[ { "from": "system", "value": "Update cumulative flow chart, add average\n" }, { "from": "human", "value": "'use strict';\n\nvar utils = require('../utils');\n\n\n\nfunction createColumnsObj(lists) {\n var columns = {};\n\n for(var list in lists) {\n lists[list].forEach(function(column) {\n ...
javascript
chosen
[ { "from": "system", "value": "Make sure that we're only tracking extensions\n" }, { "from": "human", "value": "var assert = require('assert');\n\nmodule.exports = function() {};\n\nmodule.exports.prototype.getOptionName = function () {\n return 'disallowObjectController';\n};\n\nmodule.exports....
javascript
chosen
[ { "from": "system", "value": "Remove koa.js dependencies and add any required express middleware\n" }, { "from": "human", "value": "var compress \t= require('koa-compress'),\n\t\tlogger \t\t= require('koa-logger'),\n\t\tserve \t\t= require('koa-static'),\n\t\troute \t\t= require('koa-route'),\n\...
javascript
chosen
[ { "from": "system", "value": "Update component to pass tests.\n" }, { "from": "human", "value": "jest.dontMock('../../components/PlainText.js');\n\nvar React = require('react');\nvar TestUtils = require('react-addons-test-utils');\n\nvar plainTextComponent = React.createFactory(require('../../co...
javascript
chosen
[ { "from": "system", "value": "Add path definition for the creating group API.\n" }, { "from": "human", "value": "module.exports = {};\n\nfunction define( key, value ) {\n\tmodule.exports[key] = value;\n}\n\ndefine( 'token', { 'get' : '/user/getToken' } );\ndefine( 'message', { 'publish' : '/mess...
javascript
chosen
[ { "from": "system", "value": "Stop writing out test files\n" }, { "from": "human", "value": "var vm = require(\"vm\"),\n\n rollup = require(\"rollup\").rollup;\n\nmodule.exports = function(entry, tgt) {\n tgt.exports = {};\n \n return rollup(\n Object.assign(\n {},\...
javascript
chosen
[ { "from": "system", "value": "Use 'data' folder instead of 'data-global'\n" }, { "from": "human", "value": "'use strict';\n\nvar resolve = require('path').resolve\n , Driver = require('dbjs-persistence')\n , mano = require('mano');\n\nmodule.exports = function (root) {\n\tvar driver = new ...
javascript
chosen
[ { "from": "system", "value": "Stop spawning enemies when player is dead. Player regenerates health.\n" }, { "from": "human", "value": "var canvas = document.getElementById('g');\nvar controls = new Controls();\nvar camera = new Camera(canvas, 0, 0, 3.0);\nvar backgroundLayer = [];\nvar entities ...
javascript
chosen
[ { "from": "system", "value": "Update up to changes in es5-ext package\n" }, { "from": "human", "value": "'use strict';\n\nvar defineProperty = Object.defineProperty\n , copy = require('es5-ext/array/#/copy')\n , remove = require('es5-ext/array/#/remove')\n , d =...
javascript
chosen
[ { "from": "system", "value": "Use textContent to get title\n" }, { "from": "human", "value": "function setAriaCurrent() {\n\tvar id = document.getElementById(\"inicio\");\n\tid.innerText(document.title)\n}\n\nsetAriaCurrent();\n" }, { "from": "gpt", "value": "function setAriaCurrent(...
javascript
chosen
[ { "from": "system", "value": "Replace small names by country acronyms\n" }, { "from": "human", "value": "'use strict';\n\nfunction leagues() {\n return {\n bundesliga: {\n code: 'bundesliga',\n name: 'Bundesliga',\n smallName: 'Bundesliga'\n },\n...
javascript
chosen
[ { "from": "system", "value": "Remove fun from the world\n" }, { "from": "human", "value": "import _ from 'lodash'\n\nconst emptyFunny = [\n 'Looks like you don’t have any queries. Be a lot cooler if you did.',\n 'Create a query. Go on, I dare ya!',\n 'Create a query. Have fun!',\n '1) Create...
javascript
chosen
[ { "from": "system", "value": "Use contenthash to generate the JS bundles names\n" }, { "from": "human", "value": "const baseConfig = require('./webpack.base.config.js');\nconst merge = require('webpack-merge');\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\nconst OptimizeCSSA...
javascript
chosen
[ { "from": "system", "value": "Update service worker cache version\n" }, { "from": "human", "value": "var CACHE_NAME = 'buddhabrot-2017-10-12-2';\nvar urlsToCache = [\n '.',\n '/',\n '/main.js',\n '/material-components-web.min.css',\n '/material-components-web.min.js',\n '/rust-logo-blk.svg...
javascript
chosen
[ { "from": "system", "value": "Add semicolon, like a javascript conformist.\n" }, { "from": "human", "value": "// Creates the reminders table.\n\nvar Knex = require('knex');\n\nvar knex = Knex.initialize({\n client: 'pg',\n connection: process.env.DATABASE_URL\n});\n\nvar createTable = function...
javascript
chosen
[ { "from": "system", "value": "Add print of stack trace as default for chai\n" }, { "from": "human", "value": "assert = chai.assert\r\nexpect = chai.expect\r\nshould = chai.should\r\n" }, { "from": "gpt", "value": "assert = chai.assert\r\nexpect = chai.expect\r\nshould = chai.should\r...
javascript
chosen
[ { "from": "system", "value": "Use id instead of htmlId\n" }, { "from": "human", "value": "//@flow\n\nimport React from 'react';\nimport Editor from 'app/components/Editor';\n\ntype Props = {\n /** The content to be displayed - the text */\n content: string,\n /** The id of the div wrapping th...
javascript
chosen
[ { "from": "system", "value": "Use environment variable for system32\n\nWindows can be installed on a different drive than `c:\\`" }, { "from": "human", "value": "'use babel';\n\nimport { CompositeDisposable } from 'atom';\n\nexport default {\n\n subscriptions: null,\n\n config: {\n \"path\"...
javascript
chosen
[ { "from": "system", "value": "Fix cl console.log shorthand to show real path\n\nMerge pull request #100 from Novicell/tbb2-patch-1\r\nUpdate novicell.js" }, { "from": "human", "value": "'use strict';\n/*global console:true */\n\n/*!\n*\n* Novicell JavaScript Library v0.5\n* http://www.novicell...
javascript
chosen
[ { "from": "system", "value": "Remove extra space from footer\n" }, { "from": "human", "value": "// On document ready handler\n$(function() {\n $('footer').prepend(new Date().getFullYear() + '&nbsp;');\n});\n" }, { "from": "gpt", "value": "// On document ready handler\n$(function() {...
javascript
chosen
[ { "from": "system", "value": "Fix HTML unescape issue for messages\n" }, { "from": "human", "value": "import Ember from \"ember\";\nconst { getOwner } = Ember;\n\nexport default Ember.Service.extend({\n i18n: Ember.inject.service(),\n\n convert: function(values) {\n var offerId = values.off...
javascript
chosen
[ { "from": "system", "value": "Remove `if` statement, as `timeout` should always be positive integer\n" }, { "from": "human", "value": "/* eslint-disable no-underscore-dangle */\n'use strict';\n\n// MODULES //\n\nvar timeout = require( './set_timeout.js' );\nvar clear = require( './clear_timeout....
javascript
chosen
[ { "from": "system", "value": "UICAL-85: Add prop-types validation for ariaLabel\n" }, { "from": "human", "value": "/**\n * Nav List\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nconst NavList = ({ className, children, ariaLabel, ...rest }) => (\n <nav\n data-test...
javascript
chosen
[ { "from": "system", "value": "Set the route for text wallposts to the model passed as a parameter\n" }, { "from": "human", "value": "App.WallRouteMixin = Em.Mixin.create({\n\n parentId: Em.K(),\n parentType: Em.K(),\n\n // This way the ArrayController won't hold an immutable array thus ...
javascript
chosen
[ { "from": "system", "value": "Update gulp for to use production settings.\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n environments = require('gulp-environments'),\n gutil = require('gulp-util');\n\nvar development = environments.development;\nvar production = environments....
javascript
chosen
[ { "from": "system", "value": "Revert \"remove turbolinks support, alternativly use jquery.turbolinks gem\"\n\nThis reverts commit a2d0358429d64c87cd354f43ca976fa6147ea0c6.\n" }, { "from": "human", "value": "// Inspired from Paul Irish and Jason Garber\n\nAPP = {};\n \nGIStyle = {\n exec: functi...
javascript
chosen
[ { "from": "system", "value": "Update to use loader.finalSource for exported stylesheet\n" }, { "from": "human", "value": "var path = require('path');\nvar through = require('through');\nvar postcss = require('postcss');\nvar autoprefixer = require('autoprefixer-core');\nvar shasum = require('sha...
javascript
chosen
[ { "from": "system", "value": "Fix image size adjustment on gallery images\n\nGallery images are being adjusted wrongly, this patch adds .gallerybox\nto the Class Blacklist for the adjustThumbWidths transform.\n\nBug: T228287\nChange-Id: Ib69397229385357fe82a1f4d8dc2b3044d324bcb\n" }, { "from": "huma...
javascript
chosen
[ { "from": "system", "value": "Modify EN/FR button to toggle url\n" }, { "from": "human", "value": "//Switching between languages on narrow devices (smartphones)\n$(\"#language\").click(function() {\n\t//Switch text to the other language\n\t\t$(\"span[lang|='en']\").toggle(0);\n\t\t$(\"span[lang|...
javascript
chosen
[ { "from": "system", "value": "chore(tests): Fix false positive test result\n" }, { "from": "human", "value": "import { moduleFor, test } from 'ember-qunit';\n\nmoduleFor('service:client', 'Unit | Service | Client', {\n // Specify the other units that are required for this test.\n //needs: ['se...
javascript
chosen
[ { "from": "system", "value": "Read \"autofmt\" option from storage\n" }, { "from": "human", "value": "import browser from 'webextension-polyfill';\n\nimport render from '../../common/popup/render';\nimport enhance from '../../common/enhance';\nimport '../../common/popup/popup.scss';\n\nimport st...
javascript
chosen
[ { "from": "system", "value": "Set port to 4000 everywhere except production\n\nThis sets the API client port to 4000 everywhere except production. The `process.env.NODE_ENV` is replaced by webpack with it's value during file processing, so can be used to change variables based on environments.\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Check for vendor returned by API call in my-rep directive. This prevents tray from showing if there is no vendor!\n" }, { "from": "human", "value": "angular\n .module('app')\n .directive(\"myRep\", ['$location', 'authService', 'vendorService', '$document',\n ...
javascript
chosen
[ { "from": "system", "value": "Add melted response to datapoint store\n" }, { "from": "human", "value": "import _ from 'lodash'\nimport Reflux from 'reflux'\nimport StateMixin from'reflux-state-mixin'\nimport DatapointActions from 'actions/DatapointActions'\n\nvar DatapointStore = Reflux.createSt...
javascript
chosen
[ { "from": "system", "value": "Add link to Github on example page\n" }, { "from": "human", "value": "var React = require('react');\nvar Message = require('../src/index');\n\nReact.renderComponent(React.DOM.div(null, [\n React.DOM.code(null, \"<Message type='error' messages={['I'm an error']} />\...
javascript
chosen
[ { "from": "system", "value": "Disable color if tty doesn't like it\n" }, { "from": "human", "value": "/*\nCopyright (c) 2012, Yahoo! Inc. All rights reserved.\nCode licensed under the BSD License:\nhttp://yuilibrary.com/license/\n*/\nvar color = require('ansi-color').set;\n\n\nvar prefix = color...
javascript
chosen
[ { "from": "system", "value": "Change outdated command to show package manager by default\n" }, { "from": "human", "value": "var fs = require('fs')\n , events = require('events')\n , eventEmitter = new events.EventEmitter()\n , pluginDirectory = __dirname + '/package-managers'\n\nvar Opm = {\n...
javascript
chosen
[ { "from": "system", "value": "fix(deepExtend): Add test for undefined dest" }, { "from": "human", "value": "'use strict';\n\ndescribe('Module: highchartsNg', function () {\n // load the controller's module\n beforeEach(module('highcharts-ng'));\n\n it('should extend a simple object', inject(f...
javascript
chosen
[ { "from": "system", "value": "Add archaic WebSocket error handling\n" }, { "from": "human", "value": "new Vue({\n el: '#app',\n\n // Using ES6 string litteral delimiters because\n // Go uses {{ . }} for its templates\n delimiters: ['${', '}'],\n\n data: {\n ws: null,\n message: '',\n ...
javascript
chosen
[ { "from": "system", "value": "Watch for changes at serverboards and current\n\nThis was not necesary in chrome, but was in FF. Anyway it should b\nethere as it prevents update if those props do not change.\n" }, { "from": "human", "value": "import View from 'app/components/serverboard/serverboar...
javascript
chosen
[ { "from": "system", "value": "Update template string translation test.\n" }, { "from": "human", "value": "\"abcdefg\";\n\"abc$efg\";\n\"abc'efg\";\n\"abc\\\"efg\";\n\"abc\" + (d) + \"efg\";\n\"abc\\n\\\n\\n\\\n\\n\\\nefg\";\n\"\\\"\\\"\\\"\";\nhtml(_esdown.callSite([\"a\", \"b\", \"c\\n\"], [\"a...
javascript
chosen
[ { "from": "system", "value": "Revert \"fix: prevent [ref] from turning into shortcodes\"\n\nThis reverts commit 324c5d483f354de76fdf0800bb30966a400a77ba.\nBreaks pages with existing shortcodes.\n" }, { "from": "human", "value": "import Summary from \"./Summary/Summary\";\nimport ProminentLink fr...
javascript
chosen
[ { "from": "system", "value": "Fix mismatched horizontal and vertical proptypes\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport Radium from 'radium';\nimport resolveCellStyles from './util/resolve-cell-styles';\nimport omit from 'lodash.omit';\n\nconst Cell = ...
javascript
chosen
[ { "from": "system", "value": "TemplateLint: Disable some rules for now\n" }, { "from": "human", "value": "'use strict';\n\n/* eslint-env node */\n\nmodule.exports = {\n extends: 'recommended',\n};\n" }, { "from": "gpt", "value": "'use strict';\n\n/* eslint-env node */\n\nmodule.ex...
javascript
chosen
[ { "from": "system", "value": "Remove propTypes, which are validated by tests anyways now." }, { "from": "human", "value": "import React from 'react';\n\nimport KataGroupsComponent from './katagroups';\nimport KatasComponent from './katas.js';\nimport Kata from './kata.js';\nimport {default as Ka...
javascript
chosen
[ { "from": "system", "value": "Move variable assignment into function.\n" }, { "from": "human", "value": "$(document).ready(function() {\n var locationPathName = location.pathname != '/' ? location.pathname : '/ruby/ruby/releases';\n $(\".top-nav a[href='\" + locationPathName + \"']\").addClass...
javascript
chosen
[ { "from": "system", "value": "Send userID if it exists\n" }, { "from": "human", "value": "import React from 'react';\nimport './Rating.scss';\nimport { AuthCtx } from '../withUser';\n\nclass Rating extends React.Component {\n constructor(props) {\n super(props);\n\n this.ratingVals = [\n ...
javascript
chosen
[ { "from": "system", "value": "Fix last PR. ever see the PR and make a if with curly braces\n" }, { "from": "human", "value": "'use strict';\n\nconst Promise = require('bluebird');\nconst Server = require('./server');\n\nmodule.exports = {start};\n\nfunction start () {\n return Promise.resolve()...
javascript
chosen
[ { "from": "system", "value": "Fix texture applied to model\n\n\n\nFormer-commit-id: 82019a79aafd9ebd854ab5b23f011874bbb34ae7" }, { "from": "human", "value": "import {\n Mesh,\n MultiMaterial,\n JSONLoader\n} from 'three';\n\nimport {MeshComponent} from '../../core/MeshComponent';\n\nclass Mod...
javascript
chosen
[ { "from": "system", "value": "Fix for \"Posts has no field postCategory\" error\n\nIt's related to https://github.com/keystonejs/keystone/issues/1870." }, { "from": "human", "value": "var keystone = require('keystone');\n\n/**\n * PostCategory Model\n * ==================\n */\n\nvar PostCategor...
javascript
chosen
[ { "from": "system", "value": "Sort extracted messages by key\n" }, { "from": "human", "value": "import fs from 'fs'\nimport { sync as globSync } from 'glob'\nimport { sync as mkdirpSync } from 'mkdirp'\n\nconst MESSAGES_PATTERN = './_translations/**/*.json'\nconst LANG_DIR = './_translat...
javascript
chosen