conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add routes for all v2 timelines controllers\n\n" }, { "from": "human", "value": "import TimelinesController from '../../../controllers/api/v2/TimelinesController'\n\n\nexport default function addRoutes(app) {\n const controller = new TimelinesController(app);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Update example to use promises & client id\n" }, { "from": "human", "value": "var twitchStreams = require('../');\n\ntwitchStreams.get('Monstercat', function(error, streams) {\n if (error) return console.log('Error caught:', error);\n console.log('Got stream d...
javascript
chosen
[ { "from": "system", "value": "Add Operator type default option.\n" }, { "from": "human", "value": "import {operatorExpression} from './expression';\nimport parseParameters from './parameters';\n\n/**\n * Parse a dataflow operator.\n */\nexport default function parseOperator(spec, ctx) {\n var p...
javascript
chosen
[ { "from": "system", "value": "Use callback to display raw results\n\n* Move invariants out of request structure\n* Move request operation to dedicated sendRequest fn\n* TODO: Remove deprecated comment\n" }, { "from": "human", "value": "'use strict';\n\nvar request = require('request');\n\nvar op...
javascript
chosen
[ { "from": "system", "value": "Use tiddlyspace challenger for use on twangular space\n" }, { "from": "human", "value": "/*jshint unused:false */\nfunction LoginController($scope, loginService) {\n\n $scope.login = function() {\n\n loginService.login($scope.username, $scope.password, fun...
javascript
chosen
[ { "from": "system", "value": "Put the $locationProvider into html5 mode\n\nI need this so I can pull querystring variables\n\nE.g. /npact/run/library/NC_007760.gbk?endBase=19994 will go through\nendBase of 1994 otherwise that needs to be after the hash.\n\nre #863 (0.25)\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Use a loop intead of reduce\n" }, { "from": "human", "value": "const pick = (obj, keys) =>\n keys.reduce((result, key) => {\n result[key] = obj[key]\n return result\n }, {})\n\nexport default pick\n" }, { "from": "gpt", "value": "const pick = (ob...
javascript
chosen
[ { "from": "system", "value": "Add indexes to user schema\n" }, { "from": "human", "value": "var mongoose = require('mongoose'),\n urlFormatter = require('../../app/models/url_formatter.server.model'),\n Schema = mongoose.Schema;\n \nvar UserSchema = new Schema({\n firstName: String,\...
javascript
chosen
[ { "from": "system", "value": "Add example of brunch file concatenation order\n\nFixes https://github.com/phoenixframework/phoenix/issues/690" }, { "from": "human", "value": "exports.config = {\n // See http://brunch.io/#documentation for docs.\n files: {\n javascripts: {\n joinTo: 'js/...
javascript
chosen
[ { "from": "system", "value": "Add init method for storage options\n" }, { "from": "human", "value": "var Accessory = require('./lib/Accessory.js').Accessory;\nvar Bridge = require('./lib/Bridge.js').Bridge;\nvar Service = require('./lib/Service.js').Service;\nvar Characteristic = require('./lib/...
javascript
chosen
[ { "from": "system", "value": "Fix indent and trailing whitespace.\n" }, { "from": "human", "value": "var settings = require('ep_etherpad-lite/node/utils/Settings');\nvar githubAuth = require('github-auth');\nvar config = {\n organization: settings.users.github.org,\n autologin: true // Thi...
javascript
chosen
[ { "from": "system", "value": "Update: Remove fs.exists & rely on try/catch\n" }, { "from": "human", "value": "const os = require('os');\nconst fs = require('fs');\nconst path = require('path');\nconst execFile = require('child_process').execFile;\n\nconst tmpfile = path.join(os.tmpdir(), process...
javascript
chosen
[ { "from": "system", "value": "Use \" (double quote) for string literal\n" }, { "from": "human", "value": "jQuery(function($, undefined) {\n var id = Math.random().toString();\n var sendCommandQueue = [];\n\n function enqueueCommand(command, onResponse) {\n var sendCommand = function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add the message count label (static for now)\n" }, { "from": "human", "value": "/*\n * Copyright (C) 2011 Marco Barisione <marco@barisione.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser Gene...
javascript
chosen
[ { "from": "system", "value": "Fix error on picking up experience\n" }, { "from": "human", "value": "var minecraftData = require('minecraft-data');\nvar isArmor = require('./lib/isArmor');\nvar equipItem = require('./lib/equipItem');\n\nmodule.exports = function(bot, config) {\n if(!bot) {\n ...
javascript
chosen
[ { "from": "system", "value": "Change return object, use gulp from args\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n modula = require('modula-loader'),\n _ = require('lodash'),\n plugins = require('gulp-load-plugins')()\n\nplugins.uglify = require('gulp-ugli...
javascript
chosen
[ { "from": "system", "value": "Fix: Make sure includePaths default is specific for each file\n" }, { "from": "human", "value": "var map = require('map-stream')\n , sass = require('node-sass')\n , path = require('path')\n , gutil = require('gulp-util')\n , ext = gutil.replaceExtension\n...
javascript
chosen
[ { "from": "system", "value": "Remove leading slash from destDir to avoid trying to access root dir\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n name: require('./package').name,\n\n treeForAddonTestSupport(tree) {\n // intentionally not calling _super here\n //...
javascript
chosen
[ { "from": "system", "value": "Use lastSeen instead of clients in list\n" }, { "from": "human", "value": "#! /usr/bin/env node\n'use strict';\n\nconst unifi = require('./lib/unifi');\nconst domoticz = require('./lib/domoticz');\nconst config = require('./lib/config');\n\nlet configArgIndex = proc...
javascript
chosen
[ { "from": "system", "value": "feat: Add --ext flag and handle only files with given extension\n" }, { "from": "human", "value": "#!/usr/bin/env node\nconst express = require('express');\nconst fileExists = require('file-exists');\nconst bodyParser = require('body-parser');\nconst fs = require('f...
javascript
chosen
[ { "from": "system", "value": "Append scss outside of recursive function calls\n" }, { "from": "human", "value": "var sass = require('node-sass'),\n path = require('path'),\n fs = require('fs');\n\nvar handledBaseFolderNames = {\n 'bower_components': 'bower_components',\n 'node_module...
javascript
chosen
[ { "from": "system", "value": "Fix event to work with other plugins.\n" }, { "from": "human", "value": "var autoprefixer = require('autoprefixer');\n\nmodule.exports = function() {\n var args = Array.prototype.slice.call(arguments);\n\n return function(style){\n style.on('end', function(css,...
javascript
chosen
[ { "from": "system", "value": "Add better logging to see when wasm is loaded\n" }, { "from": "human", "value": "\n//only exports browser api. use chloride module\n//to get automatic fallbacks!\n\n//load tweetnacl first, so that it works sync, and everything is there.\nvar exports = require('sodiu...
javascript
chosen
[ { "from": "system", "value": "Check if optional stream is a function\n" }, { "from": "human", "value": "'use strict';\nvar isStream = require('is-stream');\nvar matchCondition = require('match-condition');\nvar peekStream = require('peek-stream');\nvar through = require('through2');\n\nmodule.ex...
javascript
chosen
[ { "from": "system", "value": "fix: Use require.resolve to clean up require cache\n" }, { "from": "human", "value": "#!/usr/bin/env node\nconst express = require('express');\nconst fileExists = require('file-exists');\nconst bodyParser = require('body-parser');\nconst fs = require('fs');\nconst {...
javascript
chosen
[ { "from": "system", "value": "Improve logging on loading source 👻" }, { "from": "human", "value": "try {\n /**\n * Try loading the compiled code.\n */\n module.exports = require('./lib').default\n} catch (e) {\n /**\n * If the compiled code is not available,\n * load from source.\n ...
javascript
chosen
[ { "from": "system", "value": "Add local version of tcomb-react to exports to prevent clashing React versions.\n" }, { "from": "human", "value": "var exports = {\n ScrollView: require('./src/react/ScrollView/ScrollView'),\n ScrollViewDelegate: require('./src/react/ScrollView/ScrollViewDeleg...
javascript
chosen
[ { "from": "system", "value": "Allow more liberal promise detection, es5 compat\n" }, { "from": "human", "value": "'use strict';\n\nvar Promise = require('es6-promise').Promise;\n\nmodule.exports = function(array, haltCallback) {\n if(!(haltCallback instanceof Function)) {\n haltCallback = fu...
javascript
chosen
[ { "from": "system", "value": "Add several flex-related numerical properties to the ignore list\n" }, { "from": "human", "value": "var postcss = require('postcss'),\n extend = require('extend');\n\nmodule.exports = postcss.plugin('postcss-default-unit', function (opts) {\n opts = opts || {}...
javascript
chosen
[ { "from": "system", "value": "Add JSDoc to Client class.\n" }, { "from": "human", "value": "/**\n * index.js\n * Client entry point.\n *\n * @author Francis Brito <fr.br94@gmail.com>\n * @license MIT\n */\n'use strict';\n\nvar Client = function Client(apiKey, opts) {\n if (!apiKey) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use default config if not setted\n" }, { "from": "human", "value": "module.exports = function(config) {\n return {\n producer: require('./lib/producer')(config || {}),\n consumer: require('./lib/consumer')(config || {})\n };\n};\n" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "[MF] Solve static analysis issues for f3cf071 commit.\n" }, { "from": "human", "value": "/**\n * Created by alnedorezov on 5/26/17.\n */\nfunction initZoomIn() {\n Tool.zoomIn = function () {\n return fromPrototype(Tool, {\n onClick: function (i...
javascript
chosen
[ { "from": "system", "value": "Increase timeouts to improve test runs\n\nAttempts to address issue with a high perecentage\nof acceptance test runs failing." }, { "from": "human", "value": "module.exports = {\n waitForConditionPollInterval: 1000,\n waitForConditionTimeout: 6000,\n pauseDuratio...
javascript
chosen
[ { "from": "system", "value": "Send hideSubmit prop to form\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Button, ButtonGroup, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';\nimport FontAwesome from 'react-fontawesome';\n\nexport default c...
javascript
chosen
[ { "from": "system", "value": "Verify whether the page has any <math> element before doing the test and inserting the fallback\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed wi...
javascript
chosen
[ { "from": "system", "value": "Rename MoviesController to be consistent with file naming convention\n" }, { "from": "human", "value": "const router = require('express').Router();\nconst MoviesController = require('../controllers/MoviesController');\nconst checkTmdbConfig = require('../middlewares...
javascript
chosen
[ { "from": "system", "value": "Fix width issue. Remove JS that was for <v4\n" }, { "from": "human", "value": "document.addEventListener('DOMContentLoaded', function() {\n // Inititate Select2 on any select element with the class .select2\n $('select.select2').select2({\n // change that\n ...
javascript
chosen
[ { "from": "system", "value": "Fix VERSION getter test so it runs in suite\n" }, { "from": "human", "value": "var buster = require(\"buster\");\nvar assert = buster.assert;\nbuster.testCli = require(\"../../../lib/buster-test-cli\");\n\nbuster.testCase(\"Module index\", {\n \"should have dynam...
javascript
chosen
[ { "from": "system", "value": "Sort by greatest CP when the name is the same\n" }, { "from": "human", "value": "import Long from 'long';\nimport _ from 'lodash';\n\nexport default {\n recent(items) {\n return _.reverse(\n _.sortBy(items, (v) => {\n const ms = v && v.creation_time_...
javascript
chosen
[ { "from": "system", "value": "Use string representation of object when formatting error messages\n" }, { "from": "human", "value": "'use strict';\n\nexports.formatStr = function () {\n var args = Array.prototype.slice.call(arguments)\n , str = args.shift()\n , i = 0;\n return str.replace...
javascript
chosen
[ { "from": "system", "value": "Add force option to Grunt clean task.\n\nOverrides this task from blocking deletion of folders outside current working dir (CWD).\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n\tgrunt.config('clean', {\n\t\tstyles: {\n\t\t\tsrc: [\n\t\t\t\...
javascript
chosen
[ { "from": "system", "value": "Change document.title on route change\n" }, { "from": "human", "value": "import Vue from 'vue';\nimport Router from 'vue-router';\n\n// Pages\nimport Home from 'new-dashboard/pages/Home';\nimport Solutions from 'new-dashboard/pages/Solutions';\nimport Maps from 'new...
javascript
chosen
[ { "from": "system", "value": "Fix broken twitter avatars (for real this time)\n- didn't notice avatarOptions object last time\n" }, { "from": "human", "value": "privacyOptions = { // true means exposed\n _id: true,\n commentCount: true,\n createdAt: true,\n email_hash: true,\n isInvited: tr...
javascript
chosen
[ { "from": "system", "value": "Add url as a command line argument\n" }, { "from": "human", "value": "'use strict';\n\nvar epaper = require('../index.js');\n\nepaper.init({\n spiDev: '/dev/spidev1.0',\n clockSpeed: 1e5\n}, function(err) {\n if (err) {\n throw new Error(err);\n }\n\n epaper...
javascript
chosen
[ { "from": "system", "value": "Remove hidden test as it is not being used\n" }, { "from": "human", "value": "/*\n* ADR Reporting\n* Copyright (C) 2017 Divay Prakash\n* GNU Affero General Public License 3.0 (https://github.com/divayprakash/adr/blob/master/LICENSE)\n*/\nvar dataUriTest;\nModernizr....
javascript
chosen
[ { "from": "system", "value": "Return after errors in update server\n" }, { "from": "human", "value": "const express = require('express')\nconst DiscordServer = require('./DiscordServer')\n\nmodule.exports = \n// This function starts the update server. This is used\n// to cause the bot to d...
javascript
chosen
[ { "from": "system", "value": "Handle case where module is in the parent module's node_modules directory\n" }, { "from": "human", "value": "import fs from \"fs\";\nimport path from \"path\";\nimport copyDir from \"copy-dir\";\nimport isFunction from \"lodash.isfunction\";\nimport rimraf from \"ri...
javascript
chosen
[ { "from": "system", "value": "Add resolveDataUrl function to the AssetResolver prototype\n" }, { "from": "human", "value": "var extend = require('lodash/object/extend');\nvar resolvePath = require('./resolve-path');\nvar resolveUrl = require('./resolve-url');\n\nfunction AssetResolver(options) {...
javascript
chosen
[ { "from": "system", "value": "Fix ratings to validate between 1 and 5.\n" }, { "from": "human", "value": "'use strict'\n\nconst Sequelize = require('sequelize')\nconst db = require('APP/db')\n\nconst Review = db.define('review', {\n rating: {\n type: Sequelize.INTEGER,\n allowNull: false,...
javascript
chosen
[ { "from": "system", "value": "Allow override on toolbar items through attribute\n\nUse can add \"toolbar\" attribute in directive to override toolbar items.\r\ne.g. \r\n<div simditor name=\"content\" ng-model=\"content\" toolbar=\"['title', 'bold', 'italic', 'underline', 'strikethrough', '|', 'ol', 'ul', ...
javascript
chosen
[ { "from": "system", "value": "Set log exchange to persist and not auto delete. We'll want log messages to queue even if nobody is picking them up.\n" }, { "from": "human", "value": "var Rx = require('rx');\nvar rabbit = require('amqp');\n\nmodule.exports = {\n\tconfigure: function(config) {\n\t\...
javascript
chosen
[ { "from": "system", "value": "feat: Increase percent of instances having clustering\n" }, { "from": "human", "value": "export const DEFAULT_PERIOD = 'all'\nexport const DEFAULT_MODE = 'default'\nexport const SETTING_TYPE = 'clustering'\nexport const DEFAULT_MAX_BOUND = 48\nexport const DEFAULT_E...
javascript
chosen
[ { "from": "system", "value": "Add example tests for todos actions.\n" }, { "from": "human", "value": "import {actions, create} from 'client/todos/actions';\nimport {expect} from 'chai';\n\n// http://chaijs.com/api/bdd\n\ndescribe('create', () => {\n it('is a function', () => {\n // TODO: Add...
javascript
chosen
[ { "from": "system", "value": "Disable test that is not relevant yet." }, { "from": "human", "value": "import assert from 'assert';\nimport GithubSearchResult from '../github-search-result.js';\n\ndescribe('create kata groups from the github search result', function() {\n it('', function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix comment java to tomcat" }, { "from": "human", "value": "var shjs = require('shelljs');\n\nif (!shjs.which('docker')) {\n shjs.echo('Sorry, this script requires docker.');\n shjs.exit(1);\n} else {\n // build all images\n // ubuntu\n shjs.cd('ubuntu-base');\...
javascript
chosen
[ { "from": "system", "value": "Remove unused method process.requireModule from unit tests\n" }, { "from": "human", "value": "'use strict';\n\n// Module dependencies\nvar path = require('path');\nvar openVeoAPI = require('@openveo/api');\n\n// Set module root directory\nprocess.root = path.join(__...
javascript
chosen
[ { "from": "system", "value": "Simplify utility to test if a value is a function\n\nBy using the typeof operator directly, we prevent possible race\nconditions during module loading.\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar typeOf = require( '@stdlib/utils/type-of'...
javascript
chosen
[ { "from": "system", "value": "Fix path : working with trailing /\n" }, { "from": "human", "value": "function (doc, req) {\n // !json templates.page\n\n var mustache = require(\"vendor/couchapp/lib/mustache\");\n\n var path, cipherdata, errormessage;\n\n if (req.raw_path.substr(-4) ==...
javascript
chosen
[ { "from": "system", "value": "requireTrailingComma: Fix incorrect option name in error message\n" }, { "from": "human", "value": "var assert = require('assert');\nvar tokenHelper = require('../token-helper');\n\nmodule.exports = function() {};\n\nmodule.exports.prototype = {\n configure: func...
javascript
chosen
[ { "from": "system", "value": "Add comment for simulating timeout\n" }, { "from": "human", "value": "import api from '../utils/webAPIUtils';\n\nexport default {\n list: () => api.get('/api/todo'),\n create: (todo) => api.post('/api/todo', todo),\n remove: (id) => api.delete(`/api/todo/${id}`),...
javascript
chosen
[ { "from": "system", "value": "Replace remaining instantiation from constructor\n" }, { "from": "human", "value": "var common = require('../../common');\nvar connection = common.createConnection();\nvar assert = require('assert');\n\nvar rows = undefined;\nvar rows1 = undefined;\nvar fields = und...
javascript
chosen
[ { "from": "system", "value": "Change to create connection from using default connection\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar _ = require('lodash');\nvar Const = require('../const.js');\n\nvar DatabaseManager = {\n \n messageModel:null,\n userModel:...
javascript
chosen
[ { "from": "system", "value": "Make development version badge less prominent\n" }, { "from": "human", "value": "/**\n * Background tasks\n */\nclass PathmarksBackground {\n\n\tstatic standardIcon() {\n\t\tchrome.browserAction.setIcon({path: '../images/icon38.png'});\n\t}\n\n\tstatic devBadge() {\...
javascript
chosen
[ { "from": "system", "value": "Replace the take name error with one that made more sense to display on the login view.\n" }, { "from": "human", "value": "'use strict';\n\nvar Q = require('q');\n\nmodule.exports = {\n findByName: function(name) {\n var deferred = Q.defer();\n\n if(name === ...
javascript
chosen
[ { "from": "system", "value": "Fix formSelect component's default option\n\nWhen adding using the `default-option` directive you would need to have added a `length` property with a truthy value to successfully add the default option. This change fixes that by making sure there is a default option with a text...
javascript
chosen
[ { "from": "system", "value": "Use unminified for development env\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = {\n name: 'Ember CLI Data Factory Guy',\n\n blueprintsPath: function() {\n return path.join(__dirname, 'blueprints');\n },\n\n included: func...
javascript
chosen
[ { "from": "system", "value": "Fix no data error on cde dashboard\n\nPossible related to http://jira.meteorite.bi/browse/SKU-1258." }, { "from": "human", "value": "var saikuWidgetComponent = BaseComponent.extend({\n\n\tupdate : function() {\n\t\tvar myself=this;\n\t\tvar htmlId = \"#\" + myself.h...
javascript
chosen
[ { "from": "system", "value": "Add contribute.json to the nickname blacklist\n\nRef #1535\n" }, { "from": "human", "value": "// nicknameblacklist.js\n//\n// list of banished nicknames\n//\n// Copyright 2017, Ryan Riddle\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n//...
javascript
chosen
[ { "from": "system", "value": "Adjust limited mouse based camera movement\n" }, { "from": "human", "value": "\n\nvar GNOVEL = GNOVEL || {};\n\n(function() {\n\t\"use strict\";\n\n\t/**\n\t * @class MouseMovedCamera\n\t * If created, will enable effect of mouse moved camera (small shift in the ca...
javascript
chosen
[ { "from": "system", "value": "Remove unwanted console.log statement in example code\n" }, { "from": "human", "value": "'use strict';\n\nvar w2v = require( './../lib' );\n\nw2v.loadModel( __dirname + '/fixtures/vectors.txt', function( err, model ) {\n\tconsole.log( model );\n\n\tvar wordVecs = mo...
javascript
chosen
[ { "from": "system", "value": "Return a simple object when an entity is picked\n" }, { "from": "human", "value": "angular.module('OpiferEntityPicker', ['ui.bootstrap.typeahead'])\n\n .directive('entityPicker', function() {\n\n var tpl =\n '<input type=\"text\" ng-model=\"sear...
javascript
chosen
[ { "from": "system", "value": "Revert \"expire_time into dbrelayer section\"\n\nThis reverts commit e9ed0f81ac79957788199a595b57d58f43a42066.\n" }, { "from": "human", "value": "\r\n// redis host\r\nexports.queue= {};\r\nexports.queue.redis_host = '10.95.8.182';\r\n\r\nexports.dbrelayer = {};\r\ne...
javascript
chosen
[ { "from": "system", "value": "Remove reference to old splplash.html\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Render the splash page of application\n */\nexports.renderSplash = function (req,res) {\n res.render('modules/core/server/views/splash', {\n user: req.user || null\...
javascript
chosen
[ { "from": "system", "value": "Change local storage key prefix back to \"x-font-\" for fontload.js.\n" }, { "from": "human", "value": "function loadFont(a,b,c){function d(){if(!window.FontFace)return!1;var a=new FontFace(\"t\",'url(\"data:application/font-woff2,\") format(\"woff2\")',{});return a...
javascript
chosen
[ { "from": "system", "value": "Change calc mode to mode text function name\n" }, { "from": "human", "value": "var mode = 0; //primary\n\nfunction calc_mode() {\n\tvar modes = [\"primary\", \"secondary\", \"tertiary\"];\n\treturn modes[mode];\n}\n\nfunction send_data() {\n\t$.ajax({\n\t\turl: \"ca...
javascript
chosen
[ { "from": "system", "value": "Simplify the server version component\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\n\nmodule.exports = function(app) {\n\treturn function(req, res) {\n\t\tfs.readFile(app.get('appPath') + '/version.json', 'utf8', function(err, data) {\...
javascript
chosen
[ { "from": "system", "value": "Set should use a writeable database.\n" }, { "from": "human", "value": "function Client() {\n\n}\n\nClient.prototype = {\n chain: [],\n\n events: { },\n\n register: function(action) {\n if(this.chain.length > 0) {\n this.chain.push(action);\n\n retur...
javascript
chosen
[ { "from": "system", "value": "Load javascript and css across website\n" }, { "from": "human", "value": "function loadScript(url, callback){\n var script = document.createElement(\"script\")\n script.type = \"text/javascript\";\n\n if (script.readyState){ //IE\n script.onreadystatechange =...
javascript
chosen
[ { "from": "system", "value": "Handle error 1006 (Connection reset by peer) gracefully\n" }, { "from": "human", "value": "const Eris = require(\"eris\");\nconst config = require(\"./cfg\");\n\nconst intents = [\n // PRIVILEGED INTENTS\n \"guildMembers\", // For server greetings\n\n // REGULAR ...
javascript
chosen
[ { "from": "system", "value": "Reset landing page state only upon logout\n\nThis change prevents the signup and login page analytics events to be\nfired erroneously. [Finishes #133219321]\n" }, { "from": "human", "value": "'use strict';\n\nimport { API_LOGIN_SUCCESS, API_SIGNUP_SUCCESS } from 'ap...
javascript
chosen
[ { "from": "system", "value": "Put data into alphabetical order\n" }, { "from": "human", "value": "'use strict';\n\nconst Utils = require(\"../../util/utils\");\n\nmodule.exports = class FeatureList {\n\n constructor() {\n this.features = []\n }\n\n add(properties, geometry) {\n ...
javascript
chosen
[ { "from": "system", "value": "Set the MutationRecord inside of the detail, not as the detail\n" }, { "from": "human", "value": "/**\n * Dispatches the \"contentchange\" events. The detail may be different,\n * but the eventType is always \"contentchange\"\n *\n * @param contentElement\n * @param...
javascript
chosen
[ { "from": "system", "value": "Convert action creators to arrow functions\n\n" }, { "from": "human", "value": "import * as types from '../constants/actionTypes';\n\nexport function updateArchetype(value) {\n return {\n type: types.UPDATE_ARCHETYPE,\n payload: {\n archetype: value\n ...
javascript
chosen
[ { "from": "system", "value": "Update Server back to local\n" }, { "from": "human", "value": "var Backbone = require('backbone');\n\nmodule.exports = Backbone.Model.extend({\n defaults: {\n beenSet: true, //set this back to false when done testing\n guid: \"8f9c3e25c0e196647f83fa704a59c6b7...
javascript
chosen
[ { "from": "system", "value": "Add blur filter to all images in css\n" }, { "from": "human", "value": "\nvar postcss = require('postcss'),\n color = require('color');\n\nmodule.exports = postcss.plugin('postcss-lowvision', function () {\n return function (css) {\n css.walkDecls('colo...
javascript
chosen
[ { "from": "system", "value": "Add header to the source file\n" }, { "from": "human", "value": "'use strict';\r\n\r\nangular.module('seblucas.slGridListToggle', [])\r\n .directive('slGridListToggle', function() {\r\n return {\r\n restrict: 'E',\r\n require: '^ngModel',\r\n scop...
javascript
chosen
[ { "from": "system", "value": "Update models to handle ids correctly\n\nMongo database entry ids are Strings not ints update models accordingly\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\n\nvar periodSchema = new mongoose.Schema({\n day: Date,\n start_time: Date,...
javascript
chosen
[ { "from": "system", "value": "Initialize _owned during buildRendering to prevent shared _owned\n" }, { "from": "human", "value": "define([\n\t\"dojo/_base/declare\"\n], function (declare) {\n\treturn declare(null, {\n\t\t// summary:\n\t\t//\t\tAdds functionality for creating relationships betwee...
javascript
chosen
[ { "from": "system", "value": "Rename `path` in `name` to be consistent\n" }, { "from": "human", "value": "'use strict';\n\nvar reqRegEx = /\\s*(?:\\{(.*)\\})?\\s*(?:(\\$?[^\\s]+))?\\s*(?:\\(([^\\)]*)\\))?\\s*(?:-?\\s*(.*?))\\s*$/;\n\nmodule.exports = {\n\n parse: function (text) {\n var matc...
javascript
chosen
[ { "from": "system", "value": "Add some spec for how this thing ought to work.\n" }, { "from": "human", "value": "\nvar server = \"http://localhost:5984/\";\n\n\n" }, { "from": "gpt", "value": "/**\n * Use this to make an object that rests on the couch.\n\nvar couch = CouchDB.rest(\"h...
javascript
chosen
[ { "from": "system", "value": "Remove remaining parts of turbo_links\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/javas...
javascript
chosen
[ { "from": "system", "value": "Stop relying on internal functions\n" }, { "from": "human", "value": "'use strict'\n\n/*!\n * multer\n * Copyright(c) 2014 Hage Yaapa\n * Copyright(c) 2015 Fangdun Cai\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\nconst originalMulter = require('mult...
javascript
chosen
[ { "from": "system", "value": "Use window.origin instead of window.href" }, { "from": "human", "value": "import Browser from './browser'\nimport Print from './print'\n\nexport default {\n print: (params, printFrame) => {\n // If showing feedback to user, pre load pdf files (hacky)\n if (pa...
javascript
chosen
[ { "from": "system", "value": "Remove old comment, and unessary if logic\n" }, { "from": "human", "value": "import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport $ from \"jquery\";\nimport Backbone from \"backbone\";\n\nexport default React.createClass({\n displayName: \"Ta...
javascript
chosen
[ { "from": "system", "value": "Add test for collapsed text\n" }, { "from": "human", "value": "import ExpandablePanelModule from \"./expandablePanel\";\n\nconst { module } = angular.mock;\n\ndescribe(\"ExpandablePanel\", () => {\n beforeEach(module(ExpandablePanelModule));\n\n let $log;\n befor...
javascript
chosen
[ { "from": "system", "value": "Add directConnect to true in protractor tests\n- it's to avoid the Error: Timed out waiting for the WebDriver server\n" }, { "from": "human", "value": "var HtmlScreenshotReporter = require(\"protractor-jasmine2-screenshot-reporter\");\nvar JasmineReporters = require...
javascript
chosen
[ { "from": "system", "value": "Remove workaround for broken el.find()\n" }, { "from": "human", "value": "import { NodeComponent } from 'substance'\nimport katex from 'katex'\n\nexport default class InlineFormulaComponent extends NodeComponent {\n\n render($$) {\n const node = this.props.node\...
javascript
chosen
[ { "from": "system", "value": "Add handling of online/offline event\n" }, { "from": "human", "value": "import React from 'react';\nimport {Link} from 'react-router';\n\nexport default class Header extends React.Component {\n render() {\n var offline = false;\n if (!navigator.onLine) offlin...
javascript
chosen
[ { "from": "system", "value": "Use process.exit(0) if none found\n" }, { "from": "human", "value": "'use strict'\n\nvar fs = require('fs')\nvar miss = require('mississippi')\nvar config = require('../config')\n\nfunction filterJobsList (jobs) {\n var list = []\n\n jobs.forEach(function (job) {\...
javascript
chosen
[ { "from": "system", "value": "Check if the 2nd param is process.argv and work well\n" }, { "from": "human", "value": "(function() {\n var HashArg = {};\n HashArg.get = function(argdefs, argv) {\n var args = {};\n if(!argv) {\n argv = [];\n for(var i = 2;...
javascript
chosen