conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Move query string function to router class\n" }, { "from": "human", "value": "class GelatoRouter extends Backbone.Router {\n\n execute(callback, args, name) {\n if (this.page) {\n this.page.remove();\n }\n\n this.trigger('navigate:before', args, name)...
javascript
chosen
[ { "from": "system", "value": "Add props validation to stateless functions\n" }, { "from": "human", "value": "import React from 'react'\nimport { IndexLink, Link } from 'react-router'\nimport { connect } from 'react-redux'\nimport snippet from '../helpers/snippet'\n\nfunction bkmrkd (props) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix accidental creation of global variable.\n" }, { "from": "human", "value": "module.exports = (function() {\n var def = require('./def');\n var Handler = require('./handler');\n HandlerAdaptor = def.type(Handler, function(handler) {\n this.def_prop('handler'...
javascript
chosen
[ { "from": "system", "value": "Make command argument validation clear.\n" }, { "from": "human", "value": "const commands = {\n 'join': ['channel'],\n 'part': ['channel', 'message?'],\n 'ctcp': ['target', 'type', 'text'],\n 'action': ['target', 'message'],\n 'whois': ['nick'],\n 'list': [],\...
javascript
chosen
[ { "from": "system", "value": "Fix the problem with Chute's API not returning correct Content-Type.\n" }, { "from": "human", "value": "import Promise from 'bluebird';\nimport request from 'superagent';\nimport assign from 'lodash/object/assign';\n\nconst API_BASE = 'https://api.getchute.com/v2';\...
javascript
chosen
[ { "from": "system", "value": "Revert 'Change required library with minified one'\n" }, { "from": "human", "value": "let should = require('should');\nlet expect = require('chai').expect;\nlet jsdom = require('jsdom');\nlet {JSDOM} = jsdom;\nlet Shell;\ndescribe('Shell', () => {\n let {document...
javascript
chosen
[ { "from": "system", "value": "Add support for multi-languages books in JSON format\n" }, { "from": "human", "value": "var util = require(\"util\");\nvar path = require(\"path\");\nvar Q = require(\"q\");\n\nvar fs = require(\"../fs\");\nvar parse = require(\"../../parse\");\nvar BaseGenerator = ...
javascript
chosen
[ { "from": "system", "value": "Add styles for the delete bar\n" }, { "from": "human", "value": "/**\n * The \"Delete bar\" is the area at the top of the screen where you can drag\n * expressions to remove them.\n *\n * @flow\n */\n\nimport React from 'react';\nimport {\n Text,\n} from 'react-n...
javascript
chosen
[ { "from": "system", "value": "Make testing work on Windows\n" }, { "from": "human", "value": "\n/**\n * Module dependencies.\n */\n\nvar jade = require('../')\n , fs = require('fs');\n\n// test cases\n\nvar cases = fs.readdirSync('test/cases').filter(function(file){\n return ~file.indexOf('.ja...
javascript
chosen
[ { "from": "system", "value": "Add basic test for injectDeps\n" }, { "from": "human", "value": "var chai = require('chai'),\n expect = chai.expect,\n sinon = require('sinon'),\n sinonChai = require(\"sinon-chai\");\n\nchai.use(sinonChai);\n" }, { "from": "gpt", "value": "var chai =...
javascript
chosen
[ { "from": "system", "value": "style(tests): Fix the whitespace in the tests" }, { "from": "human", "value": "var merge = require('merge');\n\nvar array1 = {\n\tsalutation: 'Goodbye',\n\tname: 'World!'\n};\nvar array2 = {\n\tsalutation: 'Hello',\n\tseperator: ' '\n};\n\nvar output = merge(array1,...
javascript
chosen
[ { "from": "system", "value": "Fix scrollbar showing. Auto-calculate the pixels inside calc().\n\nThe scrollbar fix is actually just line 21\n" }, { "from": "human", "value": "import React from 'react'\nimport '../styles/video.css'\n\nconst Tutorial = props =>\n <div className='container'>\n ...
javascript
chosen
[ { "from": "system", "value": "Include composer.json in the WP distribution, to help WP-Packagist\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n\tgrunt.initConfig({\n\t\tcopy: {\n\t\t\tmain: {\n\t\t\t\tsrc: [\n\t\t\t\t\t'assets/**',\n\t\t\t\t\t'!assets/*/src/**',\n\t\t\...
javascript
chosen
[ { "from": "system", "value": "Make so that grunt test is more human readable and in travis use grunt travis that do coveralls\n" }, { "from": "human", "value": "'use strict';\nmodule.exports = function(grunt) {\n // Load tasks\n grunt.loadNpmTasks('grunt-wiredep');\n grunt.loadNpmTasks(...
javascript
chosen
[ { "from": "system", "value": "Work around issue with coveralls lib.\n" }, { "from": "human", "value": "/*\n * grunt-contrib-jshint\n * http://gruntjs.com/\n *\n * Copyright (c) 2015 \"Cowboy\" Ben Alman, contributors\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nmodule.exports = f...
javascript
chosen
[ { "from": "system", "value": "Add target to browserify tasks for thoroughness\n" }, { "from": "human", "value": "var tm = require('task-master');\n\nmodule.exports = function(grunt) {\n tm(grunt, {\n jit: {\n travis: 'grunt-travis-matrix',\n matrix: 'grunt-travis-matrix',\n mo...
javascript
chosen
[ { "from": "system", "value": "Reduce gemfire server logging to warning\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n grunt.initConfig(\n {\n pkg: grunt.file.readJSON('package.json'),\n shell: {\n rebuild: {\n command: 'npm install --build...
javascript
chosen
[ { "from": "system", "value": "[chore] Add bower.json and package.json to jshint checks\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n\n jshint: {\n files: ['*.js', 'client/app/*.js', 'server/**/*.js', 'database/**/*.js'],\n options: {\n...
javascript
chosen
[ { "from": "system", "value": "Bring back the intersection observer polyfill\n\nWhy:\n\n* Apparently we need it. Ask Justo.\n" }, { "from": "human", "value": "/**\n * Implement Gatsby's Browser APIs in this file.\n *\n * See: https://www.gatsbyjs.org/docs/browser-apis/\n */\n\n// You can delete t...
javascript
chosen
[ { "from": "system", "value": "Move `wrap` task to run before `watch` task\n" }, { "from": "human", "value": "// Use grunt to produce top-level javascript files, but not to run tests (Karma\n// has its own watcher).\n\nmodule.exports = function(grunt) {\n grunt.initConfig({\n pkg: grunt.file....
javascript
chosen
[ { "from": "system", "value": "Add test to check for error from a router\n\nFigured out a way to handle error replies from the router when testing\nwith async/await.\n" }, { "from": "human", "value": "const chai = require('chai')\nconst expect = chai.expect\nconst chaiHttp = require('chai-http')\...
javascript
chosen
[ { "from": "system", "value": "Correct unit test assertion for XHR object\n" }, { "from": "human", "value": "/*!\n Copyright 2013 Rustici Software\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": "Remove dead code, add default options\n" }, { "from": "human", "value": "/*\n * grunt-fontello-svg\n * https://github.com/chimo/grunt-fontello-svg\n *\n * Copyright (c) 2014 chimo\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nvar fontello_svg = requir...
javascript
chosen
[ { "from": "system", "value": "Update e2e test for new content\n" }, { "from": "human", "value": "module.exports = {\n 'Test for component appears on the screen': function (browser) {\n browser\n .url('http://localhost:8080/')\n .waitForElementVisible('body', 1000)\n .assert.co...
javascript
chosen
[ { "from": "system", "value": "Update channel to send alerts to.\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar slackBot = require('slack-bot')(process.env.URL);\n\nrouter.post('/', function(req, res) {\n // Cheap security\n if (req.que...
javascript
chosen
[ { "from": "system", "value": "Remove trailing slash in siteUrl\n\nThis fixes issue where URLs had `//` in them because the post slugs start with `/`\n" }, { "from": "human", "value": "const colors = require('../../src/styles/colors')\n\nmodule.exports = {\n homeTitle: 'Ben Ilegbodu',\n siteTit...
javascript
chosen
[ { "from": "system", "value": "Add parserOptions explicitly for this project\n" }, { "from": "human", "value": "// XXX: To uniform the style of an object literals, we enable `quote-props`\n/*eslint quote-props: [2, \"always\"] no-magic-numbers: 0 */\n\n'use strict';\n\n/**\n * Test ourself :)\n ...
javascript
chosen
[ { "from": "system", "value": "[change] Implement middlewares to use in app.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\nvar path = require('path');\nvar express = require('express');\n\nvar controllers = require('./controllers');\n" }, { "from": "gpt", "v...
javascript
chosen
[ { "from": "system", "value": "Add 'electron' to ESLint configuration.\n" }, { "from": "human", "value": "module.exports = {\n parserOptions: {\n ecmaVersion: 6,\n ecmaFeatures: {\n jsx: true\n },\n },\n extends: 'airbnb',\n env: {\n node: true,\n commonjs: true,\n moch...
javascript
chosen
[ { "from": "system", "value": "Add ignored stories that come from Apps Manager tracker\n\nSigned-off-by: Steven Locke <baaff752d2ae0b1c8049cab727257de91dfbb71f@pivotal.io>\n" }, { "from": "human", "value": "import axios from 'axios';\n\nconst ignoredStories = ['151262175', '148077489', '151620080...
javascript
chosen
[ { "from": "system", "value": "Configure import plugin to recognise experimental modules\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = {\n parser: 'babel-eslint',\n\n extends: [\n '@strv/javascript/environments/nodejs/v7',\n '@strv/javascript/environments/nodejs/opti...
javascript
chosen
[ { "from": "system", "value": "Update toJSON method to be compatable with json api\n" }, { "from": "human", "value": "\nfunction createModel(resource) {\n\n // Dynamically create constructor for model\n // TODO: Type checking + required vs non-required\n var _createModel = function(obj) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix compatibility with ember 2\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport Remarkable from 'remarkable';\n\nexport function mdRemarkable(markdownInput) {\n var md = new Remarkable();\n return new Ember.Handlebars.SafeString(md.render(mark...
javascript
chosen
[ { "from": "system", "value": "Fix preflight fn to match request path against preflight config path, not the other way around\n" }, { "from": "human", "value": "/**\n * Module dependencies.\n */\n\nvar _ = require('lodash');\nvar pathToRegexp = require('path-to-regexp');\n\n/**\n * @optional {Di...
javascript
chosen
[ { "from": "system", "value": "Use `application/x-bat` MIME type for .bat extension\n\nFixes #121.\n" }, { "from": "human", "value": "\"use strict\";\n\n/**\nMIME type definitions consisting of those in `mime-db` plus custom additions and\noverrides.\n\nSee <https://github.com/jshttp/mime-db> for...
javascript
chosen
[ { "from": "system", "value": "Use String.prototype.trim() in favour of RegExp to trim a value\n" }, { "from": "human", "value": "var URL = require('url');\n\n/**\n * Utility to cleanup the base host value. Also removes url fragments.\n *\n * Works for:\n * - hostname\n * - //hostname\n * - schem...
javascript
chosen
[ { "from": "system", "value": "Remove NoErrorsPlugin until webpack-hot-middleware learns to display syntax error overlay after reload as well\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n // or devtool: 'eval' to debug i...
javascript
chosen
[ { "from": "system", "value": "Add id to navigation bar and removed unnecessary spacer\n" }, { "from": "human", "value": "Ext.define('SenchaFront.view.Main', {\n extend: 'Ext.NavigationView',\n xtype: 'main',\n requires: [\n 'Ext.plugin.ListSwipeAction',\n 'Ext.dataview.Lis...
javascript
chosen
[ { "from": "system", "value": "refactor: Remove materializecss select field render function\n\nUsing it now in controller when required" }, { "from": "human", "value": "import Ember from 'ember';\nimport $ from 'jquery';\n\nexport default Ember.Controller.extend({\n indexedDbPromised: Ember.inje...
javascript
chosen
[ { "from": "system", "value": "Replace search loop with mapping function and general improvements.\n" }, { "from": "human", "value": "const botBuilder = require('claudia-bot-builder')\nconst telegramTemplate = require('claudia-bot-builder').telegramTemplate\nconst request = require('minimal-reque...
javascript
chosen
[ { "from": "system", "value": "Add \"Back\" button to artist wizard\n" }, { "from": "human", "value": "const { Markup } = require('telegraf');\nconst { WizardScene } = require('telegraf-flow');\n\nconst artistWizard = new WizardScene('artistWizard',\n (ctx) => {\n ctx.reply(\n 'Send me t...
javascript
chosen
[ { "from": "system", "value": "Remove stray console.logs that were totally there on purpose\n" }, { "from": "human", "value": "exercism.views.ListNotifications = Backbone.View.extend({\n template: JST[\"app/templates/list_notifications.us\"],\n\n id: \"list-notifications\",\n\n initialize: fun...
javascript
chosen
[ { "from": "system", "value": "Clarify how to perform future migrations\n" }, { "from": "human", "value": "import packageJson from '../package.json';\nimport compareVersions from 'semver-compare';\nimport { SETTINGS_KEYS } from './settings';\n\nexport function migrateDataToVersion(database, setti...
javascript
chosen
[ { "from": "system", "value": "Improve end-of-line space removal performance\n\nThe performance impact of the previous method was only felt on excessively\nlarge lines of empty space surrounded by words. i.e. 'a b \\n' but with\n20k spaces between a and b.\n" }, { "from": "human", "value": ...
javascript
chosen
[ { "from": "system", "value": "Test retrive, convert and compare dates\n" }, { "from": "human", "value": "$(document).ready(function () {\n // Current date\n var d = new Date(),\n month = d.getMonth() + 1,\n day = d.getDate(),\n year = d.getYear();\n \n // trello ...
javascript
chosen
[ { "from": "system", "value": "Fix token highlighting for URLs like /api/:tokens?query=string\n" }, { "from": "human", "value": "\n// Highlight a string with tokens like :this and $that\n// Used to highlight parameters in Restify routes\n\nexports.tokens = {\n\n case_insensitive: true,\n keyw...
javascript
chosen
[ { "from": "system", "value": "Add comment to send func\n" }, { "from": "human", "value": "import { HUB } from './hub';\nimport config from './config';\n\nexport function post (apiUrl, data) {\n const payload = JSON.stringify(data);\n const url = config.API_ROOT + apiUrl;\n\n GM_xmlhttpR...
javascript
chosen
[ { "from": "system", "value": "Update to current response module\n" }, { "from": "human", "value": "include('ringo/webapp/response');\n\nexports.index = function index(req) {\n return skinResponse('skins/chat.html', {\n title: \"CometD Chat (RingoJS version)\",\n contextPath: req...
javascript
chosen
[ { "from": "system", "value": "Rename to use CM naming consistently\n" }, { "from": "human", "value": "import CodeMirror, { Doc } from 'codemirror'\n\nimport LatexParser from './ide/editor/codemirror/parser'\n\nexport function init (rootEl) {\n CodeMirror.defineMode('latex', () => new LatexParse...
javascript
chosen
[ { "from": "system", "value": "Resolve IP geolocations with hownetworks/whereabouts\n" }, { "from": "human", "value": "import { errors } from \"./lib/gcloud\";\n\nimport * as store from \"./lib/store\";\nimport * as taskQueue from \"./lib/taskqueue\";\nimport * as resolve from \"./lib/resolve\";\...
javascript
chosen
[ { "from": "system", "value": "Include version from package.json in build output file name\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n compress: {\n main: {\n options: {\n ar...
javascript
chosen
[ { "from": "system", "value": "Change test task and add code style tasks\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (grunt) {\n // Show elapsed time at the end\n require('time-grunt')(grunt);\n // Load all grunt tasks\n require('load-grunt-tasks')(grunt);\n\...
javascript
chosen
[ { "from": "system", "value": "Put example code in comment block.\n" }, { "from": "human", "value": "// Made by Tim Caswell, https://gist.github.com/creationix/bb1474fd018076862c6b\nmodule.exports = asyncMap;\n\n// This will loop through an array calling fn(item, callback) for each item.\n// It a...
javascript
chosen
[ { "from": "system", "value": "Fix off-by-one for adjective list\n" }, { "from": "human", "value": "var fs = require(\"fs\");\nvar path = require(\"path\");\nvar _ = require(\"lodash\");\n\nvar animals;\nvar adjectives;\n\nmodule.exports = function () {\n\tif (animals && adjectives) {\n\t\tr...
javascript
chosen
[ { "from": "system", "value": "Set NODE_ENV env variable to 'test' during testsuite\n\nHushes millstone debugging output\n" }, { "from": "human", "value": "/**\n * User: simon\n * Date: 30/08/2011\n * Time: 13:52\n * Desc: Loads test specific variables\n */\n\nvar _ = require('underscore');\n\n//...
javascript
chosen
[ { "from": "system", "value": "Clear input fields properly after submitting form\n" }, { "from": "human", "value": "$(document).ready(function(){\n console.log(\"ready\")\n\n $('form').on('click','.remove_fields', function(event){\n event.preventDefault();\n $(this).prev('input[type=hidde...
javascript
chosen
[ { "from": "system", "value": "Refactor put method for elements\n" }, { "from": "human", "value": "angular.module('app', []).controller('AppCtrl', function ($scope, $http) {\n\t$scope.results = [];\n\n\t$scope.loadUsers = function() {\n\t\t$http.get('/elements')\n\t\t\t.success(function(data) {\n...
javascript
chosen
[ { "from": "system", "value": "Remove unreliable integration tests from automated testing\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n 'use strict';\n\n // Add the grunt-mocha-test tasks.\n grunt.loadNpmTasks('grunt-mocha-test');\n\n // Project configuration...
javascript
chosen
[ { "from": "system", "value": "Add validation rules for limit, offset, and sorting\n" }, { "from": "human", "value": "const Joi = require('joi');\n\nconst PARAMS = {\n name: Joi.string().required()\n};\n\nconst PAYLOAD = {\n name: Joi.string().required(),\n maintainers: Joi.array(),\n descrip...
javascript
chosen
[ { "from": "system", "value": "Use relative imports for node compatibility\n" }, { "from": "human", "value": "import hooks from 'htmlbars-runtime/hooks';\nimport render from 'htmlbars-runtime/render';\nimport { manualElement } from 'htmlbars-runtime/render';\nimport { visitChildren } from \"../ht...
javascript
chosen
[ { "from": "system", "value": "Remove outdated (React) prop shape property; we no longer aggregate idea w/ user\n" }, { "from": "human", "value": "//\n// Reusable, domain-specific prop types\n//\nimport PropTypes from \"prop-types\"\n\nimport STAGES from \"../js/configs/stages\"\nimport { CATEGOR...
javascript
chosen
[ { "from": "system", "value": "Update old tests, add tests for utils and DataPackList\n" }, { "from": "human", "value": "import {jsdom} from 'jsdom';\n" }, { "from": "gpt", "value": "import {jsdom} from 'jsdom';\n// this adds the ability to change the dom size when testing components ...
javascript
chosen
[ { "from": "system", "value": "Fix test after moving it\n" }, { "from": "human", "value": "var pongular = require('../lib/pongular').pongular;\n\nvar ook = pongular.module('ook', []);\nook.constant('e', 1.7);\n\nvar pong = pongular.module('pong', ['ook']);\npong.constant('pi', 3.14);\npong.config...
javascript
chosen
[ { "from": "system", "value": "Install chromium directly (not via puppeteer)\n" }, { "from": "human", "value": "// Karma configuration file, see link for more information\n// https://karma-runner.github.io/0.13/config/configuration-file.html\nprocess.env.CHROME_BIN = require('puppeteer').executab...
javascript
chosen
[ { "from": "system", "value": "Add region confirmation for delete command\n" }, { "from": "human", "value": "import inquirer from 'inquirer'\n\nfunction deleteStack (cloudformation, argv, utils) {\n const stackName = argv._[1]\n\n inquirer.prompt([\n {\n type: 'confirm',\n name: 'o...
javascript
chosen
[ { "from": "system", "value": "Add thunk middleware to store \n\n" }, { "from": "human", "value": "import { createStore } from 'redux'\nimport reducer from '../reducers'\n\nexport default () => {\n const store = createStore(reducer)\n\n return store\n}\n" }, { "from": "gpt", "value"...
javascript
chosen
[ { "from": "system", "value": "Correct container name to data" }, { "from": "human", "value": "'use strict'\n\nvar pubsubangular = angular.module('pubsub.angular', []);\npubsubangular.factory('ps', function () {\n var ps = window.PubSub;\n if(!!ps===false){\n throw new Error('Pubsub-...
javascript
chosen
[ { "from": "human", "value": "Complete lesson 15 - switch\n" }, { "from": "gpt", "value": "function Switch() {\n\tvar self = Ti.UI.createWindow({});\n\t\n\tvar view = Ti.UI.createView({\n\t\tleft : '35%',\n\t\ttop : '35%',\n\t\tlayout : 'horizontal'\n\t});\n\t\n\tvar titleLabel = Ti.UI.createLabe...
javascript
chosen
[ { "from": "system", "value": "Extend article schema with subtitle.\n" }, { "from": "human", "value": "import { DocumentNode, CHILD, CHILDREN, TEXT } from 'substance'\nimport { RICH_TEXT_ANNOS } from './modelConstants'\n\nexport default class Article extends DocumentNode {}\nArticle.schema = {\n ...
javascript
chosen
[ { "from": "system", "value": "Set default application name to folder name\n\nFixes #1\n" }, { "from": "human", "value": "'use strict';\nvar util = require('util');\nvar path = require('path');\nvar yeoman = require('yeoman-generator');\n\n\nvar AppengineGenerator = module.exports = function Appe...
javascript
chosen
[ { "from": "system", "value": "Test the courses property on the instructor-group model\n" }, { "from": "human", "value": "import {\n moduleForModel,\n test\n} from 'ember-qunit';\n\nmoduleForModel('instructor-group', 'InstructorGroup', {\n // Specify the other units that are required for this ...
javascript
chosen
[ { "from": "system", "value": "Fix checking type of data (array is recognized as an object)\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n var mod = angular.module('components.utils', []);\n\n mod.factory('Utils', ['$window', function Utils($window) {\n\n function str...
javascript
chosen
[ { "from": "system", "value": "Allow bullets to finish travelling - otherwise it looks all silly ;)\n" }, { "from": "human", "value": "var controller = null;\nvar speed = 30;\nvar life = 3000;\n\nfunction start()\n{\n\tcontroller = Game.getFromScene(\"Background\").ControllerScript;\n}\n\nfunctio...
javascript
chosen
[ { "from": "system", "value": "Increment retries before printing log\n" }, { "from": "human", "value": "'use strict';\n\nvar net = require('net'),\n utils = require('radiodan-client').utils,\n logger = utils.logger(__filename);\n\nfunction create(port, socket) {\n var deferred = utils....
javascript
chosen
[ { "from": "system", "value": "Implement skipping of non-existing files\n\nIf any other plugin leaves `files` with entry that does not correspond\nto an existing file this entry should be skipped silently." }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar ...
javascript
chosen
[ { "from": "system", "value": "Drop vary from js module\n" }, { "from": "human", "value": "Object.defineProperty(exports, 'lock', {\n\tget() {\n\t\treturn require('./lock');\n\t}\n});\n\nObject.defineProperty(exports, 'tag', {\n\tget() {\n\t\treturn require('./tag');\n\t}\n});\n\nObject.definePro...
javascript
chosen
[ { "from": "system", "value": "Add an invokeP function and use it internally [...]\n\nI know I'm just throwing probably terrible ideas around at this point.\n" }, { "from": "human", "value": "\n/**\n * Dependencies\n * --------------------------------------------------------------------------*/\n...
javascript
chosen
[ { "from": "system", "value": "Allow override of all callbacks for sails-generate\n" }, { "from": "human", "value": "/**\n * Module dependencies\n */\n\nvar generate = require('./generate')\n\t, reportback = require('reportback')();\n\n\n\n/**\n * Generate module(s)\n *\n * @param {Object} sco...
javascript
chosen
[ { "from": "system", "value": "Update JS docs for notification content script\n" }, { "from": "human", "value": "/* See license.txt for terms of usage */\r\n\r\n/**\r\n * xxxHonza: TODO docs\r\n */\r\nwindow.addEventListener(\"click\", function(event) {\r\n var target = event.target;\r\n if (ta...
javascript
chosen
[ { "from": "system", "value": "Check if using chrome first\n" }, { "from": "human", "value": "'use strict';\n/*global window: false, document: false, $:false, d3:false, toggle_overview_btn, checkIfUsingChromeLocally, addData*/\n\n$(document).ready(function() {\n toggle_overview_btn(); // write o...
javascript
chosen
[ { "from": "system", "value": "Make Elron provider count live time (api)\n" }, { "from": "human", "value": "const got = require('got');\n\nconst cache = require('../utils/cache.js');\nconst time = require('../utils/time.js');\n\n// Get trips for stop.\nasync function getTrips(id) {\n\t\n\tconst n...
javascript
chosen
[ { "from": "system", "value": "Add catchall route for serving Angular application\n" }, { "from": "human", "value": "var artistController = require('../controllers/artist-controller');\nvar genreController = require('../controllers/genre-controller');\n\nmodule.exports = function(app, passport) {...
javascript
chosen
[ { "from": "system", "value": "Enable full recursive visit search\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar visitsHelper = require('../src/helpers/visits');\nvar parser = require('../src/helpers/parser.js');\n\nvar url = process.env....
javascript
chosen
[ { "from": "system", "value": "Disable data change in prod and pre-prod environment\n" }, { "from": "human", "value": "Meteor.startup(function () {\n // Reset Database only in environment dev\n if (process.env.NODE_ENV === 'development') {\n KSessions.remove({});\n Books.remove({});\n ...
javascript
chosen
[ { "from": "system", "value": "Fix issue with trying to show sync icon when logged out.\n" }, { "from": "human", "value": "/* global sauce, jQuery */\n\nsauce.ns('profile', ns => {\n 'use strict';\n\n\n const idMatch = location.pathname.match(/\\/(?:athletes|pros)\\/([0-9]+)/);\n const a...
javascript
chosen
[ { "from": "system", "value": "Rename import to avoid naming conflict\n" }, { "from": "human", "value": "import React from 'react';\nimport { shallow } from 'enzyme'; // eslint-disable-line\nimport Array from '../types/Array';\n\ndescribe('Array', () => {\n it('should subscribe to setKnobs event...
javascript
chosen
[ { "from": "system", "value": "Add support for IE (CORS)\n" }, { "from": "human", "value": "//= require_self\n//= require ./string\n//= require_tree .\n/* global Data:true */\n\nData = Ember.Namespace.create({\n\n ajax: function (settings) {\n return $.ajax(settings);\n }\n});\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Rename disableText prop to removeText in UiIcon test\n" }, { "from": "human", "value": "import Vue from 'vue';\nimport UiIcon from '../src/UiIcon.vue';\n\ndescribe('UiIcon.vue', function() {\n it('should initialize with correct data/props', function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Set up indexing for simple events.\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\n// A simple event is an event which does not contain data associated with it, and\n// instead just records \"it happened\", ...
javascript
chosen
[ { "from": "system", "value": "Update the active class for the current step\n" }, { "from": "human", "value": "var GtfsEditor = GtfsEditor || {};\n\n(function(G, $, ich) {\n G.Router = Backbone.Router.extend({\n routes: {\n '': 'showStep',\n ':step': 'showStep'\n },\n\n initia...
javascript
chosen
[ { "from": "system", "value": "Use different selector for disp.cc mobile version" }, { "from": "human", "value": "'use strict';\n\nvar elements = document.querySelectorAll('.record');\nif (elements.length) {\n var line = Array.prototype.filter.call(elements,function(record) {\n return record....
javascript
chosen
[ { "from": "system", "value": "Change message sort order to top to bottom\n" }, { "from": "human", "value": "if (Meteor.isClient) {\n\n Accounts.ui.config({\n passwordSignupFields: 'USERNAME_ONLY'\n });\n\n Template.messages.helpers({\n messages: function() {\n return Message...
javascript
chosen
[ { "from": "system", "value": "Put in place a little workaround to get a nice 'name' on the NSException wrap's 'stack' property.\n" }, { "from": "human", "value": "/**\n * Creates a JS Error object from an NSException pointer.\n */\nvar id = require('./id')\n , Err = require('vm').runInNewContex...
javascript
chosen
[ { "from": "system", "value": "Fix cheating on first integral step\n" }, { "from": "human", "value": "import { newSignal, signalStep } from './signal';\n\n// Euler integration\n// integrate :: (a -> b -> dt -> a) -> a -> Signal t b -> Signal t a\nexport default (integral, a, s) => runInteg(integr...
javascript
chosen
[ { "from": "system", "value": "Integrate all settings into settings.json file.\n" }, { "from": "human", "value": "var fs = require('fs');\n\nvar Settings = {};\n\nSettings.init = function (){};\n\nSettings.get = function (key){\n var tokenFileName = process.env.HOME + '/.unidisk/' + key;\n var ...
javascript
chosen
[ { "from": "system", "value": "Set the iframe url on the JS side\n" }, { "from": "human", "value": "function queryString (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\"),\n results = regex.ex...
javascript
chosen
[ { "from": "system", "value": "Remove IIFE as browserify adds one\n" }, { "from": "human", "value": "/* angular-file-saver\n*\n* A AngularJS service that implements the HTML5 W3C saveAs() in browsers that\n* do not natively support it\n*\n* (c) 2015 Philipp Alferov\n* License: MIT\n*\n*/\n\n(func...
javascript
chosen
[ { "from": "system", "value": "Normalize for nulling out on IE at the ends\n" }, { "from": "human", "value": "var _create = global.document.createNodeIterator;\n\nexport function createNodeIterator(root, whatToShow, filter = null) {\n var iter = _create.call(global.document, root, whatToShow, fi...
javascript
chosen
[ { "from": "system", "value": "fix: Add missing \"use strict\" to api tester\n\nEnsures that `const` and `let` can be used properly." }, { "from": "human", "value": "const assert = require('assert');\n\nconst api = {\n\n configureStaticApi(apiServerCreator, port) {\n assert(typeof apiServerCr...
javascript
chosen
[ { "from": "system", "value": "Add test for same length, same letters, different letter instance counts\n\nOne possible solution to detecting an anagram might be to check to see if the words are the same length and that each letter from the first word is contained in the second word. This additional test wou...
javascript
chosen