conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Sort rules lists (take 2)\n" }, { "from": "human", "value": "(function () {\n var cogClass = function () {};\n cogClass.prototype.exec = function (params, request, response) {\n var oops = this.utils.apiError;\n var sys = this.sys;\n var r...
javascript
chosen
[ { "from": "system", "value": "Allow for custom user agent.\n" }, { "from": "human", "value": "class Analytics {\n constructor(trackingId, clientId, version) {\n this.version = version || 1;\n this.trackingId = trackingId;\n this.clientId = clientId;\n }\n\n send(hit) {\n\n hit.set...
javascript
chosen
[ { "from": "system", "value": "Edit typo of extra space" }, { "from": "human", "value": "$(function() {\n $(\"a.load_reviews\").on(\"click\", function(e){\n//Send AJAX HIGH-LEVEL get request\n $.get(this.href).success(function(json) {\n var $ul = $(\"div.reviews ul\")\n $ul.html(\" \")\n ...
javascript
chosen
[ { "from": "system", "value": "Comment out now unused imports previously needed for CSRF\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2014-2020 Bjoern Kimminich.\n * SPDX-License-Identifier: MIT\n */\n\nconst models = require('../models/index')\nconst insecurity = require('../lib/insec...
javascript
chosen
[ { "from": "system", "value": "Add missed sinon fakeTimer global to mocha\n" }, { "from": "human", "value": "const assert = require('assert');\nconst sinon = require('sinon');\n\nglobal.assert = assert;\nglobal.stub = sinon.stub;\nglobal.spy = sinon.spy;\nglobal.createStubInstance = sinon.createS...
javascript
chosen
[ { "from": "system", "value": "Add an option for disabling UI, false by default though\n" }, { "from": "human", "value": "'use strict';\n\nimport 'source-map-support/register';\nimport http from 'http';\nimport express from 'express';\nimport RED from 'node-red';\n\n// Create an Express app\nlet ...
javascript
chosen
[ { "from": "system", "value": "Stop returning values from the computation\n\nFixes #43" }, { "from": "human", "value": "\n\n// futurize :: Constructor -> CPS -> ( ...args -> Future )\nexport const futurize = Future => fn => function (...args) {\n return new Future((rej, res) =>\n fn(...args, ...
javascript
chosen
[ { "from": "system", "value": "Add real status codes depending on if the request succeeded or not\n" }, { "from": "human", "value": "'use strict';\n\nconst childProcess = require('child-process-promise');\nconst express = require('express');\nconst path = require('path');\nconst fs = require('fs'...
javascript
chosen
[ { "from": "system", "value": "Use `loaderUtils.stringifyRequest` to generate 'require' statements\n\nFixes paths on Windows\n" }, { "from": "human", "value": "import loaderUtils from 'loader-utils';\n\nmodule.exports = function () {};\nmodule.exports.pitch = function (remainingRequest) {\n this...
javascript
chosen
[ { "from": "system", "value": "Change lt to n, add number alias\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst yargs = require('yargs');\n\n// ./modules\nconst rocketLaunch = require('./modules/rocketLaunch');\nconst info = require('./modules/info');\nconst settings = require('./...
javascript
chosen
[ { "from": "system", "value": "Use 'enzyme' for 'View' tests\n" }, { "from": "human", "value": "/* eslint-env mocha */\n\nimport * as utils from '../../../modules/specHelpers'\nimport assert from 'assert'\nimport React from 'react'\n\nimport View from '../'\n\nsuite('components/View', () => {\n ...
javascript
chosen
[ { "from": "system", "value": "Switch to \"new\" style Readable Streams\n\nhttp://nodejs.org/api/process.html#process_process_stdin\n" }, { "from": "human", "value": "var fs = require('fs');\nvar Comb = require('csscomb');\n\nvar cssCombFile = process.argv[3];\nif (fs.existsSync(cssCombFile)) {\n...
javascript
chosen
[ { "from": "system", "value": "Remove underline colour in Android text inputs\n\nSummary: `require('something.jpg')` returns a `number` type.\n\nReviewed By: ejanzer\n\nDifferential Revision: D4132544\n\nfbshipit-source-id: cf47baa377258195fe0155b3ea34208325d7c462\n" }, { "from": "human", "value"...
javascript
chosen
[ { "from": "system", "value": "Add deprecation comment to fakeMorphRetriever\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.morph').service('fakeMorphRetriever', function() {\n this.getStubData = function(callback) {\n var result;\n var request = $.ajax({\n ...
javascript
chosen
[ { "from": "system", "value": "Fix module controller view instantiation example.\n" }, { "from": "human", "value": "define([\n 'spoon',\n './{{name}}View'\n], function (spoon, {{name}}View) {\n\n 'use strict';\n\n return spoon.Controller.extend({\n $name: '{{name}}Controller',\...
javascript
chosen
[ { "from": "system", "value": "Fix less-loader generator to work with less mixins\n" }, { "from": "human", "value": "var ExtractTextPlugin = require('extract-text-webpack-plugin');\n\nmodule.exports = {\n test: /\\.less$/,\n loader: ExtractTextPlugin.extract('style-loader', 'css-loader!less-loa...
javascript
chosen
[ { "from": "system", "value": "Add map view to bar shortcuts\n" }, { "from": "human", "value": "'use strict';\n\n// Configuring the Articles module\nangular.module('events').run(['Menus',\n\tfunction(Menus) {\n\t\t// Set top bar menu items\n\t\tMenus.addMenuItem('topbar', 'Events', 'events', 'dro...
javascript
chosen
[ { "from": "system", "value": "Allow protocol to also be specified.\n" }, { "from": "human", "value": "'use strict';\n\nvar request = require('../request')\n ;\n\nvar token = {};\n\nvar Authenticatable = {\n token: {\n get: function () {\n return token;\n }\n },\n\n authenticate: {...
javascript
chosen
[ { "from": "system", "value": "Use main from package descriptor in gruntfile\n" }, { "from": "human", "value": "/*global module:false*/\nmodule.exports = function (grunt) {\n\n 'use strict';\n\n var pkg = grunt.file.readJSON('package.json');\n\n // Project configuration.\n grunt.initConfig({\...
javascript
chosen
[ { "from": "system", "value": "Make grunt have a default task\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n var packageFile = grunt.file.readJSON(\"package.json\");\n \n grunt.initConfig({\n pkg: packageFile,\n jshint: {\n all: [\"Gruntf...
javascript
chosen
[ { "from": "system", "value": "Include search query used to generate results\n" }, { "from": "human", "value": "import request from 'request';\nimport {Observable} from 'rxjs';\nimport fs from 'fs';\n\nconst githubSearchQuery = `\n https://api.github.com/search/repositories?q=cycle+OR+cyclejs+la...
javascript
chosen
[ { "from": "system", "value": "Simplify the way we determine when to upload java code.\n" }, { "from": "human", "value": "var socket = io.connect('/'); \nvar idleSec = 0;\n\nsocket.on('byte_code', function(data) {\n\t$('#output_bc').val(data.code);\n});\n\nsocket.on('wrong', function(data) {\n\t$...
javascript
chosen
[ { "from": "system", "value": "Update fish over time example to use async data, and show data update\n" }, { "from": "human", "value": "import ChartistChart from './chartist-chart';\n\nfunction getData () {\n return {\n labels: [\n 'Salmon', 'Yellowtail', 'Dolphin', 'Cow'\n ],\n se...
javascript
chosen
[ { "from": "system", "value": "test: Comment out a flaky test case\n- It is flaky possibly because of different timezone in CI\n" }, { "from": "human", "value": "context('Datetime Field Validation', () => {\n\tbefore(() => {\n\t\tcy.login();\n\t\tcy.visit('/app/communication');\n\t});\n\n\tit('da...
javascript
chosen
[ { "from": "system", "value": "Increase service worker cache version\n" }, { "from": "human", "value": "'use strict';\n\nvar CACHE_NAME = 'offline-issues-cache-v1';\n\nvar urlsToCache = [\n './',\n 'css/bootstrap.css',\n 'css/app.css',\n 'js/lodash.js',\n 'js/jquery-2.2.4.js',\n 'js/bootstr...
javascript
chosen
[ { "from": "system", "value": "Increase maximum request size for rendered process.\n" }, { "from": "human", "value": "import React from 'react';\nimport express from 'express';\nimport bodyParser from 'body-parser';\nimport path from 'path';\n\n/**\n * Set up Express.\n */\nconst app = express();...
javascript
chosen
[ { "from": "system", "value": "Add some static folders and redirect index.html\n" }, { "from": "human", "value": "var express = require('express');\n\nvar app = express();\n\n\n\napp.listen(3000, function () {\n console.log('Listening on port 3000');\n});" }, { "from": "gpt", "valu...
javascript
chosen
[ { "from": "system", "value": "Fix error in getting config env\n" }, { "from": "human", "value": "const express = require('express');\nconst morgan = require('morgan');\nconst compression = require('compression');\nconst { generateTitle, lorem } = require('./lib/utils');\nconst config = require('...
javascript
chosen
[ { "from": "system", "value": "Copy the package logo from media to the compiled assets folder\n" }, { "from": "human", "value": "let gulp = require(\"gulp\");\nlet handlebars = require('gulp-compile-handlebars');\nlet sass = require(\"gulp-sass\");\nlet autoprefixer = require(\"gulp-autoprefixer\...
javascript
chosen
[ { "from": "system", "value": "CLI: Make the Node version check use arrows like in index.js\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\n// Disable options that don't work in Node.js 0.12.\n// Gruntfile.js & tasks/*.js are the only non-transpiled files.\n/* eslint-di...
javascript
chosen
[ { "from": "system", "value": "fix(redux): Clear board on new request\n" }, { "from": "human", "value": "import * as types from '../types'\nimport initialState from '../initialState';\nimport { createReducer, mergeState } from '~/utils/redux';\n\nexport default createReducer(initialState.board, {...
javascript
chosen
[ { "from": "system", "value": "Add `./pod-install-exponent.sh` to detached projects\n\nfbshipit-source-id: 0337353\n" }, { "from": "human", "value": "import {\n Detach,\n} from 'xdl';\n\nasync function action(projectDir, options) {\n await Detach.prepareDetachedBuildAsync(projectDir, options);\...
javascript
chosen
[ { "from": "system", "value": "Kill log\nAlso fix typo \"initialise\" ==> \"initialize\"\n" }, { "from": "human", "value": "var Game = require('./models/game'),\n bowlingGame,\n onLoad;\n\n// Create instance of bowling game\nbowlingGame = new Game();\n\n/**\n * Set up bowling game on docume...
javascript
chosen
[ { "from": "system", "value": "Fix routing for sort on front page\n" }, { "from": "human", "value": "const SubredditTarget = require('route_targets/subreddit.js');\n\nconst Routes = {\n '/': {\n target: SubredditTarget,\n '/': 'view',\n },\n '/r/:subreddit': {\n target: SubredditTarge...
javascript
chosen
[ { "from": "system", "value": "Revert \"enable inline requires in metro bundler\"\n\nThis reverts commit 62183cf21a045d3aa43814462fb267f0a9c67498.\n\nSigned-off-by: Kristofer Rye <1ed31cfd0b53bc3d1689a6fee6dbfc9507dffd22@gmail.com>\n" }, { "from": "human", "value": "/**\n * Metro configuration fo...
javascript
chosen
[ { "from": "system", "value": "Apply instead of error when no rule\n" }, { "from": "human", "value": "var Q = require('q');\nvar extend = require('extend');\nvar jsonPathEngine = require('JSONPath');\n\nvar Patch = function (obj) {\n this.id = null;\n this.data = {};\n this.applyAtJsonP...
javascript
chosen
[ { "from": "system", "value": "Check values before committing to user profile\n" }, { "from": "human", "value": "Meteor.methods({\n setUserThingPerPage: function(perPage) {\n\tupdateUserProfileField('per_page', perPage);\n return perPage;\n },\n setUserThingSort: function(sort) {\...
javascript
chosen
[ { "from": "system", "value": "Add notNullable constraints and defaultTo value\n" }, { "from": "human", "value": "'use strict';\n\nconst useTimestampType = true;\nconst defaultToNow = false;\n\nexports.up = (knex) => {\n return knex.schema.createTableIfNotExists('users', (table) => {\n table....
javascript
chosen
[ { "from": "system", "value": "Stop using APPLICATION_HTTP_URL for cross-domain requests.\n" }, { "from": "human", "value": "module.exports = Zeppelin.Model.extend({\n name: 'Board',\n\n validations: {\n name: {\n isEmpty: false,\n message: 'Every board requires at least a name.'\n...
javascript
chosen
[ { "from": "system", "value": "Add some IRC server settings\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Object.extend({\n\n name : '',\n ircServer : {},\n channels : null,\n users : null,\n\n id: function() {\n // This could be based on ...
javascript
chosen
[ { "from": "system", "value": "Fix Inject Data to HTML Template\n" }, { "from": "human", "value": "module.exports = {\n inputValidator: function (dataInput, callback) {\n if (dataInput)\n if (dataInput.header && dataInput.time && dataInput.holding && dataInput.subtitle)\n return c...
javascript
chosen
[ { "from": "system", "value": "Reduce concurrency of test environments\n\n- Due to browserstack issue. Contacted support, but this will suffice temporarily.\n" }, { "from": "human", "value": "const base = require('./karma.base.conf');\n\nmodule.exports = Object.assign(base, {\n\tbrowserDisconnect...
javascript
chosen
[ { "from": "system", "value": "Fix delete reducer on IE11\n\nCloses #1036\n" }, { "from": "human", "value": "import {\n CRUD_GET_LIST_SUCCESS,\n CRUD_DELETE_SUCCESS,\n} from '../../../../actions/dataActions';\n\nexport default resource => (\n previousState = [],\n { type, payload, req...
javascript
chosen
[ { "from": "system", "value": "Fix undefined var in wield script\n" }, { "from": "human", "value": "exports.listeners = {\n\twield: function (l10n) {\n\t\treturn function (location, player, players) {\n\t\t\tlocation = location || body;\n\t\t\tplayer.sayL10n(l10n, 'WIELD', this.getShortDesc(playe...
javascript
chosen
[ { "from": "system", "value": "Make StoryItem receive story object\n\nIt receives the object of story instead of only its fields.\n" }, { "from": "human", "value": "import React from \"react\";\nimport StoryItem from \"../story/StoryItem\";\n\nconst Stories = ({ stories }) => {\n if (!stories.le...
javascript
chosen
[ { "from": "system", "value": "Update St. Olaf calendar URL\n\nWe have changed calendar backend systems, so the old URL will go away soon. This is, I believe, the new ID for the master St. Olaf calendar.\r\n\r\nIt has the (dis)advantage of including Alumni and Athletics events, but we're not sure how to excl...
javascript
chosen
[ { "from": "system", "value": ":ambulance: Fix resolving errors in dev mode\n" }, { "from": "human", "value": "module.exports = {\n\tentry: './dev/main.ts',\n\thtml: {\n\t\ttitle: 'Vue Thailand address',\n\t\tdescription: 'Thai address input for Vue.'\n\t},\n\tpresets: [\n\t\trequire('poi-preset-...
javascript
chosen
[ { "from": "system", "value": "Move summary-toolbox to TradeInfoPanel, use React.Fragment as containing elem\n" }, { "from": "human", "value": "import React from 'react';\nimport { translate } from '../../../common/i18n';\n\nconst RunButton = () => (\n <div className=\"summary-toolbox\">\n ...
javascript
chosen
[ { "from": "system", "value": "Fix build up of objects when skier is stopped.\n" }, { "from": "human", "value": "var Tree = require('./tree');\nvar Rock = require('./rock');\nvar drawObstacles = require('./draw-obstacles');\n\nvar obstacleGenerator = function(obstacles, skier, canvas, ctx, obstac...
javascript
chosen
[ { "from": "system", "value": "Rename baseUrl env to apiUrl\n" }, { "from": "human", "value": "import axios from 'axios'\n\nexport default axios.create({\n baseURL: process.env.baseUrl\n})\n" }, { "from": "gpt", "value": "import axios from 'axios'\n\nexport default axios.create({\n ...
javascript
chosen
[ { "from": "system", "value": "Allow both string and number for the radio button value\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Control from './Control';\nimport controlActions from '../actions/controls';\nimport {connect} from '...
javascript
chosen
[ { "from": "system", "value": "Refactor one line arrow function to drop braces and explicit return.\n" }, { "from": "human", "value": "import '../stylesheets/ui.scss'\n\nconst percentToDecimal = (decimal) => {\n\treturn ((decimal * 100) + '%')\n}\n\nconst calcGoalProgress = (total, goal) => {\n\t...
javascript
chosen
[ { "from": "system", "value": "Change generic error to RangeError\n" }, { "from": "human", "value": "async function vendorAuth() {\n return { id: 1, name: 'vendor 1' };\n}\n\nasync function clientAuth() {\n return { id: 1, name: 'client 1' };\n}\n\nasync function auth(type, id) {\n if (!auth.o...
javascript
chosen
[ { "from": "system", "value": "Use Buffer with fill(), parseInt() with radix\n" }, { "from": "human", "value": "var http = require('http');\n\n\nconst PORT = 25000;\nvar responses = {};\n\n\nfunction handle(request, response) {\n var msize = request.url.substr(1);\n if (!msize) {\n m...
javascript
chosen
[ { "from": "system", "value": "Add all scroll-tracker-component options in scroll-page.\n" }, { "from": "human", "value": "import { ScrollTrackerComponentManager } from 'scroll-tracker-component-manager';\nimport AbstractPageTransitionComponent from './AbstractTransitionComponent';\n\nexport defa...
javascript
chosen
[ { "from": "system", "value": "Use browser.setValue instead of browser.keys\n\nbrowser.keys doesn't work in Firefox, it seems it's been deprecated from the\nspec.\n" }, { "from": "human", "value": "/* eslint-disable import/prefer-default-export */\n// TODO: remove ^\n\n/**\n * @param {String} tod...
javascript
chosen
[ { "from": "system", "value": "Improve UX around disabled split button menu items.\n" }, { "from": "human", "value": "import styled from \"styled-components\";\nimport { colors } from \"constants/theme\";\n\nconst MenuItem = styled.button.attrs({\n type: \"button\"\n})`\n font-size: 1em;\n bor...
javascript
chosen
[ { "from": "system", "value": "Add icon to map zoom menu.\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport { ButtonToolbar, ButtonGroup, DropdownButton, MenuItem } from 'react-bootstrap';\nimport { List } from 'immutable';\n\nfunction MapToolbar(props){\n let ...
javascript
chosen
[ { "from": "system", "value": "Remove an extraneous comma in ReviewReplyModel.\n\nThis comma would break certain browsers.\n" }, { "from": "human", "value": "/*\n * Review replies.\n *\n * Encapsulates replies to a top-level review.\n */\nRB.ReviewReply = RB.BaseResource.extend({\n defaults: _...
javascript
chosen
[ { "from": "system", "value": "Make sure pdf is loaded at the correct time\n" }, { "from": "human", "value": "if(document.getElementById(\"resume\") !== null) {\n PDFObject.embed(\"/static/gen/resume.pdf\", \"#resume\");\n}\n" }, { "from": "gpt", "value": "if(document.getElementById(...
javascript
chosen
[ { "from": "system", "value": "Improve selection for initializing the ui-tabs\n" }, { "from": "human", "value": "$(function() {\n $( \"#topic-2\" ).tabs();\n $( \"#topic-3\" ).tabs();\n $( \"#topic-5\" ).tabs();\n $( \"#topic-6\" ).tabs();\n $( \"#topic-7\" ).tabs();\n $( \"#topic-8\" ).tab...
javascript
chosen
[ { "from": "system", "value": "Allow search submission by pressing enter.\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport { Textfield } from 'react-mdl';\n\n\nconst SearchInput = ({ expandable, query, search, ...otherProps }) => (\n <Textfield\n value={que...
javascript
chosen
[ { "from": "system", "value": "Remove add private-module signup script to browserify\n" }, { "from": "human", "value": "window.$ = require(\"jquery\");\n\nrequire(\"./crumb\")();\nrequire(\"./hiring\");\nrequire(\"./npm-expansions\");\nrequire(\"./email-obfuscate\")();\nrequire(\"./payments\")();...
javascript
chosen
[ { "from": "system", "value": "Make opts field optional in WalletSubprovider\n" }, { "from": "human", "value": "'use strict'\n\nconst inherits = require('util').inherits\nconst HookedWalletEthTxSubprovider = require('web3-provider-engine/subproviders/hooked-wallet-ethtx')\n\nmodule.exports = Wall...
javascript
chosen
[ { "from": "system", "value": "chore: Remove before, after etc from base\n" }, { "from": "human", "value": "// describe(\"About <SubjectName>\", function () {\n//\n// describe(\"<SubjectPart>\", function () {\n//\n// beforeEach(function () {});\n// afterEach(function () {});\n// bef...
javascript
chosen
[ { "from": "system", "value": "Call 'getSystemInfo' only on success\n" }, { "from": "human", "value": "(function(globalSettings, $, _, window, undefined) {\n var Application = window.Application,\n settings = globalSettings.SysMonitor;\n\n var SystemMonitorView = Backbone.View.extend...
javascript
chosen
[ { "from": "system", "value": "Fix scaled Y axis drawing with vertical graph padding\n\nModifies Axis.Y.Scaled to render correctly in cases where the owning\ngraph has a non [0, 1] domain (e.g. with significant top or bottom\npadding).\n" }, { "from": "human", "value": "Rickshaw.namespace('Ricksh...
javascript
chosen
[ { "from": "system", "value": "Swap the order for my most favorite languages\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\n// GET home page\nrouter.get('/', function(req, res) {\n res.render('index', {\n meta: {\n titl...
javascript
chosen
[ { "from": "system", "value": "Use Angular factory instead of service\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('ng-cable', [])\n\n.service('$cable', function () {\n\n function AngularCable(url) {\n this.cable = Cable.createConsumer(url);\n this.subscript...
javascript
chosen
[ { "from": "system", "value": "CHANGED: Switch back to port 3000 to avoid possible conflict with IIS.\n" }, { "from": "human", "value": "module.exports = {\n server: {\n app: {\n message: 'Band Tile service for BKK Futár'\n },\n connections: {\n route...
javascript
chosen
[ { "from": "system", "value": "Fix a bug in the sample file & add 'willfail' task\n" }, { "from": "human", "value": "/**\n * Run per command line as `task-runner demo.js`\n */\n\nconst taskRunner = require('../lib/index')\n\nexport async function npmList () {\n return await taskRunner.shell('npm...
javascript
chosen
[ { "from": "system", "value": "Add field 'created' to Client collection\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar mongoose = require('mongoose'),\n Schema = mongoose.Schema;\n\n/**\n * Client Schema\n */\nvar ClientSchema = new Schema({\n clientI...
javascript
chosen
[ { "from": "system", "value": "Build up spec test for backbone model\n" }, { "from": "human", "value": "var TodoList = [{\n 'id_todo': '1',\n 'title': 'Finish up todozen',\n 'column': 'inbox',\n 'color': 'yellow'\n},{\n 'id_todo': '2',\n 'title': 'Implement testing',\n 'column': 'working',...
javascript
chosen
[ { "from": "system", "value": "Remove unneccesary raw tag removal\n" }, { "from": "human", "value": "'use strict';\n\nclass EscapedIncludeTag {\n static register(env) {\n env.addExtension(this.name, new this());\n }\n\n get tags() { return ['escapedInclude']; }\n\n parse(parser, nodes, lex...
javascript
chosen
[ { "from": "system", "value": "Define initial structure of Games document\n" }, { "from": "human", "value": "Games = new Meteor.Collection(\"games\");" }, { "from": "gpt", "value": "Games = new Meteor.Collection(\"games\");\n/* Struture of Games document\n{\n\t_id: string,\n\tgameType...
javascript
chosen
[ { "from": "system", "value": "Expand the '.env()' API call with more flexibility.\n" }, { "from": "human", "value": "// @flow\nimport type { CacheConfigurator, SimpleCacheConfigurator } from \"../caching\";\n\nexport type PluginAPI = {\n cache: SimpleCacheConfigurator,\n env: () => string,\n ...
javascript
chosen
[ { "from": "system", "value": "Add toString method to Token class\n" }, { "from": "human", "value": "export default class Token {\n\tstatic get Comment () { return \"Comment\"; }\n\tstatic get Key () { return \"Key\"; }\n\tstatic get Literal () { return \"Literal\"; }\n\tstatic get Punctuator () ...
javascript
chosen
[ { "from": "system", "value": "Add a navigation item to go to the tools section\n" }, { "from": "human", "value": "import React from \"react\";\nimport styled from \"styled-components\";\nimport Link from \"gatsby-link\";\nimport Headroom from \"react-headroom\";\n\nconst StyledMenu = styled.div`...
javascript
chosen
[ { "from": "system", "value": "Add debug mode for test store to log mutations\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport Vuex from 'vuex'\n\nVue.use(Vuex)\n\nexport function createStore (mods) {\n let modules = {}\n for (let key of Object.keys(mods)) {\n modules[key] = ...
javascript
chosen
[ { "from": "system", "value": "Fix re-rendering not triggering if only the language changed and not a state\n" }, { "from": "human", "value": "const debug = require('debug')('react-localize:translate')\nimport {translate as _translate} from 'react-i18next'\nimport pure from 'recompose/pure'\n\n//...
javascript
chosen
[ { "from": "system", "value": "Allow https in body url\n" }, { "from": "human", "value": "/*global describe:true it:true */\n'use strict';\n\nvar app = require('../app').app\nvar request = require('supertest')\n\ndescribe('The router', function() {\n describe('index page', function() {\n it(...
javascript
chosen
[ { "from": "system", "value": "Fix Lazyloading on mobile devices\n" }, { "from": "human", "value": "var LazyLoadInit = function() {\n\n //\n // Init\n //\n this.init();\n\n};\n\nLazyLoadInit.prototype.init = function() {\n\n var that = this;\n\n $(\"img.lazyload\").lazyload({\n ...
javascript
chosen
[ { "from": "system", "value": "Convert all $ to jQuery\n" }, { "from": "human", "value": "(function(ko) {\n\t\n\tif (typeof (jQuery) === \"undefined\") { return; }\n\tif (typeof (jQuery.cookie) === \"undefined\") { return; }\n\t\n\tko.extenders.cookie = function(target, key) {\n\t\tvar initialVal...
javascript
chosen
[ { "from": "system", "value": "Refactor to return react class directly\n" }, { "from": "human", "value": "var React = require('react');\n\nvar MediaQueryable = function(mediaQueries) {\n var MediaQueryableComponent = React.createClass({\n displayName: \"MediaQueryable\",\n\n getInitialStat...
javascript
chosen
[ { "from": "system", "value": "Handle all inputs from keyboard\n" }, { "from": "human", "value": "var Calci = {\n init: function() {\n $('#calculator .input').click(function(){\n var input;\n if(this.dataset.keyType == \"digit\"){\n Calci.handleInput(this.dataset.digit);\n ...
javascript
chosen
[ { "from": "system", "value": "Use toggle instead of checkbox (to prevent collisions with bootstrap)\n" }, { "from": "human", "value": "import React, {Component, PropTypes} from 'react';\nimport GuiInput from './Input';\n\nexport default class GuiBoolean extends Component {\n static listItemClas...
javascript
chosen
[ { "from": "system", "value": "Work on the custom date and time picker\n" }, { "from": "human", "value": "(function() {\n\t'use strict';\n\n\tangular.module('triplanner.common.dateTimePicker', [])\n\n\t\t.directive('dateTimePicker', [\n\t\t\tfunction() {\n\t\t\t\treturn {\n\t\t\t\t\trestrict: 'A'...
javascript
chosen
[ { "from": "system", "value": "Include port when logging Graphite server address.\n" }, { "from": "human", "value": "'use strict';\n\nvar net = require('net'),\n log = require('intel'),\n Promise = require('bluebird');\n\nclass GraphiteSender {\n constructor(host, port) {\n this.host = host...
javascript
chosen
[ { "from": "system", "value": "Add callback to sortable to prepare db connection.\n" }, { "from": "human", "value": "var updateUrlView = new multiTab.UpdateUrlView( {el: $('#update-and-delete-urls')} ),\n insertUrlView = new multiTab.InsertUrlView({\n el: $('#insert-url'),\n upda...
javascript
chosen
[ { "from": "system", "value": "Use multiple link header for h2 push\n" }, { "from": "human", "value": "const router = require(\"koa-router\")();\nconst dropzones = require(\"../dropzones\");\n\nconst h2pushJSON = path => `<${path}>; rel=preload; as=json`;\n\nrouter.get(\"/dz/:dz\", (ctx, next) =>...
javascript
chosen
[ { "from": "system", "value": "Add className form-group to Checkbox label\n" }, { "from": "human", "value": "const { elements } = require('react-elementary').default;\n\nconst { input, label } = elements;\n\nfunction CheckBox(props) {\n const { name, onChange, value } = props;\n return label(\n...
javascript
chosen
[ { "from": "system", "value": "Fix create review parameter names\n" }, { "from": "human", "value": "import AWS from 'aws-sdk';\nimport uuid from 'uuid';\n\nexport class CreateReview {\n\n constructor(AWS, table) {\n this.client = new AWS.DynamoDB.DocumentClient({\n params: {\n Tab...
javascript
chosen
[ { "from": "system", "value": "Delete bar chart with previous version of visits.\n" }, { "from": "human", "value": "google.charts.load('current', {packages: ['corechart', 'bar']});\n\n// Render a chart visual on dashboard page for tracking class visits\nfunction drawBasic() {\n\n // Set up the d...
javascript
chosen
[ { "from": "system", "value": "Use a better regex to avoid transforming all modules\n" }, { "from": "human", "value": "module.exports = {\n roots: ['<rootDir>/src/', '<rootDir>/test/'],\n transform: {\n '^.+\\\\.tsx?$': 'ts-jest',\n '\\\\.m?jsx?$': 'jest-esm-transformer',\n },\n testMat...
javascript
chosen
[ { "from": "system", "value": "Fix missing semi-colon bug in javascript file\n" }, { "from": "human", "value": "import 'jquery-ui-dist/jquery-ui';\n\n$(() => {\n // Is there already one prefix section on this Phase?\n //\n // draggableSections - A jQuery object, the sortable element.\n //\n ...
javascript
chosen
[ { "from": "system", "value": "Replace use of React.PropTypes with version from ‘prop-types’\n" }, { "from": "human", "value": "import React from 'react';\n\nclass HomeContainer extends React.Component {\n static contextTypes = {\n router: React.PropTypes.object.isRequired\n };\n\n ...
javascript
chosen
[ { "from": "system", "value": "Revert \"experimenting with history location\"\n\nThis reverts commit 7494e0f0954f57526f0ef28e17294c211562ed01.\n" }, { "from": "human", "value": "var Router = Ember.Router.extend({\n location: \"history\"\n});\n\nRouter.map(function () {\n this.resource(\"cli...
javascript
chosen
[ { "from": "system", "value": "Fix reduxify: Collection item creation should not fail if item exists already\n\nThis is pretty important for reduxify, since it's used in the client and the client might have already created a temporary entity before sending the creation command to the server.\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Fix eslint errors in create-tables.\n" }, { "from": "human", "value": "exports.up = async(knex) => {\n\n await knex.schema.createTableIfNotExists('order', (table) => {\n table.increments('id').primary()\n table.string('user').notNullable()\n table.string('...
javascript
chosen
[ { "from": "system", "value": "Fix ZeroClipboard.swf's path in dist/gh-pages (Previously, it worked in local `gulp serve:list` but not on github page)\n" }, { "from": "human", "value": "'use strict';\n/* globals window */\n\nangular.module('vleApp', [\n 'ngAnimate',\n 'ngCookies',\n 'ng...
javascript
chosen