conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add show report table option\n" }, { "from": "human", "value": "//Karyo Options\r\nKaryo.prototype.Options = function(opt)\r\n{\r\n //Check preview regions\r\n if(typeof opt.previewRegions !== 'undefined'){ this.chrpreview.show = opt.previewRegions; }\r\n\r\n //C...
javascript
chosen
[ { "from": "system", "value": "Fix file name on webpack configuration\n" }, { "from": "human", "value": "\n/**\n * Module dependencies.\n */\n\nimport packageConfig from './package.json';\nimport webpack from 'webpack';\n\n/**\n * Webpack configuration.\n */\n\nexport default {\n entry: './src/b...
javascript
chosen
[ { "from": "system", "value": "Include tonemapping and encoding chunks\n" }, { "from": "human", "value": "export default /* glsl */`\nuniform vec3 color;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\...
javascript
chosen
[ { "from": "system", "value": "Remove mix of spaces and tabs\n" }, { "from": "human", "value": "define(\n\t['backbone', 'views/filenameview', 'collections/files', 'app'],\n\tfunction(Backbone, FilenameView, Files, app) {\n\tvar FilesView = Backbone.View.extend({\n\t\ttagName: 'ul',\n\n\t\tinitial...
javascript
chosen
[ { "from": "system", "value": "Fix bug of cleaning test files.\n" }, { "from": "human", "value": "const exec = require('child_process').exec;\nconst inspect = require('util').inspect;\nconst fs = require('fs');\nconst path = require('path');\nconst del = require('del');\nconst mkdirp = require('m...
javascript
chosen
[ { "from": "system", "value": "Apply the same filename rules to Jest as we do React\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n\tplugins: [\n\t\t'jest',\n\t],\n\tenv: {\n\t\t'jest/globals': true,\n\t},\n\textends: [\n\t\t'./index',\n\t\t'./rules/plugin-jest',\n\t].map...
javascript
chosen
[ { "from": "system", "value": "Add proper name for DOMTokenList" }, { "from": "human", "value": ";(function () {\n 'use strict';\n\n if ('relList' in document.createElement('a')) {\n return;\n }\n\n var i;\n var elements = [HTMLAnchorElement, HTMLAreaElement, HTMLLinkElement...
javascript
chosen
[ { "from": "system", "value": "Throw an error if Mongo is missing envvars\n" }, { "from": "human", "value": "module.exports = function(config) {\n var mongoose = require('mongoose');\n\n var db = mongoose.connection;\n var schemas = {};\n\n var eventSchema = new mongoose.Schema({\n 'catego...
javascript
chosen
[ { "from": "system", "value": "Use normalizer as plugin in example.\n" }, { "from": "human", "value": "/**\n * Module dependencies\n */\n\nvar Zeditor = require('zeditor');\nvar ZeditorPaste = require('zeditor-paste');\n\n/**\n * Get DOM nodes\n */\n\nvar editorNode = document.getElementById('edi...
javascript
chosen
[ { "from": "system", "value": "Reword label on strategy picker\n\nCloses #349\n" }, { "from": "human", "value": "$(document).on(\"page:change\", function(){\n $(\"select.multi-select\").multiselect({\n buttonWidth: '200px',\n buttonText: function(options) {\n if (options.length) {\n ...
javascript
chosen
[ { "from": "system", "value": "Exclude socket.io client from fast boot build\n" }, { "from": "human", "value": "/*jshint node:true*/\n/* global require, module */\nvar EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nmodule.exports = function(defaults) {\n var app = new EmberAddon(...
javascript
chosen
[ { "from": "system", "value": "fix: Fix the shelves, which are not displaying all the books\n\nThere was a problem displaying more than three books inside a shelf at the same time.\nIt has been fixed adding a style from the Bulma library.\n" }, { "from": "human", "value": "import React, {Componen...
javascript
chosen
[ { "from": "system", "value": "Remove title bar, but keep 'traffic light buttons'.\n" }, { "from": "human", "value": "const {app, BrowserWindow, globalShortcut} = require('electron')\nconst { resolve } = require('path')\n\nlet win = null\n\napp.on('window-all-closed', function () {\n if (process...
javascript
chosen
[ { "from": "system", "value": "Add semicolon to the return statement\n" }, { "from": "human", "value": "import mapKeys from 'lodash/mapKeys';\nimport mapValues from 'lodash/mapValues';\nimport camelCase from 'lodash/camelCase';\nimport snakeCase from 'lodash/snakeCase';\n\nfunction ensureTypeSnak...
javascript
chosen
[ { "from": "human", "value": "Add the admin waiting requests controller\n" }, { "from": "gpt", "value": "'use strict';\n\nvar ctrlFactory = require('restitute').controller;\n\n\n\nfunction listController() {\n ctrlFactory.list.call(this, '/rest/admin/waitingrequests');\n\n this.controllerAc...
javascript
chosen
[ { "from": "system", "value": "Fix breaches() default domain value\n" }, { "from": "human", "value": "const hibp = require('hibp');\n\n/**\n * Fetches all breached sites in the system.\n *\n * @param {string} domain a domain by which to filter the results (default: all\n * domains)\n * @returns {...
javascript
chosen
[ { "from": "system", "value": "Update localStorage to namespace keys\n\nRationale for this is that if I host similar games on the same domain,\nthey have a chance of overwriting each others' data.\n" }, { "from": "human", "value": "Storage.prototype.setObject = function (key, value) {\n this.s...
javascript
chosen
[ { "from": "system", "value": "Add more images in search\n" }, { "from": "human", "value": "class BrowseController {\n constructor($scope, $uibModalInstance, ImageFactory, text) {\n 'ngInject';\n\n var imageCount = 60;\n\n $scope.text = text;\n $scope.photos = [];\n $scope.canShow...
javascript
chosen
[ { "from": "system", "value": "Disable inline JS minification because AAAARGH\n" }, { "from": "human", "value": "import gulpLoadPlugins from 'gulp-load-plugins';\nimport pkg from './package.json';\nconst $ = gulpLoadPlugins();\n\nexport default {\n 'js': () => [\n $.sourcemaps.init(),\n //...
javascript
chosen
[ { "from": "system", "value": "Use the correct funciton call...\n" }, { "from": "human", "value": "/* eslint-env browser */\n\n'use strict';\n\nmodule.exports = {\n preload() {\n\n },\n\n init() {\n this.state.load('main');\n },\n};\n" }, { "from": "gpt", "value": "/* eslint-en...
javascript
chosen
[ { "from": "system", "value": "Refresh button pulls random quote\n\nfrom list of quotes, but purely random (eventually want pseudorandom,\nso that quotes aren't repeated too often, or cycling through the list\nin some order or something)\n" }, { "from": "human", "value": "// Written in jquery\n\n...
javascript
chosen
[ { "from": "system", "value": "Include Redux DevTools extension in the content script\n" }, { "from": "human", "value": "// dev only: async fetch bundle\n\nconst arrowURLs = [ 'https://github.com' ];\n\nchrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {\n if (changeInfo.status ...
javascript
chosen
[ { "from": "system", "value": "Check query string for access_token before checking in headers\n" }, { "from": "human", "value": "module.exports = function (req) {\n\tfunction getParam(paramName) {\n\t\tif (req.query && typeof req.query[paramName] !== 'undefined')\n\t\t\treturn req.query[paramName...
javascript
chosen
[ { "from": "system", "value": "Set timezone explicitly to UTC on server-side\n" }, { "from": "human", "value": "const dotenv = require('dotenv')\nconst path = require('path')\n\ndotenv.config({ path: path.join(__dirname, '..', '..', '.env') })\n\nconst url = process.env.DATABASE_URL\nconst dialec...
javascript
chosen
[ { "from": "system", "value": "Make corrections to placement of 'chromato.mix'\n" }, { "from": "human", "value": "(function() {\n var Color;\n\nchromato = function(x, y, z, m) {\n return new Color(x, y, z, m);\n};\n\n\nchromato.color = function(x, y, z, m) {\n return new Color(x, y, z, m);\n};...
javascript
chosen
[ { "from": "system", "value": "Make sure user is in group\n" }, { "from": "human", "value": "// Includes\nvar setRank = require('../setRank.js').func;\nvar getRoles = require('./getRoles.js').func;\nvar getRankNameInGroup = require('./getRankNameInGroup.js').func;\n\n// Args\nexports.required = [...
javascript
chosen
[ { "from": "system", "value": "Fix bad working directory bug.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\nlet isRoot = require('is-root');\n\nif(isRoot()) {\n console.error(\"I refuse to run as root.\");\n process.exit(-1);\n}\n\nlet path = require('path');\nlet...
javascript
chosen
[ { "from": "system", "value": "Include passphrase for validation and connection\n" }, { "from": "human", "value": "var fs = require('fs');\nvar q = require('q');\nvar sysu = require('util');\n\nvar resolve = require('./resolve');\n\nfunction loadCredentials(credentials) {\n\n\t// Prepare PKC...
javascript
chosen
[ { "from": "system", "value": "Fix Primus ws access by first registering interfaces and then starting http server with listen\n" }, { "from": "human", "value": "(function () {\n\n var express = require('express')\n , namespace = require('express-namespace')\n , Multiplexer = re...
javascript
chosen
[ { "from": "system", "value": "Watch current application's entry point directory" }, { "from": "human", "value": "var path = require('path')\n, http = require('http')\nexports = function(port){\n http.createServer(require.main.exports.get).listen(port)\n}\n" }, { "from": "gpt", "valu...
javascript
chosen
[ { "from": "system", "value": "Clear Drupal caches is sort of working, but need to figure out if $PATH is available in the environment\n" }, { "from": "human", "value": "Hooks.addMenuItem(\"Actions/Drupal/Coder Review\", \"\", function () {\n Alert.show(\"Drupal!\");\n});" }, { "from": "...
javascript
chosen
[ { "from": "system", "value": "Change option from extraKeys to addKeyMaps\n" }, { "from": "human", "value": "import React from 'react'\nimport SimpleMDE from 'react-simplemde-editor'\n\nconst PoemEditor = (props) => {\n const extraKeys = {\n // 'Ctrl-Enter': () => { props.handleEditorSubmit()...
javascript
chosen
[ { "from": "system", "value": "Remove additional label from x axis\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Bar } from 'react-chartjs-2';\n\nimport { round } from '../utils/format';\n\nexport default function BarChart({ data, yAx...
javascript
chosen
[ { "from": "system", "value": "FIX Removal of existing lock timer on form load" }, { "from": "human", "value": "jQuery.entwine(\"editlock\", function($) {\n\n\t$('.cms-edit-form').entwine({\n\t\tRecordID: null,\n\t\tRecordClass: null,\n\t\tLockURL: null,\n\t\tonmatch: function() {\n\t\t\tif(this....
javascript
chosen
[ { "from": "system", "value": "Fix the typo in the test case\n\n ref #34\n" }, { "from": "human", "value": "'use babel'\n\nimport RandomTipPanel from '../lib/random-tip-panel'\n\ndescribe('RandomTipPanel', () => {\n let panel = null\n beforeEach(() => {\n panel = new RandomTipPanel('user-su...
javascript
chosen
[ { "from": "system", "value": "Save in DB send status\n" }, { "from": "human", "value": "module.exports = function init(params) {\n const emails = params.emails;\n const knex = params.knex;\n const util = params.util;\n const service = require('./services/adNotifications')({ knex, util });\n\...
javascript
chosen
[ { "from": "system", "value": "Make sure clean happens synchronhously\n" }, { "from": "human", "value": "import gulp from 'gulp';\nimport append from 'gulp-add-src';\nimport babel from 'gulp-babel';\nimport mocha from 'gulp-mocha';\nimport del from 'del';\nimport runSequence from 'run-sequence';\...
javascript
chosen
[ { "from": "system", "value": "Remove _actors variable and stick with _actorRefs\n" }, { "from": "human", "value": "/*\n * This class represents actors in the game\n */\n'use strict';\nimport Ball from 'Ball.js';\n\nconst actorsDefinitions = {\n ball: {\n xVelocity: 0,\n yVelocity: 0,\n ...
javascript
chosen
[ { "from": "system", "value": "Add the arrow-parens rule as disabled\n" }, { "from": "human", "value": "module.exports = {\n \"extends\": \"./\",\n\n \"parser\": \"babel-eslint\",\n\n \"env\": {\n \"es6\": true\n },\n\n \"rules\": {\n\n // Override to warn about unnecessary Use Strict ...
javascript
chosen
[ { "from": "system", "value": "Fix issue with example expecting other handlers to be passed to load handler\n" }, { "from": "human", "value": "import makeOrganism from '../../../src'\nimport * as loadItemsState from '../state/placeholderAPI'\nimport Items from '../components/Items'\n\n// export d...
javascript
chosen
[ { "from": "system", "value": "Fix root component on mobile platform\n" }, { "from": "human", "value": "import Expo from 'expo';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\n\n// we don't want this to require transformation\nclass AwakeIn...
javascript
chosen
[ { "from": "system", "value": "Stop console error about content security policy\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'smallprint',\n environment: environment,\n baseURL: '/',\n locationTyp...
javascript
chosen
[ { "from": "system", "value": "Exclude tests and examples from API docs\n" }, { "from": "human", "value": "\n// TypeDoc Configuration\nmodule.exports = {\n out: '../../docs/dist/api/rev-models',\n\n readme: './DOCINDEX.md',\n includes: './src',\n theme: '../../docs/typedoc/theme/',\n ...
javascript
chosen
[ { "from": "system", "value": "Add user identification to segment" }, { "from": "human", "value": "/**\n * @license Angulartics v0.17.0\n * (c) 2013 Luis Farzati http://luisfarzati.github.io/angulartics\n * License: MIT\n */\n(function(angular) {\n'use strict';\n\n/**\n * @ngdoc overview\n * @nam...
javascript
chosen
[ { "from": "system", "value": "Remove filterelements if no query\n" }, { "from": "human", "value": "'use strict';\nimport Reflux from 'reflux';\nimport Socket from 'socket.io-client';\nimport {filter} from 'lodash';\nimport QueryAction from './QueryUpdate.action.js';\n\nconst socket = Socket.conn...
javascript
chosen
[ { "from": "system", "value": "Add rel=\"noopener\" target=\"_blank\" to external links\n" }, { "from": "human", "value": "import { Link as GatsbyLink } from \"gatsby\"\nimport React from \"react\"\n\nconst styles = {\n borderRadius: \"0.3em\",\n code: {\n textShadow: \"none\",\n },\n}\n\nc...
javascript
chosen
[ { "from": "system", "value": "Add constructormethod and set state on input value change\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nclass SearchBar extends Component {\n render() {\n return <input />;\n }\n};\n\nexport default SearchBar;\n" }, { "...
javascript
chosen
[ { "from": "system", "value": "Add some output info, remove unused branching\n" }, { "from": "human", "value": "import Promise from 'bluebird';\n\n//\n// getLastTimetamp will get the last indexing timestamp from Firebase\n//\nconst getLastTimestamp = ({ CONFIG, dataset, fb }) => {\n\n if (!CON...
javascript
chosen
[ { "from": "system", "value": "Save buffer when changing date, and load the new date's buffer\n\nStraightforwardly do this in the changeDate action creator\n" }, { "from": "human", "value": "import * as types from './actionTypes'\n\nexport function changeDate (date) {\n return {\n type: types...
javascript
chosen
[ { "from": "system", "value": "Change source path of old model file from data to cache folder\n" }, { "from": "human", "value": "var path = require('path'),\n vow = require('vow'),\n inherit = require('inherit'),\n fsExtra = require('fs-extra'),\n Base = require('./base');\n\nmodule.e...
javascript
chosen
[ { "from": "system", "value": "Add theme prop to SimpleSelect instance\n" }, { "from": "human", "value": "const PropTypes = require('prop-types');\nconst React = require('react');\nconst Button = require('./Button');\nconst SimpleSelect = require('./SimpleSelect');\n\nclass HeaderMenu extends Rea...
javascript
chosen
[ { "from": "system", "value": "Use `padStart` to complete random bytes with zeros\n\nThe use of `String.padStart()` is in my opinion more idiomatic than manually add zeros at the beginning, then removing them." }, { "from": "human", "value": "function yyid() {\n /* eslint-disable arrow-body-styl...
javascript
chosen
[ { "from": "system", "value": "Add tests for serial operation\n" }, { "from": "human", "value": "const test = require('blue-tape')\nconst Dexie = require('dexie')\nconst DexieBatch = require('./dexie-batch')\n\nconst batchSize = 10\nconst testEntries = Array(42).fill().map((_, i) => i)\n\ntestWit...
javascript
chosen
[ { "from": "system", "value": "Add default case to switch statement\n" }, { "from": "human", "value": "#! /usr/local/bin/node\n\nconst fs = require('fs')\nconst add = require('./commands/add')\nconst list = require('./commands/list')\nconst done = require('./commands/done')\n\nconst command = pro...
javascript
chosen
[ { "from": "system", "value": "Use renderFile directly if an engine supports it.\n" }, { "from": "human", "value": "exports.name = 'adapter-base-express';\n\nexports.attach = function(/* options */){\n var self = this;\n\n /**\n * This plugin requires that a template engine plugin has already...
javascript
chosen
[ { "from": "system", "value": "Change chart background to gradient.\n" }, { "from": "human", "value": "google.charts.load('current', {'packages':['corechart']});\n\nfunction drawChart() {\n // Instead of the following, get the visits and days array from localStorage\n var visits = [5, 10, 7,20,...
javascript
chosen
[ { "from": "system", "value": "feat(client): Use localForage instead of localStorage\n" }, { "from": "human", "value": "class persist {\n static get SESSION_TOKEN_KEY () { return 'sessionToken' }\n static willGetSessionToken() {\n return new Promise(resolve => {\n try {\n resolve...
javascript
chosen
[ { "from": "system", "value": "Set up models for DB\n" }, { "from": "human", "value": "const mongoose = require('mongoose');\n" }, { "from": "gpt", "value": "const mongoose = require('mongoose');\n\nconst noteSchema = mongoose.Schema({\n user_id: String,\n // not sure what notes sho...
javascript
chosen
[ { "from": "system", "value": "Correct update date in constants\n" }, { "from": "human", "value": "\nvar moment = require('moment');\n\n// note that month indices are zero-based\n\nmodule.exports.DATA_START_YEAR = 2012;\nmodule.exports.DATA_START_MONTH = 0;\n\nmodule.exports.DATA_END_YEAR = 2015;...
javascript
chosen
[ { "from": "system", "value": "Add key reading and response key hashing and encoding\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(client, data){\n client.shaking = true;\n let socket = client.socket;\n socket.write('Nice');\n};\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Add test case of TalkAction\n\n- should dont to set nowtalking if call talk method\n" }, { "from": "human", "value": "'use strict';\n\nconst chai = require('chai');\nconst {expect} = chai;\nconst {sandbox} = require('sinon');\nchai.use(require('sinon-chai'));\n\ndes...
javascript
chosen
[ { "from": "system", "value": "Add new blog post redirect function button.\n" }, { "from": "human", "value": "'use strict';\n\n/* global CartUtility */\nmodule.exports = function ($scope, $location, $window) {\n CartUtility.log('CartBlogListCtrl');\n};" }, { "from": "gpt", "value":...
javascript
chosen
[ { "from": "system", "value": "Use object-assign polyfill for object creation\n" }, { "from": "human", "value": "const {bindActionCreators} = require('redux')\nconst store = require('../store')\nconst globals = require('./globals')\nconst captures = require('./captures')\n\nconst unboundActions =...
javascript
chosen
[ { "from": "system", "value": "Fix usableCommand bug from Kyra\n\n" }, { "from": "human", "value": "exports.conf = {\n type: \"get\",\n method: \"usableCommands\",\n appliesTo: [\"Message\"],\n};\n\n// eslint-disable-next-line func-names\nexports.extend = function () {\n this.client.commands....
javascript
chosen
[ { "from": "system", "value": "Add site footer to each documentation generator\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar cssstats = require('cssstats')\n\nvar module = require('tac...
javascript
chosen
[ { "from": "system", "value": "Make default window size smaller\n" }, { "from": "human", "value": "'use strict'\n\nconst electron = require('electron')\nconst app = electron.app // Module to control application life.\nconst BrowserWindow = electron.BrowserWindow // Module to create native browser...
javascript
chosen
[ { "from": "system", "value": "Add unit tests for scope-bootstrap.js in the browser\n" }, { "from": "human", "value": "test(\"scope() must be defined\",function(){\n ok(false, \"missing tests\");\n});\n" }, { "from": "gpt", "value": "(function(){\n\n var\n // global object\n g...
javascript
chosen
[ { "from": "system", "value": "Fix OptionParser::InvalidOption: invalid option: --source-map\n" }, { "from": "human", "value": "module.exports = {\n\n // Production settings\n prod: {\n options: {\n sourceMap: true,\n loadPath: require('node-refills').includePat...
javascript
chosen
[ { "from": "system", "value": "Set age groups to match paper registration.\n" }, { "from": "human", "value": "calculateAgeGroup = function (age) {\n /*\n * Calculate the age group\n * based on an age input\n * return the age group string\n * 0-5: child\n * 6-10: youth\n * 11-...
javascript
chosen
[ { "from": "system", "value": "Put bracket in wrong place\n" }, { "from": "human", "value": "uis.directive('uiSelectMatch', ['uiSelectConfig', function(uiSelectConfig) {\n return {\n restrict: 'EA',\n require: '^uiSelect',\n replace: true,\n transclude: true,\n templateUrl: functi...
javascript
chosen
[ { "from": "system", "value": "Add user 'danilorb' as new challenger.\n" }, { "from": "human", "value": "// Welcome!\n// Add your github user if you accepted the challenge!\n\nvar players = [\n\t'raphamorim',\n\t'israelst',\n\t'afonsopacifer',\n\t'rafaelfragosom',\n 'brunokinoshita',\n\t'pauli...
javascript
chosen
[ { "from": "system", "value": "Add fallback value for bucket\n\nOtherwise, we cannot get to the orion configuration page in a newly\ndeployed app (because FS.Store will crash without the bucket specified).\n" }, { "from": "human", "value": "// Read AWS config from orion. Orion ensures these are o...
javascript
chosen
[ { "from": "system", "value": "Use match() in meteor methods to be able to use the \"audit-argument-checks\" MDG package\n" }, { "from": "human", "value": "/***\n * loggerSet - checks to see if the Logger object has been created on server\n * @returns {boolean} - return true if the Logger object ...
javascript
chosen
[ { "from": "system", "value": "fix(client): Update location detection for socket.io\n" }, { "from": "human", "value": "var Karma = require('./karma');\nvar StatusUpdater = require('./updater');\nvar util = require('./util');\n\nvar KARMA_URL_ROOT = require('./constants').KARMA_URL_ROOT;\n\n\n// C...
javascript
chosen
[ { "from": "system", "value": "Add isDerMarktEnabled to defaultConfigs seeder\n" }, { "from": "human", "value": "module.exports = {\n up: queryInterface => {\n return queryInterface.bulkInsert('configs', [{\n app: 'default',\n baseUrl: 'https://domain.com',\n currency: 'EUR',\n...
javascript
chosen
[ { "from": "system", "value": "Fix push stream prototype constructor.\n" }, { "from": "human", "value": "define([\n './stream',\n '../functional/isFunction',\n '../functional/isDefined',\n '../functional/invoke'\n], function (Stream, isFunction, isDefined, invoke) {\n 'use strict';...
javascript
chosen
[ { "from": "system", "value": "Convert main_action function definition to using inject().\n" }, { "from": "human", "value": "function main_action() {\n\tif (/\\/$/.test(req.path)) { // Path ends with / -> we're in a popup\n\t\tthis.renderPopup({\n\t\t\tcontent: this.renderTemplate('picture', {\n\...
javascript
chosen
[ { "from": "system", "value": "Clean the sandbox after the last test\n\nOtherwise there can be some weird test pollution\n" }, { "from": "human", "value": "(function(){\n\nfunction mochaSinon(sinon){\n if (typeof beforeEach !== \"function\") {\n throw \"mocha-sinon relies on mocha having been...
javascript
chosen
[ { "from": "system", "value": "Fix bug where not updating task would make monitor requeue it\n" }, { "from": "human", "value": "'use strict';\n\nvar events = require('events'),\n util = require('util');\n\nmodule.exports = function(manager, data) {\n events.EventEmitter.call(this);\n var...
javascript
chosen
[ { "from": "system", "value": "Add more items to demo\n" }, { "from": "human", "value": "'use strict';\n\nimport React from 'react/addons';\n\nimport Accordion from '../src/Accordion';\nimport AccordionItem from '../src/AccordionItem';\n\nclass Demo extends React.Component {\n\n render() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add api items to network first list.\n" }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\n\nconst jsFiles = fs.readdirSync(path.resolve('dist', 'chrome')).filter(filename => filename.endsWith('.js.br')).map(filename => `dist/c...
javascript
chosen
[ { "from": "system", "value": "Fix typo in websocket example" }, { "from": "human", "value": "var messageTxt;\nvar messages;\n\n$(function () {\n\n\tmessageTxt = $(\"#messageTxt\");\n\tmessages = $(\"#messages\");\n\n\n\tw = new Ws(\"ws://\" + HOST + \"/my_endpoint\");\n\tw.OnConnect(function () ...
javascript
chosen
[ { "from": "system", "value": "Call req.send when using get convienience function.\n" }, { "from": "human", "value": "define(['exports',\n './lib/request',\n 'url'],\nfunction(exports, Request, uri) {\n\n function request(url, method, cb) {\n var headers;\n \n if (typeof u...
javascript
chosen
[ { "from": "system", "value": "Allow multiple components defined in one file.\n" }, { "from": "human", "value": "module.exports = {\n parser: 'babel-eslint',\n extends: 'airbnb',\n globals: {\n before: true,\n beforeEach: true,\n after: true,\n afterEach: true,\n describe: true,...
javascript
chosen
[ { "from": "system", "value": "Add origin to option setting failure\n" }, { "from": "human", "value": "'use strict'\n\nvar jsYAML = require('js-yaml')\n\nmodule.exports = yamlConfig\n\n// Modify remark to read configuration from comments.\nfunction yamlConfig() {\n var Parser = this.Parser\n va...
javascript
chosen
[ { "from": "system", "value": "Fix running bower on non-windows\n" }, { "from": "human", "value": "var join = require('path').join;\r\nvar execFileSync = require('child_process').execFileSync;\r\nvar WHERE_PATH = join(process.env.WINDIR, 'System32', 'where.exe');\r\nvar cache = {};\r\nvar origina...
javascript
chosen
[ { "from": "system", "value": "Fix a few imports missing, and errors\n" }, { "from": "human", "value": "import uuid from 'node-uuid';\nimport express from 'express';\nimport OrientDB from 'orientjs';\nimport {BinaryServer} from 'binaryjs';\n\nimport setupStreamServer from './lib/setup-stream-serv...
javascript
chosen
[ { "from": "system", "value": "Refactor to improve bundle size\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = visit\n\nvar visitParents = require('unist-util-visit-parents')\n\nvisit.CONTINUE = visitParents.CONTINUE\nvisit.SKIP = visitParents.SKIP\nvisit.EXIT = visitParents.E...
javascript
chosen
[ { "from": "system", "value": "Transform ESM to CJS when BABEL_ENV is \"test\"\n" }, { "from": "human", "value": "const pluginLodash = require('babel-plugin-lodash')\nconst pluginReactRequire = require('babel-plugin-react-require').default\nconst presetEnv = require('babel-preset-env')\nconst pre...
javascript
chosen
[ { "from": "system", "value": "Remove 'foo' From Session Storage\n\nJust a little cleanup for those OCD folks out there." }, { "from": "human", "value": "module.exports = (function store() {\n 'use strict';\n\n function nope() { /* Fallback for when no store is supported */ }\n\n try {\n se...
javascript
chosen
[ { "from": "system", "value": "Change successful event to resolve response data\n" }, { "from": "human", "value": "var Q = require('q');\n\nmodule.exports = function(AWS){\n\tAWS.Request.prototype.promise = function(){\n\t\tvar deferred = Q.defer();\n\n\t\tthis.\n\t\ton('success', function(respon...
javascript
chosen
[ { "from": "system", "value": "Check warningCount as well as errorCount\n\nhttp://eslint.org/docs/developer-guide/nodejs-api#executeonfiles\n\n\"The errorCount and warningCount give the exact number of\nerrors and warnings respectively on the given file.\"\n" }, { "from": "human", "value": "'use ...
javascript
chosen
[ { "from": "system", "value": "Add config for client ID for premium g maps users" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-place-autocomplete',\n contentFor: function(type, config) {\n var content = '';\n if (type === 'bod...
javascript
chosen
[ { "from": "system", "value": "Use dynamic port for heroku\n" }, { "from": "human", "value": "\"use strict\";\n\nvar request = require('request');\nvar bodyParser = require('body-parser');\n\nvar express = require('express');\nvar app = express();\n\napp.use('/', express.static(__dirname + '/publ...
javascript
chosen
[ { "from": "system", "value": "Add date time to all console log output\n" }, { "from": "human", "value": "'use strict';\n\nconst schedule = require('node-schedule');\n\nconst jenkins = require('./lib/jenkins');\nconst redis = require('./lib/redis');\n\nconst gitter = require('./lib/gitter');\n...
javascript
chosen
[ { "from": "system", "value": "Use just the default exports\n" }, { "from": "human", "value": "import {default as color, Color} from \"./src/color\";\nimport {default as rgb, Rgb} from \"./src/rgb\";\nimport {default as hsl, Hsl} from \"./src/hsl\";\nimport {default as lab, Lab} from \"./src/lab\...
javascript
chosen
[ { "from": "system", "value": "Add pushHamburgerIcon and remove .scroll-icon\n" }, { "from": "human", "value": "$(document).ready(function() {\n \n $(window).scroll(function() {\n if ($(this).scrollTop() > 1) {\n \n /* add header animation */\n $('header'...
javascript
chosen
[ { "from": "system", "value": "Correct typo in keypair generation example" }, { "from": "human", "value": "'use strict';\n\nvar storj = require('storj');\nvar fs = require('fs');\n// Set the bridge api URL\nvar api = 'https://api.storj.io';\n// Create client for interacting with API\n\n// API cre...
javascript
chosen
[ { "from": "system", "value": "Switch google analytics to always use https, since they redirect theselves\n" }, { "from": "human", "value": "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),...
javascript
chosen
[ { "from": "system", "value": "Handle bad title requests on getWiki endpoint\n" }, { "from": "human", "value": "const bodyParser = require('body-parser');\nconst request = require('request');\nconst Entities = require('html-entities').AllHtmlEntities;\n\nconst entities = new Entities(); // decode...
javascript
chosen