conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add coverage for setDirectionsLink handler\n" }, { "from": "human", "value": "import { expect } from 'chai';\nimport sinon from 'sinon';\n\nimport setDirectionsLink from './../../handlers/setDirectionsLink';\n\ndescribe('setDirectionsLink handler', () => {\n it('ex...
javascript
chosen
[ { "from": "system", "value": "Remove following array on auth redux state\n" }, { "from": "human", "value": "import * as types from './authActions';\n\nconst initialState = {\n isAuthenticated: false,\n isFetching: false,\n user: {},\n\n following: [],\n followingIsLoading: true,\n};\n\nexpo...
javascript
chosen
[ { "from": "system", "value": "Define mocha as testing framework.\nWe don't use jasmine that is the wallaby default.\n" }, { "from": "human", "value": "module.exports = function (wallaby) {\n 'use strict'\n\n return {\n files: [\n {pattern: 'node_modules/systemjs/dist/system.js', instru...
javascript
chosen
[ { "from": "system", "value": "Add `isTakenKing` test, but example is empty.\n\n* TODO\n" }, { "from": "human", "value": "import Board from '../../frontend/src/shogi/board';\nimport Piece from '../../frontend/src/shogi/piece';\nimport memo from 'memo-is';\nimport _ from 'lodash';\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Revert \"fix transfer form unlock wallet issue\"\n\nThis reverts commit 9510fcaea98c9f569c0176500efebcbc0d648a8a.\n" }, { "from": "human", "value": "import alt from \"alt-instance\"\nimport WalletUnlockActions from \"actions/WalletUnlockActions\"\nimport WalletDb fr...
javascript
chosen
[ { "from": "system", "value": "Switch params order and allow full options object" }, { "from": "human", "value": "var fs = require(\"fs\")\nvar path = require(\"path\")\n\nvar Parser = require(\"./index\")\n\nmodule.exports = less\n\nfunction less(location, callback, preprocess) {\n var option...
javascript
chosen
[ { "from": "system", "value": "Update classes of closest('.fl_wrap') instead of parent()\n\nThis allows it to work even for cases where the input is a descendant, but not a direct child, of the .fl_wrap element. This happens, for instance, if you use the conventional bootstrap control-group hierarchy." }, ...
javascript
chosen
[ { "from": "system", "value": "Make comments collection load only when loading a post\n" }, { "from": "human", "value": "Router.configure({\n layoutTemplate: 'layout',\n loadingTemplate: 'loading',\n notFoundTemplate: 'notFound',\n waitOn: function() {\n return [Meteor.subscribe('posts'), ...
javascript
chosen
[ { "from": "system", "value": "Adjust elements' height for window size\n" }, { "from": "human", "value": "/* global $ */\n\n'use strict';\n\nangular.module('memoApp')\n .controller('MemoEditCtrl', function ($scope, $routeParams, memoService) {\n $('.nav li').removeClass('active');\n $('#na...
javascript
chosen
[ { "from": "system", "value": "Remove blasting API on each keyPress. Fix TBD.\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { connect } from 'react-redux'\nimport { evaluateText } from '../actions'\nimport TextArea from '../components/TextArea'\n\nconst mapSt...
javascript
chosen
[ { "from": "system", "value": "Remove call to `console.log` in build script\n" }, { "from": "human", "value": "'use strict';\n\nvar zone = require('mdast-zone');\nvar u = require('unist-builder');\nvar sort = require('alphanum-sort/lib/compare');\nvar gemoji = require('gemoji').unicode;\nvar emot...
javascript
chosen
[ { "from": "system", "value": "Allow user to set a different database\n" }, { "from": "human", "value": "if (Meteor.isServer) {\n const _resetDatabase = function (options) {\n if (process.env.NODE_ENV !== 'development') {\n throw new Error(\n 'resetDatabase is not allowed outside ...
javascript
chosen
[ { "from": "system", "value": "[docs] Reduce the size of the wepback output in the console\n" }, { "from": "human", "value": "// @flow weak\n\nconst WebpackDevServer = require('webpack-dev-server');\nconst webpack = require('webpack');\nconst webpackConfig = require('./webpack.dev.config');\n\nco...
javascript
chosen
[ { "from": "system", "value": "Add important withCredentials flag to API calls\n" }, { "from": "human", "value": "import axios from 'axios';\nimport createApiUrl from 'helpers/createApiUrl';\nimport queryParams from 'query-params';\n\nconst apiUrl = (requestPath) => {\n const prefix = process.en...
javascript
chosen
[ { "from": "system", "value": "Reset seek progress on song change\n" }, { "from": "human", "value": "import Sound from 'react-sound';\n\nimport {\n START_PLAYBACK,\n PAUSE_PLAYBACK,\n UPDATE_PLAYBACK_PROGRESS,\n UPDATE_SEEK\n} from '../actions/player';\n\nconst initialState = {\n playbackSta...
javascript
chosen
[ { "from": "system", "value": "Allow boolean values for Animation PropType\n\nCloses #163, #162.\n" }, { "from": "human", "value": "// Copyright (c) 2016 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associate...
javascript
chosen
[ { "from": "system", "value": "Add newline in file to keep github happy\n" }, { "from": "human", "value": "/**\n * Return an array of function of the form x => { type, payload = x }\n */\nexport function createActions(...types) {\n return types.map(createAction)\n}\n\n/**\n * Create a single act...
javascript
chosen
[ { "from": "system", "value": "examples: Add missing uppy.socket call to S3 example\n" }, { "from": "human", "value": "const uppy = require('uppy-server')\nconst app = require('express')()\n\napp.use(require('cors')())\napp.use(require('body-parser').json())\n\napp.use(uppy.app({\n providerOptio...
javascript
chosen
[ { "from": "system", "value": "Fix logos on 'Browse' page ('/directory')\n" }, { "from": "human", "value": "'use strict';\n\nimport React from 'react';\nimport { browserHistory } from 'react-router';\n\nimport EnterpriseSummary from './EnterpriseSummaryComponent.js';\n\nclass DirectoryComponent e...
javascript
chosen
[ { "from": "system", "value": "Move window options into a variable\n" }, { "from": "human", "value": "chrome.app.runtime.onLaunched.addListener(function() {\n var screenWidth = Math.round(screen.width * 0.75);\n var screenHeight = Math.round(screen.height * 0.75);\n\n chrome.app.window.create(...
javascript
chosen
[ { "from": "system", "value": "Fix Error Component When Theres No Errors\n" }, { "from": "human", "value": "var React = require(\"react\")\n\nexport default class Errors extends React.Component {\n displayName = \"FriggingBootstrap.Errors\"\n\n static defaultProps = require(\"../default_props.j...
javascript
chosen
[ { "from": "system", "value": "Add removal of uneeded function in props\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { connect } from 'react-redux';\n\nimport { ...
javascript
chosen
[ { "from": "system", "value": "Use recommended react plugin for eslint\n\n - this avoids the annoying `unused variable 'React' error`, becuase React needs to be in scope for jsx\n" }, { "from": "human", "value": "module.exports = {\n \"env\": {\n \"browser\": true,\n \"es6\": true,\n \...
javascript
chosen
[ { "from": "system", "value": "Remove unused eslint env options\n" }, { "from": "human", "value": "'use strict'\n\nconst { env, platform } = process\n\nmodule.exports = {\n extends: [\n 'eslint:recommended',\n 'eslint-config-airbnb-base',\n 'plugin:prettier/recommended',\n ],\n\n env:...
javascript
chosen
[ { "from": "system", "value": "Configure JS linter warnings for Ember deprecations\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOptions: {\n ecmaVersion: 2018,\n sourceType: 'module',\n ecmaFeatures: {\n le...
javascript
chosen
[ { "from": "system", "value": "Set ESLint config to Vue rules\n" }, { "from": "human", "value": "// http://eslint.org/docs/user-guide/configuring\n\nmodule.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOptions: {\n sourceType: 'module'\n },\n env: {\n browser: true,\n },...
javascript
chosen
[ { "from": "system", "value": "Fix the Print widget french language translations\n\nfixes #818" }, { "from": "human", "value": "define ({\n title: 'Titre',\n format: 'Format',\n layout: 'Disposition',\n settings: 'Paramètres',\n mapScaleExtent: 'Échelle/étendue de la carte',\n p...
javascript
chosen
[ { "from": "system", "value": "Hide modal on valid user creation\n" }, { "from": "human", "value": "$(document).ready(function () {\n var currentUser = {};\n\n $('form').on('submit', function () {\n var userName = $('input#user-name').val();\n io.socket.post('/user', { name: userName }, f...
javascript
chosen
[ { "from": "system", "value": "Fix undefined is not an object for Application route\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';\n\nconst { service } = Ember.inject;\n\nexport default Ember.Rou...
javascript
chosen
[ { "from": "system", "value": "Return the newly created control\n\nThis enables code like:\n\nvar button = L.easyButton(...);\nmap.removeControl(button);\n" }, { "from": "human", "value": "L.Control.EasyButtons = L.Control.extend({\n options: {\n position: 'topleft',\n title: '',...
javascript
chosen
[ { "from": "system", "value": "Reduce amount of calculations in broadphase.\n" }, { "from": "human", "value": "/*globals define*/\ndefine([\n 'physics/intersection'\n], function( Intersection ) {\n 'use strict';\n\n // Filter all physics entities that may be colliding.\n function broadphase( ...
javascript
chosen
[ { "from": "system", "value": "Fix chess logic in analysis\n" }, { "from": "human", "value": "import { askWorker } from '../../utils';\n\nexport default function chessLogic(ctrl) {\n\n const worker = new Worker('vendor/scalachessjs.js');\n\n worker.addEventListener('message', function(msg) {\n ...
javascript
chosen
[ { "from": "system", "value": "fix(SvgIconWidget): Support old and new svg-loader\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport defaultIcon from '../../../../svg/kitware.svg';\n\nexport default function SvgIconWidget(props) {\n const s...
javascript
chosen
[ { "from": "system", "value": "Fix CI failure due to Babel's changed whitespace handling.\n" }, { "from": "human", "value": "import test from 'ava';\nimport {transform} from 'babel-core';\nimport plugin from '..';\n\nfunction isEqual (t, fixture, expected) {\n t.deepEqual(transform(fixture, {p...
javascript
chosen
[ { "from": "system", "value": "Clean up option action creators\n" }, { "from": "human", "value": "import {\n SET_SPEED,\n SET_PAUSE,\n SET_PAUSE_HOVER,\n SET_FALLOFF,\n SET_RADII_SCALE,\n SET_BOUNCE_BODIES,\n SET_BOUNCE_SCREEN,\n} from './types'\n\n\nexport function speed(s) {\n return {\...
javascript
chosen
[ { "from": "system", "value": "Make sure the temp directory exists (otherwise error is thrown in WebpackManifest)\n" }, { "from": "human", "value": "var gulp = require('gulp')\nvar gulpSequence = require('gulp-sequence')\nvar getEnabledTasks = require('../lib/getEnabledTasks')\nvar ...
javascript
chosen
[ { "from": "system", "value": "Add course: opens new page correctly in ROLE\n" }, { "from": "human", "value": "/**\n * @file courses-widget.js\n * Additional js functions if the course-overview is loaded as separate widget\n */\n\n\n/**\n * change normal overview page to separate widget page\n *...
javascript
chosen
[ { "from": "system", "value": "Make close script more robust.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar minimist = require('minimist')\nvar ss = require('../')\n\nvar argv = minimist(process.argv.slice(2), {\n boolean: 'close',\n alias: { t: 'timeout' }\n})\n\nvar browser = ...
javascript
chosen
[ { "from": "system", "value": "feat: Add pagination options to listReferencedFiles\n" }, { "from": "human", "value": "import {cozyFetchJSON} from './fetch'\nimport { DOCTYPE_FILES } from './doctypes'\n\nfunction updateRelations (verb) {\n return function (cozy, doc, ids) {\n if (!doc) throw n...
javascript
chosen
[ { "from": "system", "value": "Add rc as prerelease name\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n\n bump: {\n options: {\n files: ['package.json'],\n ...
javascript
chosen
[ { "from": "system", "value": "Add custom and customPrivate in Address component to allow custom validation\n" }, { "from": "human", "value": "export const component = {\n \"input\": true,\n \"tableView\": true,\n \"label\": \"address\",\n \"key\": \"address\",\n \"placeholder\": \"\",\n \"...
javascript
chosen
[ { "from": "system", "value": "Set https for a link to status page\n" }, { "from": "human", "value": "import React from 'react'\nimport classnames from 'classnames'\nimport { statusPageURL } from 'utils/settings'\nimport classes from './Header.scss'\n\nexport const Header = (props) => (\n <heade...
javascript
chosen
[ { "from": "system", "value": "Switch to using vars for hostname in gh resolver.\n" }, { "from": "human", "value": "/* @flow */\n\nimport type {ExplodedFragment} from './hosted-git-resolver.js';\nimport HostedGitResolver from './hosted-git-resolver.js';\n\nexport default class GitHubResolver exte...
javascript
chosen
[ { "from": "system", "value": "Copy get and set Functions to new service\n" }, { "from": "human", "value": "angular.module('app', [])\n.factory(\"settings\", [function() {\n \n}])" }, { "from": "gpt", "value": "angular.module('app', [])\n .factory(\"settings\", [function () {\n ...
javascript
chosen
[ { "from": "system", "value": "Add support for thumbs down in radio mode on Yandex.Music\n" }, { "from": "human", "value": "controller = new BasicController({\n supports: {\n playpause: true,\n next: true,\n previous: true,\n favorite: true\n },\n playPauseSel...
javascript
chosen
[ { "from": "system", "value": "Check for typeof string on cache hit\n" }, { "from": "human", "value": "var xhr = require('xhr');\nvar defaults = require('lodash.defaults');\n\nmodule.exports = function (options, callback) {\n // Set default options\n defaults(options, {\n method: 'GET',\n ...
javascript
chosen
[ { "from": "system", "value": "Use html string instead of temp html file\n" }, { "from": "human", "value": "const fs = require('fs')\nconst path = require('path')\nconst showdown = require('showdown')\nconst temp = require('temp')\nconst url = require('url')\n\nexports.reloadMarkdownFile = functi...
javascript
chosen
[ { "from": "system", "value": "Disable cleaning build/ dir before building\n" }, { "from": "human", "value": "const argv = require(\"yargs\").argv;\nconst Metalsmith = require(\"metalsmith\");\nconst superstatic = require(\"superstatic\").server;\nconst watch = require(\"metalsmith-watch\");\n\nc...
javascript
chosen
[ { "from": "system", "value": "Align bottom sheet to center\n" }, { "from": "human", "value": "// @flow\n\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Dimensions } from 'react-native';\nimport {\n BottomSheet as CommonBottomSheet,\n Device,\n type OnDimensio...
javascript
chosen
[ { "from": "system", "value": "Add more sugar to helper for iterating compound operations.\n\n- breakable\n- reverse\n" }, { "from": "human", "value": "var Helpers = {};\n\nHelpers.last = function(op) {\n if (op.type === \"compound\") {\n return op.ops[op.ops.length-1];\n }\n return op;\n};...
javascript
chosen
[ { "from": "system", "value": "Return listening to $locationChangeSuccess back because it is not the source of broken query error\n" }, { "from": "human", "value": "if ('angular' in window) {\n angular.module('ng').run(['$rootScope', '$window', function ($rootScope, $window) {\n\n \t$rootScope....
javascript
chosen
[ { "from": "system", "value": "Add tests around title setting for tgr command\n" }, { "from": "human", "value": "var tgr = require(\"__buttercup/classes/commands/command.tgr.js\");\n\nmodule.exports = {\n errors: {\n groupNotFoundThrowsError: function (test) {\n var command = new tgr();\...
javascript
chosen
[ { "from": "system", "value": "Remove box prefix from config\n" }, { "from": "human", "value": "/*\n * Things Gateway Default Configuration.\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file...
javascript
chosen
[ { "from": "system", "value": "Change `composedUrl` to use the abstracted s/ URL\n" }, { "from": "human", "value": "/**\n * HiveModel.js\n */\n(function (spiderOakApp, window, undefined) {\n \"use strict\";\n var console = window.console || {};\n console.log = console.log || function(){};\n v...
javascript
chosen
[ { "from": "system", "value": "Add exporting of root navigation ref and functions\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nexport { ROUTES } from './constants';\nexport { getCurrentRouteName, getCurrentParams } from './selectors';\...
javascript
chosen
[ { "from": "system", "value": "Fix silly javascript bug - was using global variables\n" }, { "from": "human", "value": "function smoothed_count(\n iterations,\n final_modulus_squared){\n\n final_modulus = Math.sqrt(final_modulus_squared);\n\n if (final_modulus< 1){\n return ite...
javascript
chosen
[ { "from": "system", "value": "Use prefixName abstraction in nano.use\n" }, { "from": "human", "value": "var NanoProxyDbFunctions = function(nano, prefix) {\r\n this.nano = nano;\r\n this.prefix = prefix;\r\n};\r\n\r\nNanoProxyDbFunctions.prototype.create = function(name, callback) {\r\n retur...
javascript
chosen
[ { "from": "system", "value": "Update remote origin for deploy github pages\n" }, { "from": "human", "value": "module.exports = {\n // Autoprefixer\n autoprefixer: {\n // https://github.com/postcss/autoprefixer#browsers\n browsers: [\n 'Explorer >= 10',\n 'ExplorerMobile >= 10',...
javascript
chosen
[ { "from": "system", "value": "Use fs-extra to remove outputDir\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nimport fs from 'fs-extra'\nimport colors from 'colors'\n\nimport { isSite, exists } from '../lib/etc'\nimport config from '../lib/config'\n\nif (!isSite()) {\n console.error(...
javascript
chosen
[ { "from": "system", "value": "Use standard node for bin\n" }, { "from": "human", "value": "#!/usr/bin/env babel-node\n\n'use strict'\n\nimport Mason from '../lib/index'\nimport Arguments from '../lib/cli/Arguments'\n\ntry {\n\tlet input = new Arguments();\n\tMason.run(input.command(), input.all(...
javascript
chosen
[ { "from": "system", "value": "Allow data to be sent back in AJAX response\n\nBefore we only sent error message\n" }, { "from": "human", "value": "exports.toObjectId = function (str) {\n var ObjectId = (require('mongoose').Types.ObjectId);\n return new ObjectId(str);\n};\n\nexports.respondT...
javascript
chosen
[ { "from": "system", "value": "chore(grunt): Add defualt grunt task -> `tdd`\n" }, { "from": "human", "value": "module.exports = {\n\n\t// Linting\n\t// -------------------------\n\tlint: ['jshint:all'],\n\n\n\t// Testing\n\t// -------------------------\n\ttest: ['karma:unit'],\n\tcoverage: ['kar...
javascript
chosen
[ { "from": "system", "value": "refactor(Core): Remove Core from exposed api\n\nBREAKING CHANGE: Since the full potential of core is now exposed through the default\ntranslationManager, it is no longer necessary to expose this method\n" }, { "from": "human", "value": "export { default } from './ma...
javascript
chosen
[ { "from": "system", "value": "Add Bluebird to window if window is a thing\n\n #goodnessSquad\n" }, { "from": "human", "value": "module.exports = require(\"./promise.js\");" }, { "from": "gpt", "value": "const Bluebird = require(\"./promise.js\");\nmodule.exports = Bluebird\n\nif (typ...
javascript
chosen
[ { "from": "system", "value": "Move EventEmitter require and use new syntax" }, { "from": "human", "value": "'use strict';\n\nvar EventEmitter = require('events').EventEmitter;\nfunction emitThen (event) {\n var args = Array.prototype.slice.call(arguments, 1);\n /* jshint validthis:true */\n r...
javascript
chosen
[ { "from": "system", "value": "Support custom input extensions for files\n" }, { "from": "human", "value": "'use strict';\n\nvar Filter = require('broccoli-filter');\nvar react = require('react-tools').transform;\n\nmodule.exports = ReactFilter;\n\nReactFilter.prototype = Object.create(Filter.pro...
javascript
chosen
[ { "from": "system", "value": "Remove unused variables: util, self\n" }, { "from": "human", "value": "var fs = require('fs')\n , util = require('util')\n , findExec = require('find-exec')\n , child_process = require('child_process')\n , players = ...
javascript
chosen
[ { "from": "system", "value": "Use module.parent's directory for resolving usage.txt\n\nChanges the default behavior of resolving the usage.txt.\n\nSEMVER: MAJOR\n" }, { "from": "human", "value": "var path = require('path')\n , fs = require('fs')\n\nmodule.exports = function(file) {\n file = fi...
javascript
chosen
[ { "from": "system", "value": "Make the Redis connection more robust\n\nWhen Redis resets the connection, the ECONNRESET error cause the nodejs server\nto exit. Capture and log it so that the server lives on. It will reconnect, and\nperhaps we'll learn that different errors require different handling after\n...
javascript
chosen
[ { "from": "system", "value": "Create person with last seen\n" }, { "from": "human", "value": "var MissingPerson = require('../../app/models/missingPerson');\n\nexports.create = function (req, res) {\n var firstname = req.body.firstname;\n var surname = req.body.surname;\n\n var missingP...
javascript
chosen
[ { "from": "system", "value": "Add missing unit test for auth_hdr.\n" }, { "from": "human", "value": "var auth_hdr = require('../lib/auth_header')\n\n\ndescribe('Parsing Auth Header field-value', function() {\n\n it('Should handle single space separated values', function() {\n var res =...
javascript
chosen
[ { "from": "system", "value": "Add type and id to script tag\n\nThe current script tag recommended by inspectlet contains an ID and the type specified.\r\n\r\nI don't think it makes too much difference but I think it is interesting to keep the script tag as close as possible of what is recommended by inspect...
javascript
chosen
[ { "from": "system", "value": "Set Mac prompt to feature ⌘\n" }, { "from": "human", "value": "var deselectCurrent = require('toggle-selection');\n\nfunction copy(text, options) {\n var debug, message, cb, reselectPrevious, range, selection, mark;\n if (!options) { options = {}; }\n debug = opt...
javascript
chosen
[ { "from": "system", "value": "Use new readable event from midiplex to start pipe\n" }, { "from": "human", "value": "var Midiplex = require('midiplex')\nvar midi = require('midi')\nvar through = require('through')\nvar net = require('net')\n\nvar mp = new Midiplex()\n\nfunction controlServer(cont...
javascript
chosen
[ { "from": "system", "value": "Remove extraneous statements, use new class name\n" }, { "from": "human", "value": "// jscs:disable requireMultipleVarDecl\n\n'use strict';\n\nvar Promise = require('bluebird'),\n StorageBase = require('ghost-storage-base'),\n imgur = require('imgur');\n\nclas...
javascript
chosen
[ { "from": "system", "value": "Add options for exact or g regex\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function() {\n return new RegExp('^\\\\s*(?:\\\\+?(\\\\d{1,3}))?[-. (]*(\\\\d{3})[-. )]*(\\\\d{3})[-. ]*(\\\\d{4})(?: *x(\\\\d+))?\\\\s*$');\n}\n" }, { "fr...
javascript
chosen
[ { "from": "system", "value": "Update splitEvery test with ES6 syntax" }, { "from": "human", "value": "import {assert} from 'chai';\nimport splitEvery from '../../src/util/split-every.js';\n\ndescribe('#splitEvery', () => {\n it('should split a collection into slices of the specified length', fu...
javascript
chosen
[ { "from": "system", "value": "Fix ESLint violations in logger\n" }, { "from": "human", "value": "const fs = require('fs');\nconst winston = require('winston');\nconst { createLogger, format, transports } = winston;\n\nconst logger = createLogger({\n format: format.combine(\n format.timestamp...
javascript
chosen
[ { "from": "system", "value": "Change the Mongo index to also use the actual field (thanks Jason!)\n" }, { "from": "human", "value": "'use strict';\n\nfunction storage (collection, ctx) {\n var ObjectID = require('mongodb').ObjectID;\n\n function create (obj, fn) {\n obj.created_at = (new D...
javascript
chosen
[ { "from": "system", "value": "Fix issue with walking paths instead of watching them. (Thanks to @mbibee and @betaveros.)\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar logger = require('./logger');\n\nmodule.exports = watcher;\n\nvar dirsToIgnore = /...
javascript
chosen
[ { "from": "system", "value": "Add additional test case for stripping existing hypens, too\n" }, { "from": "human", "value": "QUnit.test(\n \"Slug.transform() defaults\",\n function (assert)\n {\n const Slug = mojave.url.Slug;\n\n // test defaults\n const instance = ...
javascript
chosen
[ { "from": "system", "value": "Update webpack rules for test app\n" }, { "from": "human", "value": "var path = require(\"path\");\nvar webpack = require(\"webpack\");\nvar WebpackBuildNotifierPlugin = require(\"webpack-build-notifier\");\nvar HtmlWebpackPlugin = require(\"html-webpack-plugin\");\...
javascript
chosen
[ { "from": "system", "value": "Use nicer syntax instead of Reflect\n" }, { "from": "human", "value": "import MirageServer from '@miragejs/server/lib';\nexport * from '@miragejs/server/lib';\n\nimport Inflector from 'ember-inflector';\nimport { __inflections } from './utils/inflector';\n\nfunction...
javascript
chosen
[ { "from": "system", "value": "Set up the canvas for the game\n" }, { "from": "human", "value": "(function(){\n\t// see http://benalman.com/news/2010/11/immediately-invoked-function-expression/\n\t\t\n\t\n\t\n})();" }, { "from": "gpt", "value": "(function() {\n // see http://benalm...
javascript
chosen
[ { "from": "system", "value": "Fix Safari JS error after uglify\n" }, { "from": "human", "value": "const webpack = require('webpack')\nconst merge = require('webpack-merge')\nconst BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin\nconst UglifyJsPlugin = require('ugli...
javascript
chosen
[ { "from": "system", "value": "Remove the leading '.' in the entryModule path\n" }, { "from": "human", "value": "'use strict';\nconst webpackConfig = require('./webpack.config.js');\nconst loaders = require('./webpack/loaders');\nconst AotPlugin = require('@ngtools/webpack').AotPlugin;\n\nconst ...
javascript
chosen
[ { "from": "system", "value": "Implement just enough of connection for drive() to start accepting connections\n" }, { "from": "human", "value": "/**\n * Turnpike plumbing.\n *\n * Connection objects are created by the Turnpike listener, and are passed to EndpointControllers during the routing\n *...
javascript
chosen
[ { "from": "system", "value": "Build hello-config object from config arg\n" }, { "from": "human", "value": "'use strict'\n\nconst Koa = require('koa-plus')\n\nclass App extends Koa {\n /**\n * Creates an `App` instance\n *\n * @param {Object} config - Configuration for the app\n * @retur...
javascript
chosen
[ { "from": "system", "value": "Fix chopped off data for twelve hours\n" }, { "from": "human", "value": "const React = require('react');\nconst Styled = require('styled-components');\nconst fns = require('../../shared/functions');\nconst constants = require('../../shared/constants');\nconst CloseI...
javascript
chosen
[ { "from": "system", "value": "Add some extras to props\n" }, { "from": "human", "value": "const date = new Date();\nexport const defaults = {\n date: {\n day: date.getDate(),\n month: date.getMonth(),\n fullYear: date.getFullYear()\n },\n user: {\n name: '',\n github: '',\n ...
javascript
chosen
[ { "from": "system", "value": "Throw helpful information -- if uncommented\n" }, { "from": "human", "value": "function isequalRel(x, y, tol) {\n var EPS = Math.pow(2, -52); // IEEE 754 double precision epsilon\n return (Math.abs(x - y) <= (tol * Math.max(Math.abs(x), Math.abs(y)) + EPS));\n...
javascript
chosen
[ { "from": "system", "value": "Fix bad reference on webhook response.\n" }, { "from": "human", "value": "/* LIB */\n\nconst radial = require('../../radial');\nconst authenticate = require('./authenticate');\n\n/* MODULES */\n\nconst xmlConvert = require('xml-js');\n\n/* CONSTRUCTOR */\n\n(functio...
javascript
chosen
[ { "from": "system", "value": "Add (sparse) English locale for `main`\n" }, { "from": "human", "value": "\"use strict\";\n\nvar zoteroI18n = requirePo('./../../../editorsnotes/djotero/locale/%s/LC_MESSAGES/django.po');\n\nmodule.exports = {\n main: null,\n zotero: zoteroI18n\n}\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Add a layer to the document's children list when created and support activeLayer.\n" }, { "from": "human", "value": "Doc = Base.extend({\n\tinitialize: function(canvas) {\n\t\tthis.canvas = canvas;\n\t\tthis.ctx = this.canvas.getContext('2d');\n\t\tthis.size = new S...
javascript
chosen
[ { "from": "system", "value": "Fix typo and use the weak boolean on the correct place.\n" }, { "from": "human", "value": "Package.describe({\n name: 'meteorflux:reactive-state',\n version: '1.3.5',\n summary: 'ReactiveState is a reactive object to save complex state data.',\n git: 'https://gi...
javascript
chosen
[ { "from": "system", "value": "Install plugins when the server starts\n" }, { "from": "human", "value": "import Server from 'socket.io';\nimport server from './server';\nimport { registerHandlers } from './handlers';\n\nconst httpServer = server(app => {\n console.log(`Rotonde listening on ${app...
javascript
chosen
[ { "from": "system", "value": "Add error callback to geoloc\n" }, { "from": "human", "value": "class HomeCtrl {\n constructor(AppConstants, NetworkRequests, $localStorage) {\n 'ngInject';\n\n this._NetworkRequests = NetworkRequests;\n this._storage = $localStorage;\n\n ...
javascript
chosen
[ { "from": "system", "value": "Store last connected client count interval\n" }, { "from": "human", "value": "const socketIO = require(\"socket.io\");\n\nfunction WebsocketServer(app, httpServer) {\n var server = socketIO(httpServer);\n console.log(\"Websocket server attached to HTTP server....
javascript
chosen
[ { "from": "system", "value": "Comment out isomorphic fetch because of error message\n" }, { "from": "human", "value": "const submitAjaxFormRequest = function(formObjectName) {\n return {\n type: 'SUBMIT_AJAX_FORM_REQUEST',\n formObjectName\n }\n}\nconst submitAjaxFormFailure = function(e...
javascript
chosen
[ { "from": "system", "value": "Set RU lang for FB js sdk\n" }, { "from": "human", "value": "// VKontakte with app Id\nVK.init({apiId: 5103140, onlyWidgets: true});\n\n// Facebook js sdk\nwindow.fbAsyncInit = function() {\n FB.init({\n appId : '778342298941480',\n xfbml ...
javascript
chosen