conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add buttons to li's and add functionality for delte button.\n" }, { "from": "human", "value": "// create a function that stores added title and body, function that makes dynamic element ('li' li's need to have a h1, p , [delete, uipvote, downvote] buttons, quality)\...
javascript
chosen
[ { "from": "system", "value": "[Eigen] Add alternative site assocation path.\n" }, { "from": "human", "value": "var artsyEigenWebAssociation = require('artsy-eigen-web-association');\nvar express = require('express');\nvar https = require('https');\nvar http = require('http');\nvar morgan = requi...
javascript
chosen
[ { "from": "system", "value": "Change method of www redirect\n" }, { "from": "human", "value": "var express = require('express');\nvar compression = require('compression');\nvar app = express();\napp.use(compression());\napp.use(express.static(__dirname + '/public'));\n\nfunction wwwRedirect(req,...
javascript
chosen
[ { "from": "system", "value": "Fix chrome args breaking tests.\n" }, { "from": "human", "value": "module.exports = {\n test_page: 'tests/index.html?hidepassed',\n disable_watching: true,\n launch_in_ci: [\n 'Chrome'\n ],\n launch_in_dev: [\n 'Chrome'\n ],\n browser_args: {\n Chrom...
javascript
chosen
[ { "from": "system", "value": "Add cyrillic symbols support in mention regexp" }, { "from": "human", "value": "// common chinese symbols: \\u4e00-\\u9eff - http://stackoverflow.com/a/1366113/837709\n// hiragana (japanese): \\u3040-\\u309F - https://gist.github.com/ryanmcgrath/982242#file-japanese...
javascript
chosen
[ { "from": "system", "value": "Add blank page following last page\n" }, { "from": "human", "value": "import hummus from 'hummus'\n\nexport default function (path, res) {\n // create a PDF parser\n const parser = hummus.createReader(path)\n\n // create array to hold dimensions\n const boxes = ...
javascript
chosen
[ { "from": "system", "value": "Speed up webpack bundle builds\n\nThis is the equivalent of:\n\nhttps://github.com/facebook/relay/commit/f7f6c100b98450b9587a2bbf3fdaf21c78b024cc\n\nSpeeds up the first-build from 12s to 4s on my machine.\n" }, { "from": "human", "value": "import express from 'expre...
javascript
chosen
[ { "from": "system", "value": "Add development config for express\n" }, { "from": "human", "value": "\"use strict\";\n\nvar config = require('./config'),\n\nexpress = require('express'),\nthunkify = require('co-express'),\nengine = require('express-hbs'),\n\napp = thunkify(express()),\n\nmongo = ...
javascript
chosen
[ { "from": "system", "value": "Allow setting PORT and HOST from environment\n" }, { "from": "human", "value": "const express = require('express')\nconst next = require('next')\nconst { join } = require('path')\n\nconst dev = process.env.NODE_ENV !== 'production'\nconst app = next({ dev })\nconst ...
javascript
chosen
[ { "from": "system", "value": "Update js display of treatment text\n" }, { "from": "human", "value": "'use strict';\n\nvar SingleTreatment = module.exports.SingleTreatment = function(treatment) {\n var treatmentText = '';\n\n if (treatment.concentration) {\n treatmentText += treatmen...
javascript
chosen
[ { "from": "system", "value": "Use spree/spree source for spec\n" }, { "from": "human", "value": "import * as React from 'react'\nimport { RedocStandalone } from 'redoc'\n\nimport Layout from '../../components/Layout'\n\nconst IndexPage = () => (\n <Layout activeRootSection=\"api/v2\">\n <Red...
javascript
chosen
[ { "from": "system", "value": "Remove kerning adjustment from blank lines\n" }, { "from": "human", "value": "var escape = require('escape-latex');\nvar quotes = require('../replace-quotes');\n\nvar preprocess = function(input) {\n return escape(quotes(input));\n};\n\nvar blankLine = (\n '{\\\\l...
javascript
chosen
[ { "from": "system", "value": "Set msvs_version to 2019 when rebuilding\n\nChange-type: patch\n" }, { "from": "human", "value": "'use strict'\n\nconst cp = require('child_process');\nconst rimraf = require('rimraf');\nconst process = require('process');\n\n// Rebuild native modules for ia32 and r...
javascript
chosen
[ { "from": "system", "value": "Check if installs or starcount is undefined\n" }, { "from": "human", "value": "function calcWidth(name) {\n return 250 + name.length * 6.305555555555555;\n}\n\nWebApp.connectHandlers.use(\"/package\", function(request, response) {\n var url = `https://atmospherejs...
javascript
chosen
[ { "from": "system", "value": "Support arriving from other pages, fix from @noahm!" }, { "from": "human", "value": "// ==UserScript==\n// @name Github: Back button's back, all right!\n// @namespace http://github.com/carols10cents/github-back-button\n// @description Restores the functiona...
javascript
chosen
[ { "from": "system", "value": "Change == to === to suit best practices\n" }, { "from": "human", "value": "let map;\nlet service;\n\nconst MTV = new google.maps.LatLng(37.3861,122.0839);\n\n/**\n * Inits map and calls a nearby search of prominent restaurants in 5000m \n * radius of MTV\n */\nfunct...
javascript
chosen
[ { "from": "system", "value": "Add service and description to detailed parsed by aliss\n" }, { "from": "human", "value": "const parse = json => {\n if(!json.results){\n return [];\n }\n\n return json.results.map(item => {\n return {\n title: item.title,\n ...
javascript
chosen
[ { "from": "system", "value": "Remove extra wait time in set volume" }, { "from": "human", "value": "const Effect = require('./Effect');\n\n/**\n * Affect the volume of an effect chain.\n */\nclass VolumeEffect extends Effect {\n /**\n * Default value to set the Effect to when constructed ...
javascript
chosen
[ { "from": "system", "value": "Fix info button on Android\n" }, { "from": "human", "value": "// @flow\nimport React, { Component } from 'react';\nimport { StyleSheet, TouchableOpacity } from 'react-native';\nimport type { NavigationScreenProp } from 'react-navigation';\nimport appStyle from '../....
javascript
chosen
[ { "from": "system", "value": "Use baseUrl from protractor config\n\n- Remove duplicate definition of test\nbase url in e2e tests by using the one\ndefined in the protractor config\n" }, { "from": "human", "value": "var request = require('request')\n\nvar TestEndpointsHelper = function() {\n v...
javascript
chosen
[ { "from": "system", "value": "Fix unused and undefined vars" }, { "from": "human", "value": "var bot = require( 'nodemw' ),\n\treadline = require( 'readline' ),\n\tfs = require( 'fs' ),\n\trl = readline.createInterface( {\n\t\tinput: process.stdin,\n\t\toutput: process.stdout\n\t} ),\n\tclient =...
javascript
chosen
[ { "from": "system", "value": "[TECG-125] Use checkstyle output from jshint reporter\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar jshint = require('gulp-jshint');\nvar csslint = require('gulp-csslint');\n\ngulp.task('lint', ['jshint', 'csslint']);\n\ngulp.t...
javascript
chosen
[ { "from": "system", "value": "Fix label clickability on checkboxes\n" }, { "from": "human", "value": "// @flow\n\nimport React from \"react\";\nimport { List } from \"immutable\";\nimport { ChoiceType } from \"../../../types\";\n\ntype Props = {\n choices: List<ChoiceType>\n};\n\nexport default...
javascript
chosen
[ { "from": "system", "value": "Throw exceptions in dev again\n" }, { "from": "human", "value": "import Raven from 'raven-js';\n\nexport function install() {\n if (process.env.NODE_ENV === 'production') {\n if (process.env.REACT_APP_RAVEN_DSN) {\n Raven.config(process.env.REACT_APP_RAVEN_...
javascript
chosen
[ { "from": "system", "value": "Reset team domain on failure\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport { task } from 'ember-concurrency';\n\nconst { computed } = Ember;\n\nexport default Ember.Component.extend({\n teamDomain: computed('team.domain', function() {\n c...
javascript
chosen
[ { "from": "system", "value": "Hide storage reservation and persistent volume claims\n\nhttps://github.com/rancher/rancher/issues/14859\n" }, { "from": "human", "value": "import { get, set } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport Component from '@ember...
javascript
chosen
[ { "from": "system", "value": "Add a default fixed fee currency\n\nThis prevents an unhandled error when mobile nodes are returned as moderators without a fixedFee object.\n" }, { "from": "human", "value": "import BaseModel from '../BaseModel';\nimport app from '../../app';\nimport { getCurrencyB...
javascript
chosen
[ { "from": "system", "value": "Fix seconds part of play time showing incorrectly in range [59.5, 60.0)\n\nThis effectively rolls back the commit 989d5fb3. Using `round` instead\nof `floor` for the seconds of the playtime wasn't such a great idea\nafter all, because it made the time stamp to show up like \"0:...
javascript
chosen
[ { "from": "system", "value": "Throw error when ThemeCollection does not have theme by that name\n" }, { "from": "human", "value": "pageflow.ThemesCollection = Backbone.Collection.extend({\n model: pageflow.Theme,\n\n findByName: function(name) {\n return this.findWhere({name: name});\n }\n...
javascript
chosen
[ { "from": "system", "value": "Allow comma-separated values for --previewAttr.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/**\n * Parse and insert all log lines in a path.\n */\n\n'use strict';\n\nvar program = require('commander');\n\n// Support all attributes normally defined by ...
javascript
chosen
[ { "from": "system", "value": "Add some defaults for prop types\n" }, { "from": "human", "value": "import {Map} from 'immutable';\n\nexport default function buildProps(propsDefinition, allProps = false) {\n const props = {}\n\n Map(propsDefinition).map((data, prop) => {\n if (data.defaultVal...
javascript
chosen
[ { "from": "system", "value": "Add logout rout logic and 404 catch route.\n" }, { "from": "human", "value": "'use strict';\n\nvar passport = require('passport');\n\nmodule.exports = function (router) {\n\n router.get('/', function (req, res) {\n \n res.render('index');\n \...
javascript
chosen
[ { "from": "system", "value": "Allow presence and iq stanzas in forwards\n" }, { "from": "human", "value": "import { Namespace as NS } from 'xmpp-constants';\n\n\nexport default function (JXT) {\n\n let Forwarded = JXT.define({\n name: 'forwarded',\n namespace: NS.FORWARD_0,\n ...
javascript
chosen
[ { "from": "system", "value": "Add routing for facebook auth\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\nconst passport = require('passport')\nconst FacebookStrategy = require('passport-facebook').Strategy\n\npassport.use(new FacebookSt...
javascript
chosen
[ { "from": "system", "value": "Fix history and scale down not working in production mode\n\nIn dev mode guacamole-client targets localhost:1337 for the backend\nIn production mode guacamole-client targets backend:1337 for the backend\nUpdate isGuacamole policy to take the production setup into account\n" }...
javascript
chosen
[ { "from": "system", "value": "Make right column width flexible\n" }, { "from": "human", "value": "'use strict';\n\nconst CLITable = require('cli-table3');\nconst chalk = require('chalk');\nconst { toUpper } = require('lodash/fp');\n\nconst strapi = require('../../index');\n\nmodule.exports = asy...
javascript
chosen
[ { "from": "system", "value": "Fix minor error with HKID verification\n" }, { "from": "human", "value": "Meteor.methods({\n checkHKID: function (hkid) {\n var hkidPat = /^([A-Z]{1,2})([0-9]{6})([A0-9])$/; // HKID format = 1 or 2 letters followed by 6 numbers and 1 checksum digit.\n ...
javascript
chosen
[ { "from": "system", "value": "Add spec tests for gateway run functions\n" }, { "from": "human", "value": "\"use babel\";\n\nimport gateway from \"../lib/gateway\";\n\ndescribe(\"Gateway\", () => {\n describe(\"packagePath\", () => {\n it(\"returns path of package installation\", () => {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix wrong auto-scrolling when opening the menu.\n\nFixed page scrolling down when main menu is closing.\n\nFixed incorrect logic for scrolling on submenu (\"More\") scrolling.\nJQuery.not() is a filter/selector, not a class detector.\n" }, { "from": "human", "value"...
javascript
chosen
[ { "from": "system", "value": "Make addClass implementation symmetric with removeClass.\n" }, { "from": "human", "value": "var sideshow = function () {\n function hasClass (elem, cls) {\n var names = elem.className.split(\" \");\n for (var i = 0; i < names; i++) {\n if...
javascript
chosen
[ { "from": "system", "value": "Use JavaScript to intercept space bar event." }, { "from": "human", "value": "var Cloudy = {\n isPlayerPage: function() {\n return $(\"#audioplayer\").length == 1;\n },\n\n sendEpisodeToCloudy: function() {\n var episodeTitle = $(\".titlestack...
javascript
chosen
[ { "from": "system", "value": "[api] Allow for optional gzip encoding.\n" }, { "from": "human", "value": "/*\n * tar-stream.js: Checkout adapter for a tar stream.\n *\n * (C) 2012 Bradley Meck.\n * MIT LICENSE\n *\n */\n\nvar tar = require('tar');\n\n//\n// ### function download (source, callback...
javascript
chosen
[ { "from": "system", "value": "Handle error in readdir() callback.\n" }, { "from": "human", "value": "/*jslint node: true, nomen: true, white: true, unparam: true, todo: true*/\n/*!\n * Sitegear3\n * Copyright(c) 2014 Ben New, Sitegear.org\n * MIT Licensed\n */\n\n(function (_, path, fs) {\n\t\"u...
javascript
chosen
[ { "from": "system", "value": "Correct \"Doc test pane\" to \"Dock test pane\"\n\nThis PR so far only changes the string displayed in the UI. The rest of the code still refers to this option as `doccontainer`. Should all these instances also be changed to `dockcontainer`?\r\n\r\nAs an aside, it seems to be c...
javascript
chosen
[ { "from": "system", "value": "Rewrite with using startComet function of plurk modules\n" }, { "from": "human", "value": "var log4js = require('log4js');\nvar PlurkClient = require('plurk').PlurkClient;\nvar nconf = require('nconf');\n\nnconf.file('config', __dirname + '/config/config.json')\n\t....
javascript
chosen
[ { "from": "system", "value": "fix: Support for larger kind of key\n" }, { "from": "human", "value": "import notp from 'notp'\nimport b32 from 'thirty-two'\n\nexport function cleanKey (key) {\n return key.replace(/[^a-z2-7]+/g, '').slice(0, 32)\n}\n\nexport function isValidKey (key) {\n return ...
javascript
chosen
[ { "from": "system", "value": "Add a homefeed_subscriptions database table\n" }, { "from": "human", "value": "export async function up(knex) {\n await knex.schema\n .raw('alter table feeds add column title text')\n .raw('alter table feeds add column ord integer')\n .raw(`alter table fee...
javascript
chosen
[ { "from": "system", "value": "Fix bad error checking - caused name/image/thumbnail to be arrays\n" }, { "from": "human", "value": "module.exports = {\n \"parseResults\": function(result) {\n var xmlItems = result.items && result.items.item;\n var items = [];\n\n if (xmlItems) {\n ...
javascript
chosen
[ { "from": "system", "value": "DoublyLinkedList: Test push to the front of the list\n" }, { "from": "human", "value": "/* eslint-env mocha */\nconst DoublyLinkedList = require('../../src').DataStructures.DoublyLinkedList;\nconst assert = require('assert');\n\ndescribe('DoublyLinkedList', () => {\...
javascript
chosen
[ { "from": "system", "value": "feat: Update Layout assets to latest specifications\n" }, { "from": "human", "value": "'use strict';\n\n/*\n * Use for Async operations before displaying page\n *\nmodule.exports.prepare = function() {\n this.done({});\n};\n */\n\n/*\n * Compute Vue parameters\n *\...
javascript
chosen
[ { "from": "system", "value": "Fix vrt scenario script issue.\n" }, { "from": "human", "value": "/**\n * Site Kit by Google, Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *...
javascript
chosen
[ { "from": "system", "value": "Change umd module name to ko.store.\n" }, { "from": "human", "value": "import babel from 'rollup-plugin-babel';\nimport mergeBaseConfig from './rollup.merge-base-config.js';\n\nconst cjsConfig = {\n format: 'umd',\n moduleName: 'knockoutStore',\n plugins: [...
javascript
chosen
[ { "from": "system", "value": "Make use of chai's lengthOf assertion and simplify test\n" }, { "from": "human", "value": "import React from 'react';\nimport {Segment, Segments} from 'stardust';\n\ndescribe('Segments', () => {\n it('should render children', () => {\n const [segmentOne, segment...
javascript
chosen
[ { "from": "system", "value": "Fix multiline string in pluginContextMenu template\n" }, { "from": "human", "value": "'use strict';\nangular.module('arethusa.contextMenu').directive('pluginContextMenu', function () {\n return {\n restrict: 'E',\n scope: true,\n replace: true,\n link: ...
javascript
chosen
[ { "from": "system", "value": "Add minWidth/Height to Chrome app\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n chrome.app.runtime.onLaunched.addListener(function() {\n chrome.app.window.create('index.html', {\n innerBounds: {\n width: 960,\n height: ...
javascript
chosen
[ { "from": "system", "value": "Fix error with navigating to new page\n" }, { "from": "human", "value": "(function(window){\n\twindow.ITCheck = window.ITCheck || {};\n\n\t// Get things rolling\n\tchrome.alarms.onAlarm.addListener(ITCheck.getUnreadThreadCount);\n\tchrome.runtime.onStartup.addListen...
javascript
chosen
[ { "from": "system", "value": "Add parser options to abuse reports\n" }, { "from": "human", "value": "// Abuse reports\n//\n'use strict';\n\n\nconst Mongoose = require('mongoose');\nconst Schema = Mongoose.Schema;\n\n\nmodule.exports = function (N, collectionName) {\n\n let AbuseReport = new S...
javascript
chosen
[ { "from": "system", "value": "Add flex display to view by default" }, { "from": "human", "value": "import { createComponent } from 'react-fela'\r\n\r\nconst View = props => ({\r\n display: props.hidden && 'none',\r\n zIndex: props.zIndex,\r\n position: 'fixed',\r\n top: 0,\r\n left: 0,\r\n ...
javascript
chosen
[ { "from": "system", "value": "Increase API timeout to 10s\n\nAccomodate slow/whoalaned requests, like the google crawler. It was set\nto 5s previously when we thought that api requests were causing the\nrequest queue to back up, which does not appear to be the case.\n" }, { "from": "human", "val...
javascript
chosen
[ { "from": "system", "value": "Clarify the code a bit\n" }, { "from": "human", "value": "module.exports = function stringReplaceAsync(\n string,\n searchValue,\n replaceValue\n) {\n try {\n if (typeof replaceValue === \"function\") {\n // Step 1: Call native `replace` one time to acqu...
javascript
chosen
[ { "from": "system", "value": "Improve top level class description\n" }, { "from": "human", "value": "// cavy-cli reporter class.\nexport default class CavyReporter {\n // Internal: Creates a websocket connection to the cavy-cli server.\n onStart() {\n const url = 'ws://127.0.0.1:8082/';\n ...
javascript
chosen
[ { "from": "system", "value": "Update driver file for new module interfaces\n" }, { "from": "human", "value": "require('./lib/metro-transit')\n\n// Create the handler that responds to the Alexa Request.\nexports.handler = function (event, context) {\n // Create an instance of the MetroTransit ...
javascript
chosen
[ { "from": "system", "value": "Update Text Component to allow React components to render as child\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport styles from './text_component.module.scss';\n\nfunctio...
javascript
chosen
[ { "from": "system", "value": "Create plain object in toJSON method\n\nStandard deep equality doesn't seem to fail because it doesn't check for\ntypes (i.e. constructor). However, the deep equality that chai uses\ntakes that into account and seems like a good idea to remove the\nprototype in the object to be...
javascript
chosen
[ { "from": "system", "value": "Add shutdown notification and process title\n" }, { "from": "human", "value": "var app = require('./server/routes');\n\nvar server = app.listen(3000, function() {\n console.log('Listening on port %d', server.address().port);\n});\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Fix uBlock Origin breaking flapper by injecting CSS stylesheet\n" }, { "from": "human", "value": "/**\n * Searches the first loaded style sheet for an @keyframes animation by name.\n * FYI: If you use \"to\" or \"from\" they'll get converted to percentage values, so...
javascript
chosen
[ { "from": "system", "value": "Add 'full' option to get all package details not just version number.\n" }, { "from": "human", "value": "'use strict';\n\nconst semver = require('semver');\nconst fetch = require('node-fetch');\nconst url = require('url');\n\nmodule.exports = pkg => {\n if (typeof ...
javascript
chosen
[ { "from": "system", "value": "Update reducto module to work with new config schema.\n" }, { "from": "human", "value": "var _ = require('underscore');\nvar utils = require('./lib/utils');\nvar middleware = require('./lib/middleware');\nvar fixture = require('./lib/fixture');\nvar service = requir...
javascript
chosen
[ { "from": "system", "value": ":art: Move tooltip to only show on hovering info-icon\n" }, { "from": "human", "value": "'use babel'\n\nimport {React} from 'react-for-atom'\n\nexport default React.createClass({\n\n propTypes: {\n readyCount: React.PropTypes.number,\n totalCount: React.PropT...
javascript
chosen
[ { "from": "system", "value": "Handle errors that occure during request" }, { "from": "human", "value": "const request = require('request');\nconst fs = require('fs');\nconst thenify = require('thenify').withCallback;\n\nconst download = (url, file, callback) => {\n const stream = fs.createWrite...
javascript
chosen
[ { "from": "system", "value": "Make it compatible with older node.js" }, { "from": "human", "value": "module.exports = function (protocol) {\n\tprotocol = protocol || 'http';\n\tvar url = 'http://vicopo.selfbuild.fr/search/';\n\tswitch (protocol) {\n\t\tcase 'https':\n\t\t\turl = 'https://www.sel...
javascript
chosen
[ { "from": "system", "value": "Use the native Object.keys if it's available." }, { "from": "human", "value": "\"use strict\";\n\n// modified from https://github.com/es-shims/es6-shim\nvar keys = require('object-keys');\nvar isObject = function (obj) {\n\treturn typeof obj !== 'undefined' && obj !...
javascript
chosen
[ { "from": "system", "value": "Rename option to caseSensitive to avoid double negation\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = {\n rules: {\n \"sort-object-props\": function(context) {\n var ignoreCase = context.options[0].ignoreCase;\n ...
javascript
chosen
[ { "from": "system", "value": "Fix parsing of initState JSON as noticed by @aawc\n" }, { "from": "human", "value": "'use strict';\n\nvar Q = require('q');\nvar request = Q.denodeify(require('request'));\n\nvar chromecastHomeURL = 'https://clients3.google.com/cast/chromecast/home/v/c9541b08';\nvar...
javascript
chosen
[ { "from": "system", "value": "Remove redundant call to getCertificationData()\n\nThis was fetching certificate info from every site twice.\n" }, { "from": "human", "value": "// Enable promise error logging\nrequire('promise/lib/rejection-tracking').enable();\n\nvar express = require('express');\...
javascript
chosen
[ { "from": "system", "value": "Use callbacks to ensure save is completed before returning a result\n" }, { "from": "human", "value": "var express = require(\"express\"),\n mongoose = require(\"mongoose\"),\n app = express();\n\nmongoose.connect(\"mongodb://localhost/test\", function (err) {...
javascript
chosen
[ { "from": "system", "value": "Allow author_id on public API\n" }, { "from": "human", "value": "import BlogPost from '../database/models/blog-post';\nimport log from '../log';\n\nconst PUBLIC_API_ATTRIBUTES = [\n 'id',\n 'title',\n 'link',\n 'description',\n 'date_updated',\n 'date_publishe...
javascript
chosen
[ { "from": "system", "value": "Fix syntax error on previous commit\n" }, { "from": "human", "value": "describe('pingPong', function() {\n it(\"is true for a number that is divisible by 3\", function() {\n expect(pingPong(6)).to.equal(true);\n });\n\n it(\"is true for a number that is divisi...
javascript
chosen
[ { "from": "system", "value": "Copy only the participants list instead of using .extend()\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('Teem')\n .directive('participate', function() {\n return {\n controller: [\n '$scope', '$element', '$attrs', 'SessionSvc', '$...
javascript
chosen
[ { "from": "system", "value": "Fix proxy incorrectly proxying requests for files a level deeper than intended\n" }, { "from": "human", "value": "var path = require('path');\nvar fs = require('fs');\nvar mime = require('mime');\n\nvar pattern = function (file, included) {\n return {pattern: fil...
javascript
chosen
[ { "from": "system", "value": "Save result as array of school name only\n" }, { "from": "human", "value": "var Xray = require('x-ray'),\n fs = require('fs')\n\nvar x = Xray()\n\nvar baseURLPrefix = \"http://www.thaischool.in.th/sitemap.php?school_area=&province_id=\",\n baseURLSuffix = \"&s...
javascript
chosen
[ { "from": "system", "value": "Use jQuery directly instead of $ in plugin\n" }, { "from": "human", "value": "/**\n * Initialize Pattern builder plugin.\n */\n;(function ($) {\n\n var pluginName = 'patternMaker',\n pluginDefaults = {\n palette: []\n };\n\n /**\n ...
javascript
chosen
[ { "from": "system", "value": "Rename browser-sync task to serve.\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar browserSync = require('browser-sync');\n\ngulp.task('browser-sync', function () {\n browserSync({\n server: {\n baseDir: './dist'\n }\...
javascript
chosen
[ { "from": "system", "value": "Add module for conditional content\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n moj.Modules.Conditional = {\n el: '.js-Conditional',\n\n init: function () {\n var _this = this;\n\n this.cacheEls();\n this.bindEvents();...
javascript
chosen
[ { "from": "system", "value": "Fix bugs in redux state of pathname\n\nWe were getting bugs due to the redux state of `general.pathname` set to `undefined` when it shouldn't be as a result of `PAGE_CHANGE` actions with no `action.path` data. This resulted in incorrect API requests and the display of results w...
javascript
chosen
[ { "from": "system", "value": "Use correct file name to require enums.js\n" }, { "from": "human", "value": "var enums = require(\"./enum.js\");\n\ndescribe(\"Enum\", function() {\n it(\"can have symbols with custom properties\", function() {\n var color = new enums.Enum({\n r...
javascript
chosen
[ { "from": "system", "value": "Refactor source to use more ES6 syntax.\n" }, { "from": "human", "value": "var TimeSegments = {\n\n // Segment an array of events by scale\n segment(events, scale, options) {\n scale = scale || 'weeks';\n options = options || {};\n _.defaults(options, {\n...
javascript
chosen
[ { "from": "system", "value": "Fix title of resources without name\n" }, { "from": "human", "value": "export const formatURL = (url) => (\n url.length ? url.replace(/^https?:\\/\\//, '') : ''\n)\n\nexport const getTitle = (data) => (\n data.about && data.about.name\n ? data.about.name\n ...
javascript
chosen
[ { "from": "system", "value": "Fix db ref for SO\n" }, { "from": "human", "value": "export let baseUrl = 'http://rosettastack.com';\nexport let sites = [{\n name: 'Programmers',\n slug: 'programmers',\n seUrl: 'http://programmers.stackexchange.com/',\n langs: ['en', 'fr'],\n db: 'localhost/p...
javascript
chosen
[ { "from": "system", "value": "Update native module to 0.18 style\n" }, { "from": "human", "value": "// make is a function that takes an instance of the\r\n// elm runtime\r\n// returns an object where:\r\n// keys are names to be accessed in pure Elm\r\n// values are either functions or ...
javascript
chosen
[ { "from": "system", "value": "Split up the book detail fetching into smaller chunks\n" }, { "from": "human", "value": "\"use strict\";\n\nvar\n // redis = require(\"redis\"),\n // client = redis.createClient(),\n _ = require(\"underscore\"),\n Fetcher = require(\"l2b-price-f...
javascript
chosen
[ { "from": "system", "value": "Load extensions into express app\n" }, { "from": "human", "value": "'use strict'\n\nlet fs = require('fs')\nlet dotenv = require('dotenv')\nlet express = require('express')\nlet session = require('express-session')\nlet cookieParser = require('cookie-parser')\nlet b...
javascript
chosen
[ { "from": "system", "value": "Add angular brush mode to test\n" }, { "from": "human", "value": "var vows = require('vows'),\n assert = require('assert'),\n events = require('events'),\n load = require('./load'),\n suite = vows.describe('brushModes');\n\nfunction d3Parcoords() {\n va...
javascript
chosen
[ { "from": "system", "value": "UPD: Add 'imply' service-configuration. Increment version number to 0.2.0" }, { "from": "human", "value": "Package.describe({\n summary: \"Login service for VKontakte accounts (https://vk.com)\",\n version: \"0.1.4\",\n git: \"https://github.com/alexpods/me...
javascript
chosen
[ { "from": "system", "value": "Update depedencies and version number\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Reactive bootstrap modals for meteor\",\n version: \"1.0.5\",\n git: \"https://github.com/jchristman/reactive-modal.git\",\n name: \"jchristman:reactive-moda...
javascript
chosen
[ { "from": "system", "value": "Use it instead of test. Small structure change\n" }, { "from": "human", "value": "import { createAuthMiddleware } from '../src'\n\ndescribe('auth middleware', () => {\n const middleware = createAuthMiddleware()\n const nextHandler = middleware({})\n const actionH...
javascript
chosen
[ { "from": "system", "value": "Change default output behaviour to output to STDIO\n" }, { "from": "human", "value": "#!/usr/bin/env nodejs\n\n// Autoformatter for Turing\n\nconst fs = require('fs'),\n argv = require('minimist')(process.argv.slice(2), {boolean:true});\n\nvar files = argv._;\n...
javascript
chosen
[ { "from": "system", "value": "Remove default rendered child element\n" }, { "from": "human", "value": "import React, {PropTypes} from 'react';\nimport ReactDOM from 'react-dom';\n\nclass Portal extends React.Component {\n componentDidMount() {\n this.nodeEl = document.createElement('div');\n...
javascript
chosen
[ { "from": "system", "value": "Remove _onSelect noop from BasePickerView\n" }, { "from": "human", "value": "'use strict';\n\nvar BaseView = require('../base-view');\n\nfunction BasePickerView() {\n BaseView.apply(this, arguments);\n\n this._initialize();\n}\n\nBasePickerView.prototype = Object....
javascript
chosen
[ { "from": "system", "value": "Remove tests around canvas objects\n\n[jsdom doesn’t really handle the canvas element very well](https://github.com/tmpvar/jsdom#canvas). It just treats it just like a div. We can add the canvas package, but that requires a whole slew of other things to do deal with (namely Cai...
javascript
chosen