conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Swap arguments to make encoding/decoding commands more natural\n" }, { "from": "human", "value": "const logger = require('../logger')\r\nconst slackEncoder = require('../slack-encoder')\r\n\r\nmodule.exports = (controller) => {\r\n\r\n controller.hears([/encode bas...
javascript
chosen
[ { "from": "system", "value": "Remove function definition for brevity\n" }, { "from": "human", "value": "HNSpecial.settings.registerModule(\"hide_downvote\", function () {\n function hideDownvoteButton () {\n var arrows = _.toArray(document.getElementsByClassName('votearrow'));\n\n arrows....
javascript
chosen
[ { "from": "system", "value": "Add success tracking for benefits and quick answers\n" }, { "from": "human", "value": "var GOVUK = GOVUK || {};\nGOVUK.Analytics = GOVUK.Analytics || {};\nGOVUK.Analytics.Trackers = {};\n\n/*\n * Available methods on control:\n * - trackTimeBasedSuccess(milliseconds...
javascript
chosen
[ { "from": "system", "value": "Add JS to toggle active class on buttons.\n" }, { "from": "human", "value": "/* PSEUDO CODE FOR LOGIN MENU\n\n1. COLLECT DATA ENTERED INTO THE <INPUT>\n2. WHEN .LOGIN-SUBMIT IS 'CLICKED' `GET/users/id` TO DATABASE TO BE VERIFIED?\n*/\n\n\n;(function(){\n angular.m...
javascript
chosen
[ { "from": "system", "value": "fix: Throw correct exception with axios\n" }, { "from": "human", "value": "const axios = require('axios')\n\nconst { EmptyHttpResponseError, NotFoundError } = require('./errors')\n\nmodule.exports = async function request(url) {\n const response = await axios({\n ...
javascript
chosen
[ { "from": "system", "value": "Rewrite JS reloading etc without jQuery\n\n" }, { "from": "human", "value": "let handle = setInterval(updateTimestamps, 90000);\n\nfunction updateTimestamps() {\n let first = true;\n\n $(\".humantime\").each(function () {\n var $time = $(this);\n\n $.get('/h...
javascript
chosen
[ { "from": "system", "value": "Add tests for inner, in-progress and completion text\n" }, { "from": "human", "value": "describe('progress-button directive', function() {\n\tvar element, scope\n\n\tbeforeEach(function() {\n\t\tmodule('progressButton')\n\n\t\tinject(function($rootScope, $compile) {...
javascript
chosen
[ { "from": "system", "value": "Refactor test example with syllable breaks\n- no doubt there will be disagreements & ambiguities, but at least we can assert what the code can/should be doing more precisely\n" }, { "from": "human", "value": "'use strict';\nlet mocha = require('mocha');\nlet should ...
javascript
chosen
[ { "from": "system", "value": "Fix: Scale XYZ matrix generator didn't use 1.0 as the default\ncomponent value, as it obviously should.\n" }, { "from": "human", "value": "E2.p = E2.plugins[\"scale_xyz_matrix\"] = function(core, node)\n{\n\tthis.desc = 'Create a matrix that scales the X, Y and Z ax...
javascript
chosen
[ { "from": "system", "value": "Add comment for Standard to know about the global variables\n" }, { "from": "human", "value": "var div = React.DOM.div\nvar h1 = React.DOM.h1\n\nvar MyTitle = React.createClass({\n render () {\n return (\n div(null,\n h1({style: {color: this.props.co...
javascript
chosen
[ { "from": "system", "value": "Fix an issue that on IE the QRCode cannot be displayed due to this.baseURI is undefined in IE\n" }, { "from": "human", "value": "$(function() {\n var links = $(\"#gamelist h1 a\").map(function() {\n var gameName = this.text;\n var baseUrl = this.bas...
javascript
chosen
[ { "from": "system", "value": "FIX small issues with localstorage\n" }, { "from": "human", "value": "// TODO: figure out a way to share this code with the CLI (lib/core/src/server/build-dev.js)\n\nimport { localStorage, fetch } from 'global';\n\nconst versionsUrl = 'https://storybook.js.org/versi...
javascript
chosen
[ { "from": "system", "value": " Allow DBL to bypass cookie consent\n" }, { "from": "human", "value": "module.exports = function checkCookieConsent(rq, rs, nx) {\n if (rq.originalUrl.startsWith(\"/static\")) return nx(); // prevent the data consent from loading on static files\n if (rq.origi...
javascript
chosen
[ { "from": "system", "value": "Build available cuts from files\n" }, { "from": "human", "value": "var inquirer = require('inquirer');\n\nvar question = [{\n choices: getCutsList,\n message: 'Select the cut file',\n name: 'cut',\n type: 'list'\n}];\n\nfunction prompt() {\n\n var promise = new...
javascript
chosen
[ { "from": "system", "value": "Complete get user list function\n" }, { "from": "human", "value": "function updateUserList(dyDB, table, userId, cb) {\n\n\tdyDB.putItem({\n\t\t\"TableName\": table,\n\t\t\"Item\": {\n\t\t\t\"user_id\": {\"S\": userId.toString()}\n\t\t}\n\t}, function(err, result) {\...
javascript
chosen
[ { "from": "system", "value": "Enable alerts in admin panel\n" }, { "from": "human", "value": "'use strict';\n\n//require('bootstrap/js/dist/alert');\n//require('bootstrap/js/dist/button');\n//require('bootstrap/js/dist/carousel');\nrequire('bootstrap/js/dist/collapse');\nrequire('bootstrap/js/di...
javascript
chosen
[ { "from": "system", "value": "Store by fully qualified domain name.\n" }, { "from": "human", "value": "// module for interacting with tabs\nvar data = require('sdk/self').data;\nvar storage = require(\"storage\");\nvar tabs = require(\"sdk/tabs\");\n\nvar item_position = '';\n\n\nfunction bind_c...
javascript
chosen
[ { "from": "system", "value": "Update up to changes in es5-ext\n" }, { "from": "human", "value": "'use strict';\n\nvar chain = require('es5-ext/function/#/chain')\n , write = process.stdout.write.bind(process.stdout)\n\n , chars = '-\\\\|/'\n , l = chars.length\n , p;\n\np = {\n\tnext: 0,...
javascript
chosen
[ { "from": "system", "value": "Include low and hidpi icon toggle support\n" }, { "from": "human", "value": "// Global variables for isolated world\nvar iconActive = false;\n\nfunction toggle(){\n // Show \"on\" icon when showing the help\n if(iconActive == false){\n activate();\n } else{\n ...
javascript
chosen
[ { "from": "system", "value": "Update for the last changes in the API\n" }, { "from": "human", "value": "\n// Allows to get the video of the url through the api_url (optional)\nfunction BaseVideoInfo(url, api_url) {\n\tthis.url = url || 'null';\n\tthis.api_url = api_url || \"https://youtube-dl.ap...
javascript
chosen
[ { "from": "system", "value": "Remove \"text-fill\" class requirement from text elements for automatic resizing. [IQSLDSH-382]\n" }, { "from": "human", "value": "/*global angular*/\n(function () {\n 'use strict';\n\n // member attribute = member in slide to watch for changes\n // min-fon...
javascript
chosen
[ { "from": "system", "value": "Create base New Relic configuration to prevent application crashes.\n" }, { "from": "human", "value": "/**\n * New Relic agent configuration.\n *\n * See lib/config.defaults.js in the agent distribution for a more complete\n * description of configuration variables ...
javascript
chosen
[ { "from": "system", "value": "Call MtkStyle.Reload whenever a window is created\n" }, { "from": "human", "value": "function MtkWindow (settings) {\n MtkContainer.call (this, settings);\n\n this.Xaml = this.Control.Content.Root;\n this.Realize ();\n\n this.Override (\"OnSizeAllocation...
javascript
chosen
[ { "from": "system", "value": "Support setting includePolyfill in either `babel` or `ember-cli-babel`.\n\nNewer versions of ember-cli-babel issue a deprecation warning when\nsetting `babel.includePolyfill` (suggesting instead to use\n`ember-cli-babel`).\n\nThis slightly tweaks things to allow either usage.\n...
javascript
chosen
[ { "from": "system", "value": "Use substring instead of slicing - double speedup!\n\n pff\n 1,997,810 op/s » tiny (production)\n 621,845 op/s » short (production)\n 1,386,780 op/s » tiny (5)\n 720,355 op/s » short (10)\n 77,338 op/s » medium (100)\n\n...
javascript
chosen
[ { "from": "system", "value": "Add error checking in the main app\n" }, { "from": "human", "value": "var express = require( 'express' ),\n\t\tapp = express(),\n\t\tdebug = require( 'debug' )( 'dashboard:init' ),\n\t\tconfig = require( './config' ),\n\t\tswig = require( 'swig' ),\n\t\tpath = requi...
javascript
chosen
[ { "from": "system", "value": "FIX version in installation hint for webworker-threads\n" }, { "from": "human", "value": "\nvar logUtils = require('../utils/log-utils.js');\n// var log = logUtils.log;\nvar warn = logUtils.warn;\n\n//////// async / threaded grammar compiler support: ///////////////...
javascript
chosen
[ { "from": "system", "value": "Add expose method which must be used with inner ES6 classes" }, { "from": "human", "value": "\nmodule.exports = {\n\n onReload: function(callback) {\n withLiveReactload(function(lrload) {\n if (!lrload.onReloadCallbacks) {\n lrload.onReloadCallbacks ...
javascript
chosen
[ { "from": "system", "value": "Fix source map file property\n" }, { "from": "human", "value": "\"use strict\";\n\nvar gutil = require(\"gulp-util\");\nvar through = require(\"through2\");\nvar ngAnnotate = require(\"ng-annotate\");\nvar applySourceMap = require(\"vinyl-sourcemaps-apply\");\nvar m...
javascript
chosen
[ { "from": "system", "value": "Add configuration option for disabling vote messages" }, { "from": "human", "value": "// ==UserScript==\n// @name Robin Assistant\n// @namespace com.github.leoverto\n// @include https://www.reddit.com/robin/\n// @version 1\n// @author LeoVerto\...
javascript
chosen
[ { "from": "system", "value": "Add version constraints for all dependencies of accounts-password.\n\nThis is necessary to allow publishing accounts-password independently of a\nMeteor release.\n\nNote that the npm-bcrypt version has been bumped to 0.8.7_1.\n" }, { "from": "human", "value": "Packa...
javascript
chosen
[ { "from": "system", "value": "Split domains into separate include rules\n" }, { "from": "human", "value": "// ==UserScript==\n// @author Janne K\n// @name Newspaper Paywall Bypass\n// @description Bypasses paywall on Finnish newspapers' websites\n// @version 1.1.4\n// @homepa...
javascript
chosen
[ { "from": "system", "value": "Change server port to 4000\n" }, { "from": "human", "value": "var express = require('express')\nvar app = express()\nvar session = require('express-session')\nvar bodyParser = require('body-parser')\nvar cookieParser = require('cookie-parser')\nvar passport = requir...
javascript
chosen
[ { "from": "system", "value": "Make sure that *this* module's `.eslintrc` is exported." }, { "from": "human", "value": "var fs = require('fs');\n\nmodule.exports = JSON.parse(fs.readFileSync('.eslintrc'));\n" }, { "from": "gpt", "value": "var fs = require('fs');\nvar path = require('p...
javascript
chosen
[ { "from": "system", "value": "Check that the non-plugin events are not caught by the plugin\n" }, { "from": "human", "value": "var Plugin = require('vigour-native/lib/bridge/Plugin')\nvar plugin\n\ndescribe('plugin', function () {\n it('should be requireable', function () {\n plugin = requir...
javascript
chosen
[ { "from": "system", "value": "Support replacing all instances of the string in a html file" }, { "from": "human", "value": "function HtmlReplaceWebpackPlugin(options)\n{\n options = Array.isArray(options) ? options : [options]\n\n options.forEach(function(option)\n {\n if(typeof option.pat...
javascript
chosen
[ { "from": "system", "value": "Hide other submenus when opening a new one\n" }, { "from": "human", "value": "$(document).ready(function () {\n\n function openSubMenu(event) {\n if (this.pathname === '/') {\n event.preventDefault();\n }\n event.stopPropagation();\n $(this).parent...
javascript
chosen
[ { "from": "system", "value": "Update ember-addon file to be compatible with latest master\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar commands = require('./lib/commands');\nvar postBuild = require('./lib/tasks/post-build');\n\nmodule.exports = {\n ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Merging 'feature/refactors' into 'develop'\"\n" }, { "from": "human", "value": "var env = process.env.NODE_ENV || 'development';\nif (env === 'development') {\n require('dotenv').load();\n}\n// The main application script, ties everything together.\nvar bo...
javascript
chosen
[ { "from": "system", "value": "Configure eslint - make 4 space indent mandatory.\n" }, { "from": "human", "value": "// https://eslint.org/docs/user-guide/configuring\n\nmodule.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOptions: {\n sourceType: 'module'\n },\n env: {\n ...
javascript
chosen
[ { "from": "system", "value": "Make docs web-friendly (remove file: prefixes in browsers, keep them in help)\n" }, { "from": "human", "value": "// Replaces internal \"qrc:/*.png\" image URIs with web-friendly URIs\nfunction replaceqrc()\n{\n var imgs = document.images;\n for (var i = 0; i <...
javascript
chosen
[ { "from": "system", "value": "Remove trailing whitespace on component integration test\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';<% if (testType === 'integration') { %>\nimport hbs from 'htmlbars-inline-precompile';<% } %>\n\nmoduleForComponent('<%...
javascript
chosen
[ { "from": "system", "value": "Set folder name as m3u name\n" }, { "from": "human", "value": "#!/usr/bin/env node\nconst fs = require('fs')\nconst path = require('path')\n\nvar fileName = process.argv[2]\nconsole.log(\"Processing: \" +fileName)\nvar PREFIX = \"file://\"\n\nfunction createDir(fold...
javascript
chosen
[ { "from": "system", "value": "Add the disabled and readOnly props directly to the SingleLineInputBase\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport InputMask from 'react-input-mask';\nimport Icon from '../icon';\nimport SingleLineInputBase from './Singl...
javascript
chosen
[ { "from": "system", "value": "Update tests to reflect new method signature\n" }, { "from": "human", "value": "const assert = require('assert');\n\nconst Account = require('../Contents/Scripts/account.js').Account;\nconst PullRequest = require('../Contents/Scripts/pull-request.js').PullReques...
javascript
chosen
[ { "from": "system", "value": "Switch doc to closure compiler templating\n" }, { "from": "human", "value": "/**\n * Takes a bounding box and returns a new bounding box with a size expanded or contracted\n * by a factor of X.\n *\n * @module turf/size\n * @category measurement\n * @param {Array<nu...
javascript
chosen
[ { "from": "system", "value": "Make exports play nice with Webpack.\n\nWebpack doesn’t like expressions in requires.\n" }, { "from": "human", "value": "var key,\r\n path = require('path'),\r\n dirpaths = require(__dirname + '/lib/paths');\r\n\r\nfor (key in dirpaths) {\r\n\tif (dirpaths.has...
javascript
chosen
[ { "from": "system", "value": "feat: Change to json:api content type\n" }, { "from": "human", "value": "const express = require('express');\nconst HTTPStatus = require('http-status-codes');\n\nconst scraper = require('./app/routes/scraper');\nconst handleErrorResponse = require('./app/errorRespon...
javascript
chosen
[ { "from": "system", "value": "Load file content and set file base for proper destination\n" }, { "from": "human", "value": "/**\n * Created by Maurice on 6/13/2015.\n */\n\n'use strict';\n\nvar through = require('through2');\nvar gutil = require('gulp-util');\nvar PluginError = gutil.PluginError...
javascript
chosen
[ { "from": "system", "value": "Make tests Node 4 compatible\n" }, { "from": "human", "value": "let P = require('path')\n\nlet srcPath = process.env.USE_BUILT ?\n P.resolve('.') :\n P.resolve('./src')\n\nrequire('babel-register')({\n plugins: [\n ['module-resolver', {\n alias: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add new rules for closing brackets and v-html tag\n" }, { "from": "human", "value": "module.exports = {\n plugins: [\n 'vue'\n ],\n extends: [\n 'vast',\n 'plugin:vue/recommended'\n ],\n rules: {\n // Stylistic Issues:\n ...
javascript
chosen
[ { "from": "system", "value": "Update code description for location.uri\n" }, { "from": "human", "value": "import { parseLocation } from 'routes/location';\n\n/**\n * Retrieve information about current location\n *\n * @param {string} [value]\n * @returns {Object}\n */\nexport function uri(value)...
javascript
chosen
[ { "from": "system", "value": "Replace log function with console.log\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar api = require('../lib/api/')(require('request'));\n\nrequire('../')(function(log) {\n console.log('prefix: ' + log);\n}, api);\n" }, { "from...
javascript
chosen
[ { "from": "system", "value": "Fix some Motion UI demos in docs not working\n" }, { "from": "human", "value": "// Code for specific docs examples.\n\n!function() {\n\n$('[data-docs-example-ofc]').click(function() {\n $('#offCanvasLeft').toggleClass('reveal-for-large');\n});\n\n$('[data-docs-exam...
javascript
chosen
[ { "from": "system", "value": "ALIEN-Github-3: Use the component name descriptor\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('alienUiApp').controller(\n 'NewCloudController', ['$scope', '$modalInstance', '$http', function($scope, $modalInstance, $http) {\n $scope.newCloud...
javascript
chosen
[ { "from": "system", "value": "Make it work under window.plugins\n\nrequire throw errors in Cordova -v = 3.4.0-0.1.3. Cordova.exec is already available. Add the plugin under window.plugins object." }, { "from": "human", "value": "/**\n * Phonegap DatePicker Plugin Copyright (c) Greg Allen 2011 MI...
javascript
chosen
[ { "from": "system", "value": "PLAT-8479: Add accessibility option to make accessibility feature enable on garnet sample\n\nAdd accessibility option, which is set to true.\n\nhttps://jira2.lgsvl.com/browse/PLAT-8479\nEnyo-DCO-1.1-Signed-off-by: Bongsub Kim <bongsub.kim@lgepartner.com>\n\nChange-Id: I6017abad...
javascript
chosen
[ { "from": "system", "value": "Use null instead of undefined in loose check for clarity of purpose\n" }, { "from": "human", "value": "/**\n * Store\n * Used to provide default values for a store configuration\n */\n\nexports.reduce = function (stores, state, transformer, initial) {\n return stor...
javascript
chosen
[ { "from": "system", "value": "Refactor: Use dispatcher instead of extending EventEmitter.\n" }, { "from": "human", "value": "var EventEmitter = require('events').EventEmitter;\n\nclass ActionCreator extends EventEmitter {\n constructor(api){\n super();\n this.api = api;\n }\n\n subscrib...
javascript
chosen
[ { "from": "system", "value": "Set return_url when logging in users\n" }, { "from": "human", "value": "define(function () {\n var App = Ember.Application.create()\n , isDev = /localhost/.test(document.location.href)\n , tokenRegexp = /authentication_token=([a-zA-Z0-9]+)/;\n\n /* Resolve a...
javascript
chosen
[ { "from": "system", "value": "Discard active tabs if their window is minimized\n" }, { "from": "human", "value": "(function(tabs, windows){\n\n \"use strict\";\n\n const specialUrls =/chrome-extension:|chrome:|chrome-devtools:|file:|chrome.google.com\\/webstore/;\n\n let discardAllTabs ...
javascript
chosen
[ { "from": "system", "value": "Remove isVariable from exposed utils\n" }, { "from": "human", "value": "import postcssPlugin from \"./postcssPlugin\"\nimport standalone from \"./standalone\"\nimport createPlugin from \"./createPlugin\"\nimport rules from \"./rules\"\nimport {\n report,\n ruleMes...
javascript
chosen
[ { "from": "system", "value": "Allow passing in a store\n" }, { "from": "human", "value": "'use strict';\n\nclass Keyv {\n\tconstructor() {\n\t\tthis.store = new Map();\n\t}\n\n\tget(key) {\n\t\treturn Promise.resolve(this.store.get(key)).then(data => {\n\t\t\tif (!data) {\n\t\t\t\treturn undefin...
javascript
chosen
[ { "from": "system", "value": "Remove name from `createAlfa` as function name is not mutable.\n" }, { "from": "human", "value": "import createStore from './store'\nimport createAction from './action'\nimport { createProvide, createSubscribe } from './injection'\n\n\nexport function createAlfa(nam...
javascript
chosen
[ { "from": "system", "value": "Refactor transforms from object to array.\n" }, { "from": "human", "value": "import { parser } from './parser';\nimport { compile } from './compiler';\nimport { entity } from './transform/entity';\nimport { whitespace } from './optimize/whitespace';\nimport { getTem...
javascript
chosen
[ { "from": "system", "value": "Add remove commas & format string" }, { "from": "human", "value": "import PersianNumber, {latinToPersian, arabicToPersian} from './PersianNumber.js';\nimport PersianNumberWords from './PersianNumberWords.js';\n\nconst components = {\n PersianNumber,\n PersianNumbe...
javascript
chosen
[ { "from": "system", "value": "Stop XO complaining about void\n" }, { "from": "human", "value": "// Loaded ready states\nconst loadedStates = ['interactive', 'complete'];\n\n// Return Promise\nconst whenDomReady = (cb, doc) => new Promise(resolve => {\n\t// Allow doc to be passed in as the lone f...
javascript
chosen
[ { "from": "system", "value": "Insert jobs in a single statement\n\nWhile writing code we should always ask ourselves: \"Is there a better way to do\nthis? Do we really needed replication?\" A quick look at MongoDB's documentation\nI found out that MongoDB allows to insert an array of elements.\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Move parent checking into filter function\n" }, { "from": "human", "value": "export default function ({ Plugin, types: t }) {\n const visitor = {\n Property: {\n exit(node) {\n if (node.computed || node.key.name !== 'propTypes') {\n return;\...
javascript
chosen
[ { "from": "system", "value": "Update help and version description" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// Licensed under the Apache License, Version 2.0 (the “License”); you may not\n// use this file except in compliance with the License. You may obtain a copy of\n// the Licen...
javascript
chosen
[ { "from": "system", "value": "Use default controls if no controls configured\n" }, { "from": "human", "value": "angular.module('anol.map')\n\n.provider('ControlsService', [function() {\n var _controls = [];\n\n this.setControls = function(controls) {\n _controls = controls;\n };\...
javascript
chosen
[ { "from": "system", "value": "Send empty list on initial sitesList build.\n" }, { "from": "human", "value": "import app from 'app';\nimport fs from 'fs';\nimport path from 'path';\n\nvar appDataPath = path.join(app.getPath('userData'), \"sitesList.json\") ;\nvar appDataIsBeingWritten = false;\n\...
javascript
chosen
[ { "from": "system", "value": "Remove spinner, was for testing only.\n" }, { "from": "human", "value": "enyo.kind({\n\tname: \"MyApp.MainView\",\n\tkind: \"moon.Panel\",\n\tclasses: \"moon main-view\",\n\tcontroller: \".app.controllers.messageController\",\n\tbindings: [{\n\t\tfrom: \".controller...
javascript
chosen
[ { "from": "system", "value": "Add eventEmitter to tone controller, emit when a new tone analysis is received\n" }, { "from": "human", "value": "const Tone = require('../schemas/toneSchema');\r\n\r\n\r\nexports.saveTone = (tone) => {\r\n const newTone = new Tone(tone);\r\n newTone.save().then((...
javascript
chosen
[ { "from": "system", "value": "Change logInstructions to allow users to copy import codes\n" }, { "from": "human", "value": "'use strict';\nvar yeoman = require('yeoman-generator');\nvar path = require('path');\n\nmodule.exports = yeoman.Base.extend({\n constructor: function () {\n yeoman.Bas...
javascript
chosen
[ { "from": "system", "value": "Add curly braces to columnName\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\n\nconst EditableTableHeader = ({columnNames}) => {\n\n return(\n <div>\n {columnNames.map( columnName => {return <div>columnName...
javascript
chosen
[ { "from": "system", "value": "Add pagination functionality to query\n" }, { "from": "human", "value": "const tor = require('../lib/tor');\n\nmodule.exports = (req, res) => {\n\n let title = 'Top 10 nodes by consensus weight';\n const query = {\n limit: 10\n };\n if(req.query.s) {\n tit...
javascript
chosen
[ { "from": "system", "value": "Fix filename in generated tsconfig\n\nThe generated JavaScript file ends with `.js` and therefore we\nshould list the full name in our tsconfig as well. We ran into\ncompilation issues on https://crrev.com/c/3073941 and they required\nthe full extension to be listed. It's not c...
javascript
chosen
[ { "from": "system", "value": "Fix the build monitor getting hidden forever on connection error - even if it was just a single occurrence\n" }, { "from": "human", "value": "$(document).ready(function () {\n\n //bind the knockoutjs model to the html\n var viewModel = new BuildScreenViewMode...
javascript
chosen
[ { "from": "system", "value": "Adjust remote browser initialization and configuration.\n" }, { "from": "human", "value": "var chai = require(\"chai\");\nvar chaiAsPromised = require(\"chai-as-promised\");\nvar wd = require('wd');\n\nrequire(\"mocha-as-promised\")();\nrequire('colors');\n\nchai.us...
javascript
chosen
[ { "from": "system", "value": "Apply bespoke order and labels to investment summary date picker\n" }, { "from": "human", "value": "import { get } from 'lodash'\n\n/**\n * Converts investment summary received by the API into data ranges\n * that the chart component can work with\n */\nexport const...
javascript
chosen
[ { "from": "system", "value": "Use a more obvious check for transitions\n" }, { "from": "human", "value": "import React from 'react';\nimport Relay from 'react-relay';\n\nimport Container from './Container';\nimport RouteAggregator from './RouteAggregator';\n\nexport default class RootComponent e...
javascript
chosen
[ { "from": "system", "value": "Trim the output line, since we're erasing to EOL anyway\n\nCurrently renderTemplate ALWAYS produces a string of the length you specify,\neven if it has to pad stuff to produce that. This renders the\n\"erase-to-eol\" command meaningless, so we either should ditch that or we\ns...
javascript
chosen
[ { "from": "system", "value": "Add check to ensure launcher components begin with 'stockflux-'\n" }, { "from": "human", "value": "import React, { useEffect, useState } from 'react';\nimport { OpenfinApiHelpers } from 'stockflux-core';\nimport Components from 'stockflux-components';\nimport './App...
javascript
chosen
[ { "from": "system", "value": "Fix name of main TodoApp\n" }, { "from": "human", "value": "import React from 'react';\n\nimport AddTodoForm from './AddTodoForm';\nimport TodoList from './TodoList';\n\nexport default class App extends React.Component {\n state = {\n todos: []\n }\n\n render(...
javascript
chosen
[ { "from": "system", "value": "Remove showing of actual internal error to user and show in log instead\n" }, { "from": "human", "value": "/**\n * Created by Omnius on 03/08/2016.\n */\n'use strict';\n\nconst Boom = require('boom');\n\nmodule.exports = () => {\n\n return (request, reply) => {\n...
javascript
chosen
[ { "from": "system", "value": "Improve console polyfill String coercion\n" }, { "from": "human", "value": "/*\n * Minimal console.log() polyfill\n */\n\nif (typeof console === 'undefined') {\n Object.defineProperty(this, 'console', {\n value: {}, writable: true, enumerable: false, conf...
javascript
chosen
[ { "from": "system", "value": "Allow clients to provide their own function to decide whether form is valid before submission\n" }, { "from": "human", "value": "$.fn.informantSubscribeForm = function (options) {\n var settings = $.extend({\n renderResults: false,\n resultContainer...
javascript
chosen
[ { "from": "system", "value": "Add highstock exporting before other lib\n" }, { "from": "human", "value": "module.exports = {\n all: {\n options: {\n separator: ';',\n },\n files: {\n 'dist/js/lib.js': [\n 'src/javascript/lib/jquery.js'...
javascript
chosen
[ { "from": "system", "value": "Use junctions instead of dir linking for windows\n" }, { "from": "human", "value": "var rimraf = require(\"rimraf\");\nvar async = require(\"async\");\nvar path = require(\"path\");\nvar fs = require(\"fs\");\n\nfunction symlinkDep(src, dest, callback) {\n f...
javascript
chosen
[ { "from": "system", "value": "Update Tabs to use S selectors\n" }, { "from": "human", "value": "/*jslint unparam: true, browser: true, indent: 2 */\n;(function ($, window, document, undefined) {\n 'use strict';\n\n Foundation.libs.tab = {\n name : 'tab',\n\n version : '5.0.3',\n\n set...
javascript
chosen
[ { "from": "system", "value": "Rename `Stop recording` to `Pause recording`\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport { connect } from 'react-redux';\nimport RecordIcon from 'react-icons/lib/md/fiber-manual-record';\nimport StopIcon from 'reac...
javascript
chosen
[ { "from": "system", "value": "Exclude node_modules/react-devtools/node_modules for webpack build\n" }, { "from": "human", "value": "import { join } from 'path';\n\nexport default {\n output: {\n path: join(__dirname, '../dist/js'),\n filename: 'bundle.js',\n libraryTarget: 'commonjs2',...
javascript
chosen
[ { "from": "system", "value": "Disable timeslots that have passed\n\nRefs #42.\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport { Label } from 'react-bootstrap';\n\nexport class TimeSlot extends Component {\n render() {\n const { onChange, select...
javascript
chosen
[ { "from": "system", "value": "feat: Add a primary model attribute\n\n`primaryModel` defaults to `'model'` but can be changed in cases where the `model` hook must return an array or hash of promises and the user wants to be explicit about the model in the template e.g. `user` vs `model`." }, { "from"...
javascript
chosen
[ { "from": "system", "value": "Add support to projection changes\n" }, { "from": "human", "value": "TC.control = TC.control || {};\r\n\r\nif (!TC.Control) {\r\n TC.syncLoadJS(TC.apiLocation + 'TC/Control');\r\n}\r\n\r\nTC.control.NavBar = function () {\r\n TC.Control.apply(this, arguments)...
javascript
chosen
[ { "from": "system", "value": "[Glitch] Fix unnecessary service worker registration and preloading when logged out\n\nPort 894ce3726a38733ea7b8c880658b962f92d021ae to glitch-soc\n\nSigned-off-by: Claire <82b964c50e9d1d222e48cf5046e6484a966a7b07@sitedethib.com>\n" }, { "from": "human", "value": "i...
javascript
chosen
[ { "from": "system", "value": "Add function to send GA events\n\nAdd a function to the site JavaScript to send Google Analytics events if\nit has been loaded.\n" }, { "from": "human", "value": "martinCostello = {\n website: {\n branch: $(\"meta[name='x-site-branch']\").attr(\"content\"...
javascript
chosen
[ { "from": "system", "value": "help.mtg: Remove anchorScroll's url hash when done\n\nOtherwise url hash fragment is left visible even after modal is dismissed.\n" }, { "from": "human", "value": "/**\n * (c) 2016 Tieto Finland Oy\n * Licensed under the MIT license.\n */\n'use strict';\n\n/**\n * @...
javascript
chosen
[ { "from": "system", "value": "Add sampel route for heroku testing\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\n/* GET home page. */\nrouter.get('/', function(req, res, next) {\n res.render('index', { title: 'Express' });\n});\n\n\n\nmod...
javascript
chosen