conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove redundant exception handling in exportCollection\n" }, { "from": "human", "value": "const { search, exportSearch } = require('../services')\nconst { transformApiResponseToSearchCollection } = require('../transformers')\n\nfunction getCollection (searchEntity,...
javascript
chosen
[ { "from": "system", "value": "Add warn and error to generic object\n" }, { "from": "human", "value": "/**\n * @require {core.ext.Object}\n * @require {core.ext.String}\n * @require {core.ext.Function}\n */\ncore.Class(\"lowland.Object\", {\n include : [core.property.MGeneric, lowland.base.UserD...
javascript
chosen
[ { "from": "system", "value": "Make links open up in new windows." }, { "from": "human", "value": "// Simple file for handling text.\nvar Text = (function() {\n\t\n\tvar emailRegex = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}/ig;\n\tvar emailReplacement = '<a class=\"email\" href=\"mailto:$&\">$&</...
javascript
chosen
[ { "from": "system", "value": "Fix address prefixes, add dogecoin/litecoin BIP32 versions\n" }, { "from": "human", "value": "// https://en.bitcoin.it/wiki/List_of_address_prefixes\nmodule.exports = {\n bitcoin: {\n bip32: {\n pub: 0x0488b21e,\n priv: 0x0488ade4\n },\n pubKeyHa...
javascript
chosen
[ { "from": "system", "value": "Remove async again - not compatibile with leafletjs\n" }, { "from": "human", "value": "var components = require('./components');\nvar javascript = require('../tasks/javascript');\nvar extend = require('extend');\n\n/**\n * Helper function for rendering a page\n * Ab...
javascript
chosen
[ { "from": "system", "value": "Add filter tags to stories actions on js app\n" }, { "from": "human", "value": "import { createAction } from 'redux-actions';\nimport { createThunkAction } from 'utils/redux';\n\nconst fetchStoriesInit = createAction('fetchStoriesInit');\nconst fetchStoriesReady = c...
javascript
chosen
[ { "from": "system", "value": "Improve track API file header.\n" }, { "from": "human", "value": "/**\n * Cache data.\n *\n * Site Kit by Google, Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance w...
javascript
chosen
[ { "from": "system", "value": "Add static server middleware that is active in non-production environments only.\n" }, { "from": "human", "value": "// Server startup script\n// =====================\n// Responsible for configuring the server,\n// inserting middleware, and starting the\n// app up. ...
javascript
chosen
[ { "from": "system", "value": "Allow ping command to be used by anyone\n" }, { "from": "human", "value": "const Command = require('../Command')\n\nmodule.exports =\nclass PingCommand extends Command {\n constructor (client) {\n super(client, {\n name: 'ping',\n properName: 'Ping',\n...
javascript
chosen
[ { "from": "system", "value": "Remove unused SockJS server-side config options\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n define(['sockjs'], function (sockjs) {\n var sockjs_opts = {\n sockjs_url: 'http://cdn.sockjs.org/sockjs-0.3.min.js'\n };\n\n return ...
javascript
chosen
[ { "from": "system", "value": "Delete the hard-coded fake teams\n" }, { "from": "human", "value": "import { ADD_TEAM_SUCCESS } from './actionCreators'\r\n\r\nlet initialState = [\r\n { id: 2, name: 'gym', colour: \"#49078d\", balance: 105463 },\r\n { id: 1, name: 'fred', colour: \"#23fe4d\", ba...
javascript
chosen
[ { "from": "system", "value": "Make sure we're not grabbing any prototype props\n\nProbably unnecessary, but let's be safe\n" }, { "from": "human", "value": "'use strict';\n\nvar trackStar = (function(){\n function TrackStar() {\n var integrations = {};\n\n if(!(this instanceof TrackStar))...
javascript
chosen
[ { "from": "system", "value": "Add the name of the included script\n" }, { "from": "human", "value": "/** Copyright (c) 2013 Jan Nicklas Released under MIT license */\n\n/* global define: false, jQuery: true */\n/* jshint sub:true */\n\n// RequireJS amd factory\n// http://stackoverflow.com/questi...
javascript
chosen
[ { "from": "system", "value": "Fix `render is undefined` in EmailParliament\n" }, { "from": "human", "value": "import React, { useState } from 'react';\nimport classnames from 'classnames';\nimport { search } from './api';\nimport SearchByPostcode from './SearchByPostcode';\nimport EmailComposer ...
javascript
chosen
[ { "from": "system", "value": "Make community card horizontal by default\n" }, { "from": "human", "value": "'use strict';\nimport React from 'react';\n\nvar CommunityCard = React.createClass({\n displayName: 'CommunityCard',\n\n propTypes: {\n title: React.PropTypes.string,\n linkTitle: R...
javascript
chosen
[ { "from": "system", "value": "Use modulePaths instead of moduleDirectories\n" }, { "from": "human", "value": "import Metalsmith from 'metalsmith';\nimport common from '@rollup/plugin-commonjs';\nimport inPlace from '@metalsmith/in-place';\nimport layouts from '@metalsmith/layouts';\nimport markd...
javascript
chosen
[ { "from": "system", "value": "Update dropdown with properr var name\n" }, { "from": "human", "value": "import React from 'react';\nimport { changeApplicationFieldValue } from '../../actions/application';\nimport { bindActionCreators } from 'redux';\nimport { connect } from 'react-redux';\n\ncons...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary conversion, that is done now at kata creation time." }, { "from": "human", "value": "import Kata from './kata.js';\n\nexport default class KataGroup {\n \n static withKatas(groupName, rawKataItems) {\n var group = new KataGroup();\n group.n...
javascript
chosen
[ { "from": "system", "value": "Fix navigating twice with params\n" }, { "from": "human", "value": "import { isArray } from 'lodash';\nimport { AppNavigator } from 'DailyScrum/src/Scenes';\n\nexport default (state, action) => {\n const { type } = action;\n if (type === 'Navigation/NAVIGATE' && i...
javascript
chosen
[ { "from": "system", "value": "[feat]: Add endpoints to update and delete user\n" }, { "from": "human", "value": "import express from 'express';\nimport UserController from '../controllers/UserController';\n\nconst userRouter = express.Router();\nuserRouter.post('/api/user/signup', UserController...
javascript
chosen
[ { "from": "system", "value": "Use , rather than ;\n" }, { "from": "human", "value": "$(document).ready(function (){\n var width = $(window).width(),\n costumizedWith = width - 30,\n image = $('.artis-img');\n headline = $('.headline-img');\n ads = $('.ads');\n i...
javascript
chosen
[ { "from": "system", "value": "[DDW-557] Correct path for EPOCH files in Linux\n" }, { "from": "human", "value": "// @flow\nimport fs from 'fs';\nimport path from 'path';\nimport { appFolderPath } from '../config';\nimport { getNumberOfEpochsConsolidatedChannel } from '../ipc/getNumberOfEpochsCon...
javascript
chosen
[ { "from": "system", "value": "Set max length on mapcode pieces\n\nFixes #1.\n" }, { "from": "human", "value": "'use strict';\nvar fs = require('fs');\nvar Download = require('download');\nvar CSV = require('comma-separated-values');\nvar arrayUniq = require('array-uniq');\n\nnew Download({extrac...
javascript
chosen
[ { "from": "system", "value": "Rename of pre and elems to generic nodes\n" }, { "from": "human", "value": "define([\n 'jquery', // src/jquery.js,\n 'defaults'\n], function ($, defaults) {\n\n function Crayon(element, options) {\n console.error('construct');\n this.element = element;\n ...
javascript
chosen
[ { "from": "system", "value": "Increase timeout in crash/worker test for travis\n" }, { "from": "human", "value": "\n'use strict';\n\nvar path = require('path');\n\nvar expect = require('thehelp-test').expect;\nvar supertest = require('supertest');\nvar util = require('./util');\n\ndescribe('top-...
javascript
chosen
[ { "from": "system", "value": "Add data accuracy note in footer\n" }, { "from": "human", "value": "import React from 'react';\nimport './scss/footer.scss';\n\nconst Footer = () => {\n return (\n <footer>\n <p>© 2016 Michael Kohler - JavaScript frontend and backend developer\n with...
javascript
chosen
[ { "from": "system", "value": "Fix keys case into details panel\n" }, { "from": "human", "value": "'use strict';\n\nlet blessed = require('blessed');\nlet _ = require('lodash');\nlet config = require('../../config/config');\n\n\nmodule.exports = function () {\n let hostDetailsPanel = blessed.l...
javascript
chosen
[ { "from": "system", "value": "Add missing translation to consumer-ui\n" }, { "from": "human", "value": "angular.module('nnConsumerUi')\n .config(function($translateProvider) {\n $translateProvider.translations('fi', {\n 'REQUIRED_FIELD': 'Pakollinen kenttä',\n 'CHARACTERS_LEFT': 'M...
javascript
chosen
[ { "from": "system", "value": "Add comment for null as default value\n" }, { "from": "human", "value": "\"use strict\";\n\nvar Vow = require( \"vow\" );\n\nmodule.exports = function( grunt ) {\n\n var filter = Array.prototype.filter,\n JSCS = require( \"./lib/jscs\" ).init( grunt );\n\n...
javascript
chosen
[ { "from": "system", "value": "Implement class/static method for George\n" }, { "from": "human", "value": "export default class GeorgeForeman {\n constructor() {\n }\n}\n" }, { "from": "gpt", "value": "export default class GeorgeForeman {\n constructor() {\n this.generation = Ge...
javascript
chosen
[ { "from": "system", "value": "Call resizeevent on body when cookiebanner change visibility\nMake it possible to change something in web after the visibility of the cookiebanner changed. For example to move fixed content, if the cookiebanner appears on top of the page.\n" }, { "from": "human", "v...
javascript
chosen
[ { "from": "system", "value": "Fix Gulp not watching subdirectories of client\n" }, { "from": "human", "value": "var babelify = require('babelify');\nvar browserify = require('browserify');\nvar browserSync = require('browser-sync');\nvar buffer = require('vinyl-buffer');\nvar gulp = require('gul...
javascript
chosen
[ { "from": "system", "value": "Add standalone field to browserify build\n\ncloses #29\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar browserify = require('browserify');\nvar source = require('vinyl-source-stream');\nvar streamify = require('gulp-streamify');\...
javascript
chosen
[ { "from": "system", "value": "Use ng-style to fix header float issue on ie10.\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module(\"hikeio\").\n\tdirective(\"headerEntry\", function() {\n\t\treturn {\n\t\t\tscope: {\n\t\t\t\talign: \"@\",\n\t\t\t\tlabel: \"@\",\n\t\t\t\turl: \"@...
javascript
chosen
[ { "from": "system", "value": "Use const instead of var in require\n" }, { "from": "human", "value": "var elixir = require('laravel-elixir');\n\nrequire('laravel-elixir-vue');\n\n/*\n |--------------------------------------------------------------------------\n | Elixir Asset Management\n |------...
javascript
chosen
[ { "from": "system", "value": "Increase QUnit timeout to 10s, as Travis doesn't finish in time.\n" }, { "from": "human", "value": "/*\n * Paper.js - The Swiss Army Knife of Vector Graphics Scripting.\n * http://paperjs.org/\n *\n * Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey\n * http...
javascript
chosen
[ { "from": "system", "value": "Add query and callback parsing to get/post/put/del\n" }, { "from": "human", "value": "var parse = require('./parse');\n\nmodule.exports = function(data) {\n this.token = data.token;\n};\n\nmodule.exports.prototype = {\n get: function() {\n query = parse...
javascript
chosen
[ { "from": "system", "value": "Fix plugin injection on Windows\n" }, { "from": "human", "value": "const babelLoaderMatcher = function(rule) {\n return rule.loader && rule.loader.indexOf(\"babel-loader/\") != -1;\n}\n\nconst getLoader = function(rules, matcher) {\n var loader;\n\n rules.some(ru...
javascript
chosen
[ { "from": "system", "value": "Set greeting defaults to null\n" }, { "from": "human", "value": "let userConfig;\n\ntry {\n userConfig = require('../config');\n} catch (e) {\n throw new Error(`Config file could not be found or read! The error given was: ${e.message}`);\n}\n\nconst defaultConfig ...
javascript
chosen
[ { "from": "system", "value": "Fix SLURM allocation details summary.\n" }, { "from": "human", "value": "import slurmAllocationDetailsDialog from './slurm-allocation-details-dialog';\nimport slurmAllocationUsageChart from './slurm-allocation-usage-chart';\nimport slurmAllocationUsageTable from './...
javascript
chosen
[ { "from": "system", "value": "Add an additional match line for http\n\nAdd an additional match line for http so the script script runs on http/s." }, { "from": "human", "value": "// ==UserScript==\n// @name Display Stats\n// @namespace https://github.com/EFox2413/initiumGrease\n// @ve...
javascript
chosen
[ { "from": "system", "value": "Add publish task (for gh-pages)\n" }, { "from": "human", "value": "///\nvar pkg = require(\"./package.json\")\n , gulp = require(\"gulp\")\n , plumber = require(\"gulp-plumber\")\n\n///\n// Lint JS\n///\nvar jshint = require(\"gulp-jshint\")\n , jsonFiles = [\".j...
javascript
chosen
[ { "from": "system", "value": "Remove the license from the package export\n\nAlready present in the downloaded package\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar zip = require('gulp-zip');\n\n// Release\ngulp.task('release', function () {\n\n var zippe...
javascript
chosen
[ { "from": "system", "value": "Use the right step name for profiling\n" }, { "from": "human", "value": "const _ = require('underscore');\n\nmodule.exports = function dbConnSetup (pgConnection) {\n return function dbConnSetupMiddleware (req, res, next) {\n const { user } = res.locals;\n\...
javascript
chosen
[ { "from": "system", "value": "Add more languages to highlight\n" }, { "from": "human", "value": "import hljs from 'highlight.js/lib/highlight';\nimport javascript from 'highlight.js/lib/languages/javascript';\nimport ruby from 'highlight.js/lib/languages/ruby';\nimport elixir from 'highlight.js/...
javascript
chosen
[ { "from": "system", "value": "Change away froma accepting array to accepting arguments like our own createServer\n" }, { "from": "human", "value": "/*globals module, require*/\n\nvar stack = require('stack'),\n http = require('http'),\n _hs = http.createServer;\n\nhttp.createServer = funct...
javascript
chosen
[ { "from": "system", "value": "Fix version in error reports\n\nWe need to return a string here, but match() is an array.\n" }, { "from": "human", "value": "import RavenService from 'ember-cli-sentry/services/raven';\nimport { inject as service } from '@ember/service';\nimport config from '../conf...
javascript
chosen
[ { "from": "system", "value": "Add test endpoint for /orders\n" }, { "from": "human", "value": "export default function() {\n}\n" }, { "from": "gpt", "value": "export default function() {\n\n this.get('/orders', function(db, request) {\n return {\n data: [\n {\n ...
javascript
chosen
[ { "from": "system", "value": "Comment local unit testing from using browserstack\n" }, { "from": "human", "value": "// Include common configuration\nconst {karmaCommon, getKarmaConfig, defaultBrowserMatrix} = require('../../../test/karma.common');\n\nmodule.exports = function (config) {\n const...
javascript
chosen
[ { "from": "system", "value": "Add support for adding classes to the select box\n" }, { "from": "human", "value": "Handlebars.registerHelper('select_box', function(field, options) {\n var html_options,\n _this = this;\n if (!field) {\n return;\n }\n\n if (options.hash.optionValues && opti...
javascript
chosen
[ { "from": "system", "value": "Add fix issue with linux time\n\n" }, { "from": "human", "value": "import dotProp from 'dot-prop-immutable'\nimport * as types from './forecastDailyActionTypes'\n\nconst initialState = {\n forecastDaily: {\n data: [],\n app: {\n locationId: 5128581 // ny...
javascript
chosen
[ { "from": "system", "value": "Rename variable in regular expression build script\n" }, { "from": "human", "value": "var captureDigit = '([1-9][0-9]*)'\n\nvar EUCD = new RegExp(\n '^' +\n captureDigit + 'e' +\n optional(captureDigit + 'u') +\n optional(captureDigit + 'c') +\n optional(captur...
javascript
chosen
[ { "from": "system", "value": "Fix double inclusion of jquery\n" }, { "from": "human", "value": "//= require jquery\n//= require jquery.ui.all\n//= require georgia/jquery.ui.touch-punch\n//= require jquery_ujs\n//= require jquery-fileupload\n//= require twitter/bootstrap\n//= require select2\n//=...
javascript
chosen
[ { "from": "system", "value": "Examples: Fix mock sensor randomization code\n" }, { "from": "human", "value": "// This mock sensor implementation triggers an event with some data every once in a while\n\nvar emitter = require( \"events\" ).EventEmitter,\n\tpossibleStrings = [\n\t\t\"Helsinki\",\n...
javascript
chosen
[ { "from": "system", "value": "Change number of issues per page to 100\n" }, { "from": "human", "value": "import { R, BPromise } from \"../../utils\";\nimport { Github } from \"../../github\";\nimport { Mentor } from \"../../mentor\";\nimport { Pivotal } from \"../../pivotal\";\n\nexport class Gi...
javascript
chosen
[ { "from": "system", "value": "Fix syntax for node 10\n" }, { "from": "human", "value": "const REQUIRED_FIELDS = Object.freeze(['to']);\nconst OPTIONAL_FIELDS = Object.freeze([\n 'customer_id',\n 'transactional_message_id',\n 'message_data',\n 'from',\n 'from_id',\n 'reply_to',\n 'reply_to...
javascript
chosen
[ { "from": "system", "value": "Include normal CSS types in the copy rep\n\ngit-svn-id: 35c6607454e245926b27e417202055c242b00e84@8608 e969d3be-0e28-0410-a27f-dd5c76401a8b\n" }, { "from": "human", "value": "/* See license.txt for terms of usage */\n\nFBL.ns(function() { with (FBL) {\n\nvar Fireform...
javascript
chosen
[ { "from": "system", "value": "Add create method in Transcation controller. -cwc\n\nNext thing to do is add update method.\n" }, { "from": "human", "value": "'use strict';\n\nvar mongoose = require('mongoose');\nvar Transaction = require('../models/Transaction');\nmongoose.Promise = global.Promis...
javascript
chosen
[ { "from": "system", "value": "Enable Javascript syntax highlighting in some cmds\n" }, { "from": "human", "value": "/**\n * Development commands plugin\n * \n * This houses the bot's development commands.\n * These commands should only be used if the operator knows what their doing.\n *\n * @lic...
javascript
chosen
[ { "from": "system", "value": "Change name of the event\n" }, { "from": "human", "value": "$(document).ready(function(){\n if (analytics) {\n $('a[target=_blank]').click(function (e) {\n var url = this.getAttribute(\"href\") || this.getAttribute(\"xlink:href\");\n analytics.track(\...
javascript
chosen
[ { "from": "system", "value": "Hide florlp_name when type not 0\n" }, { "from": "human", "value": "$(document).ready(function() {\n $('#verified').click(function() {\n if($(this).attr(\"checked\")) {\n $('#activate').removeAttr('disabled');\n } else {\n $('#...
javascript
chosen
[ { "from": "system", "value": "Use promise chaining during registration\n" }, { "from": "human", "value": "(function (angular) {\n 'use strict';\n\n angular\n .module('movieClub.auth')\n .factory('authApi', authApi);\n\n function authApi($firebaseAuth, usersApi, firebaseRef...
javascript
chosen
[ { "from": "system", "value": "Use equality in tape template\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar tape = require( 'tape' );\nvar lib = require( './../lib' );\n\n\n// TESTS //\n\ntape( 'main export is a function', function test( t ) {\n\tt.ok( typeof lib === 'fu...
javascript
chosen
[ { "from": "system", "value": "Add sort media queries to Grunt mqpacker config.\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n\tgrunt.config('css_mqpacker', {\n\t\toptions: {\n\t\t\tmap: false, // enable/disable source maps\n\t\t},\n\t\tmain: {\n\t\t\tsrc: '<%= project....
javascript
chosen
[ { "from": "system", "value": "Change require to new path. Removed comment that prevents pipecast from working :sweat:\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar serveStdIn = require('./lib/serveStdIn.js');\nvar launchChromecastStreamingApp = require('./lib/sen...
javascript
chosen
[ { "from": "system", "value": "Change children propType for tooltip\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport Dropdown from 'fyndiq-component-dropdown'\n\nimport styles from '../styles.less'\n\nconst Tooltip = ({ text, children, posit...
javascript
chosen
[ { "from": "system", "value": "Refactor syntax language selector redirect url\n" }, { "from": "human", "value": "const toArray = nodelist => Array.prototype.slice.call(nodelist);\nconst things = ['method', 'case', 'organization'];\n\nconst languageSelect = {\n redirectUrl: null,\n isThingDetail...
javascript
chosen
[ { "from": "system", "value": "Put the Counter into App\n\n" }, { "from": "human", "value": "import React from 'react'\n\nconst App = () => (\n <h1>Hello from React</h1>\n)\n\nexport default App\n" }, { "from": "gpt", "value": "import React from 'react'\n\nimport Counter from '../../...
javascript
chosen
[ { "from": "system", "value": "Adjust REPL component target element\n" }, { "from": "human", "value": "import Repl from './Repl.html';\nimport examples from './examples.js';\n\nfunction tryParseData ( encoded ) {\n\ttry {\n\t\treturn JSON.parse( decodeURIComponent( atob( encoded ) ) );\n\t} catch...
javascript
chosen
[ { "from": "system", "value": "docs: Modify the website nav style.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { NavLink } from 'react-router-dom';\nimport nav from '../icons/nav';\nimport styles from './index.module.less';\n\nexport default class index ex...
javascript
chosen
[ { "from": "system", "value": "Create list tag in View.\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n // Model\n\n var Task = Backbone.Model.extend({\n defaults: {\n title: 'do something!',\n completed: false\n },\n validate: function (attr) {\n i...
javascript
chosen
[ { "from": "system", "value": "Add api 401 unauthorized interception and redirect to login\n\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n angular\n .module('doleticApp')\n .service('APIInterceptorService', APIInterceptorService);\n\n APIInterceptorS...
javascript
chosen
[ { "from": "system", "value": "Add version contraints for sinon and chai\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Meteor unit testing framework for packages\",\n name: \"spacejamio:munit\",\n version: \"1.0.0\",\n git: \"https://github.com/spacejamio/meteor-m...
javascript
chosen
[ { "from": "system", "value": "Switch to new spec protocol\n" }, { "from": "human", "value": "const {JsContext} = require('stencila')\n\n/**\n * A Node.js context for executing Javascript code\n */\nclass NodeContext extends JsContext {}\n\nNodeContext.spec = {\n name: 'NodeContext',\n base: 'C...
javascript
chosen
[ { "from": "system", "value": "Use the Correct PropTypes for the FormShape\n" }, { "from": "human", "value": "/**\n * Values suitable for use within `propTypes` of components.\n *\n * @module higherform\n */\n\nimport { PropTypes } from 'react';\n\nexport const FormShape = PropTypes.shape({\n ...
javascript
chosen
[ { "from": "system", "value": "Fix pass of arguments issue\n" }, { "from": "human", "value": "'use strict';\n\nvar assign = require('es5-ext/object/assign')\n , setPrototypeOf = require('es5-ext/object/set-prototype-of')\n , d = require('d')\n\n , captureStackTrace = Error...
javascript
chosen
[ { "from": "system", "value": "Fix java generatino of DAOSink.\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with ...
javascript
chosen
[ { "from": "system", "value": "Improve conciseness of console.log messages\n" }, { "from": "human", "value": "var Bookmark = require('../models/index.js').Bookmark;\n\nvar create = function(props, callback) {\n Bookmark.build(props)\n .save()\n .then(function(bookmark) {\n callback(bookmark...
javascript
chosen
[ { "from": "system", "value": "Tweak RegEx to add colon\n" }, { "from": "human", "value": "/**\n * Searches a content string for titles by the keyword\n * @param {string} contents - File contents as a utf8 string\n * @param {object} cfg - Config object\n * @param {string} [title] - Title to searc...
javascript
chosen
[ { "from": "system", "value": "Add clear command to base object, and simplify inspect\n" }, { "from": "human", "value": "module.exports = exports = function BaseObject(key, myRedis, options) {\n this.key = key;\n\n if (myRedis && !options) {\n options = myRedis;\n myRedis = null;\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Use route whitelist method for security\n" }, { "from": "human", "value": "/*****************************************************************************/\n/* Client and Server Routes */\n/*****************************************************************************...
javascript
chosen
[ { "from": "system", "value": "Fix overwriting of username by passing ‘-u|—username’\n" }, { "from": "human", "value": "'use strict';\n\nvar os = require('os');\nvar path = require('path');\nvar dotenv = require('dotenv');\n\nvar defaultMappings = {\n username: 'SCS_USERNAME',\n password: '...
javascript
chosen
[ { "from": "system", "value": "Update to use new blog location.\n\n" }, { "from": "human", "value": "\nfunction yql_lookup(query, cb_function) {\n var url = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent(query) + '&format=json&diagnostics=true';\n\n //alert(url);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Use max number of attempts to scan user queues\n" }, { "from": "human", "value": "'use strict';\n\nvar QUEUE = require('../job_queue').QUEUE;\n\nfunction QueueSeeker(pool) {\n this.pool = pool;\n}\n\nmodule.exports = QueueSeeker;\n\nQueueSeeker.prototype.seek = f...
javascript
chosen
[ { "from": "system", "value": "Use centralized test data for Amount tests\n" }, { "from": "human", "value": "// Import AVA\nimport test from 'ava'\n\n// Imports\nimport Amount from '../../src/primitives/amount'\nimport BigNumber from 'bignumber.js'\n\n// Test data\nconst testNumber = 78953286724\...
javascript
chosen
[ { "from": "system", "value": "Add annotation selector breacrumb for Direct Linking\n" }, { "from": "human", "value": "import { retryUntil } from '../utils'\nimport { descriptorToRange, markRange } from './annotations'\n\nimport styles from './styles.css'\n\nexport async function highlightAnnotat...
javascript
chosen
[ { "from": "system", "value": "Add as thrift test to suite\n" }, { "from": "human", "value": "// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\...
javascript
chosen
[ { "from": "system", "value": "Fix issues with findUser refactor\n" }, { "from": "human", "value": "const Q = require('q');\n\n// Regex to test if the string is likely a facebook user ID\nconst USER_ID_REGEX = /^\\d+$/;\n\nasync function getFBUserInfoByID(api, id) {\n return await Q.nfcall(api...
javascript
chosen
[ { "from": "system", "value": ":sparkes: Use fake mailer on tests\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(User) {\n if (process.env.NODE_ENV !== 'testing') {\n User.afterRemote('create', async (context, user) => {\n const options = {\n type: '...
javascript
chosen
[ { "from": "system", "value": "Allow method chaining in QueryConverter\n" }, { "from": "human", "value": "/* global URI */\n\n/**\n * QueryConverter stores a list of string to string pairs\n * as a hash (Embereño for POJO) and can export that list as a JSON string,\n * a URL query string, or a ha...
javascript
chosen
[ { "from": "system", "value": "Reset destroyed flag on reset\n" }, { "from": "human", "value": "import Phaser from 'phaser';\n\nimport { tile, nextTile, alignToGrid, pixelToTile } from '../../tiles';\nimport { clone } from '../../utils';\nimport objectPool from '../../object-pool';\n\nimport twee...
javascript
chosen
[ { "from": "system", "value": "Fix issue when redux dev tool extension is not available\n" }, { "from": "human", "value": "import {createStore, applyMiddleware, compose} from 'redux';\nimport { routerMiddleware } from 'react-router-redux';\nimport throttle from 'lodash/throttle';\nimport recipes ...
javascript
chosen
[ { "from": "system", "value": "Add a test testing some known timezone values.\n" }, { "from": "human", "value": "var should = require('should')\n , time = require('../')\n\ndescribe('tzset()', function () {\n\n beforeEach(function () {\n process.env.TZ = 'UTC'\n })\n\n it('should work with...
javascript
chosen
[ { "from": "system", "value": "Fix the title of the main video\n" }, { "from": "human", "value": "import window from 'global/window';\nimport document from 'global/document';\nimport $ from 'jquery';\nimport videojs from 'video.js';\n\nconst player = window.player = videojs('preview-player', {\n ...
javascript
chosen
[ { "from": "system", "value": "Mark response bot as @todo.\n" }, { "from": "human", "value": "const invokeLambdaFunction = require('../src/lambda-invoke-function');\n\nfunction respondOnError(error) {\n const payload = {\n message: error.message,\n };\n\n return invokeLambdaFunction(payload...
javascript
chosen
[ { "from": "system", "value": "Update to use correct jquery-ui.css file\n" }, { "from": "human", "value": "$(document).ready(function(){\n Modernizr.load({\n test: Modernizr.inputtypes.date,\n nope: ['http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', 'http://ajax....
javascript
chosen
[ { "from": "system", "value": "[api] Add options.stdin, clean up options logic.\n" }, { "from": "human", "value": "\nvar prefork = require('../build/Release/prefork').prefork,\n fs = require('fs');\n\nmodule.exports = function (options) {\n options = options || {};\n var outfd, errfd;\n\n i...
javascript
chosen
[ { "from": "system", "value": "Update to first Rest API test\n" }, { "from": "human", "value": "var chai = require('chai');\nvar chaiHttp = require('chai-http');\nvar server = require('../app');\nvar should = chai.should();\n// var expect = chai.expect;\n// var request = require(\"request\");\n\...
javascript
chosen
[ { "from": "system", "value": "Add meta version for build version\n" }, { "from": "human", "value": "import '@/css/tailwind.css'\nimport '@/css/prism.css'\n\nimport { ThemeProvider } from 'next-themes'\nimport Head from 'next/head'\n\nimport siteMetadata from '@/data/siteMetadata'\nimport Analyti...
javascript
chosen
[ { "from": "system", "value": "Remove cls and swap args\n" }, { "from": "human", "value": "describe('Dataview', function () {\n this.bail(true)\n this.timeout(20 * 1000)\n\n it('Switch to \"Dataview\" tab', function (done) {\n eTT().tab('Dataview').click(done)\n })\n\n it('C...
javascript
chosen