conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Move unnecessary things out of env schema" }, { "from": "human", "value": "let EnvironmentVariables = {\n description: 'Set environment variables for each task your service launches in addition to those set by Mesos.',\n type: 'object',\n title: 'Environment Vari...
javascript
chosen
[ { "from": "system", "value": "Replace loaders -> rules. Delete useless configs\n" }, { "from": "human", "value": "const loaders = require(\"./loaders\");\nconst webpack = require(\"webpack\");\nconst path = require(\"path\");\n\nmodule.exports = {\n context: path.join(__dirname, \"..\"),\n ent...
javascript
chosen
[ { "from": "system", "value": "Use `charCodeAt` instead of `charAt`\n\n`charCodeAt` is faster in general.\n\nRef. #4.\n" }, { "from": "human", "value": "/*! http://mths.be/endswith v0.1.0 by @mathias */\nif (!String.prototype.endsWith) {\n\t(function() {\n\t\t'use strict'; // needed to support `a...
javascript
chosen
[ { "from": "system", "value": "Add active() method to graph object model\n" }, { "from": "human", "value": "// Copyright 2015, EMC, Inc.\n\n'use strict';\n\nmodule.exports = GraphModelFactory;\n\nGraphModelFactory.$provide = 'Models.GraphObject';\nGraphModelFactory.$inject = [\n 'Model'\n];\n\...
javascript
chosen
[ { "from": "system", "value": "Fix ilm-session serializer test dependancies\n" }, { "from": "human", "value": "import { moduleForModel, test } from 'ember-qunit';\n\nmoduleForModel('ilm-session', 'Unit | Serializer | ilm session', {\n // Specify the other units that are required for this test.\n...
javascript
chosen
[ { "from": "system", "value": "Add tests for saying more than\n" }, { "from": "human", "value": "var overload = require('../src/overload');\nvar should = require('should');\n\ndescribe('overload', function() {\n describe('arity', function() {\n it('should exist', function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Extend timeout before killing process.\n" }, { "from": "human", "value": "const R = require(\"ramda\");\nconst Promise = require(\"bluebird\");\nconst pubsub = require(\"../\")(\"amqp://docker\");\n\n\n\nconst publish = (event, index) => {\n const data = { number...
javascript
chosen
[ { "from": "system", "value": "Update up to changes in es5-ext\n" }, { "from": "human", "value": "'use strict';\n\nvar CustomError = require('es5-ext/error/custom')\n , logger = require('../lib/logger')();\n\nmodule.exports = function (t, a) {\n\tt = t(logger);\n\tt(true, true, 'foo');\n\tt...
javascript
chosen
[ { "from": "system", "value": "Add /schema path that serves schema as plain text\n" }, { "from": "human", "value": "import express from 'express';\nimport { apolloExpress, graphiqlExpress } from 'apollo-server';\nimport bodyParser from 'body-parser';\nimport cors from 'cors';\nimport { createServ...
javascript
chosen
[ { "from": "system", "value": "Disable some annoying JSCS stuff\n" }, { "from": "human", "value": "// server.js\n\n'use strict';\n\nconst express = require('express');\nconst app = express();\nconst mongoose = require('mongoose');\nconst morgan = require('morgan');...
javascript
chosen
[ { "from": "system", "value": "Remove the `X-Powered-By` header added by Express\n\nThe `X-Powered-By` header provides no real benefit and also leaks\ninformation about the design of the underlying system that may be\nuseful to attackers.\n" }, { "from": "human", "value": "'use strict';\n\nconst ...
javascript
chosen
[ { "from": "system", "value": "Remove left over console log\n" }, { "from": "human", "value": "module(\"Hide department children\", {\n setup: function() {\n this.$departments = $(\n '<div class=\"js-hide-department-children\">'\n + '<div class=\"department\">'\n + '<div clas...
javascript
chosen
[ { "from": "system", "value": "Fix fail on Object.keys(app.me.installed) which was holding up\npage loads.\n\n- fixes #964\n" }, { "from": "human", "value": "import app from 'ampersand-app';\nimport Model from 'ampersand-model';\n\nimport querystring from 'querystring';\n\nexport default Model.ex...
javascript
chosen
[ { "from": "system", "value": "Change the name of Panel and Elements sidebar pane to 'Backbone'\n" }, { "from": "human", "value": "// Script executed every time the devtools are opened.\n\n// custom panel\nchrome.devtools.panels.create(\"Backbone Debugger\", \"img/panel.png\", \"panel.html\");\n\...
javascript
chosen
[ { "from": "system", "value": "Create Web Server & Handle route GET and POST\n" }, { "from": "human", "value": "// Problem: We need a simple way to look at a user's badge count and JavaScript point from a web browser\n// Solution: Use Node.js to perform the profile look ups and server our templat...
javascript
chosen
[ { "from": "system", "value": "Add default case to example file\n" }, { "from": "human", "value": "var express = require('express');\nvar bunyan = require('bunyan');\nvar log = bunyan.createLogger({ name: 'app' });\n\nvar app = express();\n\nvar webhooks = require('datashaman-webhooks');\nwebhook...
javascript
chosen
[ { "from": "system", "value": "Remove default description on user model\n" }, { "from": "human", "value": "const Sequelize = require('sequelize');\nconst db = require('../db.js');\n\nconst Users = db.define('users',\n {\n id: {\n type: Sequelize.UUID,\n defaultValue: Sequelize.UUIDV...
javascript
chosen
[ { "from": "system", "value": "Save RegExp object to database instead of string, and more concise filter\n" }, { "from": "human", "value": "'use strict'\n\nconst mongoose = require('mongoose')\n\nconst PermissionSchema = new mongoose.Schema({\n regex: { type: String, required: true, unique: true...
javascript
chosen
[ { "from": "system", "value": "Add support for removing the last capture group.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\n/** Load modules. */\nvar fs = require('fs'),\n path = require('path');\n\n/** Resolve program params. */\nvar args = process.argv.slice(proc...
javascript
chosen
[ { "from": "system", "value": "Change to 'newNotification', change to post\n\n" }, { "from": "human", "value": "Vue.component('spark-kiosk-notify', {\n props: [\n ],\n data() {\n return {\n 'notifications': [],\n 'users': [],\n 'newNotification': {...
javascript
chosen
[ { "from": "system", "value": "Add knockout bindings as dependency to case search\n" }, { "from": "human", "value": "hqDefine('domain/js/case_search_main', [\n 'jquery',\n 'hqwebapp/js/initial_page_data',\n 'domain/js/case_search',\n], function(\n $,\n initialPageData,\n caseSea...
javascript
chosen
[ { "from": "system", "value": "Change the name of the endpoint\n" }, { "from": "human", "value": "/**\n * Created by Neil on 29/09/13.\n */\nfunction signin(mode, callback, clientID) { // clientID filled in by template, immediate = true because we should not need to ask permission again\n gapi...
javascript
chosen
[ { "from": "system", "value": "Use \"elm-format\" as the default binary path\n\nNot all people have elm-format installed into /usr/local/bin/elm-format (I installed it via package manager so it's in /usr/bin/elm-format), but I assume most of the people have it int their PATH. This should fix #18 for most use...
javascript
chosen
[ { "from": "system", "value": "Update weather tweet message to only tweetHead\n" }, { "from": "human", "value": "/**\n * @module\n * Tweet the current weather.\n */\nconst {postStatus} = require('./../../api/twitter-api');\nconst weather = require('./../weather/getWeather');\nconst logger = requi...
javascript
chosen
[ { "from": "system", "value": "Add comment for explain step\n" }, { "from": "human", "value": "'use strict'\n\nlet levelOnePokemons = ['Pikachu','Magikarp','Balbasaur'];\n\nlet allPokemons = ['Meowth', 'Poliwag', ...levelOnePokemons];\n\nconsole.log(allPokemons);\n\nlet pikachuName = \"Pikachu\";...
javascript
chosen
[ { "from": "system", "value": "Add ignored files in gulp-eslint conf\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst gutil = require('gulp-util');\nconst eslint = require('gulp-eslint');\nconst excludeGitignore = require('gulp-exclude-gitignore');\nconst mocha = require('g...
javascript
chosen
[ { "from": "system", "value": "Add gulp clean & build tasks\n" }, { "from": "human", "value": "'use strict';\n\nconst gulp = require('gulp');\nconst babel = require('gulp-babel');\n\ngulp.task('default', () =>\n gulp.src('lib/delve.js')\n .pipe(babel({ presets: ['es2015'] }))\n .pipe(gulp.des...
javascript
chosen
[ { "from": "system", "value": "Rename server task to node\n" }, { "from": "human", "value": "/* global require */\n\nvar gulp = require('gulp'),\n spawn = require('child_process').spawn,\n ember,\n node;\n\n\ngulp.task('server', function () {\n if (node) node.kill(); // Kill server if ...
javascript
chosen
[ { "from": "system", "value": "Set font height to improve glyph quality\n" }, { "from": "human", "value": "var fontName = 'seti',\n gulp = require('gulp'),\n iconfont = require('gulp-iconfont'),\n iconfontCss = require('gulp-iconfont-css'),\n svgmin = require('gulp-s...
javascript
chosen
[ { "from": "system", "value": "Fix LiveReload for all .styl files\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n connect = require('gulp-connect'),\n stylus = require('gulp-stylus'),\n prefix = require('gulp-autoprefixer');\n\nvar paths = {\n styles: 'css/bare-ninja....
javascript
chosen
[ { "from": "system", "value": "Add release task (needs npm publish still)\n" }, { "from": "human", "value": "require('babel/register')\n\nvar gulp = require('gulp')\nvar $ = require(\"gulp-load-plugins\")()\nvar runSequence = require(\"run-sequence\")\n\ngulp.task(\"build\", function() {\n retur...
javascript
chosen
[ { "from": "system", "value": "Set up gulp watch to automatically compile TypeScript files\n" }, { "from": "human", "value": "\"use strict\"\r\n\r\nlet gulp = require('gulp');\r\nlet ts = require('gulp-typescript');\r\nlet tsProject = ts.createProject(\"tsconfig.json\");\r\n\r\ngulp.task(\"defaul...
javascript
chosen
[ { "from": "system", "value": "Add MONGODB_URI env var config\n" }, { "from": "human", "value": "var ShareDB = require('sharedb');\n\nShareDB.types.register(require('rich-text').type);\n\nmodule.exports = new ShareDB({\n db: require('sharedb-mongo')('mongodb://localhost:27017/quill-sharedb-curso...
javascript
chosen
[ { "from": "system", "value": "Handle missing adapter.js more gracefully\n" }, { "from": "human", "value": "'use strict';\n\n/**\n *\tAn RTC Object factory that works in Firefox and Chrome when adapter.js is present\n */\nfunction AdapterJsRTCObjectFactory() {\n\n\tthis.createIceServer = function...
javascript
chosen
[ { "from": "system", "value": "Add CHANGELOG.MD to copy-misc-files task\n" }, { "from": "human", "value": "const inlineNg2Template = require('gulp-inline-ng2-template');\nconst gulp = require('gulp');\nconst clean = require('gulp-clean');\n\nconst tmpDir = './tmp';\nconst distDir = './dist';\n\ng...
javascript
chosen
[ { "from": "system", "value": "[SysApps] Make the JavaScript shim dispatch events\n\nThe first thing to be done is make the JavaScript DeviceCapabilties an EventTarget\n(which is also a BindingObject). The BindingObjects are JavaScripts objects with\na link with some native object and they use a unique ID fo...
javascript
chosen
[ { "from": "system", "value": "Fix bug where cancelWindowResize, would remove the wrong callback\n" }, { "from": "human", "value": "jsio('import browser.events')\n\nvar logger = logging.getLogger(jsio.__path);\n\nvar windowResizeCallbacks = [];\n\nfunction handleResize() {\n\tif (!windowResizeCal...
javascript
chosen
[ { "from": "system", "value": "Use window.document for client-side require.\n" }, { "from": "human", "value": "// Re-using Gesso entry point\n// Detect whether this is called from a built bundle from the browser, or as the build project.\n\n\nif (typeof window !== 'undefined') {\n // Client-side...
javascript
chosen
[ { "from": "system", "value": "Use only one function call\n" }, { "from": "human", "value": "/**\n * Evidently superinspired by Chris Wilson's AudioContext-MonkeyPatch library,\n * and just patching webkitCreateShadowRoot to createShadowRoot\n */\n(function() {\n\n if( HTMLElement.prototype.w...
javascript
chosen
[ { "from": "system", "value": "Update to image src selector\n" }, { "from": "human", "value": "/*\nfor each li \n\tcolor = find span color --- this.text\n\turl = find main prod image -- this.url\n\tcategory Swatch Color Button = matching color.url\nend\n\non click \n*/\n\t\nvar colorBtnSrc = {};\...
javascript
chosen
[ { "from": "system", "value": "Read firebase creds from .env\n" }, { "from": "human", "value": "import firebase from 'firebase'\n\nconst config = {\n apiKey: \"AIzaSyDHL6JFTyBcaV60WpE4yXfeO0aZbzA9Xbk\",\n authDomain: \"practice-auth.firebaseapp.com\",\n databaseURL: \"https://practice-auth.fir...
javascript
chosen
[ { "from": "system", "value": "Increase limits for percentage change\n" }, { "from": "human", "value": "/**\n * @file Define the parameters for the activity's chart.\n */\ndefine({\n yLimitsUSD: {\n label: 'y-axis limits ($USD)',\n min: 0,\n max: 280000,\n step: 1000\n },\n yLimits...
javascript
chosen
[ { "from": "system", "value": "Make test fails for CI\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nvar gulp = require('gulp');\nvar gulp_mocha = require('gulp-mocha');\nvar gulp_jshint = require('gulp-jshint');\nvar gulp_jsdoc = require(\"gulp-jsdoc\");\n\n\nvar files = ['lib/...
javascript
chosen
[ { "from": "system", "value": "Remove unneded filename from header docblock.\n" }, { "from": "human", "value": "/**\n * search.js - Search form tests.\n */\n\ncasper.test.begin('Tests search form submission and results', 2, function suite(test) {\n casper.start();\n\n // Open the homepage.\n c...
javascript
chosen
[ { "from": "system", "value": "Change port number to 9001\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar express = require('express');\nvar routes = require('./routes');\nvar memos = require('./routes/memos');\nvar http = require('http');\nvar path = ...
javascript
chosen
[ { "from": "system", "value": "Change name of the default task" }, { "from": "human", "value": "/**\n * @author Frank David Corona Prendes <frankdavid.corona@gmail.com>\n * @copyright MIT 2016 Frank David Corona Prendes\n * @description Tarea Gulp para la compresion de ficheros JS\n * @version 1....
javascript
chosen
[ { "from": "system", "value": "Add gulp task for testing.\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n concat = require('gulp-concat'),\n rename = require('gulp-rename'),\n uglify = require('gulp-uglify');\n\nvar SRC = 'src/*.js';\nvar DEST = 'dist/';\n\ngulp.task('bu...
javascript
chosen
[ { "from": "system", "value": "Add AdminSandbox for use with admin plugins.\n" }, { "from": "human", "value": "/*\n * Sandbox - A stripped down object of things that plugins can perform.\n * This object will be passed to plugins on command and hook execution.\n */\nSandbox = function(irc, command...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix resolve() on test js interceptor [skip ci]\n" }, { "from": "human", "value": "export const options = {\n name: \"helloWorldInterceptor\",\n description: \"modifies the response of helloWorldService\",\n interceptPoint: \"RESPONSE\"\n}\n\nexport fu...
javascript
chosen
[ { "from": "system", "value": "Include registratin of judge and services in arbiter\n\n" }, { "from": "human", "value": "// var usingOraclize = artifacts.require(\"./usingOraclize.sol\");\nvar Arbiter = artifacts.require(\"./Arbiter.sol\");\nvar Judge = artifacts.require(\"./Judge.sol\");\nvar Co...
javascript
chosen
[ { "from": "system", "value": "Update whitespace removal to convert underscores to spaces\n" }, { "from": "human", "value": "var removeExcessSpaces = function(htmlString) {\n\tvar processedString = htmlString.replace(/\\s+</g, '<');\n\tprocessedString = processedString.replace(/>\\s+/g, '>');\n ...
javascript
chosen
[ { "from": "system", "value": "Simplify isStatic and isDynamic logic, and make sure they return boolean values\n" }, { "from": "human", "value": "var AudioletParameter = new Class({\n initialize: function(node, inputIndex, value) {\n this.node = node;\n if (typeof inputIndex != '...
javascript
chosen
[ { "from": "system", "value": "Make test support setBreakpoint IE11 compatible\n" }, { "from": "human", "value": "import { getContext, settled } from '@ember/test-helpers';\nimport { run } from '@ember/runloop';\n\nexport function setBreakpoint(breakpoint) {\n let breakpointArray = Array.isArray...
javascript
chosen
[ { "from": "system", "value": "Convert method routing example to new method definition\n" }, { "from": "human", "value": "var jayson = require(__dirname + '/../..');\nvar format = require('util').format;\n\nvar methods = {\n // a method that prints every request\n add: function(a, b, callback) ...
javascript
chosen
[ { "from": "system", "value": "Update in-browser logging to accommodate n-args\n" }, { "from": "human", "value": "var exports = module.exports = require('./utils.js');\n\n// We override this function for browsers, because they print objects nicer\n// natively than JSON.stringify can.\nexports.log...
javascript
chosen
[ { "from": "system", "value": "Use the new event names in the demo.\n" }, { "from": "human", "value": "'use strict';\n\n/*\n * Tanura demo app.\n *\n * This is the main script of the app demonstrating Tanura's features.\n */\n\n/**\n * Bootstrapping routine.\n */\nwindow.onload = () => {\n con...
javascript
chosen
[ { "from": "system", "value": "Add 3 second delay to application submission\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport api from 'api'\nimport { LargeButton } from '@hackclub/design-system'\n\nclass SubmitButton extends C...
javascript
chosen
[ { "from": "system", "value": "Add fromJSON, fix bug in toJSON\n" }, { "from": "human", "value": "export class Notification {\n /**\n * @typedef NotificationOptions\n * @property {string} title\n * @property {string} message\n * @property {('basic'|'sms')} [type='basic']\n */\n\n /**\...
javascript
chosen
[ { "from": "system", "value": "Remove alert on application submission" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport api from 'api'\nimport storage from 'storage'\nimport { LargeButton } from '@hackclub/design-system'\n\nclass SubmitButton extends Component {\n ...
javascript
chosen
[ { "from": "system", "value": "Reorder functions to align with execution flow.\n" }, { "from": "human", "value": "\"use strict\";\n\nfunction User( fName, lName) {\n this.fName = fName;\n this.lName = lName;\n //this.img = img; //need to add images and urls...\n this.posts = [];\n}\n\...
javascript
chosen
[ { "from": "system", "value": "Handle edge cases with zero key\n" }, { "from": "human", "value": "$(document).ready(function() {\n $('.key').click(function() {\n var number = $(this).text();\n $('#preview').append(number);\n });\n});\n" }, { "from": "gpt", "value": "function h...
javascript
chosen
[ { "from": "system", "value": "Add newline to all sent messages\n" }, { "from": "human", "value": "'use strict';\n/* This declares the function that will send a message\n */\n\nfunction sendMessage(e) {\n e.preventDefault();\n const inputNode = e.target.message;\n const message = inputNode.val...
javascript
chosen
[ { "from": "system", "value": "Use thunx to access delay state\n" }, { "from": "human", "value": "import AsyncQueue from '../utils/asyncQueueStructures';\n\nlet asyncQueue = new AsyncQueue();\n\nconst endAsync = () => {\n return { type: 'ASYNC_INACTIVE' };\n};\n\nconst callAsync = (dispatchFn, d...
javascript
chosen
[ { "from": "system", "value": "Add automated, timed removal of quests\n" }, { "from": "human", "value": "import sqlite from 'sqlite'\nimport winston from 'winston'\n\nexport default class Community {\n static async init() {\n if (this.db) { return }\n this.db = await sqlite.open(...
javascript
chosen
[ { "from": "system", "value": "Add spinner when loggin in\n\n" }, { "from": "human", "value": "import React from 'react';\nimport {browserHistory} from 'react-router'\nimport Login from './Login';\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport * as action...
javascript
chosen
[ { "from": "system", "value": "Change multi-line comment to single-line\n" }, { "from": "human", "value": "/*eslint-disable-next-line no-unused-vars*/\nfunction onNotificationMessage(message) {\n document.getElementById('symbol').innerHTML = message.symbol;\n document.getElementById('message')....
javascript
chosen
[ { "from": "system", "value": "Improve alterItems: better null-check for the returned value\n" }, { "from": "human", "value": "\nconst errors = require('@feathersjs/errors');\nconst getItems = require('./get-items');\nconst replaceItems = require('./replace-items');\n\nmodule.exports = function (...
javascript
chosen
[ { "from": "system", "value": "Add duration parsing to Amazon Alexa connector\n" }, { "from": "human", "value": "'use strict';\n\nConnector.playerSelector = '#d-content';\n\nConnector.getArtistTrack = () => {\n\tif (isPlayingLiveRadio()) {\n\t\tlet songTitle = $('.d-queue-info .song-title').text(...
javascript
chosen
[ { "from": "system", "value": "Support accessing visit/attribute sub-resource via REST\n" }, { "from": "human", "value": "angular.module('visitService', ['ngResource', 'uicommons.common'])\n .factory('Visit', function($resource) {\n return $resource(\"/\" + OPENMRS_CONTEXT_PATH + \"/ws...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary param, it's the default\n" }, { "from": "human", "value": "YUI.add(\"stream-user\", function(Y) {\n \"use strict\";\n \n var falco = Y.namespace(\"Falco\"),\n streams = Y.namespace(\"Falco.Streams\"),\n User;\n \n User...
javascript
chosen
[ { "from": "system", "value": "Use is number util to test input\n" }, { "from": "human", "value": "var ValidatorUtil = {\n isDefined: function (value) {\n return value != null && value !== '' || typeof value === 'number';\n },\n\n isEmail: function (email) {\n return email != null &&\n ...
javascript
chosen
[ { "from": "system", "value": "Use the interface from add-on sdk for OS\n" }, { "from": "human", "value": "// Define keyboard shortcuts for showing and hiding a custom panel.\nvar { Cc, Ci } = require(\"chrome\");\nvar { Hotkey } = require(\"hotkeys\");\nvar panel = require(\"panel\");\nvar timer...
javascript
chosen
[ { "from": "system", "value": "Add code for generating remote assets\n\nReviewed By: davidaurelio\n\nDifferential Revision: D6201839\n\nfbshipit-source-id: 78c81eae03c6137ba9bbe33cd7aab8b87020f8d2\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights...
javascript
chosen
[ { "from": "system", "value": "Add more functionality to vectors\n" }, { "from": "human", "value": "class Vector2D {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n }\n\n add(vec) {\n return new Vector2D(this.x + vec.x, this.y + vec.y);\n }\n\n multiply(fac...
javascript
chosen
[ { "from": "system", "value": "Fix strict mode typo in fastboot module export\n" }, { "from": "human", "value": "/* globals define, FastBoot */\n(function() {\n define('ismobilejs', ['exports'], function(exports) {\n 'use strict';\n\n let isMobileClass = FastBoot.require('ismobilejs');\n ...
javascript
chosen
[ { "from": "system", "value": "Add correct IIF and scope\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright (c) 2015 MediaMath Inc. All rights reserved.\n * This code may only be used under the BSD style license found at http://mediamath.github.io/strand/LICENSE.txt\n\n*/\nPolymer(...
javascript
chosen
[ { "from": "system", "value": "Make application function more like a backbone view\n" }, { "from": "human", "value": "class GelatoApplication extends Backbone.Model {\n\n constructor() {\n Backbone.$('body').prepend('<gelato-application></gelato-application>');\n Backbone.$('gelato-applica...
javascript
chosen
[ { "from": "system", "value": "Change package query from query param to path variable\n" }, { "from": "human", "value": "const router = require('express').Router();\n\nconst scraper = require('../service/scraper');\n\nrouter.get('/', (req, res, next) => {\n const packageName = req.query.packag...
javascript
chosen
[ { "from": "system", "value": "Return the clients IP address\n" }, { "from": "human", "value": "/*\n * @author Martin Høgh <mh@mapcentia.com>\n * @copyright 2013-2018 MapCentia ApS\n * @license http://www.gnu.org/licenses/#AGPL GNU AFFERO GENERAL PUBLIC LICENSE 3\n */\n\nvar express = re...
javascript
chosen
[ { "from": "system", "value": "Remove escapeRegExp in favor of lodash.escapeRegExp" }, { "from": "human", "value": "exports._regExpRegExp = /^\\/(.+)\\/([im]?)$/;\nexports._lineRegExp = /\\r\\n|\\r|\\n/;\n\nexports.splitLines = function (text) {\n var lines = [];\n var match, line;\n while (ma...
javascript
chosen
[ { "from": "system", "value": "Implement the Response's 'encode(...)' and 'decode(...)' Functions\n\nImplement 'encode(...)' and 'decode(...)' functions for the the response.\n" }, { "from": "human", "value": "/**\n * @flow\n */\n\ntype ResData = {\n\tnewStates: {[key: string]: string}\n};\n\n/**...
javascript
chosen
[ { "from": "system", "value": "Fix undefined name of component\n\nFix minor misspel, `Component` is `React.Component` now, should use name of `WrapperComponent` in `displayName`" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { instanceOf, func } from 'prop-type...
javascript
chosen
[ { "from": "system", "value": "Fix a second infinite loop" }, { "from": "human", "value": "// @flow\n\nexport default function (el: HTMLTextAreaElement, headToCursor: string, cursorToTail: ?string) {\n const curr = el.value, // strA + strB1 + strC\n next = headT...
javascript
chosen
[ { "from": "system", "value": "Change key used for url shortener\n\nIncompatible with old keys, so do not use same key\n" }, { "from": "human", "value": "var $ = require('jquery');\nvar LocalStorage = require('./local_storage');\n\nvar LOGIN = 'vizzuality';\nvar KEY = 'R_de188fd61320cb55d359b2fec...
javascript
chosen
[ { "from": "system", "value": "Update student from server after checkout completes\n" }, { "from": "human", "value": "import { Store } from 'consus-core/flux';\nimport CartStore from './cart-store';\n\nlet student = null;\n\nclass StudentStore extends Store{\n hasOverdueItems(items){\n ...
javascript
chosen
[ { "from": "system", "value": "Move errant variable away from require block\n" }, { "from": "human", "value": "var TruffleError = require(\"truffle-error\");\nvar inherits = require(\"util\").inherits;\nvar defaultGas = 90000;\nvar web3 = require(\"web3\");\n\ninherits(StatusError, TruffleError);...
javascript
chosen
[ { "from": "system", "value": ":art: Enhance the main cli entry file\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict'\n\n\nimport commander from 'commander'\nconst parameters = require('minimist')(process.argv.slice(2))\nconst command = parameters['_'][0]\nconst validCommands ...
javascript
chosen
[ { "from": "system", "value": "Fix a typo setting the port\n" }, { "from": "human", "value": "const\n express = require('express'),\n bodyParser = require('body-parser');\n\nconst\n {mongoose} = require('./db/mongoose'),\n dbHandler = require('./db/dbHandler');\n\nlet app = express();\nlet po...
javascript
chosen
[ { "from": "system", "value": "Add additional scenarios test cases\n" }, { "from": "human", "value": "import { API } from 'api';\nimport Scenarios from 'api/scenarios';\n\ndescribe('scenarios', () => {\n\n afterEach(() => {\n API.clearStorage();\n });\n\n it('should have currentScenario be ...
javascript
chosen
[ { "from": "system", "value": "Add styles to watched directories for watch:build/watch\n" }, { "from": "human", "value": "/*\n * Copyright 2014 Workiva, LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the Licens...
javascript
chosen
[ { "from": "system", "value": "Print all scsslint errors before existing.\n" }, { "from": "human", "value": "var path = require('path');\nvar eslint = require('gulp-eslint');\nvar merge = require('lodash/object/merge');\nvar shelljs = require('shelljs');\n\nfunction failLintBuild() {\n process.e...
javascript
chosen
[ { "from": "system", "value": "Add a polyfill for matchMedia to get tests to run\n" }, { "from": "human", "value": "import 'babel-polyfill'\nimport fs from 'fs'\nimport path from 'path'\nimport jsdom from 'jsdom'\nimport dotenv from 'dotenv'\nimport chai, { expect } from 'chai'\nimport chaiImmuta...
javascript
chosen
[ { "from": "system", "value": "Include auth token in sign up response.\n" }, { "from": "human", "value": "var bcrypt = require('bcryptjs');\nvar router = require('express').Router();\nvar User = require('../models/user');\n\nrouter.post('/', function(req, res) {\n var salt = bcrypt.genSaltSync(1...
javascript
chosen
[ { "from": "system", "value": "Remove token endPoint; need to redeploy.\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\nrouter.get('/token', function (req, res) {\n res.redirect('/');\n});\n\nrouter.get('/*', function (req, res, next) {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove amp-ssr component from demo\n\nChange-Id: I39067fd6e71f28a5365b447824280b7c4f71a01d\n" }, { "from": "human", "value": "/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\...
javascript
chosen
[ { "from": "system", "value": "Check annotated source code renders.\n" }, { "from": "human", "value": "var assert = require('assert');\n\ndescribe(\"Basic Test\", function(){\n it(\"Loads the basic demo page and sends values to server\", function(){\n browser.url('http://localhost:7888/...
javascript
chosen
[ { "from": "system", "value": "Remove default expiry on model\n" }, { "from": "human", "value": "const mongoose = require('mongoose');\nconst shortid = require('shortid');\n\nconst paste = new mongoose.Schema({\n\t_id: { type: String, default: shortid.generate },\n\tpaste: { type: String },\n\tex...
javascript
chosen
[ { "from": "system", "value": "Add info re: data saving" }, { "from": "human", "value": "module.exports = {\n title: 'Information collection notice',\n body: 'The information in this application is collected by the Ministry of Health under section 26(a) of the Freedom of Information and Protect...
javascript
chosen
[ { "from": "system", "value": "Fix the bug hidden in astring plugin\n" }, { "from": "human", "value": "import astring from 'astring';\n\n// Create a custom generator that inherits from Astring's default generator\nconst customGenerator = Object.assign({}, astring.defaultGenerator, {\n Literal(no...
javascript
chosen
[ { "from": "system", "value": "fix: Clone bundle repo tu bundle folder\n" }, { "from": "human", "value": "const { execSync } = require('child_process');\nconst path = require('path');\n\nexecSync(`\n git config user.email \"andrey.a.gubanov@gmail.com\" &&\n git config user.name \"Andrey Gub...
javascript
chosen