conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add jsdoc to two stack queue\n" }, { "from": "human", "value": "/**\n * @license\n * js-interview-questions <http://github.com/Tyriar/js-interview-questions>\n * Copyright 2015 Daniel Imms <http://www.growingwiththeweb.com>\n * Released under the MIT license <http:/...
javascript
chosen
[ { "from": "system", "value": "Fix a bug of exports\n" }, { "from": "human", "value": "/**\n * Add shim config for configuring the dependencies and exports for\n * older, traditional \"browser globals\" scripts that do not use define()\n * to declare the dependencies and set a module value.\n */\...
javascript
chosen
[ { "from": "system", "value": "Remove empty array to not lead implementation" }, { "from": "human", "value": "//\n// This is only a SKELETON file for the 'Resistor Color' exercise. It's been provided as a\n// convenience to get you started writing code faster.\n//\n\nexport const colorCode = () =...
javascript
chosen
[ { "from": "system", "value": "Add additional object for debug output\n" }, { "from": "human", "value": "export class PlayerModelService {\n\tconstructor($log, $http, $localStorage, _, websocket) {\n\t\t'ngInject';\n\n\t\tthis.$log = $log;\n\t\tthis.$http = $http;\n\t\tthis.$localStorage = $local...
javascript
chosen
[ { "from": "system", "value": "Fix react key uniqueness issue\n" }, { "from": "human", "value": "import PropTypes from 'prop-types'\nimport React from 'react'\nimport './ColorCycle.css'\n\nconst framerate = 33 // ms\n\nclass ColorCycle extends React.Component {\n static propTypes = {\n text: ...
javascript
chosen
[ { "from": "system", "value": "Add test to check that Action Item column is not displayed on render\n" }, { "from": "human", "value": "import React from \"react\"\nimport { shallow } from \"enzyme\"\nimport { expect } from \"chai\"\nimport sinon from \"sinon\"\n\nimport Room from \"../../web/stat...
javascript
chosen
[ { "from": "system", "value": "Create ability to animate metronome. Needs method and logic\n" }, { "from": "human", "value": "$(document).ready(function(){\n\n $(\".metronome-parameters\").on(\"submit\", function(event){\n event.preventDefault();\n if ($('#metronome-button').val() === \"St...
javascript
chosen
[ { "from": "system", "value": "Support for meta and selectAccount properties.\n\nAdded meta parameter and selectAccount component property." }, { "from": "human", "value": "import Ember from 'ember';\n\nconst OPTIONS = ['clientName', 'product', 'key', 'env', 'webhook', 'longtail', 'selectAccount'...
javascript
chosen
[ { "from": "system", "value": "Comment for signin?signedout version added\n" }, { "from": "human", "value": "var keystone = require('../../../');\nvar session = require('../../../lib/session');\n\nmodule.exports = function (req, res) {\n\tsession.signout(req, res, function () {\n\t\tif (typeof ke...
javascript
chosen
[ { "from": "system", "value": "Sort the exocomp system list by name.\n" }, { "from": "human", "value": "import React, { Component } from \"react\";\nimport {\n ButtonDropdown,\n DropdownToggle,\n DropdownMenu,\n DropdownItem\n} from \"reactstrap\";\n\nclass DestinationSelect extends Component...
javascript
chosen
[ { "from": "system", "value": "Replace jquery Ready() with vanilla JS\n\nWe see some errors with loading the JS for some users, caused by $ being undefined. Why that happens is unknown, since jquery should be loaded before the main.js file, but we want to ultimately remove the jquery dependency anyway.\n" ...
javascript
chosen
[ { "from": "system", "value": "Add loading spinner to resource page\n\nRefs #8.\n" }, { "from": "human", "value": "import React, {Component, PropTypes} from 'react';\nimport DocumentTitle from 'react-document-title';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport {connect} f...
javascript
chosen
[ { "from": "system", "value": "Fix source map error on dev-hook\n" }, { "from": "human", "value": "var webpack = require(\"webpack\");\n\nmodule.exports = {\n context: __dirname,\n entry: [\n \"webpack-dev-server/client?http://localhost:4002\",\n \"webpack/hot/dev-server\",\n ...
javascript
chosen
[ { "from": "system", "value": "Clarify build name for SauceLabs dashboard\n" }, { "from": "human", "value": "// this file is for use in CircleCI continuous integration environment\nmodule.exports = {\n seleniumServerURL: {\n hostname : 'ondemand.saucelabs.com',\n port :...
javascript
chosen
[ { "from": "system", "value": "Increase timeouts for e2e tests on Sauce Labs.\n" }, { "from": "human", "value": "// Protractor configuration\n// https://github.com/angular/protractor/blob/master/docs/referenceConf.js\n\nexports.config = {\n specs: ['e2e/**/*.js'],\n\n sauceUser: process.env.SAU...
javascript
chosen
[ { "from": "system", "value": "Add url in debug errors\n" }, { "from": "human", "value": "const { Readable } = require('stream')\nconst convertSDataError = require('./convertSDataError.js')\n\nclass FindStream extends Readable {\n constructor(request, startUrl, limit = 0) {\n super({objectMod...
javascript
chosen
[ { "from": "system", "value": "Use parseFloat instead of parseInt" }, { "from": "human", "value": "\"use strict\";\n\nvar cbo = cbo || {}\n\ncbo.feeCalculator = {\n init : function(container_id) {\n this.addChangeEvent(container_id);\n },\n addChangeEvent: function(container_id) {\n $('#...
javascript
chosen
[ { "from": "system", "value": "Fix numberOfPages when nItems is null\n" }, { "from": "human", "value": "/**\n * Created by FG0003 on 09/02/2017.\n */\nimport Template from './pagination.tpl.html';\n\nimport previous from './../../../icons/previous.svg';\nimport next from './../../../icons/next.sv...
javascript
chosen
[ { "from": "system", "value": "Switch success exit code test to DuckDuckGo instead of Advanced Matchers\n\nFaster" }, { "from": "human", "value": "var spawn = require('child_process').spawn;\n\n\ndescribe('Exit code', function() {\n\tit('should be 2 when passed no arguments', function(done) {\n\t...
javascript
chosen
[ { "from": "system", "value": "Add new server parameter for showing hidden files\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// Modules\nvar connect = require('connect'),\n fs = require('fs'),\n http = require('http'),\n path = require('path'),\n serveStatic = require('s...
javascript
chosen
[ { "from": "system", "value": "Exclude non-confirmed accounts from stats\n\nIn future simple User.count() would likely contain also spambots etc.\n\nWill show up as a slight drop in numbers at [statistics\npage](https://www.trustroots.org/#!/statistics).\n" }, { "from": "human", "value": "'use st...
javascript
chosen
[ { "from": "system", "value": "Add various routers to top-level exports\n" }, { "from": "human", "value": "export NavigationPrompt from './NavigationPrompt'\nexport History from './History'\nexport Link from './Link'\nexport Match from './Match'\nexport Miss from './Miss'\nexport Redirect from '....
javascript
chosen
[ { "from": "system", "value": "Add 'md-body' class to table body component\n\nReplace classNameBindings with classNames in paper-data-table-body\ncomponent\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/paper-data-table-body';\n\nconst {...
javascript
chosen
[ { "from": "system", "value": "Use a sorting index for arbitrary sorting of roles\n" }, { "from": "human", "value": "const db = require('../lib/database');\nconst messageHelpers = require('../lib/message_helpers');\nconst Table = require('ascii-table');\nconst textHelpers = require('../lib/text_h...
javascript
chosen
[ { "from": "system", "value": "Use reduce instead of forEach\n" }, { "from": "human", "value": "export const convertModifiersToClassnames = (modifiers, theme) => {\n if (!modifiers) {\n return;\n }\n\n const convertedModifiers = {};\n\n Object.keys(modifiers).forEach(key => {\n converte...
javascript
chosen
[ { "from": "system", "value": "[BUGFIX] Fix the path pointing to the example jasmine test definition\n" }, { "from": "human", "value": "/**\n * Spec.js\n * @description An array of all specifications karma will run.\n */\n\ndefine({\n\tspecs: [\n\t\t\"specs/example.spec\"\n\t]\n});\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Fix security issue with password recovery. Now a not used recovery token need to be used for password reset ... before account id was enough.\n" }, { "from": "human", "value": "const service = require('feathers-mongoose');\nconst passwordRecovery = require('./model'...
javascript
chosen
[ { "from": "system", "value": "Add new deprecations from ember-page-object\n\nSilence these for now to avoid cluttering up logs.\n" }, { "from": "human", "value": "/* global window */\n\nwindow.deprecationWorkflow = window.deprecationWorkflow || {};\nwindow.deprecationWorkflow.config = {\n workf...
javascript
chosen
[ { "from": "system", "value": "Disable TurboLinks.ProgressBar if it exists\n\nResolves #32, where TurboLinks' default progress bar loads in addition\nto this one when using this project.\n" }, { "from": "human", "value": "jQuery(function() {\n jQuery(document).on('page:fetch', function() { NPr...
javascript
chosen
[ { "from": "system", "value": "Modify the comment for hamburger menu javascript file\n" }, { "from": "human", "value": "// jQuery for user profile pages\n$(() => {\n if ($(window).width() <= 920) {\n if ($('.uls-trigger').length > 0) {\n $('.ham-nav__site-logo').css({ \"margin-left\": '-...
javascript
chosen
[ { "from": "system", "value": "Disable subdirectory input if creating node with url.\n" }, { "from": "human", "value": "(function ($) {\n\n Drupal.behaviors.ams_uploader = {\n attach: function (context) {\n\n /* No Longer Neccesary\n $('input#edit-field-media-url-u...
javascript
chosen
[ { "from": "system", "value": "Fix CSP error caused by nyc instrumentation\n\nThis had been fixed earlier, however the regular expression no longer matched\n" }, { "from": "human", "value": "'use strict';\nconst {Transform} = require('stream');\nconst {createInstrumenter} = require('istanbul-lib-...
javascript
chosen
[ { "from": "system", "value": "Fix bug in the end of Game\n" }, { "from": "human", "value": "var config = require('../config');\nvar logger = require('lib/logger')(module);\nvar startTime = Date.parse(config.get('startTime'));\nvar finishTime = Date.parse(config.get('finishTime'));\nvar Problem =...
javascript
chosen
[ { "from": "system", "value": "Add secret check and remove response code.\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar request = require('request');\n\nrouter.get('/', function(req, res) {\n request({\n url: 'https://status.heroku.c...
javascript
chosen
[ { "from": "system", "value": "Make death listener pause spawners\n" }, { "from": "human", "value": "AFRAME.registerComponent('death-listener', {\n schema: {\n characterId: {default: undefined}\n },\n\n init: function () {\n const el = this.el;\n window.addEventListener('characterDestr...
javascript
chosen
[ { "from": "system", "value": "Remove default checkbox from question answers\n" }, { "from": "human", "value": "import React from 'react';\n\nclass ContentQuestionAnswersItem extends React.Component {\n\n render() {\n const answer = this.props.answer;\n const name = this.props.na...
javascript
chosen
[ { "from": "system", "value": "Remove `is.buffer(body)` as it never happens when getting body size\n\nBecause buffers are always converted to a stream: https://github.com/sindresorhus/got/blob/master/source/normalize-arguments.js#L111" }, { "from": "human", "value": "'use strict';\nconst fs = req...
javascript
chosen
[ { "from": "system", "value": "Allow us to serve app at path that is not root, i.e. /app\n" }, { "from": "human", "value": "import {argv} from \"yargs\"\nexport default (config) => ({\n compiler_debug: argv.debug !== false,\n compiler_public_path: '/'\n})" }, { "from": "gpt", "v...
javascript
chosen
[ { "from": "system", "value": "Move the error handling out of the http request in lambda func\n" }, { "from": "human", "value": "var https = require('https');\n\nexports.handler = function(event, context, callback) {\n\n // This token should live as an environmental variable set in the\n //...
javascript
chosen
[ { "from": "system", "value": "Allow navigation to BiG CZ search without AOI\n\nTemporarily allow navigation to BiG CZ search panel without needing an\nAOI to make development easier.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar App = require('../app'),\n router = require('../rout...
javascript
chosen
[ { "from": "system", "value": "Add logic to append the AJAX response from the server to the current\nriver.\n" }, { "from": "human", "value": "$(document).ready(function() {\n});\n" }, { "from": "gpt", "value": "$(document).ready(function() {\n $('.river-form').on('click', function(e...
javascript
chosen
[ { "from": "system", "value": "Add spacer between instruction and address input\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { Field, reduxForm } from 'redux-form'\n\nimport GoButton from './components/go-button'\nimport Input from '../components/input'\n\nc...
javascript
chosen
[ { "from": "human", "value": "Add tests for the registration process\n" }, { "from": "gpt", "value": "require('../../config/init').setEnvironment()\nprocess.env.NODE_ENV = 'test'\n\nconst chai = require('chai')\nconst should = chai.should()\nconst chaiHttp = require('chai-http')\nchai.use(chaiHtt...
javascript
chosen
[ { "from": "system", "value": "Insert new sections into collection.\n" }, { "from": "human", "value": "Template.addSection.events({\n 'click #add-section-button': function (event, template) {\n /*\n / Add new section to the course\n */\n\n // Get current sections, b...
javascript
chosen
[ { "from": "system", "value": "Stop loading every single css file into the DOM\n\nWe previously loaded every single css file into the DOM in development\nmode to resolve the flash of unstyled content (FOUC). This turned out to\nbe a mistake because when you are dealing with a large app that has\nmultiple ent...
javascript
chosen
[ { "from": "system", "value": "Add prop type for Num.shorthand.\n" }, { "from": "human", "value": "/**\n * Formatted number component.\n *\n * Site Kit by Google, Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file exce...
javascript
chosen
[ { "from": "system", "value": "feat: Add implementaion of error responses according to json:api v1 spec\n" }, { "from": "human", "value": "const HTTPStatus = require('http-status-codes');\n\n// eslint-disable-next-line no-unused-vars\nfunction handleErrorResponse(err, req, res, next) {\n const r...
javascript
chosen
[ { "from": "system", "value": "Add marker subtitle to api response\n" }, { "from": "human", "value": "import _ from 'lodash';\nconst {knex} = require('../util/database').connect();\n\nfunction getMarkers() {\n return knex('markers')\n .select('*')\n .orderBy('id', 'asc')\n .then(rows =>...
javascript
chosen
[ { "from": "system", "value": "Clean up of the sign up controller\n" }, { "from": "human", "value": "'use strict';\r\n(function(controllers) {\r\n controllers.controller('signupController', [\r\n '$scope', '$location', '$timeout', 'authService', 'webApiValidationService', function ($sc...
javascript
chosen
[ { "from": "system", "value": "Add @miragejs/server to API docs\n" }, { "from": "human", "value": "'use strict';\n\nconst EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nmodule.exports = function(defaults) {\n let app = new EmberAddon(defaults, {\n // Add options here\n 'emb...
javascript
chosen
[ { "from": "system", "value": "Expand Home upon loading Edit profile\n" }, { "from": "human", "value": "(function($){\n $(function(){\n\n $('.button-collapse').sideNav();\n\n }); // end of document ready\n})(jQuery); // end of jQuery name space" }, { "from": "gpt", "value": "(fun...
javascript
chosen
[ { "from": "system", "value": "feat: Add default param expression test\n" }, { "from": "human", "value": "describe(\"About Functions\", function () {\n\n describe(\"Default Parameters\", function () {\n\n it(\"should understand how default parameters are handled\", function () {\n\n func...
javascript
chosen
[ { "from": "system", "value": "Move flow webpack plugin to only development\n" }, { "from": "human", "value": "const path = require('path');\nconst FlowBabelWebpackPlugin = require('./src/renderer/flowtype-plugin');\n\nconst ELECTRON_RENDERER_PROCESS_ROOT = path.resolve(__dirname, 'src/renderer/'...
javascript
chosen
[ { "from": "system", "value": "Switch array checking method to native isArray\n" }, { "from": "human", "value": "import { mergeArray } from 'most'\nimport { isArrayLike, map } from '@most/prelude'\n\nexport const combineEpics = epicsArray => (actions, store) => {\n if (!epicsArray || !isArrayLik...
javascript
chosen
[ { "from": "system", "value": "Change wording in store error message\n" }, { "from": "human", "value": "'use strict';\n\nconst error = require('http-errors');\n\nexports.translateDbError = (err) => {\n return Promise.reject(\n error.InternalServerError('database '+err.message)\n );\n}\n" }...
javascript
chosen
[ { "from": "system", "value": "Fix typo in JS Hello Client" }, { "from": "human", "value": "// JS Hello Client Example\n/* jshint node: true */\n\n\"use strict\";\nvar process = require(\"process\");\nvar hello = require(\"hello\").hello;\n\n// \"http://hello.datawire.io/\" is the URL of the simp...
javascript
chosen
[ { "from": "system", "value": "Make sure HTML entities are converted to the symbols they represent before passing them to the Markdown parser.\n" }, { "from": "human", "value": "// From https://gist.github.com/1343518\n// Modified by Hakim to handle markdown indented with tabs\n(function(){\n\n ...
javascript
chosen
[ { "from": "system", "value": "Set timezone of the cronjob to the timezone of Switzerland\n\nAs the telegram bot is mostly used by Swiss people.\n" }, { "from": "human", "value": "'use strict';\n\nvar sender = {\n registerCronJob: function(bot) {\n var CronJob = require('cron').CronJob;\n ...
javascript
chosen
[ { "from": "system", "value": "Use Utils.loadView to load main page.\n" }, { "from": "human", "value": "requirejs.config({\n\tshim: {\n\t\t'facebook' : {\n\t\t\texport: 'FB'\n\t\t},\n 'backbone': {\n deps: [\"underscore\", \"jquery\"],\n exports: \"Backbone\"\n ...
javascript
chosen
[ { "from": "system", "value": "Clean the index at first.\n" }, { "from": "human", "value": "const algoliasearch = require('algoliasearch');\n\nconst client = algoliasearch(process.env.APP_ID, process.env.ADMIN_API_KEY);\nconst index = client.initIndex('codelabs');\n\nconst data = require('./_post...
javascript
chosen
[ { "from": "system", "value": "Make Typeaheads polymorphic on presence of \"selectable\" prop\n" }, { "from": "human", "value": "import Typeahead from './core'\n\nexport default Typeahead" }, { "from": "gpt", "value": "import React from 'react'\nimport Typeahead from './core'\nimport ...
javascript
chosen
[ { "from": "system", "value": "Solve a possible problem caused by name collision\n" }, { "from": "human", "value": "'use strict';\n\nconst amqp = require('amqplib');\nconst debug = require('debug')('node-apimanager:amqp-sender');\n\nclass Rabbit {\n constructor(uri, monitor) {\n this.URI = ur...
javascript
chosen
[ { "from": "system", "value": "Change to Unix newlines. Add inherit call.\n" }, { "from": "human", "value": "// Copyright 2002-2012, University of Colorado\r\n\r\n/**\r\n * A model element that has a position (a.k.a. a location) which can be\r\n * changed.\r\n *\r\n * @author John Blanco\r\n * @a...
javascript
chosen
[ { "from": "system", "value": "Add disable and enable function. Refactor code.\n" }, { "from": "human", "value": "import './sal.scss';\n\nconst SELECTOR = '[data-sal]';\n\nlet options = {\n rootMargin: '0px',\n threshold: 0,\n animateClassName: 'sal-animate',\n};\n\nlet elements = [];\nlet int...
javascript
chosen
[ { "from": "system", "value": "Put parens in the right place" }, { "from": "human", "value": "(function ($) {\n \n // http://davidwalsh.name/ways-css-javascript-interact\n function addCSSRule (sheet, selector, rules, index) {\n if (sheet.insertRule) {\n sheet.insertRule(selector + '{ ' ...
javascript
chosen
[ { "from": "system", "value": "Reduce autoscroll duration and allow interruption by scrolling\n" }, { "from": "human", "value": "/*!\n * Start Bootstrap - Freelancer Bootstrap Theme (http://startbootstrap.com)\n * Code licensed under the Apache License v2.0.\n * For details, see http://www.apache...
javascript
chosen
[ { "from": "system", "value": "Fix CTCP commands always sent upper-case\n\nThis is a Node v6+ only fix.\n`irc-framework` upper-cases the first argument, and we were sending everything as a string in first argument. This correctly splits.\n" }, { "from": "human", "value": "\"use strict\";\n\nexpor...
javascript
chosen
[ { "from": "system", "value": "Fix use strict. Also add matcher for Firefox OS(?).\n" }, { "from": "human", "value": "'use strict';\n\n(function() {\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\n $('#MobileWarning').modal('show');\n }\n}...
javascript
chosen
[ { "from": "system", "value": "Add source collection view, it renders things now\n\nIt's kinda cludgey, Nabil and I are going to clean it up some, but\nfor the now, it works\n" }, { "from": "human", "value": "AV.SourceCollectionView = Backbone.View.extend({\n el: '#list_container',\n render...
javascript
chosen
[ { "from": "system", "value": "Create submit and click events for edit button.\n" }, { "from": "human", "value": "Template.betItem.helpers({\n openStatus: function() {\n return ( this.status === \"open\" ) ? true : false;\n },\n\n pendingStatus: function() {\n return ( this.status === \"...
javascript
chosen
[ { "from": "system", "value": "Use a function to get the token\n\nMore reliable: the header is not a string but a function, so right before sending the request, Angular will call `getToken` and get the token" }, { "from": "human", "value": "angular.module('ng-rails-csrf', [] ).config(['$httpProvi...
javascript
chosen
[ { "from": "system", "value": "Add basic bookmark oncreated listener for local storage updating\n" }, { "from": "human", "value": "function popupOpen(bookmark) {\n var winWidth = 400;\n var winHeight = 400;\n var winURL = \"../templates/bookmarks.html\";\n var winName = \"\";\n var winPosLef...
javascript
chosen
[ { "from": "system", "value": "Add imageUrl function to document model" }, { "from": "human", "value": "(function(){\n var dc = window.dc;\n var $ = dc.$;\n var _ = dc._;\n var Backbone = dc.Backbone;\n\n var definition = dc.embed.definition;\n var data = dc.embed.data;\...
javascript
chosen
[ { "from": "system", "value": "Fix Forgotten Key Error in Read Campaign Setting Model Logic\n" }, { "from": "human", "value": "var configuration = require('../../../config/configuration.json')\n\nmodule.exports = {\n getCampaignSettingModel: function (redisClient, CampaignHashID, callback) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix galleria URL by prepending slash /\n\nThe gallery on the homepage was broken for one specific URL:\n\nwww.gocongress.org/2020/\n\nThese worked:\n\nwww.gocongress.org/2020\nwww.gocongress.org/\n" }, { "from": "human", "value": "$(document).ready(function(){\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add simulate as a subcommand\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst semver = require('semver');\nconst version = require('../package').engines.node;\n\nif (!semver.satisfies(process.version, version)) {\n console.log(`Node.js version ${vers...
javascript
chosen
[ { "from": "system", "value": "Implement forEach on send sms\n" }, { "from": "human", "value": "var util = require('util');\nvar _ = require('lodash');\nvar Promise = require('bluebird');\nvar twilio = require('twilio');\nvar BaseSms = require('./BaseSms');\n\nutil.inherits(TwilioSms, BaseSms);\n...
javascript
chosen
[ { "from": "system", "value": "Fix compilers to only reference the scripts we intend to test against\n" }, { "from": "human", "value": "module.exports = function(wallaby) {\n return {\n env: {\n type: 'node',\n runner: 'node',\n },\n files: [\n ...
javascript
chosen
[ { "from": "system", "value": "Remove `const` declaration in favor of a `var` so as not to throw an error in older webkit browsers.\n" }, { "from": "human", "value": "'use strict'\n\nconst sign = require('./bn-sign')\n\nmodule.exports = bn2num\n\n//TODO: Make this better\nfunction bn2num(b) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix nightmare error watching API\n" }, { "from": "human", "value": "import vo from 'vo';\nimport got from 'got';\nimport nightmare from 'nightmare';\n\nfunction* checkIsLive(url, maxWait) {\n yield got(url, { timeout: maxWait, retries: 1 });\n}\n\nfunction* check...
javascript
chosen
[ { "from": "system", "value": "Fix the cli batch processing yield\n" }, { "from": "human", "value": "'use strict';\nvar co6 = require('co6');\nvar fs = co6.promisifyAll(require('fs'));\nvar os = require('os');\nvar parse = require('./parse');\nvar server = require('../server');\n\n/*\n * Run the ...
javascript
chosen
[ { "from": "system", "value": "Handle typed arrays in FormData\n" }, { "from": "human", "value": "/*global window*/\nvar isBrowser = typeof window !== 'undefined' &&\n typeof window.FormData !== 'undefined';\n\n// use native FormData in a browser\nvar FD = isBrowser?\n window.Fo...
javascript
chosen
[ { "from": "system", "value": "Remove redundant item from test config\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function( grunt ) {\n grunt.initConfig({\n jscs: {\n fail: {\n files: {\n src: \"../fixtures/fixture....
javascript
chosen
[ { "from": "system", "value": "Add redirect_uri as config parameter" }, { "from": "human", "value": "VK = {};\n\nVK.requestCredential = function (options, credentialRequestCompleteCallback) {\n\n if (!credentialRequestCompleteCallback && typeof options === 'function') {\n credentialRequ...
javascript
chosen
[ { "from": "system", "value": "Remove target from Babel for now - Need to figure out proper method for delivery\n" }, { "from": "human", "value": "module.exports = {\n presets: [\n [\n 'env',\n process.env.BABEL_ENV === 'es'\n ? {\n targets: { node: '7' },\n ...
javascript
chosen
[ { "from": "system", "value": "Fix invalidating for every .set key\n" }, { "from": "human", "value": "StateMap = function StateMap() {\n this._depsMap = {};\n this._valueMap = {};\n};\n\nStateMap.prototype.set = function(key, value, fireAway) {\n var dep = this._getDep(key);\n var existingVal...
javascript
chosen
[ { "from": "system", "value": "Remove unneccessary attack action 'toggleFavorite'\n" }, { "from": "human", "value": "import * as types from './types';\n\nexport const favoriteAttack = (attack) => {\n return {\n type: types.TOGGLE_FAVORITE,\n attack\n };\n}\n\nexport const showAttack = (at...
javascript
chosen
[ { "from": "system", "value": "Fix merging of Laravel .htaccess with h5bp .htaccess\n" }, { "from": "human", "value": "(function(exports) {\n \"use strict\";\n var request = require('request');\n var Sink = require('pipette').Sink;\n var unzipper = require('../process-zip');\n\n exports.down...
javascript
chosen
[ { "from": "system", "value": "Use $directive prefix for directive traces" }, { "from": "human", "value": "var utils = require('../utils')\n\nmodule.exports = function ($provide) {\n var instrumentDirective = function (name) {\n var directiveName = name + 'Directive'\n $provide.decorator(d...
javascript
chosen
[ { "from": "system", "value": "Document return value of compareObjects\n" }, { "from": "human", "value": "import isPlainObject from 'lodash.isplainobject';\n\n/**\n * Compares two objects by iterating their properties and calling the\n * comparator function on each one to determine if they match....
javascript
chosen
[ { "from": "system", "value": "Change argument names for thenable for clarity\n" }, { "from": "human", "value": "'use strict';\n\nvar Promise = require('bluebird');\nvar sinon = require('sinon');\n\nfunction thenable (promiseFactory) {\n return Object.getOwnPropertyNames(Promise.prototype)\n ...
javascript
chosen
[ { "from": "system", "value": "Verify key type instead of value\n\nThis is to make the code cleaner and easier to understand\n" }, { "from": "human", "value": "var extend = require('extend');\n\n\nvar Plom = function(options) {\n this.options = options || {};\n this.data = this.options.data || ...
javascript
chosen
[ { "from": "system", "value": "Make warnings instead of silent" }, { "from": "human", "value": "export default {\n extends: ['airbnb-base'],\n rules: {\n \"indent\": [ 2, 2, { \"SwitchCase\": 1} ],\n \"space-before-blocks\": [2, \"never\"],\n \"max-len\": [1, 120, 4],\n \"comma-dang...
javascript
chosen
[ { "from": "system", "value": "Remove array of illegal key chars\n\nShould have been done in 4c138b23602edc8db5a2dbc89b86db54fe3a6e0d\n" }, { "from": "human", "value": "'use strict'\n\nimport validateKey from 'firebase-validate-key'\nimport extend from 'xtend'\nimport find from 'babel-runtime/cor...
javascript
chosen
[ { "from": "system", "value": "Test Commit for Test App.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar mongoose = require('mongoose'),\n passport = require('passport'),\n logger = require('mean-logger');\n\n/**\n * Main application entry file.\n ...
javascript
chosen
[ { "from": "system", "value": "Refactoring: Replace single quotes -> double quotes, var -> const, spaces\n" }, { "from": "human", "value": "var preloaders = require(\"./preloaders\");\nvar loaders = require(\"./loaders\");\nvar webpack = require('webpack');\n\nmodule.exports = {\n entry: ['./src...
javascript
chosen
[ { "from": "system", "value": "[cli] Use separate user config for staging\n" }, { "from": "human", "value": "import ConfigStore from 'configstore'\n\nconst defaults = {}\nlet config = null\n\nconst getUserConfig = () => {\n if (!config) {\n config = new ConfigStore('sanity', defaults, {global...
javascript
chosen
[ { "from": "system", "value": "chore: Drop special index handling from `getSectionPages`\n\nNo need for that anymore.\n" }, { "from": "human", "value": "const _ = require('lodash');\n\nmodule.exports = function getSectionPages(config, sectionName, pages) {\n if (sectionName === '/') {\n const...
javascript
chosen
[ { "from": "system", "value": "Update example to reflect current switchboard urls\n" }, { "from": "human", "value": "// create a new signaller, connecting to the target switchboard\nvar signaller = require('..')('http://rtc.io/switchboard');\n\n// when a new peer is announced, log it\nsignaller.o...
javascript
chosen
[ { "from": "system", "value": "Use .length instead of instanceof Array\n" }, { "from": "human", "value": "'use strict';\n\nconst includes = require('lodash/includes');\n\n// tests\nmodule.exports = function is(element, ufo) {\n return (!ufo || typeof ufo === 'string' && element.matches && elemen...
javascript
chosen