conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add HeaderArea into HeaderRow storybook subcomponents\n" }, { "from": "human", "value": "import React from 'react';\n\nimport HeaderRow from '@ichef/gypcrete/src/HeaderRow';\nimport Button from '@ichef/gypcrete/src/Button';\nimport TextLabel from '@ichef/gypcrete/sr...
javascript
chosen
[ { "from": "system", "value": "Solve ESLint 80 chars line limit\n" }, { "from": "human", "value": "/**\n * Copyright 2017 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with th...
javascript
chosen
[ { "from": "system", "value": "Create unique export file fro AdminPage section\n" }, { "from": "human", "value": "import React from 'react';\nimport firebase from 'firebase';\n\nclass PageAdmin extends React.Component {\n state = {\n dbval: 'Admin'\n }\n\n componentDidMount() {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix typo in modal (CantMoveAttached) message." }, { "from": "human", "value": "define(function (require) {\n var React = require('react/addons'),\n BootstrapModalMixin = require('components/mixins/BootstrapModalMixin.react');\n \n return React.create...
javascript
chosen
[ { "from": "system", "value": "Fix for passing wrong arguments while calling fork function\n\nOptions should be passed as third parameter\r\nref: https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options" }, { "from": "human", "value": "const { fork } = require('child_pro...
javascript
chosen
[ { "from": "system", "value": "Add scheme validation for bookmarks\n" }, { "from": "human", "value": "// Helpers for handling URLs\nexport function encodeUrl(url) {\n return encodeURI(url);\n}\n\nexport function decodeUrl(url) {\n return decodeURI(url);\n}\n\nexport function parseUrl(url) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add tests for debounce immediate call\n" }, { "from": "human", "value": "describe('Service: debounce', function () {\n\n beforeEach(module('ngNephila.services.debounce'));\n\n var debounce, $timeout;\n\n beforeEach(inject(function (_debounce_, _$timeout_) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use change instead of propertychange\n\nBecause IE.\nhttp://stackoverflow.com/questions/11338592\n" }, { "from": "human", "value": "(function ($) {\n\nvar showCharacterCount = function ($counter, $source) {\n\tvar text = $source.val();\n\tvar length = text ? text.le...
javascript
chosen
[ { "from": "system", "value": "Add a test for HTML entities for goog.dom.textassert, and verify the thrown values in those tests.\n\n(This was inspired by investigating the assertion code after having missed some HTML entities in cl/186648009. The assertion is working fine.)\n\nRELNOTES: n/a\n\n-------------...
javascript
chosen
[ { "from": "system", "value": "Use async await on test\n" }, { "from": "human", "value": "import createCredentialsAuthenticator from '../../src/authenticators/credentials'\n\nbeforeEach(() => {\n fetch.resetMocks()\n})\n\nit('fetches from given endpoint using default config', () => {\n fetch.mo...
javascript
chosen
[ { "from": "system", "value": "Set ALEX textlint rule to warning\n\nPreviously, failures in the ALEX textlint rule would cause failures in\nCI. Now we still receive warnings for things ALEX finds, but builds\npass.\n\nSigned-off-by: Matt Langbehn <be4a68432fbbc874fc2f26c6bc5da2cd4d88fc13@gmail.com>\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Remove past status to pastSession\n" }, { "from": "human", "value": "Template.pastSessions.helpers({\n kSessions: function () {\n return KSessions.find({statut: \"past\"}, {sort: {i: -1}});\n }\n});\n" }, { "from": "gpt", "value": "Template.pastSess...
javascript
chosen
[ { "from": "system", "value": "Update unit test for newer thehelp-test" }, { "from": "human", "value": "\n'use strict';\n\nvar test = require('thehelp-test');\nvar index = require('../../../src/server/index');\n\ndescribe('thehelp-cluster', function() {\n\n it('works!', function() {\n /*jshin...
javascript
chosen
[ { "from": "system", "value": "Write proper tests for Router\n" }, { "from": "human", "value": "'use strict';\n\njest.dontMock(appFile('actions/router'));\njest.dontMock('url');\n\nconst Router = require(appFile('actions/router'));\n\ndescribe('Router', () => {\n it('instantiates a Router', () =...
javascript
chosen
[ { "from": "system", "value": "Convert double to single quotes\n" }, { "from": "human", "value": "\"use strict\";\n\nvar Redis = require('ioredis');\n\nvar start = new Date();\n\n// I can't get to 1,000,000 commands in one pipeline, not even to 120,000, because ioredis would just hang.\n// Theref...
javascript
chosen
[ { "from": "system", "value": "Fix to match intended ini structure\n" }, { "from": "human", "value": "function date_default_timezone_get () {\n // http://kevin.vanzonneveld.net\n // + original by: Brett Zamir\n // - depends on: timezone_abbreviations_list\n // % note 1: Us...
javascript
chosen
[ { "from": "system", "value": "Debug tied to node env\n\n" }, { "from": "human", "value": "import i18n from 'i18next';\nimport Backend from 'i18next-xhr-backend';\nimport LanguageDetector from 'i18next-browser-languagedetector';\nimport { reactI18nextModule } from 'react-i18next';\n\ni18n\n .use...
javascript
chosen
[ { "from": "system", "value": "Add e2e-Test for login modal.\n" }, { "from": "human", "value": "/*\n * In order to prevent errors caused by e2e tests running too fast you can slow them down by calling the following\n * function. Use higher values for slower tests.\n *\n * utils.delayPromises(50);...
javascript
chosen
[ { "from": "system", "value": "Revert \"added accessor for getting marker ID\"\n\nThis reverts commit b01cfd334df3d4e76e817dc29825f3ec100c9ba3.\n" }, { "from": "human", "value": "L.SmoothMarkerTransition = L.Marker.extend({\n options: {\n traverseTime: 1000,\n clickable: false,\n marker...
javascript
chosen
[ { "from": "system", "value": "Fix todo: constructor will now complain if not called with new keyword.\n" }, { "from": "human", "value": "var GreyTab = window.GreyTab || {};\nGreyTab.model = GreyTab.model || {};\n\nGreyTab.model.SObject = function(){\n //TODO: validate being called with new\n\...
javascript
chosen
[ { "from": "system", "value": "Use injector to do angular config function.\n" }, { "from": "human", "value": "export default function Theming($mdThemingProvider) {\n $mdThemingProvider.theme('default')\n .primaryPalette('pink')\n .accentPalette('orange');\n};\n" }, { "from": "gpt",...
javascript
chosen
[ { "from": "system", "value": "Change delay from 100 ms to 300 ms\n" }, { "from": "human", "value": "'use strict';\n\nvar timeoutID;\nvar needShow = false;\n\nfunction showAjaxIndicator() {\n\tneedShow = true;\n timeoutID = window.setTimeout(function () {\n if (needShow) $('#${component...
javascript
chosen
[ { "from": "system", "value": "Add compressed code for production use\n" }, { "from": "human", "value": "!function(o){var e=window.Vue;if(!e)throw new Error(\"Please load vue.js before install current plugin\");var n={};n.install=function(o,e){o.directive(\"scroll\",{bind:function(){console.log(\...
javascript
chosen
[ { "from": "system", "value": "Test for more default attributes, bag URL and ID attribute.\n" }, { "from": "human", "value": "describe('Tiddler Model Tests', function () {\n\n it('should be created with the correct default attributes set', function () {\n var mockStatus = {\n ...
javascript
chosen
[ { "from": "system", "value": "Improve chat autoscroll. When a new message arrives, don't scroll if user scrolled up his page more than 1/2 of his basic page height\n" }, { "from": "human", "value": "Hummingbird.ChatView = Ember.View.extend({\n scrollToBottom: function() {\n var chatItems = t...
javascript
chosen
[ { "from": "system", "value": "Add <yo-rc.json> to <configuring> priority\n" }, { "from": "human", "value": "'use strict';\nvar yeoman = require('yeoman-generator');\nvar chalk = require('chalk');\nvar yosay = require('yosay');\n\nmodule.exports = yeoman.generators.Base.extend({\n prompting: fun...
javascript
chosen
[ { "from": "system", "value": "Change yosay end message color\n" }, { "from": "human", "value": "var generators = require('yeoman-generator');\nvar inquirer = require(\"inquirer\");\nvar chalk = require('chalk');\nvar yosay = require('yosay');\n\nmodule.exports = generators.Base.extend({\n\n\tini...
javascript
chosen
[ { "from": "system", "value": "Add all available servers to status\n" }, { "from": "human", "value": "'use strict';\n\nconst has = require('has');\n\nfunction collectPoolStatus(stats, { type, host, pool }) {\n const poolStats = [\n ['_allConnections', 'open'],\n ['_freeConnection...
javascript
chosen
[ { "from": "system", "value": "Add More Director Route Testing\n" }, { "from": "human", "value": "import supertest from \"supertest\";\nimport app from \"../../app.js\";\n\nconst request = supertest(app);\n\ndescribe(\"Routes: Director\", () => {\n it(\"GET /director\", done => {\n requ...
javascript
chosen
[ { "from": "system", "value": "Refactor unit test to support bridging\n" }, { "from": "human", "value": "/*jshint expr: true*/\nlet expect = require('chai').expect;\nlet LocalQuery = require('../../lib/providers/query/localquery');\n\n// this must be moved to use the factory, else bridge is not p...
javascript
chosen
[ { "from": "system", "value": "Add milkbottle animation to assets\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/javascri...
javascript
chosen
[ { "from": "system", "value": "Fix Authenticatable mixing using wrong protocol value\n" }, { "from": "human", "value": "'use strict';\n\nvar request = require('../request')\n ;\n\nvar token = {};\n\nvar Authenticatable = {\n token: {\n get: function () {\n return token;\n }\n },\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix form validation with editing form (values already here)\n" }, { "from": "human", "value": "// Pay - /app/public/factories/formValidator.js\n\n// Form Validator resource\n\n'use strict';\n\npay.factory('FormValidator', [function () {\n return function (form, i...
javascript
chosen
[ { "from": "system", "value": "Fix 12PM/AM displaying as 00\n" }, { "from": "human", "value": "import React from 'react';\n\n\nvar Time = (props) => {\n let time = props.time;\n\n let hour = time.hour;\n\n if (!props.hourFormat24 && time.pm) {\n let pad = function (n) {\n ...
javascript
chosen
[ { "from": "system", "value": "Test HTML mapping works for nested innerHTML.\n" }, { "from": "human", "value": "import {enableTracing, disableTracing} from \"./tracing/tracing\"\nimport getRootOriginAtChar from \"./getRootOriginAtChar\"\n\nimport {disableProcessHTMLOnInitialLoad} from \"./tracing...
javascript
chosen
[ { "from": "system", "value": "Set unsecure url for mockup\n" }, { "from": "human", "value": "Droplet.define('gallery', ['item'], function(){\n\t\n\tvar self = this;\n\n\tself.on('load', function(){\n\t\tself.$droplet.on('click', '.item', function(){\n\t\t\t$(this).toggleClass('selected');\n\t\t}...
javascript
chosen
[ { "from": "system", "value": "Change loader back to esnextreact until node-build lands node 6\n" }, { "from": "human", "value": "module.exports = [{\n name: 'apiClient',\n webpack: {\n entry: {\n apiClient: './index.es6.js',\n },\n output: {\n library: '[name].js',\n li...
javascript
chosen
[ { "from": "system", "value": "Update shaders when item data is stale\n" }, { "from": "human", "value": "const i = require('itemDataRefresher.js');\n\nfateBus.subscribe(module, 'fate.configurationLoaded', function(topic, configuration) {\n new i.ItemDataRefresher('shader', configuration.shaderDa...
javascript
chosen
[ { "from": "system", "value": "chore(release): Update artifact tagging script to widen @uirouter/core dependency before pushing\n" }, { "from": "human", "value": "#!env node\n\"use strict\";\n\nlet version = require('../package.json').version;\n\nrequire('shelljs/global');\nlet readlineSync = req...
javascript
chosen
[ { "from": "system", "value": "Enable markdown on message history\n" }, { "from": "human", "value": "import React from 'react';\nimport { FormattedRelative } from 'react-intl';\nimport Avatar from '../widgets/Avatar';\n\nfunction Message(props) {\n const { model } = props;\n const sentAt = mode...
javascript
chosen
[ { "from": "system", "value": "Make more sane default Microservice return vaues\n" }, { "from": "human", "value": "function new_microservice(args) {\n/*\nbase_component_id(\"new_microservice\")\ndisplay_name(\"New microservice\")\nonly_run_on_server(true)\nvisibility(\"PRIVATE\")\nrest_api(\"chan...
javascript
chosen
[ { "from": "system", "value": "Add proptype validation to CampaignTable component\n" }, { "from": "human", "value": "import React from 'react';\n\nimport Table from '../Table';\n\nclass CampaignTable extends React.Component {\n render() {\n const cause = this.props.cause;\n const campaigns...
javascript
chosen
[ { "from": "system", "value": "Set up token for user on sign up\n" }, { "from": "human", "value": "import bcrypt from 'bcrypt';\nimport model from '../models';\n\nconst User = model.User;\n\nmodule.exports = {\n create(req, res) {\n const username = req.body.username;\n const email = req.b...
javascript
chosen
[ { "from": "system", "value": "Handle un-loaded images when setting width\n" }, { "from": "human", "value": "!(function () {\n 'use strict'\n\n // Increase width of images on large screens\n var images = document.querySelectorAll('.post__body p > img')\n for (var i = 0; i < images.length; i++...
javascript
chosen
[ { "from": "system", "value": "Make tether-to-selection use fixed positioning relative to selection\n\nChanges `{{tether-to-selection}}` to:\n * use \"position: fixed\". Avoids issues when the editor is in an\n absolutely-positioned div\n * (bugfix) Do not position relative to \".mobiledoc-editor\". Thi...
javascript
chosen
[ { "from": "system", "value": "refactor(AirtableSerializer): Use Ember.Inflector to pluralize modelName\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport DS from 'ember-data';\n\nexport default DS.RESTSerializer.extend({\n normalizeResponse(store, type, payload) {\n const ...
javascript
chosen
[ { "from": "system", "value": "feat: Add more arrow function test cases\n" }, { "from": "human", "value": "describe(\"About Functions\", function () {\n\n describe(\"Default Parameters\", function () {\n\n it(\"should understand default parameters basic usage\", function () {\n\n functio...
javascript
chosen
[ { "from": "system", "value": "Fix port and config references\n" }, { "from": "human", "value": "'use strict';\n\nconst express = require('express');\nconst MsgQueueClient = require('msgqueue-client');\n\nconst config = require('./config.js');\n\nconst app = express();\nconst mQ = new MsgQueueCli...
javascript
chosen
[ { "from": "system", "value": "Fix the order of Session model behaviors.\n" }, { "from": "human", "value": "/* global window */\nimport feathersClient from './feathers-client';\nimport feathersSession from 'can-connect-feathers/session';\nimport connect from 'can-connect';\nimport dataParse from ...
javascript
chosen
[ { "from": "system", "value": "Save data when clicking to save button\n" }, { "from": "human", "value": "\ndefine([\n\t'marionette',\n\t'app',\n\t'text!module/account/template/modifyAccount.html'\n], function(Marionette, App, ModifyAccountTemplate)\n{\n\tvar ModifyAccountView = Marionette.ItemVie...
javascript
chosen
[ { "from": "system", "value": ":new: Add attached attribute to BottomTab\n" }, { "from": "human", "value": "'use strict';\n\nclass BottomTab extends HTMLElement{\n prepare(Name){\n this.Name = Name\n return this\n }\n attachedCallback() {\n this.active = false\n this.classList.add(...
javascript
chosen
[ { "from": "system", "value": "Remove the hard coded process name now that the process name has been set.\n" }, { "from": "human", "value": "(function (module) {\n module.controller('ProjectHomeController', ProjectHomeController);\n ProjectHomeController.$inject = [\"project\", \"mcmodal\",...
javascript
chosen
[ { "from": "system", "value": "Fix memoized docker image pull\n" }, { "from": "human", "value": "import execa from 'execa'\nimport promiseMemoize from 'p-memoize'\nimport debugLog from '../../../debugLog.js'\n\nexport default class DockerImage {\n constructor(imageNameTag) {\n this._imageName...
javascript
chosen
[ { "from": "system", "value": "Fix bug in parsing empty request bodies\n\nSigned-off-by: shaisachs <47bd79f9420edf5d0991d1e2710179d4e040d480@ngpvan.com>\n" }, { "from": "human", "value": "\nmodule.exports = function (req, res, next) {\n try {\n var rawBody = req.body;\n var parsedBody = JS...
javascript
chosen
[ { "from": "system", "value": "Update SelectionButtons to new interface\n\nVersion 2.0.0 of the govuk_frontend_toolkit deprecated the old interface\nto SelectionButtons. This now uses the new style.\n" }, { "from": "human", "value": "$(document).ready(function() {\n $('.print-link a').attr('targ...
javascript
chosen
[ { "from": "system", "value": "Modify name in js file\n" }, { "from": "human", "value": "HTMLWidgets.widget({\n\n name: 'TnT',\n\n type: 'output',\n\n factory: function(el, width, height) {\n\n // Define shared variables for this instance\n var tntins = null;\n var initial_width = wid...
javascript
chosen
[ { "from": "system", "value": "Apply a baseline styling to layout\n" }, { "from": "human", "value": "import React from 'react';\n\nconst Layout = ({children}) => (\n <div>\n { children }\n </div>\n);\n\nexport default Layout;\n" }, { "from": "gpt", "value": "import React from 're...
javascript
chosen
[ { "from": "system", "value": "Change new line to prevent jshint warning\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('tweets')\n.config([\n '$stateProvider',\n function($stateProvider) {\n $stateProvider\n .state('me', {\n url: '/me',\n ...
javascript
chosen
[ { "from": "system", "value": "Add currency handling and custom points!\n" }, { "from": "human", "value": "exports.names = ['settings', 'set'];\nexports.hidden = true;\nexports.enabled = true;\nexports.matchStart = true;\nexports.handler = function (data) {\n if (bot.hasPermission(bot.getUser(...
javascript
chosen
[ { "from": "system", "value": "Make sure arguments to Buffer.write() are converted to Strings.\n\ngit-svn-id: fac99be8204c57f0935f741ea919b5bf0077cdf6@9701 688a9155-6ab5-4160-a077-9df41f55a9e9\n" }, { "from": "human", "value": "include('core/json2');\n\nexport('Buffer');\n\n/**\n * A utility clas...
javascript
chosen
[ { "from": "system", "value": "Add manager perms to User model\n" }, { "from": "human", "value": "import { not } from '@ember/object/computed';\nimport DS from 'ember-data';\n\nexport default DS.Model.extend({\n username: DS.attr('string'),\n isActive: DS.attr('boolean'),\n isStaff: DS.attr('b...
javascript
chosen
[ { "from": "system", "value": "Remove deprication warngin for sendFile\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\n\napp.set('port', (process.env.PORT || 5000));\napp.use(express.static(__dirname + '/public'));\n\napp.get('/', function(request, resp...
javascript
chosen
[ { "from": "system", "value": "Add endpoint configuration for JSONP requests against readthedocs sections API\n" }, { "from": "human", "value": "// Main Module for searchthedocs demo\ndefine(function (require) {\n var _ = require('underscore'),\n $ = require('jquery'),\n SearchTheDocsView ...
javascript
chosen
[ { "from": "system", "value": "Add lint to our own test files" }, { "from": "human", "value": "var Gulp = require('gulp'),\n\n Linoleum = require('./index');\n\nrequire('./tasks/clean');\nrequire('./tasks/lint');\nrequire('./tasks/babel');\nrequire('./tasks/test');\nrequire('./tasks/karma');\n...
javascript
chosen
[ { "from": "system", "value": "Update os_version to High Sierra" }, { "from": "human", "value": "module.exports = {\n browsers: {\n bs_chrome_mac: {\n base: 'BrowserStack',\n browser: 'chrome',\n os: 'OS X',\n os_version: 'Mountain Lion'\n },\n bs_safari_mac: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add LayoutContainer to route root\n" }, { "from": "human", "value": "/**\n * Route definitions\n */\nimport React from 'react'\nimport { IndexRedirect, IndexRoute, Route } from 'react-router'\n\n// Pages\nimport Home from 'client/pages/Home'\nimport Terms from 'clie...
javascript
chosen
[ { "from": "system", "value": "Add easy test cases for NBDiffCell\n" }, { "from": "human", "value": "test(\"test_nbdiff_construct\", function () {\n var nbdiff = new NBDiff.NBDiff(IPython.notebook, false);\n nbdiff.log('hi');\n equal(true, true);\n});\n" }, { "from": "gpt", "...
javascript
chosen
[ { "from": "system", "value": "Fix linting issue with beta branch.\n" }, { "from": "human", "value": "'use strict';\nconst symbol = require('../utilities/symbol');\n\nlet experiments = { };\n\nObject.freeze(experiments);\n\nmodule.exports = experiments;\n" }, { "from": "gpt", "value":...
javascript
chosen
[ { "from": "system", "value": "Remove erronious comment on CM plugin.\n" }, { "from": "human", "value": "var utils = require('../../utils').common;\nvar util = require('util');\nvar _ = require('underscore');\n\n/** Adds pagerduty field to devops if pagerduty related api is present\n * @param {st...
javascript
chosen
[ { "from": "human", "value": "Add basic methods to versionable map\n" }, { "from": "gpt", "value": "/* global defineProperty, defineMethod, VersionableCollection */\n'use strict';\n\nfunction VersionableMap(data) {\n VersionableCollection.call(this);\n defineProperty(this, '_data', {\n value...
javascript
chosen
[ { "from": "system", "value": "Fix promise error in leave server command\n" }, { "from": "human", "value": "exports.func = function(client, msg, args) {\n\ttry {\n\t\tif(!(msg.author.id == client.config.ownerid)) {\n\t\t\tmsg.reply(\":x: Access denied.\")\n\t\t\treturn;\n\t\t}\n\t\tif(!args[0]) {...
javascript
chosen
[ { "from": "system", "value": "Add checkboxes for each beer.\n" }, { "from": "human", "value": "$.get('http://159.203.19.50:8081/beers', function gotData(data) {\n\tconsole.debug('got data: ', data);\n\tcreateTable(data);\n}, 'json');\n\nfunction createTable(beerList) {\n\t// clear\n\t$('div#main...
javascript
chosen
[ { "from": "system", "value": "Test comment validation for empty comments\n" }, { "from": "human", "value": "import React from 'react';\nimport assert from 'assert';\nimport DiscussionComment from './discussion-comment';\nimport CommentBox from './comment-box';\nimport { shallow } from 'enzyme';\...
javascript
chosen
[ { "from": "system", "value": "Load a specific confEditor conf file in conf route\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.core').constant('CONF_ROUTE', {\n controller: 'ConfEditorCtrl',\n templateUrl: 'templates/conf_editor.html',\n resolve: {\n load: ...
javascript
chosen
[ { "from": "system", "value": "Fix description to match what shall be done, thanks @chiptus." }, { "from": "human", "value": "// 38: iterator/iterable - string. \n// The iterator protocol defines a standard way to produce a sequence of values (either finite or infinite).\n// read more at https://...
javascript
chosen
[ { "from": "system", "value": "Adjust size and spacing of the dots according to specs.\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react'\nimport { Paper } from 'material-ui'\n\nconst styles = {\n dot: {\n width: 10,\n height: 10,\n background: '#fff'...
javascript
chosen
[ { "from": "system", "value": "Remove unused variables from VM sandbox\n" }, { "from": "human", "value": "const fs = require('fs')\nconst dsl = require('./dsl')\nconst vm = require('vm')\n\nconst sandbox = Object.assign({ module, require }, global, dsl)\nvm.createContext(sandbox, { name: 'PureSpe...
javascript
chosen
[ { "from": "system", "value": "Define customevent object in element\n" }, { "from": "human", "value": "(function(){ \nxtag.customEvents.press = {\n attach: [\n \"touchend\",\n \"mouseup\"\n ],\n condition: function (event) {\n if (event.target.xtag.customevent.press.dat...
javascript
chosen
[ { "from": "system", "value": "Fix undeinfed function in obj visit\n" }, { "from": "human", "value": "(function () {\n $.misc = {\n uuid: function() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r...
javascript
chosen
[ { "from": "system", "value": "Fix bundle and enable debug mode.\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar browserify = require('browserify');\nvar source = require('vinyl-source-stream');\n\ngulp.task('default', function () {\n var bd = browserify('./t...
javascript
chosen
[ { "from": "system", "value": "Remove references to gulpish git\n" }, { "from": "human", "value": "var gulp = require('gulp');\n\nvar bump = require('gulp-bump');\nvar chug = require('gulp-chug');\nvar clean = require('gulp-clean');\nvar git = require('gulp-git');\nvar jshint = require('gulp-jshi...
javascript
chosen
[ { "from": "system", "value": "Fix exception when creating new challenge from outside category.\n" }, { "from": "human", "value": "/**\n * Copyright 2016 David Tomaschik <david@systemoverlord.com>\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Update customProjector example to use a scale. Doesn't work yet (pending merge to gh-pages)\"\n\nThis reverts commit df014cfaed10a0eba602ebb0355ef83452faf133.\n\nConflicts:\n\n\ttutorials/customProjectors/customProjectors.js\n" }, { "from": "human", "value"...
javascript
chosen
[ { "from": "system", "value": "Add some spacing to search results\n" }, { "from": "human", "value": "// @flow\nimport React, { Component } from 'react';\nimport { Link } from 'react-router';\nimport ALL_DATA from '../fixtures/alldata.js';\n\nclass SearchResultItem extends Component {\n render() ...
javascript
chosen
[ { "from": "system", "value": "Define front desk related properties\n" }, { "from": "human", "value": "// BusinessProcess requirement uploads resolution\n\n'use strict';\n\nvar memoize = require('memoizee/plain')\n , defineUploadsProcess = require('../lib/uploads-process')\n ...
javascript
chosen
[ { "from": "system", "value": "Remove middleware function. Returns current instance.\n" }, { "from": "human", "value": "'use strict';\n\nvar mongodb = require('mongodb');\nvar nodefn = require('when/node');\nvar util = require('util');\n\n\n// ### Errors ###\n\nfunction MongoConnectionError(error...
javascript
chosen
[ { "from": "system", "value": "Fix global leak in pause.\n" }, { "from": "human", "value": "\nmodule.exports = function(obj){\n var onData\n , onEnd\n , events = [];\n\n // buffer data\n obj.on('data', onData = function(data, encoding){\n events.push(['data', data, encoding]);\n });\...
javascript
chosen
[ { "from": "system", "value": "Fix get week number range\n" }, { "from": "human", "value": "const MILLISECONDS_IN_WEEK = 604800000;\n\nconst getWeekNumber = (date) => {\n const start = new Date(date);\n start.setUTCHours(0, 0, 0, 0);\n\n const startOfYear = new Date(0);\n startOfYear....
javascript
chosen
[ { "from": "system", "value": "[Details] Add initialization logic to AVM model (to prepare for\nrendering).\n\nRequired addition of two additional Backbone models:\n\n- Pair\n- Feature\n" }, { "from": "human", "value": "// Collections\n\nvar AVM = Backbone.Collection.extend({});\n\nvar RHS = Back...
javascript
chosen
[ { "from": "system", "value": "Remove use of value for v4 compat\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar JsonDB = require('node-json-db');\nvar _ = require('lodash');\n\n// Recipes listing\nrouter.get('/', function (req, res, next)...
javascript
chosen
[ { "from": "system", "value": "Stop right click working outside of LIs\n" }, { "from": "human", "value": "YUI().use('event', 'event-focus', function(Y) {Y.on(\"domready\", function() { \n new Themer.appView();\n});});\n\n" }, { "from": "gpt", "value": "YUI().use('event', 'event-foc...
javascript
chosen
[ { "from": "system", "value": "Adjust generic name validation to better check tag values\ne.g. \"name=Fast Food\" should match \"amenity=fast_food\"\n" }, { "from": "human", "value": "import { t } from '../util/locale';\nimport { discardNames } from '../../node_modules/name-suggestion-index/confi...
javascript
chosen
[ { "from": "system", "value": "Store both username and displayName in server session\n" }, { "from": "human", "value": "var passport = require('passport'),\n GitHubStrategy = require('passport-github').Strategy,\n config = require('./config');\n\npassport.serializeUser(function(user, done) ...
javascript
chosen
[ { "from": "system", "value": "Remove validation for presence of KV values\n" }, { "from": "human", "value": "import { validatePresence, validateLength } from 'ember-changeset-validations/validators';\nexport default {\n Key: [validatePresence(true), validateLength({ min: 1 })],\n Value: valida...
javascript
chosen
[ { "from": "system", "value": "Add file to JS tree for comparison\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar fs = require('fs');\nvar Plugin = require('broccoli-plugin');\nvar mergeTrees = require('broccoli-merge-trees');\nvar path = require('path');\nvar log...
javascript
chosen
[ { "from": "system", "value": "Call upstream accept method with the correct convention.\n" }, { "from": "human", "value": "var mime = require('mime');\n\nmodule.exports = function(config) {\n 'use strict';\n\n var cfg = config || {};\n var prefix = cfg.prefix || 'original';\n var ext = cfg.ex...
javascript
chosen
[ { "from": "system", "value": "Move matchers to a nested object\n" }, { "from": "human", "value": "var assert = require('assert')\n\nmodule.exports = {\n given (args, matcher) {\n return (subject) => {\n matcher(subject.bind(subject, args))\n }\n },\n\n returns (result) {\n retur...
javascript
chosen
[ { "from": "system", "value": "Fix typo: Auto disable Fast Refresh in CRA 4" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// Set the env before any code reads it\nprocess.env.NODE_ENV = process.env.NODE_ENV || 'development';\n\n// Auto disable Fast Refresh in CRA 4 until integration is ...
javascript
chosen
[ { "from": "system", "value": "Use `any-promise` instead of `bluebird`.\n" }, { "from": "human", "value": "'use strict'\n\nvar toArray = require('stream-to-array')\nvar Promise = require('bluebird')\n\nmodule.exports = streamToPromise\n\nfunction streamToPromise (stream) {\n if (stream.readable)...
javascript
chosen
[ { "from": "system", "value": "Fix wrong type of thrown object (now 'Error')" }, { "from": "human", "value": "'use strict'\n\nvar React = require('react-native')\nvar { DeviceEventEmitter, NativeAppEventEmitter, Platform } = React\n\nvar RNZipArchive = React.NativeModules.RNZipArchive\nvar promis...
javascript
chosen