conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add check if the file contains only comments\n" }, { "from": "human", "value": "const updateComment = (body, commentArr = []) => {\n body = body.map((obj, index, array) => {\n if (obj.type === 'Line' || obj.type === 'Block') {\n commentArr.push(obj)\n ...
javascript
chosen
[ { "from": "system", "value": "[usecase] Update precondition for vehicle information and data\n" }, { "from": "human", "value": "var step = '<font style=\"font-size:85%\">'\n + '<p>Test Purpose: </p>'\n + '<p>Verifies the device supports tizen vehicle information and vehicle data AP...
javascript
chosen
[ { "from": "system", "value": "Adjust dir structure for exports\n" }, { "from": "human", "value": "const siteSlug = process.argv[2];\nconst fs = require('fs');\nimport { getQuestionsStream, getAnswersStream, uninitDB } from './datastore.js';\nimport { decodify } from './codify.js';\nconst baseLan...
javascript
chosen
[ { "from": "system", "value": "Fix non-explicit arguments. (This broke when the code was minified.)\n" }, { "from": "human", "value": "/**\n * JADE DIRECTIVES\n *\n */\n\nvar module = angular.module('jade', []);\n\n/**\n * Jade Replace\n */\nmodule.directive('rpJadeReplace', function($rootScope, ...
javascript
chosen
[ { "from": "system", "value": "Check for any overflow scroll style on parent node.\n" }, { "from": "human", "value": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n/**\n * @fileOverview Find scroll parent\n */\n\nexports.default = function (node) {\n if...
javascript
chosen
[ { "from": "system", "value": "Define action for the accpet button\n" }, { "from": "human", "value": "/* 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, You can obtain one at http://mozilla.org/M...
javascript
chosen
[ { "from": "system", "value": "Add support for node module\n" }, { "from": "human", "value": "if (typeof define === \"function\" && define.amd) {\n define(function() {\n return jBone;\n });\n}\n\nif (typeof win === \"object\" && typeof win.document === \"object\") {\n win.jBone = ...
javascript
chosen
[ { "from": "system", "value": "Update user schema to take auth0_id" }, { "from": "human", "value": "exports.up = function(knex) {\n return knex.schema.createTable('users', table => {\n table.increments().primary();\n table.timestamps();\n table.string('name');\n });\n};\n\nexports.down...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix middleware check for admin commands\n" }, { "from": "human", "value": "const chalk = require('chalk')\nconst logger = require('winston')\n\nconst { Permitter } = require('../core')\n\nmodule.exports = {\n priority: 100,\n process: container => {\n con...
javascript
chosen
[ { "from": "system", "value": "Stop adding data-ember-extension to body\n" }, { "from": "human", "value": "(function() {\n\n \"use strict\";\n\n window.addEventListener('message', function(event) {\n if (event.data === 'debugger-client') {\n var port = event.ports[0];\n listenToPor...
javascript
chosen
[ { "from": "system", "value": "Convert spaces to U+3000 (ideographic space)" }, { "from": "human", "value": "module.exports = {\n commands: {\n fullwidth: {\n help: 'Creates an aesthetic',\n aliases: [ 'vw', 'fw' ],\n command: function (bot, msg) {\n let codePoints = Arr...
javascript
chosen
[ { "from": "system", "value": "Switch source order for `styleguide.css`" }, { "from": "human", "value": "import React from 'react'\nimport primerStyles from '!!raw-loader!postcss-loader!../../../../../src/index.scss'\n\nfunction LivePreviewWrapper({children}) {\n return (\n <>\n <style>{...
javascript
chosen
[ { "from": "system", "value": "Remove GA event from CV\n" }, { "from": "human", "value": "$(document).ready(function () {\n\n // Send GA event when user scrolls to the bottom of the page, which we interpret as them reading the content\n // on the page.\n (function(){\n var trigger...
javascript
chosen
[ { "from": "system", "value": "Replace header dashboard links with new post button\n" }, { "from": "human", "value": "import React from 'react';\nimport { Link } from 'react-router';\n\nclass HeaderDashboard extends React.Component {\n shouldComponentUpdate(nextProps, nextState, nextContext) {\n...
javascript
chosen
[ { "from": "system", "value": "Revert to simple tokens for front-matter multiplex\n" }, { "from": "human", "value": "import CodeMirror from \"codemirror\"\nimport _ from \"underscore\"\n\nrequire(\"codemirror/addon/mode/multiplex\")\nrequire(\"codemirror/addon/edit/trailingspace\")\n\n// Load mod...
javascript
chosen
[ { "from": "system", "value": "Change conn str to use mongolab db\n" }, { "from": "human", "value": "var path = require('path');\nvar rootPath = path.normalize(__dirname + '/../');\n\nmodule.exports = {\n development: {\n rootPath: rootPath,\n dbConn: 'mongodb://localhost:27017/f...
javascript
chosen
[ { "from": "system", "value": "Fix problem with {property}-changed event\n\nIn polymer 2 the following change was made:\nProperty change notifications (property-changed events) aren't fired when\nthe value changes as a result of a binding from the host\n(see https://polymer-library.polymer-project.org/2.0/do...
javascript
chosen
[ { "from": "system", "value": "Make autopagination functions work for listLineItems and listUpcomingLineItems\n" }, { "from": "human", "value": "'use strict';\n\nconst StripeResource = require('../StripeResource');\nconst stripeMethod = StripeResource.method;\n\nmodule.exports = StripeResource.ex...
javascript
chosen
[ { "from": "system", "value": "Fix property names in example\n\nSome of them were incorrect and others were not very descriptive. This updates the example to match what we have in the README file.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nlet lib = require('../index'),\n Point2...
javascript
chosen
[ { "from": "system", "value": "Fix a typo caused error\n" }, { "from": "human", "value": "'use strict';\nmodule.exports = {\n up: function(queryInterface, Sequelize) {\n return queryInterface.createTable('Users', {\n id: {\n allowNull: false,\n autoIncrement: true,\n ...
javascript
chosen
[ { "from": "system", "value": "Test case can be now given from command line.\n" }, { "from": "human", "value": "\n\nrequire('babel-register');\n\n\nconst RG = require('../client/src/battles');\nconst RGTest = require('../tests/roguetest');\n\nconst fact = new RG.Factory.Base();\n\nconst levels = ...
javascript
chosen
[ { "from": "system", "value": "Use node require over imports to skip the need for babel compiling\n" }, { "from": "human", "value": "'use strict'\n\nconst banner = [\n '/**',\n ' * Sanity role: ROLE_NAME',\n ' * ',\n ' * Sanity plugin loader multi-fulfiller wrapper',\n ' * Imports all fulfil...
javascript
chosen
[ { "from": "system", "value": "Fix focus events for Firefox\n" }, { "from": "human", "value": "define([\n 'libs/bean',\n 'libs/bonzo',\n 'libs/qwery'\n], function(\n bean,\n bonzo,\n qwery\n) {\n\n var defaultValue = bonzo(qwery('.sign-up__input')).attr('value');\n\n retur...
javascript
chosen
[ { "from": "system", "value": "Change drag dataKey to 'text'\n\nBumped into https://github.com/erikras/redux-form/issues/1088 and the solution to stop these errors (and to unbreak drag and drop on IE) is to just change the dataKey to 'text. \r\n\r\nThe [stack overflow question](http://stackoverflow.com/quest...
javascript
chosen
[ { "from": "system", "value": "Patron-client: Add fallback on filter names\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\n\nimport SearchFilter from './SearchFilter'\nimport Labels from '../constants/Labels'\n\nexport default React.createClass({\n propTypes: {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix how markdownOptions are passed to marked\n\nPreviously, the options have been passed as property \"options\" within the actual options object, which is ignored by marked.\r\n\r\nAlso, using the parameter of marked instead of setOptions to avoid global state." }, { "...
javascript
chosen
[ { "from": "system", "value": "Change order of Couch locations\n" }, { "from": "human", "value": "var cradle = require('cradle');\nvar applyDesignDocuments = require('./design-documents');\n\nvar couchLocation = process.env.COUCHDB || process.env.CLOUDANT_URL;\nvar couch = new(cradle.Connection)(...
javascript
chosen
[ { "from": "system", "value": "Make comment and task thread included\n" }, { "from": "human", "value": "import DS from \"ember-data\";\r\n\r\nexport default DS.Model.extend( {\r\n\tbody: DS.attr(\"string\"),\r\n\tsolution: DS.attr(\"string\"),\r\n\tthread: DS.belongsTo(\"thread\", { async: true ...
javascript
chosen
[ { "from": "system", "value": "Trim revision string in version package\n" }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\n\nlet version;\nmodule.exports = () => {\n if (!version) {\n version = `v${require(path.join(process.cwd(), 'package.json')).vers...
javascript
chosen
[ { "from": "system", "value": "Migrate to PhantomJS for testing in travis\n" }, { "from": "human", "value": "// base path, that will be used to resolve files and exclude\nbasePath = '../';\n\n\n// list of files / patterns to load in the browser\nfiles = [\n ANGULAR_SCENARIO,\n ANGULAR_SCENARIO_...
javascript
chosen
[ { "from": "system", "value": "Remove user slice since since not used\n" }, { "from": "human", "value": "import React from \"react\";\nimport { render } from \"react-dom\";\nimport ProjectSamples from \"./components/ProjectSamples\";\nimport { configureStore } from \"@reduxjs/toolkit\";\nimport {...
javascript
chosen
[ { "from": "system", "value": "Allow users to read xeroaccount for booking\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\nvar ObjectId = mongoose.Schema.Types.ObjectId;\nvar Location = require('./location_model');\n\nvar XeroAcco...
javascript
chosen
[ { "from": "system", "value": "Add tooltip mockup and ui component\n" }, { "from": "human", "value": "// @flow\nimport React from 'react';\nimport styled from 'styled-components';\n\n\nconst Wrapper = styled.div`\n position: absolute;\n display: flex;\n flex-direction: column;\n justify-conte...
javascript
chosen
[ { "from": "system", "value": "Use switch-case for handling actions\n" }, { "from": "human", "value": "import { KEYBINDING_UPDATE } from 'core/actions/types';\nimport { defaultCommands } from './defaults';\n\nexport default function keyboardConfigReducer(\n state = defaultCommands,\n action,\n)...
javascript
chosen
[ { "from": "system", "value": "Add stats command to help\n" }, { "from": "human", "value": "const Path = require('path')\n\nconst action = process.argv[2]\nvar args = process.argv.slice(3)\nvar env, bin\n\nswitch (action) {\n case 'build':\n bin = 'webpack'\n env = 'production'\n break\...
javascript
chosen
[ { "from": "system", "value": "Allow adminRole argument; create role if needed\n" }, { "from": "human", "value": "Meteor.methods({\n 'addFirstUserToAdminRole': function () {\n /*\n Look for existing users and set initial user as admin\n */\n\n // Count registered users\n var user...
javascript
chosen
[ { "from": "system", "value": "Fix for pathnames other than \"/\"\n\n" }, { "from": "human", "value": "(function (window) {\n window.__env = window.__env || {};\n if (window.location.port) {\n window.__env.hostUrl = window.location.protocol + '//' + window.location.hostname + ':' + w...
javascript
chosen
[ { "from": "system", "value": "Fix everything breaking when a body is created without an initialSpeed\n" }, { "from": "human", "value": "import Vector from \"./Vector.js\";\nimport * as constants from \"./constants\";\nimport * as pointUtils from \"./pointUtils\";\n\nimport * as movementUtils fro...
javascript
chosen
[ { "from": "system", "value": "Fix active theme selector. Add validation to API.\n\nCloses #3226\n- Remove dependent property from the computed content property\n that is used to build the active theme selector.\n- Add validation to the Settings model so that it rejects\n attempts to set an activeTheme th...
javascript
chosen
[ { "from": "system", "value": "Expand check for empty strings\n" }, { "from": "human", "value": "$(document).ready(function () {\n\t$('textarea').focus();\n\n\t$('form').on('submit', function (event) {\n\t\tevent.preventDefault();\n\n\t\tvar text = $('textarea').val();\n\t\tvar y = 0;\n\n\t\tif (...
javascript
chosen
[ { "from": "system", "value": "Fix error in node definition code\n" }, { "from": "human", "value": "var node = nodeDefinitions(\n function(globalId, ast) {\n var gid = fromGlobalId(globalId);\n var fieldKind = gid.id.match(/^[0-9]+$/) ? 'IntValue' : 'StringValue';\n var ov...
javascript
chosen
[ { "from": "system", "value": "Remove prop-types and create-react-class as externals.\n" }, { "from": "human", "value": "import resolve from 'rollup-plugin-node-resolve';\nimport commonjs from 'rollup-plugin-commonjs';\nimport babel from 'rollup-plugin-babel';\n\nexport default {\n entry: 'src...
javascript
chosen
[ { "from": "system", "value": "Replace accidental _ with space in JSDoc link.\n" }, { "from": "human", "value": "/**\n * This file specifies the database collection and field names.\n */\nexport const COLLECTION_TRIPS = 'trips';\nexport const TRIPS_TITLE = 'title';\nexport const TRIPS_DESCRIPTION...
javascript
chosen
[ { "from": "system", "value": "Update script, hope fixed now\n" }, { "from": "human", "value": "document.getElementById(\"ayuda\").setAttribute(\"aria-current\", \"page\");\n\nfunction prueba() {\n\talert(\"prueba\");\n}\n\nvar aside = document.getElementById(\"complementario\");\nvar button = do...
javascript
chosen
[ { "from": "system", "value": "Modify the imported module filename\n" }, { "from": "human", "value": "import express from 'express';\nimport logger from 'morgan';\nimport validator from 'express-validator';\nimport bodyParser from 'body-parser';\nimport verifyToken from './middlewares/auth';\nimp...
javascript
chosen
[ { "from": "system", "value": "Add a simple getOrCreate() function to MetaUserManager\nand add names to it's anonymous functions\n" }, { "from": "human", "value": "var wompt = require('./includes');\n\nfunction MetaUserManager(){\n\tthis.meta_users = {};\n\tthis.expirer = new wompt.Expirer(this.m...
javascript
chosen
[ { "from": "system", "value": "Test Insertion Sort: Test for sorting in ascending order with equal values\n" }, { "from": "human", "value": "/* eslint-env mocha */\nconst InsertionSort = require('../../../src').Algorithms.Sorting.InsertionSort;\nconst assert = require('assert');\n\ndescribe('Inse...
javascript
chosen
[ { "from": "system", "value": "test: Fix event handler test with callback\n" }, { "from": "human", "value": "/* eslint-env mocha */\n'use strict'\n\nconst chai = require('chai')\nchai.should()\n\nlet result = ''\n\nmodule.exports = function () {\n this.registerHandler('BeforeFeatures', function ...
javascript
chosen
[ { "from": "system", "value": "Refactor Javascript now concepts are understood\n" }, { "from": "human", "value": "var columns = 3\nvar itemPadding = 10\n\nfunction widthGiven(itemCount) {\n return window.innerWidth / Math.min(columns, itemCount) - itemPadding\n}\n\nfunction heightGiven(itemCou...
javascript
chosen
[ { "from": "system", "value": "Update google analytics tracking code\n" }, { "from": "human", "value": " (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\r\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\r\n m=s.getElementsByTagName(...
javascript
chosen
[ { "from": "system", "value": "Add version flag to usage info\n\nCloses #8\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar readJson = require('read-package-json');\nvar minimist = require('minimist');\nvar path = require('path');\nvar url = require('url');\n\nvar shields = require('...
javascript
chosen
[ { "from": "system", "value": "Return error message on HTTP 500\n" }, { "from": "human", "value": "var express = require('express');\n\nmodule.exports = exports = function (options) {\n var BasicAuth = require('./middleware/auth/basic');\n\n var TradesRouter = require('./routers/trades');\n va...
javascript
chosen
[ { "from": "system", "value": "Change Database with a more fitting name\n" }, { "from": "human", "value": "//Dear source-code readers, pay no attention to these global variables\nvar APP_ID = 'YtKfTS2Zo8ELUk63LzB0';\nvar APP_CODE = 'SB1wcsUEGzLA3SRHJJ7CPw';\n\n// Reference to the root of the Fire...
javascript
chosen
[ { "from": "system", "value": "Remove obsolete error handling callback\n" }, { "from": "human", "value": "#!/usr/bin/env node\n/*\n * mochify.js\n *\n * Copyright (c) 2014 Maximilian Antoni <mail@maxantoni.de>\n *\n * @license MIT\n */\n'use strict';\n\nvar mochify = require('../lib/mochify');\nv...
javascript
chosen
[ { "from": "system", "value": "Add Fieldset Text Factory For DSL\n" }, { "from": "human", "value": "import React from \"react\"\nimport Form from \"./components/form.js\"\nimport Input from \"./components/input.js\"\nimport Submit from \"./components/submit.js\"\nimport FormErrorList from \"./com...
javascript
chosen
[ { "from": "system", "value": "Move className onto a div wrapping ion-icon\n\nThis is to avoid overwriting ion-icons own classnames that it sets on itself. Overwriting these causes the icon to become invisible.\n" }, { "from": "human", "value": "// @flow\n\nimport styles from './Icon.css';\n\ntyp...
javascript
chosen
[ { "from": "system", "value": "Implement a better requestAnimationFrame polyfill\n" }, { "from": "human", "value": "require('babel-polyfill');\n\n// jsdom doesn't have support for localStorage at the moment\nglobal.localStorage = require('localStorage');\n\n// Tests should just mock responses for...
javascript
chosen
[ { "from": "system", "value": "Change the class name on the arrival component container\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport moment from 'moment';\nimport stringToHue from 'bus-detective/utils/string-to-hue';\nvar inject = Ember.inject;\n\nexport default Ember.Com...
javascript
chosen
[ { "from": "system", "value": "Add lodash to production build.\n" }, { "from": "human", "value": "/*jshint node:true*/\n/* global require, module */\nvar EmberApp = require('ember-cli/lib/broccoli/ember-app');\n\nmodule.exports = function(defaults) {\n var app = new EmberApp(defaults, {\n // ...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded requires from FeaturePathExpander\n" }, { "from": "human", "value": "var fs = require('fs');\nvar glob = require('glob');\nvar _ = require('underscore');\n\nvar FeaturePathExpander = {\n expandPaths: function expandPaths(paths) {\n var Cucum...
javascript
chosen
[ { "from": "system", "value": "Add check for existing /todo folder in path\n" }, { "from": "human", "value": "const chalk = require('chalk');\nconst fs = require('fs');\nconst path = require('path');\nconst tilde = require('tilde-expansion');\nconst shell = require('shelljs');\nconst appRootDir =...
javascript
chosen
[ { "from": "system", "value": "Make typeahead sort-- promoting identical matches, or just naturally.\n" }, { "from": "human", "value": "$( document ).ready(function() {\r\n\tvar typer = $('.typeahead');\r\n\r\n\tvar genders = new Bloodhound({\r\n\t\tdatumTokenizer: Bloodhound.tokenizers.whitespac...
javascript
chosen
[ { "from": "system", "value": "Handle paged requests differently than get-all requests\n" }, { "from": "human", "value": "import Post from 'src/models/PostModel';\nimport { buildGalleryPost } from 'src/server/modules/build';\n\nexport default (req, res, next) => {\n Post.paginate({}, {\n page...
javascript
chosen
[ { "from": "system", "value": "Update withMultipleDates HOC example usage" }, { "from": "human", "value": "import React from 'react';\nimport {render} from 'react-dom';\nimport InfiniteCalendar, {\n Calendar,\n defaultMultipleDateInterpolation,\n withMultipleDates,\n} from 'react-infinite-cale...
javascript
chosen
[ { "from": "system", "value": "Update login component test e2e" }, { "from": "human", "value": "describe('Login', function () {\n\tbeforeEach(function () {\n\t\tbrowser.get('/login');\n\t});\n\n\tit('should have <my-login>', function () {\n\t\tvar login = element(by.css('my-app my-login'));\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Allow storage module to be set explicitly\n\nRather than just by name\n" }, { "from": "human", "value": "/**\n * Copyright 2013 IBM Corp.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance wit...
javascript
chosen
[ { "from": "system", "value": "Fix typo in help text\n" }, { "from": "human", "value": "const messageHelpers = require('../lib/message_helpers');\n\nconst handler = async function(message) {\n const args = message.content.split(' ').slice(1);\n\n // the first argument is non-optional, fail if n...
javascript
chosen
[ { "from": "system", "value": ":bug: Remove login redirect for APIs\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @fileoverview Login check middleware\n */\nconst config = require('config');\n\n/*\n * Check authenticated status. Redirect to login page\n *\n * @param {object} req Exp...
javascript
chosen
[ { "from": "system", "value": "Apply total length of RFC-2821\n" }, { "from": "human", "value": "\"use strict\";\n\nvar tester = /^[-!#$%&'*+\\/0-9=?A-Z^_a-z`{|}~](\\.?[-!#$%&'*+\\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\\.?[a-zA-Z0-9])*\\.[a-zA-Z](-?[a-zA-Z0-9])+$/;\n// Thanks to:\n// http://fighti...
javascript
chosen
[ { "from": "system", "value": "Return the created proxy instead of assigning it to a var p\n" }, { "from": "human", "value": "var Database = require('./lib/database')\nvar mongodb = require('mongodb')\n\nmodule.exports = function (connString, cols, options) {\n var db = new Database(connString, ...
javascript
chosen
[ { "from": "system", "value": "Update octal literal to hex\n\nStrict mode in later versions of node caused programs that use this to crash due to the octal literal with\n\n```\ndiffie-hellman-explained/node_modules/cli-clear/index.js:26\n\tstdout += \"\\033[0f\";\n\t ^^\nSyntaxError: Octal literal...
javascript
chosen
[ { "from": "system", "value": "Use `json` option in `got`\n" }, { "from": "human", "value": "'use strict';\nvar condenseKeys = require('condense-keys');\nvar got = require('got');\n\nmodule.exports = function (buf, cb) {\n\tgot.post('https://api.imgur.com/3/image', {\n\t\theaders: {authorization:...
javascript
chosen
[ { "from": "system", "value": "Use a safer test for isExpression\n\nIt is now safe to use `isConstant` on un-trusted input, but it is still\nnot safe to use `toConstant` on un-trusted input.\n" }, { "from": "human", "value": "'use strict'\n\nvar detect = require('acorn-globals');\n\nvar lastSRC =...
javascript
chosen
[ { "from": "system", "value": "Add calls to domains get functionality\n" }, { "from": "human", "value": "var digio_api = require('../digio-api')\n, config = require('./config')\n\n\nvar api = new digio_api(config.token)\n\n// api.droplets.list_droplets(function (err, data) {\n// console.log(dat...
javascript
chosen
[ { "from": "system", "value": "Add safeguard for nested addons && fix import path\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-cli-moment-range',\n\n included: function () {\n this._super.included.apply(this, arguments);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Set mapping to standard for gamepad object.\n" }, { "from": "human", "value": "export default class {\n constructor (win, keys) {\n this.keys = keys\n this.win = win\n this.id = 'keypad'\n\n this.buttons = []\n for (var key in this.keys) {\n thi...
javascript
chosen
[ { "from": "system", "value": "Use regex search for format type\n" }, { "from": "human", "value": "module.exports = isbnValidator;\n\nfunction isbnValidator(isbnCode){\n\n var self = this;\n\n if (typeof(isbnCode) !== \"string\") return false;\n\n self.replaceDashes = function format(sequence)...
javascript
chosen
[ { "from": "system", "value": "Fix \"isWindows is not a function\" on electron\n\nFix \"isWindows is not a function\" on electron" }, { "from": "human", "value": "/*!\n * global-prefix <https://github.com/jonschlinkert/global-prefix>\n *\n * Copyright (c) 2015 Jon Schlinkert.\n * Licensed under t...
javascript
chosen
[ { "from": "system", "value": "Add development mode for live-reload on develop\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-l10n',\n\n included: function(app) {\n // @see: https://github.com/ember-cli/ember-cli/issues/3718\n ...
javascript
chosen
[ { "from": "system", "value": "Add default API version to client.\n" }, { "from": "human", "value": "/**\n * index.js\n * Client entry point.\n *\n * @author Francis Brito <fr.br94@gmail.com>\n * @license MIT\n */\n'use strict';\n\n/**\n * Client\n * Provides methods to access PrintHouse's API.\n...
javascript
chosen
[ { "from": "system", "value": "Fix variable name, add comment\n" }, { "from": "human", "value": "/* @flow */\n\ntype GiftCategory =\n 'Electronics' |\n 'Games' |\n 'Home Decoration';\n\ntype GiftWish = string | Array<GiftCategory>;\n\ntype User = {\n firstName: string,\n lastName?: string,\n...
javascript
chosen
[ { "from": "system", "value": "Fix historyIndex to actually get the last command on key-up\n" }, { "from": "human", "value": "var fs = require('fs');\nmodule.exports = function (repl, file) {\n\n try {\n var stat = fs.statSync(file);\n repl.rli.history = fs.readFileSync(file, 'utf-8').spli...
javascript
chosen
[ { "from": "system", "value": "Add the debug module to the entry file\n" }, { "from": "human", "value": "/* Copyright 2013 Twitter, Inc. Licensed under The MIT License. http://opensource.org/licenses/MIT */\n\ndefine(\n\n [\n './lib/advice',\n './lib/component',\n './lib/compose',\n ...
javascript
chosen
[ { "from": "system", "value": "Make example work with rpl\n" }, { "from": "human", "value": "/**\n * Generates a new {@link Point} feature, given coordinates\n * and, optionally, properties.\n *\n * @module turf/point\n * @param {number} longitude - position west to east in decimal degrees\n * @p...
javascript
chosen
[ { "from": "system", "value": "Remove success message, only show error message." }, { "from": "human", "value": "var elixir = require('laravel-elixir');\nvar gulp = require('gulp');\nvar imagemin = require('gulp-imagemin');\nvar pngquant = require('imagemin-pngquant');\nvar notify = require('gulp...
javascript
chosen
[ { "from": "system", "value": "Fix app constructor not being exported\n" }, { "from": "human", "value": "var express = require('express');\nvar serveStatic = require('serve-static');\nvar bodyParser = require('body-parser');\nvar session = require('express-session');\nvar RedisStore = require('co...
javascript
chosen
[ { "from": "system", "value": "Make the minimum width of a task item view 20 pixels wider to fit the discussion view in there comfortably and not have horizontal scrollbars appear\n" }, { "from": "human", "value": "jsio('from shared.javascript import Class')\njsio('import fan.ui.Button')\njsio('i...
javascript
chosen
[ { "from": "system", "value": "Add slave option support to the master-slave inputs JS.\n" }, { "from": "human", "value": "$(document).ready(function () {\n var showSlave = function ($master, showOn) {\n if ($master.is(':checkbox')) {\n return (+$master.is(':checked')).toStrin...
javascript
chosen
[ { "from": "system", "value": "Fix bug where stickybar height was not being adjusted on page resize\n" }, { "from": "human", "value": "export default {\n data () {\n return {\n windowWidth: 0,\n currentBreakpoint: '',\n breakpoints: {\n small: 767, // MUST MATCH VARIABLE...
javascript
chosen
[ { "from": "system", "value": "Statistics: Adjust label angle to 30°\n" }, { "from": "human", "value": "/*globals $, Morris, gettext*/\n$(function () {\n $(\".chart\").css(\"height\", \"250px\");\n new Morris.Area({\n element: 'obd_chart',\n data: JSON.parse($(\"#obd-data\").h...
javascript
chosen
[ { "from": "system", "value": "Use btn-link for send feedback\n" }, { "from": "human", "value": "/** @jsx React.DOM */\n'use strict';\n\nvar React = require('react'),\n ReactIntlMixin = require('react-intl');\n\n\nvar SendFeedbackButton = React.createClass({\n mixins: [ReactIntlMixin],\n propT...
javascript
chosen
[ { "from": "system", "value": "Enable debug mode with CLI option\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst flos = require('../lib/api');\nconst FlosRunner = flos.Runner;\n\n// load config\nconst config = {};\n// load linters\nconst linters = [];\n// create runner\nconst runn...
javascript
chosen
[ { "from": "system", "value": "Add e2e test for toggling settings panel.\n" }, { "from": "human", "value": "'use strict';\n\ndescribe('pattyApp', function() {\n\n beforeEach(function() {\n browser.get('index.html');\n });\n\n it('should have patty title', function() {\n expect(browser.ge...
javascript
chosen
[ { "from": "system", "value": "Repair - Fixed up SASS compilation.\n" }, { "from": "human", "value": "module.exports = function(grunt){\n grunt.config('sass', {\n sass: {\n options: {\n sourceMap: 'true'\n }, //options\n dist: {\n files: {\n 'dist/css/mai...
javascript
chosen
[ { "from": "system", "value": "Add player and enable physics\n" }, { "from": "human", "value": "/*\n * game.js\n * All of the magic happens here\n */\n\nYINS.Game = function(game) {\n\tthis.music;\n};\n\nYINS.Game.prototype = {\n\n\tcreate: function() {\n\n\t\t/* TODO: transition smoothly f...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix test case in react 15\n" }, { "from": "human", "value": "import React from 'react';\n\nlet Trigger; // eslint-disable-line\n\nif (process.env.REACT === '15') {\n const ActualTrigger = require.requireActual('rc-trigger');\n const { render } = ActualTrigge...
javascript
chosen
[ { "from": "system", "value": "Add change of tab color on click to schedule\n" }, { "from": "human", "value": "function openCourse(Course) {\n var i, x;\n x = document.getElementsByClassName(\"schedule\");\n for(i=0;i<x.length;i++){\n x[i].style.display = 'none';\n }\n docum...
javascript
chosen
[ { "from": "system", "value": "Fix crash when user has no presets loaded.\n" }, { "from": "human", "value": "var exportGeoJson = require('osm-p2p-geojson')\nvar pump = require('pump')\nvar defork = require('osm-p2p-defork')\nvar collect = require('collect-transform-stream')\n\nvar userConfig = re...
javascript
chosen
[ { "from": "system", "value": "Remove the name input after you use it\n" }, { "from": "human", "value": "/*\n * Author: Jerome Renaux\n * E-mail: jerome.renaux@gmail.com\n */\n\nvar Game = {};\n\nGame.init = function(){\n game.stage.disableVisibilityChange = true;\n};\n\nGame.preload = functio...
javascript
chosen
[ { "from": "system", "value": "Split out the different headers into their own methods for greater flexibility.\n" }, { "from": "human", "value": "function parseQString(qString) {\n var d = /^\\s*q=([01](?:\\.\\d+))\\s*$/.exec(qString);\n if (!!d) {\n return 1;\n }\n return Numb...
javascript
chosen