conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "[form] Add checking befor getEntity value..\n" }, { "from": "human", "value": "var assign = require('object-assign');\nvar actionMixin = {\n\n/**\n * Get the entity identifier for the form loading.\n * @returns {object} - The identifier of the entity.\n */\n ...
javascript
chosen
[ { "from": "system", "value": "Make google login button functional with JS\n" }, { "from": "human", "value": "/**\n * Check if user is logged in\n */\nfunction authUser() {\n fetch('/login')\n .then(response => response.json())\n .then(userAuthInfo => {\n if(userAuthInfo.isLog...
javascript
chosen
[ { "from": "system", "value": "Make / and /welcome show the same page by redirecting to /welcome in the / route.\n" }, { "from": "human", "value": "Router.map(function() {\n // Read paths from a JSON configuration file.\n // Formatted as { '/path': 'template', ... }\n // This seems nicer in a ...
javascript
chosen
[ { "from": "system", "value": "Add slow down carousel speed\n" }, { "from": "human", "value": "$(document).ready(function () {\n\n $(\".carousel-inner-download\").cycle({\n fx:'scrollVert',\n pager: '.pager',\n timeout: 4000,\n speed: 500,\n // pause: 1,\n });\n\n $(\".c1-right\...
javascript
chosen
[ { "from": "system", "value": "Handle null case for client id\n" }, { "from": "human", "value": "\"use strict\";\n\nvar restify = require('restify');\nvar async = require('async');\nvar Anyfetch = require('anyfetch');\n\n\nmodule.exports.get = function get(req, res, next) {\n if(!req.query.conte...
javascript
chosen
[ { "from": "system", "value": "Fix background - abs url for injected code\n" }, { "from": "human", "value": "if (document.location.hostname == \"localhost\") {\n var baseurl = \"\";\n} else {\n var baseurl = \"https://noconfidencevote.openup.org.za\";\n}\n\nvar initContactMPsPymParent = fun...
javascript
chosen
[ { "from": "system", "value": "Revert \"Added revert test line\"\n\nThis reverts commit 493c18f25d20e16f044d7ec489f836f72151e3bb.\n" }, { "from": "human", "value": "/**\n * React Static Boilerplate\n * https://github.com/koistya/react-static-boilerplate\n * Copyright (c) Konstantin Tarkus (@koist...
javascript
chosen
[ { "from": "system", "value": "Add routing for getting cars and buying car.\n" }, { "from": "human", "value": "var express = require('express'),\n router = express.Router(),\n carsData = require('../data/data-cars'),\n carsController = require('../controllers/cars-controller')(carsData),...
javascript
chosen
[ { "from": "system", "value": "Fix spacing in multiline variables\n" }, { "from": "human", "value": "var createBetNotification = function(bet){\n var bet = Bets.findOne({ _id: bet });\n\n BetNotifications.insert({\n toNotify: bet.bettors[1],\n betBy: bet.bettors[0],\n bet: bet._id\n }...
javascript
chosen
[ { "from": "system", "value": "Read app secret from environment\n" }, { "from": "human", "value": "module.exports = {\n auth : {\n github: {\n appId: 'edfc013fd01cf9d52a31',\n appSecret: 'a9ebb79267b7d968f10e9004724a9d9ac817a8ee',\n callbackURL : 'http://akrasia.ujo.guru:7173/a...
javascript
chosen
[ { "from": "system", "value": "Set sails.js migration property to 'alter'\n\nWe want Sails.js to try to perform migration automatically\n" }, { "from": "human", "value": "/**\n * Default model configuration\n * (sails.config.models)\n *\n * Unless you override them, the following properties will ...
javascript
chosen
[ { "from": "system", "value": "Update sort order in order to fix tie to be under jackets\n" }, { "from": "human", "value": "module.exports = [\n {\n id: 'Hairstyles',\n required: false,\n sortOrder: 1\n },\n {\n id: 'Beards',\n required: false,\n sortOrder: 4\n },\n {\n ...
javascript
chosen
[ { "from": "system", "value": "Tag searching now really works!\n" }, { "from": "human", "value": "module.exports = function (models) {\n const {\n Photo,\n User\n } = models;\n\n return {\n searchPhotos(pattern) {\n let regex = new RegExp(pattern, 'i');\n\...
javascript
chosen
[ { "from": "system", "value": "Fix history message user issue\n" }, { "from": "human", "value": "var RtmClient = require('@slack/client').RtmClient;\nvar RTM_CLIENT_EVENTS = require('@slack/client').CLIENT_EVENTS.RTM;\nvar RTM_EVENTS = require('@slack/client').RTM_EVENTS;\nvar Conversation = requ...
javascript
chosen
[ { "from": "system", "value": "Handle change to octobat service api.\n" }, { "from": "human", "value": "'use strict';\n\nvar rest = require('restler-q');\nvar q = require('q');\n\nmodule.exports = function(options) {\n return q.fcall(function() {\n if (!options) {\n throw new Error(\"opt...
javascript
chosen
[ { "from": "system", "value": "Validate stubs before permitting them.\n" }, { "from": "human", "value": "\"use babel\";\n\nimport github from './github';\nimport git from './git';\n\nexport default {\n github,\n git,\n\n make: function ({git, github}) {\n let dup = Object.create(this);\n\n ...
javascript
chosen
[ { "from": "system", "value": "ENYO-373: Remove moon.Slider from set of pre-[initialized, rendered, destroyed] controls.\n\nEnyo-DCO-1.1-Signed-off-by: Aaron Tam <aaron.tam@lge.com>\n" }, { "from": "human", "value": "(function (enyo, scope) {\n\tenyo.kind({\n\t\tname: 'moon.ContainerInitializer',...
javascript
chosen
[ { "from": "system", "value": "Send schema info error as 400\n\nThis assume schema info failure is due to user input, not application code. This could be that the server is unavailable however. Regardless it is something to be expected as opposed to an internal server error\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Use DDG.load instead of DDG.require on the YouTube plugin.\n\n- DDG.require was renamed to DDG.load.\n" }, { "from": "human", "value": "function ddg_spice_youtube(api_result) {\n \"use strict\";\n DDG.require(\"/js/nryt.js\", {\n success: function() {\n...
javascript
chosen
[ { "from": "system", "value": "Change rev option to 0.\n" }, { "from": "human", "value": "'use strict';\n\nconst Promise = require('bluebird');\nconst readFile = Promise.promisify(require('fs').readFile);\nconst stat = Promise.promisify(require('fs').stat);\n\nconst cache = {};\nconst badgesDir =...
javascript
chosen
[ { "from": "system", "value": "Adjust buttons on instructions page\n" }, { "from": "human", "value": "var instructionsState = {\n\n create: function () {\n _setBackgroundImage('instructions');\n battleStateButton = new MenuButton(528, 175, \"mainMenuButtons\", \"mapSelectState\", \"battleG...
javascript
chosen
[ { "from": "system", "value": "Remove unexisting $attrs provider + unused itemScope parameter\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n \n angular.module('ui.nestedSortable')\n\n .controller('NestedSortableController', ['$scope', '$attrs', 'nestedSortableConfig',\n...
javascript
chosen
[ { "from": "system", "value": "Fix reference to DO_STOCKS_LIST environment variable\n" }, { "from": "human", "value": "const stockIndexRegex = /^([^/]+)\\/([^/]+)$/;\n\nexport const STOCK_INDICES = (process.env.STOCK_INDICES || '')\n .split(',')\n .map(code => code.match(stockIndexRegex))\n...
javascript
chosen
[ { "from": "system", "value": "Make sure to call done to end the promise chain\n" }, { "from": "human", "value": "/*jslint node: true*/\n\n\"use strict\";\n\nvar site = require(\"./lib/scraper\").site;\n\nsite.\n getRecipeUrls().\n then(function (recipeUrls) {\n return site.getRecipe...
javascript
chosen
[ { "from": "system", "value": "Consolidate dev and prod server initialization\n" }, { "from": "human", "value": "const Server = require('./server.heroku.js')\nconst port = (process.env.PORT || 8080)\nconst app = Server.app()\n\n/*if (process.env.NODE_ENV !== 'production') {\n const webpack = req...
javascript
chosen
[ { "from": "system", "value": "Test serving static log file.\n" }, { "from": "human", "value": "var config = require('./config');\nvar express = require('express');\nvar bodyParser = require('body-parser');\nvar winston = require('winston');\nwinston.add(winston.transports.File, { filename: 'info...
javascript
chosen
[ { "from": "system", "value": "Add some basic error logging\n" }, { "from": "human", "value": "const discord = require('discord.js');\nconst fs = require('fs');\nconst yaml = require('js-yaml');\n\nconst client = new discord.Client({\n\tfetchAllMembers: true,\n\tmessageCacheMaxSize: 10000...
javascript
chosen
[ { "from": "system", "value": "Rename imports to get access to express\n" }, { "from": "human", "value": "var app = require('express')();\nvar server = require('http').Server(app);\nvar io = require('socket.io')(server);\nvar path = require('path');\nvar game = require('./game.js');\n\nserver.lis...
javascript
chosen
[ { "from": "system", "value": "Add percentage to CLI output\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\nvar meow = require('meow');\nvar w3counter = require('./');\n\nvar cli = meow({\n\thelp: [\n\t\t'Usage',\n\t\t' $ w3counter <type>',\n\t\t'',\n\t\t'Example',\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Add basic markup of single post\n" }, { "from": "human", "value": "import React from 'react';\nimport connect from 'react-redux';\nimport { fetchPost } from '../actions';\n\nclass PostsShow extends React.Component {\n componentDidMount() {\n const { id } = this....
javascript
chosen
[ { "from": "system", "value": "Add Element and Parser to esm index.\n" }, { "from": "human", "value": "/**\n * @copyright 2016-2019, Miles Johnson\n * @license https://opensource.org/licenses/MIT\n */\n\n// Our index re-exports TypeScript types, which Babel is unable to detect and omit.\n//...
javascript
chosen
[ { "from": "system", "value": "Enable shares migration for all databases\n" }, { "from": "human", "value": "'use strict'\n\nvar Sequelize = require('sequelize')\n\nvar tableName = 'Shares'\n\nvar schema = {\n id: {\n type: Sequelize.INTEGER,\n primaryKey: true,\n autoIncrement: true\n ...
javascript
chosen
[ { "from": "system", "value": "Add necessary data to server response and improve error handling\n" }, { "from": "human", "value": "const config = require('../../../../config/ilmomasiina.config'); // eslint-disable-line\nconst md5 = require('md5');\n\nmodule.exports = () => (hook) => {\n const mo...
javascript
chosen
[ { "from": "system", "value": "Send a list of all data structure elements.\n" }, { "from": "human", "value": "import protagonist from 'protagonist';\n\nexport default function parseMson(mson, cb) {\n protagonist.parse(mson.trim(), (err, parseResult) => {\n let dataStructureElements;\n\n if...
javascript
chosen
[ { "from": "system", "value": "Fix a bug in Node.js\n" }, { "from": "human", "value": "/**\n * Add shim config for configuring the dependencies and exports for\n * older, traditional \"browser globals\" scripts that do not use define()\n * to declare the dependencies and set a module value.\n */\...
javascript
chosen
[ { "from": "system", "value": "Fix tests on Windows with autocrlf on.\n" }, { "from": "human", "value": "'use strict';\n\nvar grunt = require('grunt');\n\nexports.accessibilityTests = {\n matchReports: function(test) {\n\n var actual;\n var expected;\n\n test.expect(2);\n\n actual = ...
javascript
chosen
[ { "from": "system", "value": "Add the comments on the Virtual machine collection.\n" }, { "from": "human", "value": "/*global Backbone*/\nvar URL = require('./URL');\nvar VirtualMachine = require('./virtualMachine');\n\n//define a collection of virtual machines\nmodule.exports = Backbone.Collect...
javascript
chosen
[ { "from": "system", "value": "Refactor to use new button and add tooltip message\n" }, { "from": "human", "value": "import React from 'react';\n\nexport default React.createClass({\n render: function() {\n let saveOptionsDisabled = this.props.saveOptionsDisabled ? \"disabled\" : \"\";\...
javascript
chosen
[ { "from": "system", "value": "Update about reducer to use initial state\n" }, { "from": "human", "value": "import * as actions from '../constants/actionTypes';\n\nexport default function(state = {}, action) {\n switch(action.type) {\n case actions.ABOUT_FETCH:\n return Object.assign(......
javascript
chosen
[ { "from": "system", "value": "Use room name as string, instead as object for key value\n" }, { "from": "human", "value": "'use strict';\n\nvar all = false;\nvar cache = {};\n\nfunction getCache(room) {\n if (all === false) {\n all = [];\n for (var i in Game.creeps) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the preview image size\n" }, { "from": "human", "value": "angular\n .module('events.preview.directive', ['ui.router'])\n .directive('eventPreview', function () {\n return {\n restrict: 'E',\n replace: true,\n template: '<div class=\"event-pre...
javascript
chosen
[ { "from": "system", "value": "Change event parameter name from `e` to `event`.\n" }, { "from": "human", "value": "/**\n * CreateAccountField component.\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 ...
javascript
chosen
[ { "from": "system", "value": "Add get-work request from realtime to backend\n" }, { "from": "human", "value": "const io = require('socket.io'),\n winston = require('winston');\n\nwinston.remove(winston.transports.Console);\nwinston.add(winston.transports.Console, {'timestamp': true});\n\nco...
javascript
chosen
[ { "from": "system", "value": "Fix get_auth_data when no additional data on hash\n" }, { "from": "human", "value": "function submit_score(score) {\n auth_data = get_auth_data()\n submit_data = auth_data + \"&\" + score\n call_api(\"set_score\", submit_data)\n}\n\nfunction get_auth_data()...
javascript
chosen
[ { "from": "system", "value": "Add 'visit' to tracker stub\n" }, { "from": "human", "value": "(function (instanceName) {\n var i,\n s,\n z,\n w = window,\n d = document,\n q = 'script',\n f = ['config', 'track', 'identify', 'push', 'call'],\n c ...
javascript
chosen
[ { "from": "system", "value": "Change mobilization root path to /mobilizations\n" }, { "from": "human", "value": "import DefaultConfigServer from '~server/config'\n\nexport const mobilizations = () => '/'\nexport const mobilization = (mobilization, domain = DefaultConfigServer.appDomain) => {\n ...
javascript
chosen
[ { "from": "system", "value": "Add a play sound flag\n" }, { "from": "human", "value": "(function (window) {\n\t'use strict';\n\n\tvar hearingTest = HearingTest;\n\tvar hearing = hearingTest.init();\n\n\tvar app = new Vue({\n\t\tel: '#hearing-test-app',\n\t\tdata: {\n\t\t\tfrequency: 1000\n\t\t},...
javascript
chosen
[ { "from": "system", "value": "Add random on quizz list\n" }, { "from": "human", "value": "var QuizzListView = Backbone.View.extend({\n el: '#app',\n\n templateHandlebars: Handlebars.compile(\n $('#play-template-handlebars').html()\n ),\n\n remove: function() {\n this.$el.empty();\n\n ...
javascript
chosen
[ { "from": "system", "value": "Remove console.log about exit code\n" }, { "from": "human", "value": "require('./patches/gherkin')\nrequire('./keyboard/bindings')\n\nconst electron = require('electron')\nconst Cucumber = require('cucumber')\n\nconst Options = require('../cli/options')\nconst Outpu...
javascript
chosen
[ { "from": "system", "value": "Add results route; name routes\n" }, { "from": "human", "value": "Router.route('/', function () {\n this.layout(\"layout\")\n this.render('feelings');\n});\n" }, { "from": "gpt", "value": "Router.route('/', function () {\n this.layout(\"layout\")\n t...
javascript
chosen
[ { "from": "system", "value": "Use class syntax for `Map`\n" }, { "from": "human", "value": "function ObjectMap(){\n this._obj = {};\n}\n\nlet p = ObjectMap.prototype;\n\np.set = function( key, val ){\n this._obj[ key ] = val;\n};\n\np.delete = function( key ){\n this._obj[ key ] = null;\n};\n...
javascript
chosen
[ { "from": "system", "value": "Set default for allow method to be false\n" }, { "from": "human", "value": "module.exports = {\n settings: {\n domain: 'your-domain.auth0.com',\n clientID: 'your-client-id',\n clientSecret: 'your-client-secret'\n },\n allow: function(us...
javascript
chosen
[ { "from": "system", "value": "Use relative path for db REST API access\n" }, { "from": "human", "value": "'use strict';\n\n/* Controllers */\nvar recordControllers = angular.module('myApp.recordControllers', []);\n\nrecordControllers.controller('recordCtrl', ['$scope', '$http', '_',\n function(...
javascript
chosen
[ { "from": "system", "value": "Fix it gau! oh godgp\n" }, { "from": "human", "value": "window.onload = function() {\n d3.json(\"../examples/data/gitstats.json\", function(data) {\n data.forEach(function(d) {\n d.date = new Date(d.date);\n d.name = d.name === \"ashwinraman9\" ? \"ara...
javascript
chosen
[ { "from": "system", "value": "Support Release only to simplify webpack\n" }, { "from": "human", "value": "'use strict';\n\nconst release_type = process.config.target_defaults.default_configuration;\nconst ab_neuter = require(`./build/${release_type}/ab_neuter`);\n\nmodule.exports = neuter;\n\n\n...
javascript
chosen
[ { "from": "system", "value": "Use revert() instead of throw\n" }, { "from": "human", "value": "// Using web3 for its sha function...\nvar Web3 = require(\"web3\");\n\nvar Deployed = {\n\n makeSolidityDeployedAddressesLibrary: function(mapping) {\n var self = this;\n\n var source = \"\";\n...
javascript
chosen
[ { "from": "system", "value": "Test post register response with Postman\n" }, { "from": "human", "value": "const express = require('express')\nconst bodyParser = require('body-parser')\nconst cors = require('cors')\nconst morgan = require('morgan')\n\nconst app = express()\n// Seting up middlewar...
javascript
chosen
[ { "from": "system", "value": "Stop including jquery and shims in the output\n" }, { "from": "human", "value": "'use strict';\n\nconst EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\nconst Project = require('ember-cli/lib/models/project');\n\nmodule.exports = function(defaults) {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove comment about importing all plugins\n\nNo longer the case\n" }, { "from": "human", "value": "'use strict';\n\nconst EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nmodule.exports = function(defaults) {\n let app = new EmberAddon(defaults, {\n\...
javascript
chosen
[ { "from": "system", "value": "Disable source map in dev\n" }, { "from": "human", "value": "/* eslint-env node */\nconst EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nmodule.exports = function(defaults) {\n var app = new EmberAddon(defaults, {\n // Add options here\n });\n\n...
javascript
chosen
[ { "from": "system", "value": "Add help for upgrading to latest version.\n" }, { "from": "human", "value": "var path = require('path');\nvar fs = require('fs-extra');\n\n\nfunction upgradeNeeded(config, callback) {\n var oldSyncDir = syncDirWrong(config);\n var needsUpgrade = oldSyncDir;\n\...
javascript
chosen
[ { "from": "system", "value": "Add Axis icon to the clickable area of logo\n" }, { "from": "human", "value": "import React from 'react'\nimport { Link } from 'react-router-dom'\nimport Facebook from '../components/Facebook'\nimport SearchBox from '../components/SearchBox'\n\nconst SiteHeader = ({...
javascript
chosen
[ { "from": "system", "value": "Remove alternate statement for Default project\n" }, { "from": "human", "value": "/** @jsx React.DOM */\n\ndefine(\n [\n 'react',\n 'backbone'\n ],\n function (React, Backbone) {\n\n return React.createClass({\n\n propTypes: {\n project: Reac...
javascript
chosen
[ { "from": "system", "value": "Change port number from 8080 to 80 for deployment\n" }, { "from": "human", "value": "const express = require('express');\nconst mongoose = require('mongoose');\n\nconst app = express();\n\nmongoose.connect('mongodb://localhost/speechdoctor');\n\nrequire('./config/mi...
javascript
chosen
[ { "from": "system", "value": "Add placeholder text and suggest Last Name, First Name\n" }, { "from": "human", "value": "(function() {\n window.shared || (window.shared = {});\n var dom = window.shared.ReactHelpers.dom;\n\n var ProvidedByEducatorDropdown = window.shared.ProvidedByEducatorDropd...
javascript
chosen
[ { "from": "system", "value": "Enable inline sourcemaps for better ES6 debugging.\n" }, { "from": "human", "value": "module.exports = function gruntBabel(grunt) {\n grunt.config('babel', {\n options: {\n sourceMap: false,\n modules: 'amd',\n moduleIds: true,\n moduleRoot: ...
javascript
chosen
[ { "from": "system", "value": "Simplify js ready function (and make it work…)\n" }, { "from": "human", "value": "function ready(fn) {\n if (document.readyState != 'loading'){\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n}\n\nfunction previousElementSibling...
javascript
chosen
[ { "from": "system", "value": "Remove useless var in store\n" }, { "from": "human", "value": "import Reflux from 'reflux';\nimport Actions from './Actions';\nimport Handlers from './Handlers';\n\nexport default class Store extends Reflux.Store {\n constructor() {\n super();\n this.state = ...
javascript
chosen
[ { "from": "system", "value": "Views: Reset book status and start/finish dates on add form\n" }, { "from": "human", "value": "BookShelf.BookAdd = function(params) {\n\n return $.extend(BookShelf.BookForm(params), {\n\n resetBook: function() {\n this.book.title(\"\");\n ...
javascript
chosen
[ { "from": "system", "value": "Change to updating every 10s" }, { "from": "human", "value": "// TODO: should the baseScore be stored, and updated at vote time?\n\n// This interface should change and become more OO, this'll do for now\nvar Scoring = {\n // re-run the scoring algorithm on a single...
javascript
chosen
[ { "from": "system", "value": "Add the video detail component.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport ReactDom from 'react-dom';\nimport YTSearch from 'youtube-api-search';\nimport SearchBar from './components/search_bar';\nimport VideoList from './co...
javascript
chosen
[ { "from": "system", "value": "Remove code of old API\n\n- bound `actions` and `selectors` will be provided by `bindToSelection`\n" }, { "from": "human", "value": "import { setItemsActionCreator as setItems } from './setItems'\nimport { rangeToActionCreator as rangeTo } from './rangeTo'\nimport {...
javascript
chosen
[ { "from": "system", "value": "fix: Fix to import the browser version of document-register-element.\n\n#26\n" }, { "from": "human", "value": "// We load the Safari fix before document-register-element because DRE\n// overrides attachShadow() and calls back the one it finds on HTMLElement.\nimport...
javascript
chosen
[ { "from": "system", "value": "Fix bug where Jokes.on_message did not pass on non-matching messages.\n" }, { "from": "human", "value": "define(['lib/def', 'handler'], function(Def, Handler) {\n\n var Jokes = Def.type(Handler, function(source) {\n this.constructor.__super__.call(this);\n th...
javascript
chosen
[ { "from": "system", "value": "Add empty close funciton to silence error\n" }, { "from": "human", "value": "'use strict';\r\nconsole.log('Loading preload script');\r\n\r\nconst { ipcRenderer } = require('electron');\r\n\r\nconst OldNotification = Notification;\r\n\r\nNotification = function(title...
javascript
chosen
[ { "from": "system", "value": "Improve readability of ternary operator\n" }, { "from": "human", "value": "\nimport { locale as appLocale } from '../../intl'\n\nfunction localeCompare (a, b, locale = appLocale) {\n return a.localeCompare(b, locale, { numeric: true })\n}\n\n/*\n * Sort an Immutabl...
javascript
chosen
[ { "from": "system", "value": "Change the @match metadata to the */job/*/configure pattern to be as generic as possible\n" }, { "from": "human", "value": "/*\n Copyright 2015 Ops For Developers\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file ...
javascript
chosen
[ { "from": "system", "value": "Add 80 character wrap length." }, { "from": "human", "value": "/*! jsbeautifierSettingsTweaks.js v0.1.1 by ryanpcmcquen */\n(function () {\n\n 'use strict';\n\n window.addEventListener('load', function () {\n // set any vars you want to change here\n var jsl...
javascript
chosen
[ { "from": "system", "value": "Change link URLs to avoid redirect\n" }, { "from": "human", "value": "/**\n * Truncate a string to the given length.\n *\n * @param string The string to truncate.\n * @param length The length to truncate by.\n *\n * @returns {string}\n */\nexport const truncateStrin...
javascript
chosen
[ { "from": "system", "value": "Fix ErrorEvent logging + add Ember error listener\n" }, { "from": "human", "value": "/* global DEBUG */\n/* eslint-disable no-console */\nimport { argv } from \"nwjs/argv\";\nimport Logger from \"utils/Logger\";\n\n\nconst { logDebug, logError } = new Logger( \"Appl...
javascript
chosen
[ { "from": "system", "value": "Add onclick function for button. The function is called after submitting the search. It gets the value of the search field and get the data objects via ajax\n" }, { "from": "human", "value": "//autocomplete for organism search\n $(\"#search_organism\").autocomplete(...
javascript
chosen
[ { "from": "system", "value": ":new: Add specs for rejecting promise on stream error\n" }, { "from": "human", "value": "'use strict'\ndescribe('StreamPromise', function() {\n const StreamPromise = require('../')\n const FS = require('fs')\n it('works', function() {\n waitsForPromise(functio...
javascript
chosen
[ { "from": "system", "value": "Add Text and BitmapText to node class map\n" }, { "from": "human", "value": "// Dependencies\nimport 'engine/scene/sprites/enable';\n\n// Loader middleware\nimport bitmap_font_parser from './bitmap_font_parser';\nimport { loader_use_procs } from 'engine/registry';\n...
javascript
chosen
[ { "from": "system", "value": "Allow tests to be underscored.\n\nThis is to support legacy projects that are still using underscored\nnames (looking at you backburner).\n" }, { "from": "human", "value": "/* globals requirejs, require */\n\nQUnit.config.urlConfig.push({ id: 'nojshint', label: 'Dis...
javascript
chosen
[ { "from": "system", "value": "[NGRINDER-495] Modify process and thread calc to support vuser more than\n600." }, { "from": "human", "value": "function getProcessCount(total) {\n\tif (total < 2) {\n\t\treturn 1;\n\t}\n\tif (total > 80) {\n\t return parseInt(total / 30);\n\t}\n\treturn 2;\n}\n\...
javascript
chosen
[ { "from": "system", "value": "Remove select2 again, because that sucked\n" }, { "from": "human", "value": "$(function () {\n 'use strict';\n\n var $coordinator_select = $('#coordinator_id');\n var $group_select = $('#group_id');\n\n $coordinator_select.select2();\n $group_select.s...
javascript
chosen
[ { "from": "system", "value": "Update ORM tests to ensure plain objects are returned\n" }, { "from": "human", "value": "/* eslint-disable no-unused-expressions */\n\nimport { expect } from 'chai';\n\nexport default function orm (people, _ids, errors) {\n describe('Feathers ORM Specific Tests', (...
javascript
chosen
[ { "from": "system", "value": "CSRA-000: Make the fail the test to demo CircleCI\n" }, { "from": "human", "value": "import { expect } from 'chai';\n\ndescribe('smoke test', () => {\n it('run a test', () => {\n expect(true).to.equal(true);\n });\n});\n" }, { "from": "gpt", "value"...
javascript
chosen
[ { "from": "system", "value": "Use var to satisfy tests for prehistoric nodejs versions\n" }, { "from": "human", "value": "'use strict'\n\nconst packageJson = require('../package')\nconst channelHeader = `Node.js-${process.version}-SDK-v${packageJson.version}`\n\nmodule.exports = {\n reqWithBody...
javascript
chosen
[ { "from": "system", "value": "Allow lauching without specifying main_file\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar Janeway = require('../lib/init.js'),\n libpath = require('path'),\n main_file;\n\n// Get the wanted file to require\nmain_file = libpath.resolve(process.cwd...
javascript
chosen
[ { "from": "system", "value": "Write output m3u to local directory\nRegardless of whether source m3u is in local dir or not\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar LineReader = require('line-by-line'),\n minimist = require('minimist'),\n exec = require('exec'),...
javascript
chosen
[ { "from": "system", "value": "Update cache after an edit\n" }, { "from": "human", "value": "'use strict';\n\n//var P = require('bluebird');\nvar Resource = require('../Resource');\n\nfunction Company(primus)\n{\n Resource.call(this, primus, 'Company');\n\n this._cache = { // contai...
javascript
chosen
[ { "from": "system", "value": "Enable Babel properly while testing\n" }, { "from": "human", "value": "var gulp = require('gulp');\r\n\r\ngulp.task('test', function () {\r\n require('./');\r\n var mocha = require('gulp-mocha');\r\n return gulp.src('test/**/*.es6', {\r\n read: false\r\n })\r...
javascript
chosen
[ { "from": "system", "value": "Add warning about custom presets\n" }, { "from": "human", "value": "import path from 'path';\nimport loadPresets from './presets';\nimport serverRequire from './serverRequire';\n\nfunction customPreset({ configDir }) {\n return serverRequire(path.resolve(configDir,...
javascript
chosen
[ { "from": "system", "value": "Add time ago in words to the server render\n" }, { "from": "human", "value": "import prerender from './prerender'\n\n// This is a wrapper to handle a single isomorphic render inside a child process\n\nfunction startRender(context) {\n prerender(context).then((resul...
javascript
chosen
[ { "from": "system", "value": "Move out checking by using hasOwnProperty()\n" }, { "from": "human", "value": "/*\n Copyright (c) 2014, Ryuichi Okumura. All rights reserved.\n Code licensed under the BSD License:\n https://github.com/okuryu/package-json-flatten/blob/master/LICENSE.md\n */\n\"use s...
javascript
chosen
[ { "from": "system", "value": "Use injector to do angular config function.\n" }, { "from": "human", "value": "export default function CartRouters($stateProvider, $urlRouterProvider) {\n\n}\n" }, { "from": "gpt", "value": "function CartRouters($stateProvider, $urlRouterProvider) {\n}\n...
javascript
chosen
[ { "from": "system", "value": "Add a trailing slash to the base API URL\n" }, { "from": "human", "value": "(function($) {\n\n \"use strict\";\n\n var apiUrl = \"http://redjohn.herokuapp.com/api/tweets\";\n\n function addScoresToSuspects(response) {\n _.each(response.results, funct...
javascript
chosen
[ { "from": "system", "value": "Fix log of errors not rendering the error message/data in the JSON renderer.\n" }, { "from": "human", "value": "function JsonRenderer() {\n this._nrLogs = 0;\n}\n\nJsonRenderer.prototype.end = function (data) {\n if (this._nrLogs) {\n process.stderr.wri...
javascript
chosen
[ { "from": "system", "value": "Update delayJob test to use TimeKeeper\n" }, { "from": "human", "value": "'use strict';\nrequire('../helpers');\nconst assert = require('assert');\nconst Ironium = require('../..');\n\n\ndescribe('Queue with delay', function() {\n\n const captureQueue = Ironium.qu...
javascript
chosen