conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "blueprints/server: Create .jshintrc only if \"ember-cli-jshint\" is a dependency\n" }, { "from": "human", "value": "var isPackageMissing = require('ember-cli-is-package-missing');\n\nmodule.exports = {\n description: 'Generates a server directory for mocks and prox...
javascript
chosen
[ { "from": "system", "value": "Use cloud made map style" }, { "from": "human", "value": "var base_layer = new L.tileLayer(\r\n 'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',{\r\n attribution: '&copy <a href=\" http://www.openstreetmap.org/\" title=\"OpenStreetMap\">Open...
javascript
chosen
[ { "from": "system", "value": "[ReactNative] Fix reloading in debug mode sometimes crashes packager\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICE...
javascript
chosen
[ { "from": "system", "value": "Set protractor host to 8080 instead of 3000.\n" }, { "from": "human", "value": "/**\n * @author: @AngularClass\n */\n\nrequire('ts-node/register');\nvar helpers = require('./helpers');\n\nexports.config = {\n baseUrl: 'http://localhost:3000/',\n\n // use `npm run ...
javascript
chosen
[ { "from": "system", "value": "Call back a simpler Error object if a package was not found on Bower\n" }, { "from": "human", "value": "/**\n * @module bowerPackageURL\n * @author Matthew Hasbach\n * @copyright Matthew Hasbach 2015\n * @license MIT\n */\n\n/**\n * The bowerPackageURL callback\n * ...
javascript
chosen
[ { "from": "system", "value": "Increase the grace period after load, because highcharts is a complete bastard\n" }, { "from": "human", "value": "var page = require('webpage').create();\nvar system = require('system');\nvar args = system.args;\nvar url = args[1];\nvar imagePath = args[2];\nvar att...
javascript
chosen
[ { "from": "system", "value": "Fix function name for clarity\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Link, withRouter } from 'react-router';\nimport $ from 'jquery';\n\nclass Bookmarks extends React.Component {\n constructor(prop...
javascript
chosen
[ { "from": "system", "value": "Read AWS credentials for audio as single env var\n" }, { "from": "human", "value": "var fs = require('fs');\nvar AWS = require('aws-sdk');\n\nmodule.exports = function createS3Client() {\n const awsConfig = (process.env.NODE_ENV === 'development')\n ? JSON.parse...
javascript
chosen
[ { "from": "system", "value": "Add use-strict to fix old versions of node.\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\n\nfunction getComponentFiles(filename) {\n var ext = path.extname(filename);\n if (ext === '.js') {\n return null;\n ...
javascript
chosen
[ { "from": "system", "value": "Add workspace to codebox context\n" }, { "from": "human", "value": "var Q = require(\"q\");\nvar _ = require(\"lodash\");\nvar path = require(\"path\");\nvar Packager = require(\"pkgm\");\nvar pkg = require(\"../package.json\");\n\nvar logger = require(\"./utils/log...
javascript
chosen
[ { "from": "system", "value": "Exit with code 0 if only warnings are present\n" }, { "from": "human", "value": "const table = require('text-table')\nconst chalk = require('chalk')\n\nclass Reporter {\n report (results) {\n let output = '\\n'\n let totalErrors = 0\n let totalWarnings = 0...
javascript
chosen
[ { "from": "system", "value": "Set up Provider component for redux\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport registerServiceWorker from './registerServiceWorker';\n\nReactDOM.render(<Ap...
javascript
chosen
[ { "from": "system", "value": "BREAKING: Correct the capitalization on ResponseBuilder export\n\nIf you have been including `ResponseBuilder` using the export\n`Responsebuilder`, with this commit you will now need to include it using\n`ResponseBuilder`.\n" }, { "from": "human", "value": "'use str...
javascript
chosen
[ { "from": "system", "value": "Add preload to js api\n" }, { "from": "human", "value": "import CardIOView from './CardIO.ios';\nimport * as constants from './constants';\n\nexport default CardIOView;\nexport const CardIOConstants = constants;\n" }, { "from": "gpt", "value": "import { ...
javascript
chosen
[ { "from": "system", "value": "Add handler for extension's request error\n" }, { "from": "human", "value": "(function($){\n $.appendSolveButton = function () {\n var $solve = $(document.createElement('div')).text('solve').css({\n cursor: 'pointer',\n position: 'fixed',\n left: ...
javascript
chosen
[ { "from": "system", "value": "[native] Use hook instead of connect functions and HOC in CalendarInputBar\n\nTest Plan: Flow\n\nReviewers: ashoat, palys-swm\n\nReviewed By: ashoat\n\nSubscribers: zrebcu411, Adrian\n\nDifferential Revision: https://phabricator.ashoat.com/D518\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Trim leading/trailing blank lines when unindenting\n\nRefs: b3926be9112766181a6427c3d94bead82c07d9d0@2db0c90\n" }, { "from": "human", "value": "\"use strict\";\n\nconst Chai = require(\"chai\");\nconst {util} = Chai;\n\n\nlet overwritten, unindentPattern;\n\n/**\n *...
javascript
chosen
[ { "from": "system", "value": "Fix broken reference to local module and missing export of the Strategy constructor.\n" }, { "from": "human", "value": "var OpenIDConnectStrategy = require('passport-openidconnect').Strategy;\nvar passportAuthenticateWithCUstomClaims = require('PassportAuthenticateW...
javascript
chosen
[ { "from": "system", "value": "Move global variable to the top\n" }, { "from": "human", "value": "'use strict'\n\nangular.module('pathwayApp')\n.controller('PathwayController', function ($scope, $http, $stateParams, $cookieStore, $state) {\n $http({method: 'GET',\n url: '/api/pathways/' ...
javascript
chosen
[ { "from": "system", "value": "Remove extension from extends path\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = {\n extends: 'javascript/standard/optional.js'\n}\n" }, { "from": "gpt", "value": "'use strict'\n\nmodule.exports = {\n extends: 'javascript/standard...
javascript
chosen
[ { "from": "system", "value": "Handle the npm bug with exponential backoff for the require\n" }, { "from": "human", "value": "// People frequently sudo install web-component-tester, and we have to be a\n// little careful about file permissions.\n//\n// sauce-connect-launcher downloads and caches ...
javascript
chosen
[ { "from": "system", "value": ":new: Enable the new confirmation dialog in latest package-deps\n" }, { "from": "human", "value": "/* @flow */\n\nimport LinterUI from './main'\nimport type Intentions from './intentions'\n\nconst linterUiDefault = {\n instances: new Set(),\n signalRegistry: null,...
javascript
chosen
[ { "from": "system", "value": "Fix 'Uncaught ReferenceError: d is not defined'" }, { "from": "human", "value": "var Line = require('./line');\n\nvar simplifyGeometry = function(points, tolerance){\n\n var dmax = 0;\n var index = 0;\n\n for (var i = 1; i <= points.length - 2; i++){\n d = new...
javascript
chosen
[ { "from": "system", "value": "Increase tax disc beta AB to ~100%\n\nThis should mean most users are presented with\nthe beta as the primary option during the August\ntax disc peak." }, { "from": "human", "value": "//= require govuk/multivariate-test\n\n/*jslint browser: true,\n * indent: 2,\n *...
javascript
chosen
[ { "from": "system", "value": "Fix for timeout after finish.\n" }, { "from": "human", "value": "'use strict';\n\nexports.delayed = function delayed(ms, value) {\n return new Promise(resolve => setTimeout(() => resolve(value), ms));\n};\n\nexports.timeoutError = 'timeoutError';\n\n/**\n * Waits a...
javascript
chosen
[ { "from": "system", "value": "Append lang mock to the end of file to not make source map being invalid.\n" }, { "from": "human", "value": "var vfs = require('enb/lib/fs/async-fs');\n\nmodule.exports = require('enb/lib/build-flow').create()\n .name('mock-lang-js.js')\n .target('target', '?....
javascript
chosen
[ { "from": "system", "value": "Implement search listener on search button\n" }, { "from": "human", "value": "// # Place all the behaviors and hooks related to the matching controller here.\n// # All this logic will automatically be available in application.js.\n// # You can use CoffeeScript in th...
javascript
chosen
[ { "from": "system", "value": "Disable creating relations between persons and organizations\n" }, { "from": "human", "value": "import './index.css';\nimport React from 'react';\nimport { DropTarget } from 'react-dnd';\n\nconst ConceptDropTarget = ({ connectDropTarget, isOver, canDrop, children })...
javascript
chosen
[ { "from": "system", "value": "Fix \"moment is not defined\" bug for ard channels\n" }, { "from": "human", "value": "class Show {\n\n\tstatic get INTERMISSION() {\n\t\treturn new Show('Sendepause');\n\t}\n\n\tconstructor(title) {\n\t\tthis.title = title;\n\t}\n\n\tisRunningNow() {\n\t\treturn thi...
javascript
chosen
[ { "from": "system", "value": "Add detail to sample usage\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from './template';\nimport config from 'ember-get-config';\n\n/**\n * @module ember-osf\n * @submodule components\n */\n\n/**\n * Render the provided url in an if...
javascript
chosen
[ { "from": "system", "value": "Replace HN newlines similar to t_t\n" }, { "from": "human", "value": "var hn = require('hacker-news-api');\nvar ent = require('ent');\nvar qs = require('querystring');\nvar S = require('string');\n\nvar hnRegex = /^https?:\\/\\/news\\.ycombinator\\.com\\/(.*)/;\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix broken API usage of the new bcrypt-nodejs lib\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\nvar bcrypt = require('bcrypt-nodejs');\n\nvar UserSchema = new Schema({\n email: String,\n password: String...
javascript
chosen
[ { "from": "system", "value": "Add support for Meteor 1.2\n" }, { "from": "human", "value": "var Fibers = Npm.require('fibers');\n\nvar originalYield = Fibers.yield;\nFibers.yield = function() {\n var kadiraInfo = Kadira._getInfo();\n if(kadiraInfo) {\n var eventId = Kadira.tracer.event(kadi...
javascript
chosen
[ { "from": "system", "value": "Add color to feedback msg" }, { "from": "human", "value": "\"use strict\"\nmodule.exports = (function(obj) {\n var cli = require(\"cli\"),\n json = require(\"jsonfile\");\n\n function returnUnicArrays(arr) {\n try {\n var filteredArray = arr.filter(fu...
javascript
chosen
[ { "from": "system", "value": "Implement the _writeToSocket and send methods on client\n" }, { "from": "human", "value": "var _ = require('lodash'),\n dgram = require('dgram');\n\nfunction Client (opts) {\n opts = _.defaults(_.pick(opts, Object.keys(Client.defaults)), Client.defaults);\n\n for...
javascript
chosen
[ { "from": "system", "value": "Update: Replace `fs.stat` call with `fs.lstat`\n" }, { "from": "human", "value": "'use strict';\n\nvar through2 = require('through2');\nvar fs = require('graceful-fs');\n\nfunction getStats() {\n return through2.obj(fetchStats);\n}\n\nfunction fetchStats(file, enc,...
javascript
chosen
[ { "from": "system", "value": "Fix url to the root\n" }, { "from": "human", "value": "(function() {\n window.collections.comics = Backbone.Collection.extend({\n url: '/comics'\n });\n})();\n" }, { "from": "gpt", "value": "(function() {\n window.collections.comics = Backbone.Coll...
javascript
chosen
[ { "from": "system", "value": "Make it worth a kata, make it fail :)." }, { "from": "human", "value": "// 11: destructuring - string\n// To do: make all tests pass, leave the assert lines unchanged!\n\ndescribe('destructuring also works on strings', () => {\n\n \n it('destructure every characte...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect inclusion (old modules asset should only load legacy files after migration).\n" }, { "from": "human", "value": "/**\n * All modules.\n *\n * Site Kit by Google, Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lic...
javascript
chosen
[ { "from": "system", "value": "Change \"error\" to \"error_code\" in error object\n" }, { "from": "human", "value": "var logger = require('log4js').getLogger('APP_LOG');\nvar request = require('request');\n\nfunction sendMessage(config, receiver, message, botname, callback) {\n\n\tvar chat_id = c...
javascript
chosen
[ { "from": "system", "value": "Destroy Sticky elements before leaving the page\n\nWhen Foundation initializes a page that has any sticky element, it\nloads a window scroll listener into window object to handle the sticky\nelement positioning when scrolling. This works great until user moves\nto a page withou...
javascript
chosen
[ { "from": "system", "value": "Remove providesModule that can lead to Haste dups.\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tre...
javascript
chosen
[ { "from": "system", "value": "Add player direction to initial state\n" }, { "from": "human", "value": "import Immutable from 'immutable';\n\nimport {\n parseGrounds,\n parseEntities\n} from 'state/utils/parseLevel';\n\nimport * as level1 from 'state/levels/level-01';\n\nexport const initialSta...
javascript
chosen
[ { "from": "system", "value": "Make notice attachment lightbox work after an infinite scroll happens\n" }, { "from": "human", "value": "jQuery(document).ready(function($){\n $('notices_primary').infinitescroll({\n nextSelector : \"li.nav_next a\",\n loadingImg : $('address .url')[0...
javascript
chosen
[ { "from": "system", "value": "Correct class constructor calls to be capitalized\n" }, { "from": "human", "value": "var Controller = function(shape) {\n this.gameBoard = new tetrisBoard();\n this.gameView = new browserView({gameBoard: this.gameBoard});\n}\nController.prototype.startGame = funct...
javascript
chosen
[ { "from": "system", "value": "Fix regex to allow numbers in domains" }, { "from": "human", "value": "const url = {\n _regex: {\n default: /^(?:https?:\\/\\/)?[^\\s\\/\\.]+(?:\\.[a-z]{2,})+(?:\\/\\S*)?$/i\n },\n default: context => {\n if (context.value === null || context.value && !cont...
javascript
chosen
[ { "from": "system", "value": "Test getting properties as well\n" }, { "from": "human", "value": "var jQuery = require('jquery');\nvar VIE = require('../vie.js');\n\n// Until https://github.com/tmpvar/jsdom/issues/issue/81 is fixed\nVIE.RDFa.predicateSelector = '[property]';\n\nexports['test inhe...
javascript
chosen
[ { "from": "system", "value": "Support for Shared Templates (Beta)\n- Only allow deletion if current user is Owner\n" }, { "from": "human", "value": "Meteor.methods({\n\n 'deleteTemplate'(templateId) {\n console.log(\"### DELETING TEMPLATE ###\");\n check(templateId, Match.Any);\n \n ...
javascript
chosen
[ { "from": "system", "value": "Make images clickable on members search\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport { Link } from 'react-router';\n\nclass MembersPreview extends Component {\n\n render() {\n const {displayName, searchImg, intr...
javascript
chosen
[ { "from": "system", "value": "Set static file Content-Length header\n" }, { "from": "human", "value": "Router.route('/media', {name: 'mediaMenu'});\n\nRouter.route('/media/static/:filepath*', function () {\n if (settings.findOne({key: 'mediainternalserver'}).value) {\n // var mime =...
javascript
chosen
[ { "from": "system", "value": "refactor(grunt): Use dir set bei grunt.config.\n" }, { "from": "human", "value": "module.exports = {\n\toptions: {\n\t\tconfigFile: 'karma-unit.conf.js'\n\t},\n\n\t// Sinle run\n\tunit: {\n\t\tsingleRun: true,\n\t\tpreprocessors: {\n\t\t\t'src/**/*.js': ['coverage']...
javascript
chosen
[ { "from": "system", "value": "Add option hideSourceMaps to hide source maps\n" }, { "from": "human", "value": "const {readFileSync} = require('fs')\nconst {resolve} = require('path')\n\nfunction createRequestDecorator (stats) {\n return (req, res, next) => {\n res.locals = res.locals || Obje...
javascript
chosen
[ { "from": "system", "value": "Reduce padding on fancybox images.\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module(\"hikeio\").\n\tdirective(\"fancybox\", function() {\n\t\treturn {\n\t\t\tlink: function (scope, element, attrs) {\n\t\t\t\tscope.$on(\"$routeChangeStart\", funct...
javascript
chosen
[ { "from": "system", "value": "Refactor so that next() takes the return value of gen.next()\n" }, { "from": "human", "value": "\n// Coroutine function that returns a promise that resolves when the coroutine\n// is finished. Accepts a generator function, and assumes that everything\n// yielded fro...
javascript
chosen
[ { "from": "system", "value": "fix(tests): Add the alias for jest\n" }, { "from": "human", "value": "module.exports = {\n testURL: 'http://localhost/',\n moduleFileExtensions: ['js', 'jsx', 'json', 'styl'],\n setupFiles: ['<rootDir>/test/jestLib/setup.js'],\n moduleDirectories: ['src', 'node_...
javascript
chosen
[ { "from": "system", "value": "Fix login property name used in the test login.\n" }, { "from": "human", "value": "// For conditions of distribution and use, see copyright notice in LICENSE\n\nvar client = new WebSocketClient();\nvar scene = new Scene();\nvar syncManager = new SyncManager(client, ...
javascript
chosen
[ { "from": "system", "value": "Fix label checking for access level\n" }, { "from": "human", "value": "var massahHelper = require('massah/helper')\n , helper = massahHelper.application.helper\n\nmodule.exports = (function() {\n var library = massahHelper.getLibrary()\n .then('the user h...
javascript
chosen
[ { "from": "system", "value": "Use main return value as process exit code\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict'\n\nconst main = require('./lib/main')\n\nif (require.main === module) {\n main()\n}\n" }, { "from": "gpt", "value": "#!/usr/bin/env node\n'us...
javascript
chosen
[ { "from": "system", "value": "Add a simple stress test to the unit tests\n" }, { "from": "human", "value": "/* global module, asyncTest, ok, start */\n\nmodule(\"forge.httpd\");\n\nasyncTest(\"Test that content is being served via https\", 1, function () {\n if (window.location.protocol == \"...
javascript
chosen
[ { "from": "system", "value": "Fix Ghost icon is not clickable\n\ncloses #3623\n- Initialization of the link was done on login page where the ‚burger‘\ndid not exist.\n- initialization in application needs to be done to make it work on\nrefresh\n" }, { "from": "human", "value": "import {mobileQue...
javascript
chosen
[ { "from": "system", "value": "Move Step jsonification into Step class, collab code into index.js file\n" }, { "from": "human", "value": "export class Step {\n constructor(name, from, to, pos, param = null) {\n this.name = name\n this.from = from\n this.to = to\n this.pos = pos\n ...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary librsvg proxy comment\n" }, { "from": "human", "value": "'use strict';\n\nconst expect = require('chai').expect;\nconst sinon = require('sinon');\nconst proxyquire = require('proxyquire');\nconst Plugin = require('.');\n\ndescribe('rsvg-brunch', f...
javascript
chosen
[ { "from": "system", "value": "Change transition route to exact order\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Controller.extend({\n session: Ember.inject.service(),\n notifications: Ember.inject.service(),\n\n actions: {\n addToOrder(order, acco...
javascript
chosen
[ { "from": "system", "value": "Add setup process, use Promises\n\nWIP: need to use credentials when updating the db, so this module is\nprobably not the right way to do it *automatically*.\n" }, { "from": "human", "value": "const config = require('config'),\n _ = require('lodash'),\n fs = r...
javascript
chosen
[ { "from": "system", "value": "Fix the identifier-ness test in maybe_quote.\n" }, { "from": "human", "value": "function quote(s) {\n\treturn \"\\\"\" + s.replace(/([\\\\\\\"])/, \"\\\\$1\") + \"\\\"\";\n}\n\nfunction maybe_quote(s) {\n\tif (/[\\\\\\\"]/.test(s))\n\t\treturn quote(s);\n\telse\n\t\...
javascript
chosen
[ { "from": "system", "value": "Set minimal deposit amount in accordance with description\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n function WavesWalletDepositController ($scope, events, coinomatService, dialogService, notificationService,\n ...
javascript
chosen
[ { "from": "system", "value": "Update payout structure to 50-30-20\n" }, { "from": "human", "value": "\n'use strict';\n\nexport const buyIn = 20;\nexport const startingSeconds = 15 * 60;\nexport const smallBlinds = [ 100, 200, 300, 400, 500, 800, 1000, 1500, 2000, 3000, 5000];\nexport function pa...
javascript
chosen
[ { "from": "system", "value": "Make test performance challenge window 1 minute long\n" }, { "from": "human", "value": "const moment = require('moment');\n\nconst formatString = 'YYYY-MM-DD HH:mm:ss';\nmodule.exports = {\n current: true,\n id: 1,\n name: 'Bowling Green Game',\n openAt: moment(...
javascript
chosen
[ { "from": "system", "value": "mailman: Make @match work with newer greasemonkey\n\nUsing a wildcard for the protocol no longer works.\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Mailman discard\n// @namespace http://bd808.com/userscripts/\n// @description Automatically selects...
javascript
chosen
[ { "from": "system", "value": "Make root component handling more generic\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport CampDetails from './components/camp-details'\n\nnew Vue({\n el: '#camp-details',\n render(h) {\n return h(CampDetails, { props: this.$el.dataset }...
javascript
chosen
[ { "from": "system", "value": "Disable Discourse\nThe endpoints we use are not generic\n" }, { "from": "human", "value": "/* eslint-disable global-require */\n\nmodule.exports = {\n 'Bungie.net': require( './Bungie.net.js' ),\n MiggyRSS: require( './MiggyRSS.js' ),\n Reddit: require( './...
javascript
chosen
[ { "from": "system", "value": "Work around es7 exprots from new version\n" }, { "from": "human", "value": "var Lanes = ( global.Lanes || (global.Lanes = {}) );\nLanes.Vendor = ( Lanes.Vendor || {} );\n\nLanes.Vendor.ReactProxy = require(\"react-proxy\");\nLanes.Vendor.ReactTestUtils = requi...
javascript
chosen
[ { "from": "system", "value": "Change i18n angular filter to interpolate strings\n" }, { "from": "human", "value": "/* This file is part of Indico.\n * Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).\n *\n * Indico is free software; you can redistribute it and/or\n * ...
javascript
chosen
[ { "from": "system", "value": "Set the weights for each cohort" }, { "from": "human", "value": "//= require govuk/multivariate-test\n\n/*jslint browser: true,\n * indent: 2,\n * white: true\n */\n/*global $, GOVUK */\n$(function () {\n\n GOVUK.taxDiscBetaPrimary = function () {\n $('.primar...
javascript
chosen
[ { "from": "system", "value": "Make sid cookie secure in production\n" }, { "from": "human", "value": "import config from 'config';\nimport hapiAuthCookie from 'hapi-auth-cookie';\n\nexport default (server, projectConfig) => {\n server.register(hapiAuthCookie, (err) => {\n if (err) {\n t...
javascript
chosen
[ { "from": "system", "value": "Send the minimal amount of DOM to the client\n" }, { "from": "human", "value": "/**\n * RouterHistoryContainer is already connected to the router state, so you only\n * have to pass in `routes`. It also responds to history/click events and\n * dispatches routeTo act...
javascript
chosen
[ { "from": "system", "value": "Add support for ZStandard compression.\n\nThis is landing in Kafka 2.1.0, due for release 29th October, 2018.\n\nReferences -\n\n1. https://cwiki.apache.org/confluence/display/KAFKA/KIP-110%3A+Add+Codec+for+ZStandard+Compression\n2. https://issues.apache.org/jira/browse/KAFKA-4...
javascript
chosen
[ { "from": "system", "value": "Use a closure and remove the close link.\n" }, { "from": "human", "value": " $(\"body\").prepend(\"<div id='uat-bar'><a class='go' href='#'>Show me what to test</a><div class='pop-over hide'><a class='close' href='#'>close</a></div></div>\");\n $(\"head\").append(...
javascript
chosen
[ { "from": "system", "value": "Add note regarding username/password interchange." }, { "from": "human", "value": "// User-specific configuration\nexports.conversationWorkspaceId = ''; // replace with the workspace identifier of your conversation\n\n// Create the credentials object for export\nexp...
javascript
chosen
[ { "from": "system", "value": "Use Response module to send JSON return messages\n" }, { "from": "human", "value": "var User = require('../models/user');\nvar express = require('express');\nvar router = express.Router();\n\nrouter.route('/auth').get(getAuth);\nrouter.route('/auth').post(login);\nr...
javascript
chosen
[ { "from": "system", "value": "Rewrite apn push a little bit\n" }, { "from": "human", "value": "var apn = require('apn');\nvar util = require('util');\nvar BasePushNotification = require('./BasePushNotification');\nconnection = new apn.Connection({\n cert: '',\n key: ''\n}).on('error', console....
javascript
chosen
[ { "from": "system", "value": "Drop support for IE7 and Safari 5" }, { "from": "human", "value": "module.exports = [\n 'ie/7..latest',\n 'chrome/latest',\n 'firefox/latest',\n 'safari/5..latest',\n 'android/4.4..latest',\n 'iphone/latest',\n 'ipad/latest'\n]\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Change order of include_nested to remove sort race.\n" }, { "from": "human", "value": "/* NESTED INCLUDING MIXINS\n #gradient > @include vertical($primaryColor, $secondaryColor);\n #grid > @include gu($rtl);\n TO =====>\n @include gradient-vertical($prim...
javascript
chosen
[ { "from": "system", "value": "[cli] Use file extension as a syntax name\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/**\n * ./bin/gonzales.js filename\n * ./bin/gonzales.js filename -s\n */\nvar gonzales = require('..'),\n fs = require('fs'),\n filename = process.argv[2],\n ...
javascript
chosen
[ { "from": "system", "value": ":fire: Remove unnecessary method overrides from AboutStatusBar\n" }, { "from": "human", "value": "/** @babel */\n/** @jsx etch.dom */\n\nimport {CompositeDisposable} from 'atom'\nimport etch from 'etch'\nimport EtchComponent from './etch-component'\n\nclass AboutSta...
javascript
chosen
[ { "from": "system", "value": "Fix error introduced in refactoring of characteristic write.\n" }, { "from": "human", "value": "import {\n makeCharacteristicEventListener,\n ReactNativeBluetooth,\n} from './lib';\n\nconst writeCharacteristicValue = (characteristic, buffer, withResponse) => {\n ...
javascript
chosen
[ { "from": "system", "value": "Add noclip and fast player speed to devtools\n" }, { "from": "human", "value": "import { nextCoord } from '../../../../utils';\nimport checkCollide from '../../../../collisions';\nimport { pixelToTile } from '../../../../tiles';\n\nimport interfaceWithObjects from '...
javascript
chosen
[ { "from": "system", "value": "Use Electron Prebuilt version from package.json\n" }, { "from": "human", "value": "var fs = require('fs')\nvar exec = require('child_process').exec\n\nvar pack = JSON.parse(fs.readFileSync('package.json', 'utf-8'))\nvar version = pack.version\n\nconsole.log('Buildin...
javascript
chosen
[ { "from": "system", "value": "Fix undefined style corner case\n" }, { "from": "human", "value": "import React from 'react'\n\nexport const H1 = ({ classes, children }) => (\n <h1\n className={`${classes} text-3xl font-extrabold tracking-tight text-gray-800 leading-9 sm:leading-10 sm:text-4xl...
javascript
chosen
[ { "from": "system", "value": "Use restRequest for Ajax requests to Girder servers\n" }, { "from": "human", "value": "import View from 'girder/views/View';\nimport { AccessType } from 'girder/constants';\n\nimport VegaWidgetTemplate from '../templates/vegaWidget.pug';\nimport '../stylesheets/vega...
javascript
chosen
[ { "from": "system", "value": "Make specific tweet endpoint adhere to API schema\n" }, { "from": "human", "value": "const Tweet = require('../models/tweet')\nconst config = require('../config')\nconst mongoose = require('mongoose')\n\nconst specificTweetsController = function (req, res) {\n res....
javascript
chosen
[ { "from": "system", "value": "Apply devtools as a enhanced create store\n" }, { "from": "human", "value": "import {createStore, applyMiddleware} from 'redux';\nimport thunkMiddleware from 'redux-thunk';\nimport travelApp from 'reducers/Reducers.js';\n\nconst createStoreWithMiddleware = applyMidd...
javascript
chosen
[ { "from": "system", "value": "Refresh model when pressing escape within validated input.\n" }, { "from": "human", "value": "core.directive(\"validatedinput\", function() {\n\treturn {\n\t\ttemplate: '<span ng-include src=\"view\"></span>',\n\t\trestrict: 'E',\n\t\tscope: {\n\t\t\t\"type\": \"@\"...
javascript
chosen
[ { "from": "system", "value": "Modify Fuse require statement to hopefully fit with exporting logic\n" }, { "from": "human", "value": "require('cloud/app.js');\nrequire('cloud/fuse.min.js');\n\n/*\n * Provides Cloud Functions for Rice Maps.\n */\nParse.Cloud.define(\"placesSearch\", function(reque...
javascript
chosen
[ { "from": "system", "value": "Set some sample rendering options\n" }, { "from": "human", "value": "const app = require('muffin')\nconst router = app.router\n\nrouter.get('/', function *(next) {\n console.log('Requested home')\n yield next\n})\n\napp.run(router)\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Replace \"question\" with \"step\" in Newtrip buttons\n" }, { "from": "human", "value": "function set_correct_origin(prev, last) {\n $(last).find(\"input[id*='origin_auto']\").prop(\"disabled\", true).val($(prev).find(\"input[id*='destination_auto']\").val());\n ...
javascript
chosen
[ { "from": "system", "value": "Refactor using app state instead of local state\n" }, { "from": "human", "value": "\nimport React, {Component} from 'react'\nimport {Link} from 'react-router-dom'\nimport Card from '../components/Card'\nimport {connect} from 'react-redux';\nimport {bindActionCreator...
javascript
chosen
[ { "from": "system", "value": "Add datas as parameter for v0.2.4\n" }, { "from": "human", "value": "'use strict';\n\n\n/**\n * Upload `contact` (containing contact data) onto Cluestr.\n *\n * \n * @param {Object} contact Contact to upload, plus cluestrClient\n * @param {Function} cb Callback to c...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect call to database and sloppy callback\n" }, { "from": "human", "value": "// FIXME: don't use hardcoded params\nvar nano = require('nano')('http://localhost:5984');\nvar db = nano.db.use('todo');\n\nvar todo = {};\n\ntodo.getAll = function(callback) {\n ...
javascript
chosen
[ { "from": "system", "value": "Replace \\n by <br/> when we use text as html\n" }, { "from": "human", "value": "'use strict';\n\nvar config = require('../config/configuration.js');\n\nfunction htmlReplace(str) {\n return str.replace(/<\\/?[^>]+\\/?>/g, ' ').replace(/ +/g, ' ').replace(/ ?\\n ?/g...
javascript
chosen