conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove extra string in header.\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport registerServiceWorker from './registerServiceWorker';\nimport Navbar from './comp...
javascript
chosen
[ { "from": "system", "value": "Add number, message and description\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nimport program from 'commander';\nimport bip from 'bip';\nimport moment from 'moment';\nimport pkg from '../package.json';\n\nconst getBalance = (number) =...
javascript
chosen
[ { "from": "system", "value": "TASK: Fix the intendation of the new settings object" }, { "from": "human", "value": "module.exports = {\n\tparser: 'babel-eslint',\n\textends: [\n\t\t'xo',\n\t\t'xo-react',\n\t\t'plugin:jsx-a11y/recommended',\n\t\t'plugin:promise/recommended',\n\t\t'plugin:react/re...
javascript
chosen
[ { "from": "system", "value": "Fix dot typo in .create\n" }, { "from": "human", "value": "const axios = require('axios');\n\nconst Cachios = require('./cachios');\n\nconst instance = new Cachios(axios);\n\n// allow for similar axios syntax\ninstance.create = function create(axiosInstance, nodeCac...
javascript
chosen
[ { "from": "system", "value": "Add option to accept two parameters only\n" }, { "from": "human", "value": "import fetch from 'isomorphic-fetch'\n\nexport default function fetchDispatch(url, options = {}, actions = {}) {\n\treturn (dispatch) => {\n\n\t\tif (typeof actions.request === 'function') ...
javascript
chosen
[ { "from": "system", "value": "Update the grunt task to latest grunt\n\n- use this.options()\n- use this.files\n" }, { "from": "human", "value": "/*\n * grunt-sass\n * 0.1.0 - 2012-06-12\n * github.com/sindresorhus/grunt-sass\n *\n * (c) Sindre Sorhus\n * sindresorhus.com\n * MIT License\n */\nmo...
javascript
chosen
[ { "from": "system", "value": "Fix run disowning from frontpage\n" }, { "from": "human", "value": "$(function () {\n window.disown_run = function (run) {\n $(\"#run_\" + run.id).fadeOut(300, function () { $(this).remove(); });\n $.ajax({\n url: \"/api/v3/runs/\" + run.id + \"/user\",\...
javascript
chosen
[ { "from": "system", "value": "Clean up pauseButton onclick setting\n" }, { "from": "human", "value": "'use babel';\n\nexport default class MobTimerView {\n constructor(serializedState, onPause) {\n // Create root element\n this.element = document.createElement('div');\n t...
javascript
chosen
[ { "from": "system", "value": "Add targetname option in unit test.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar fs = require('fs');\nvar should = require('chai').should();\nvar pdf2img = require('../index.js');\n\nvar input = __dirname + '/test.pdf';\n\npdf2img.setOptions({ o...
javascript
chosen
[ { "from": "system", "value": "Fix a crash in the gear tab when an Artifact's relics are not known\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Icon from 'common/Icon';\nimport ItemLink from 'common/ItemLink';\nimport ITEM_QUALITIES ...
javascript
chosen
[ { "from": "system", "value": "Use enhanceReducer to enhance reducer\n\nRather than doing it by hand.\n\nPart of STRIPES-333.\n" }, { "from": "human", "value": "import { createStore, combineReducers, applyMiddleware, compose } from 'redux';\nimport thunk from 'redux-thunk';\nimport createLogger f...
javascript
chosen
[ { "from": "system", "value": "Remove hanging comma from config file\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n 'extends': 'smartcar',\n 'env': {\n 'node': false,\n 'browser': true,\n },\n 'globals': {\n '_': false,\n 'Polymer': false,\n 'page': fa...
javascript
chosen
[ { "from": "system", "value": "Deal with commands in any case.\n" }, { "from": "human", "value": "var Chat = function(socket) {\n this.socket = socket;\n};\n\nChat.prototype.sendMessage = function(room, text) {\n var message = {\n room: room,\n text: text\n };\n this.socket.emit('messag...
javascript
chosen
[ { "from": "system", "value": "Add conditional to set 'module.exports'\n" }, { "from": "human", "value": "(function() {\n var Color;\n\nchromato = function(x, y, z, m) {\n return new Color(x, y, z, m);\n};\n\n\nchromato.color = function(x, y, z, m) {\n return new Color(x, y, z, m);\n};\n\n ch...
javascript
chosen
[ { "from": "system", "value": "Create function main & init with content_script response\n" }, { "from": "human", "value": "/**\n * StopFlash\n *\n * https://github.com/JWhile/StopFlash\n *\n * stopflash.js\n */\n\n// class StopFlashUI extends Builder\nfunction StopFlashUI()\n{\n this.super('di...
javascript
chosen
[ { "from": "system", "value": "Check that upclick tile matches the clicked tile or one of its targets.\n" }, { "from": "human", "value": "import { store } from './index';\n\nexport const tileUpClicked = clicked_tile => event => {\n if (event.button === 0) {\n store.dispatch({ type: 'ADVANCE_T...
javascript
chosen
[ { "from": "system", "value": "Add tests for translations in the API\n\nThis sets the Accept-Language header then checks that the returned\ndocument is in the requested language.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar i18n = require('../src/i18n');\nvar assert = require('assert...
javascript
chosen
[ { "from": "system", "value": ":white_check_mark: Write a spy for log trees\n" }, { "from": "human", "value": "// Copyright (c) 2017 The Regents of the University of Michigan.\n// All Rights Reserved. Licensed according to the terms of the Revised\n// BSD License. See LICENSE.txt for details.\n\n...
javascript
chosen
[ { "from": "system", "value": "Change to input type text on focus (only if empty)\n" }, { "from": "human", "value": "/**\n * @class CM_FormField_Password\n * @extends CM_FormField_Text\n */\nvar CM_FormField_Password = CM_FormField_Text.extend({\n _class: 'CM_FormField_Password',\n\n events: {\...
javascript
chosen
[ { "from": "system", "value": "Fix ember-flexberry blueprint delete dependencies\n" }, { "from": "human", "value": "/* globals module */\nmodule.exports = {\n afterInstall: function() {\n var _this = this;\n return this.addBowerPackagesToProject([\n { name: 'semantic-ui-daterangepicke...
javascript
chosen
[ { "from": "system", "value": "Remove unused argment from jobstatus config\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (interp, location, route) {\n var one = {\n controller: 'JobCtrl',\n templateUrl: 'build-tpl.html'\n };\n var routes = {\n '/': one,...
javascript
chosen
[ { "from": "system", "value": "Add google analytics to CSP img-src\n" }, { "from": "human", "value": "// @flow\n/**\n * Part of GDL gdl-frontend.\n * Copyright (C) 2018 GDL\n *\n * See LICENSE\n */\n\nconst directives = {\n defaultSrc: [\"'self'\"],\n scriptSrc: [\n \"'self'\",\n \"'unsaf...
javascript
chosen
[ { "from": "system", "value": "Add more tests that express the expected brush modes.\n" }, { "from": "human", "value": "var vows = require('vows'),\n assert = require('assert'),\n events = require('events'),\n load = require('./load'),\n suite = vows.describe('brushModes');\n\nfunctio...
javascript
chosen
[ { "from": "system", "value": "Use anchorscroll to hopefully make sure modals appear within view on mobile.\n" }, { "from": "human", "value": "/**\n * Copyright 2015 Ian Davies\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compli...
javascript
chosen
[ { "from": "system", "value": "Declare variables in bezzier.js for loops\n" }, { "from": "human", "value": "define(['../math.js', '../../app/directives/graph_sketcher/GraphUtils.js'], function(m, graphUtils) {\n return {\n numOfPts: 100,\n\n lineStyle: function(pts) {\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add showMessage bool to controller.\n" }, { "from": "human", "value": "angular.module(\"scripty5\")\n .controller(\"MessageController\", function() {\n\n });\n" }, { "from": "gpt", "value": "angular.module(\"scripty5\")\n .controller(\"MessageCo...
javascript
chosen
[ { "from": "system", "value": "Fix Bug Liens du menus configuration ne se mettent pas en actif\n" }, { "from": "human", "value": "define([\n\t'app',\n\n], function(app){\n\n\n\t/******************************************\n\t* Header View\n\t*/\n\tvar HeaderView = Backbone.View.extend({\n\n\t\tel ...
javascript
chosen
[ { "from": "system", "value": "KickstarterSideKick: Fix for new Kickstarter layout\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Kickstarter - Sidekick link\n// @namespace localhost\n// @description Adds a Sidekick link to Kickstarter projects\n// @include https://ww...
javascript
chosen
[ { "from": "system", "value": "Fix the bug of filiter\n" }, { "from": "human", "value": "function verifiyKeyword(keywordList, content) {\n\n\tvar keywords = Object.keys(keywordList);\n\n\tfor (var i = 0; i < keywordList.length; i++){\n\n\t\tif(keywordList.indexOf(content) === -1){\n\n\t\t\tvar re...
javascript
chosen
[ { "from": "system", "value": "Add multiple option to product picker.\n\nThere are a few things that reuse this picker and only work with a\nsingle selection. This was originally in bonobos/spree, but seems to\nhave been lost to the nether at some point in time.\n" }, { "from": "human", "value": ...
javascript
chosen
[ { "from": "system", "value": "Use promises instead of callbacks in test\n" }, { "from": "human", "value": "var nosniff = require('..')\n\nvar assert = require('assert')\nvar connect = require('connect')\nvar request = require('supertest')\n\ndescribe('nosniff', function () {\n it('sets header p...
javascript
chosen
[ { "from": "system", "value": "Fix test for unmatched type\n" }, { "from": "human", "value": "'use strict';\n\nvar test = require('tape');\nvar types = require('../src/types');\n\ntest('types', function (t) {\n\n t.equal(types.cast('foo'), 'foo', 'returns value if no type');\n var r = /foo/\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug: KeyframeCollection.toJSON() without options\n" }, { "from": "human", "value": "/**\n关键帧collection\n@module\n**/\ndefine([\n 'backbone', 'relationalScope',\n 'model.keyframe'\n], function(\n Backbone, relationalScope,\n Keyframe\n){\n var Keyf...
javascript
chosen
[ { "from": "system", "value": "Use event emitter in copy event test\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\n\nrequire('should');\n\nvar utils = require('../lib/utils');\n\n/**\n * Helper\n */\n\ndescribe('utils', function() {\n describe('copyEvent',...
javascript
chosen
[ { "from": "system", "value": "Fix thumbnail route when it's fetched from api\n" }, { "from": "human", "value": "export default (app) => {\n class ThumbnailService {\n constructor(authService) {\n 'ngInject';\n this.authService = authService;\n }\n\n ...
javascript
chosen
[ { "from": "system", "value": "Fix input@placeholder and textarea@placeholder detection." }, { "from": "human", "value": "\n// mostly by mathias bynens\n// https://github.com/mathiasbynens/Modernizr/commit/71932649b08e\n// but fixed by paul irish\n\n;(function(){\n \n var inputElem = document.c...
javascript
chosen
[ { "from": "system", "value": "Add missing source map comment when debug is true\n\nWithout this comment, source maps won't resolve properly.\n" }, { "from": "human", "value": "import { transformFile } from 'babel-core'\nimport { debug } from '../util/stdio'\nimport { default as es2015 } from 'ba...
javascript
chosen
[ { "from": "system", "value": "Use keycode constants from jQuery UI and improve message in test.\n" }, { "from": "human", "value": "//\n// Check for errors with up and down arrow presses in an empty notebook.\n//\ncasper.openNewNotebook();\n\ncasper.then(function () {\n var result = this.evalu...
javascript
chosen
[ { "from": "system", "value": "Revert \":lock: Destroy session on logout\"\n\nThis reverts commit 6158a0c41a1642961e6f931c6ddb61cc574e90f7.\n" }, { "from": "human", "value": "const express = require('express');\nconst passport = require('passport');\n\nconst router = express.Router();\n\nconst st...
javascript
chosen
[ { "from": "system", "value": "Fix LibNotify notification promise not resolving\n" }, { "from": "human", "value": "import { main } from \"config\";\nimport NotificationProvider from \"./NotificationProvider\";\nimport which from \"utils/node/fs/which\";\nimport { spawn } from \"child_process\";\n...
javascript
chosen
[ { "from": "system", "value": "Make check stream exists more accurate for deleted streams\n" }, { "from": "human", "value": "var debug = require('debug')('geteventstore:checkStreamExists'),\n req = require('request-promise'),\n assert = require('assert'),\n url = require('url'),\n q =...
javascript
chosen
[ { "from": "system", "value": "Change from class to id\n" }, { "from": "human", "value": "$(document).ready(function() {\n $('.submit_new_content').on('click', function() {\n window.btn_clicked = true;\n })\n\n window.onbeforeunload = function(event){\n if(!window.btn_clicked){\n ...
javascript
chosen
[ { "from": "system", "value": "Add another test to increase coverage\n" }, { "from": "human", "value": "// vi:si:et:sw=2:sts=2:ts=2\n\n/**\n * @fileoverview tests for scripts/services/things.js\n */\n\ndescribe(\n 'Service: Thing', function () {\n var Thing;\n\n var debug = new window.$deb...
javascript
chosen
[ { "from": "system", "value": "Add delay to account for anchors in tabs\n" }, { "from": "human", "value": "/**\n * Scroll smoothly to internal anchors.\n */\n$('a[href*=\\\\#]').on('click', function(evt) {\n let anchor = $($(this).attr('href'));\n $('html, body').animate({\n scrollTo...
javascript
chosen
[ { "from": "system", "value": "Remove page title management from store\n" }, { "from": "human", "value": "'use strict';\n\nvar createStore = require('fluxible/addons').createStore,\n ApplicationStore;\n\nApplicationStore = createStore({\n storeName: 'ApplicationStore',\n\n handlers: {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove .git as it seems npm cannot handle it sometimes\n" }, { "from": "human", "value": "const path = require('path');\nconst { success, warn } = require('./helpers/log')('proton-i18n');\nconst { bash } = require('./helpers/cli');\nconst { I18N_DEPENDENCY_REPO, I18...
javascript
chosen
[ { "from": "system", "value": "Add comment to url parsing function.\n" }, { "from": "human", "value": "'use strict';\n\nfunction asset(relPath) {\n return '/static/' + relPath;\n}\n\nfunction parseQueryData(url) {\n var data = url.split('?');\n return JSON.parse('{\"' + decodeURI(data[1]...
javascript
chosen
[ { "from": "system", "value": "Update footer not to use grid layout.\n" }, { "from": "human", "value": "/**\n * Footer component of the ModulePopularPagesWidget widget.\n *\n * Site Kit by Google, Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\...
javascript
chosen
[ { "from": "system", "value": "Use DevTools Extension when creating the store\n" }, { "from": "human", "value": "import {createStore, applyMiddleware, compose} from \"redux\";\n\nimport thunk from \"redux-thunk\";\n\nimport rootReducer from \"../reducers/rootReducer\";\n\nexport default function ...
javascript
chosen
[ { "from": "system", "value": "Add Highlight and Chevron to desktop-nav items\n\n" }, { "from": "human", "value": "//@flow\nimport React from \"react\";\n\nimport { Ul, Li, Nav } from \"./styled-components\";\nimport { ListItem } from \"./ListItem\";\n\nexport const DesktopNav = () => (\n <Nav>\...
javascript
chosen
[ { "from": "system", "value": "Use DOMContendLoaded event instead of load event to verify opening compose window definitely\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 with ...
javascript
chosen
[ { "from": "system", "value": "Fix a bug with FB redirects\n\nWas breaking FB login.\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n setupController: function(controller, user) {\n this._super(controller, user);\n this.store.find('prop...
javascript
chosen
[ { "from": "system", "value": "Update whiteList to demonstrate string parsing\n\nThe WhiteList is created by parsing a single string with a regular expression, which is then passed into an array of strings. Each operation is now commented." }, { "from": "human", "value": "// Name: Eric Schmitt\n/...
javascript
chosen
[ { "from": "system", "value": "Use the official Overpass API server by default\n" }, { "from": "human", "value": "\n\ndefine([], function () {\n\n\t'use strict';\n\n\treturn {\n\n\t\t'oauthConsumerKey': 'wPfXjdZViPvrRWSlenSWBsAWhYKarmOkOKk5WS4U',\n\t\t'oauthSecret': 'kaBZXTHZHKSk2jvBUr8vzk7JRI1cr...
javascript
chosen
[ { "from": "system", "value": "Break up 'Found a bug: ' string so internal js functions do not print this string deliberately.\n" }, { "from": "human", "value": "function confused(s)\n{\n if (jsshell) {\n // Magic string that jsInteresting.py looks for\n print(\"jsfunfuzz broke its own scr...
javascript
chosen
[ { "from": "system", "value": "Allow baseLayer option to be null to avoid rendering a base layer at all\n" }, { "from": "human", "value": "import geojs from 'geojs/geo.js';\nimport VisComponent from '../../VisComponent';\n\nexport default class Geo extends VisComponent {\n constructor (el, {map ...
javascript
chosen
[ { "from": "system", "value": "Fix menu view event trigger.\n" }, { "from": "human", "value": "// @flow\r\nimport ListPanelView from './ListPanelView';\r\nimport MenuItemView from './MenuItemView';\r\n\r\n/**\r\n * @name MenuPanelView\r\n * @memberof module:core.dropdown.views\r\n * @class Одиноч...
javascript
chosen
[ { "from": "system", "value": "Add ENV to add-to-slack button\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport OAuth from 'canvas-web/mixins/oauth';\n\nexport default Ember.Component.extend(OAuth, {\n clientID: ENV.slackClientID,\n endpoint: 'https://slack.com/oauth/authori...
javascript
chosen
[ { "from": "system", "value": "Change default api url to admin.openpension.org.il\n" }, { "from": "human", "value": "var baseUrl = \"http://localhost:4000/\";\n\nvar quarter2String = {\n 0: \"ראשון\",\n 1: \"שני\",\n 2: \"שלישי\",\n 3: \"רביעי\"\n};\n\nvar Model = function() {\n va...
javascript
chosen
[ { "from": "system", "value": "Add test cases for slightly more esoteric cases\n" }, { "from": "human", "value": "multiple_functions: {\n options = { if_return: true, hoist_funs: false };\n input: {\n ( function() {\n if ( !window ) {\n return;\n ...
javascript
chosen
[ { "from": "system", "value": "fix: Use localhost instead of 127.0.0.1 for the webui\n" }, { "from": "human", "value": "import multiaddr from 'multiaddr'\nimport config from './../config'\n\nexport function apiAddrToUrl (apiAddr) {\n const parts = multiaddr(apiAddr).nodeAddress()\n\n return `ht...
javascript
chosen
[ { "from": "system", "value": "Add 4 and 8 hours update intervals again\n" }, { "from": "human", "value": "'use strict';\n\n\nangular.module('Reader.optionsPage', ['Reader.services', 'Reader.directives']);\n\n\nfunction OptionsCtrl($scope, options) {\n \n $scope.syncEnabled = options.isSyn...
javascript
chosen
[ { "from": "system", "value": "Use Array indexOf instead of includes - breaks PhantomJS\n" }, { "from": "human", "value": "export default ngModule => {\n describe('home.routes', () => {\n beforeEach(window.module(ngModule.name));\n\n let $state;\n\n beforeEach(inject(_$state_ => {\n ...
javascript
chosen
[ { "from": "system", "value": "Update test for falling below mem\n" }, { "from": "human", "value": "profiles = {\n default: {\n SystemEnvironment: {\n command: \"pwd\",\n interval: 500\n },\n MotionDetector: {\n name: \"MD 1\",\n },\n BaseNotifier: {\n },\n Sy...
javascript
chosen
[ { "from": "system", "value": "Add a class to make the search bar stick inside with other elements.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nclass SearchBar extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = { term: '' };\n\t}...
javascript
chosen
[ { "from": "system", "value": "Switch to the non-buggy vertical chart.\n" }, { "from": "human", "value": "var ctx = document.getElementById(\"showStats\").getContext(\"2d\");\nvar statsChart = new Chart(ctx).HorizontalBar(statsData, {});\n" }, { "from": "gpt", "value": "Chart.defaults...
javascript
chosen
[ { "from": "system", "value": "Remove default code and displayed Households component\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport logo from './logo.svg';\nimport './App.css';\n\nclass App extends Component {\n render() {\n return (\n <div classNam...
javascript
chosen
[ { "from": "system", "value": "Add how to add file and get the contents\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nimport ipfsAPI from 'ipfs-api'\n\nvar ipfs = ipfsAPI('localhost', '5001')\n\nexport default class App extends Component {\n\tconstructor(props) {...
javascript
chosen
[ { "from": "system", "value": "Add validation to user input\n" }, { "from": "human", "value": "import mongo from 'then-mongo';\n\nconst db = mongo(\n process.env.DATABASE,\n ['stories'],\n);\nconst ObjectId = db.ObjectId;\n\nlet storiesCache = _getStories();\nlet cacheById = {};\n\n// CREATE\ne...
javascript
chosen
[ { "from": "system", "value": "Fix indentation on single file\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function(connection, parsed, data, callback) {\n\n if (!parsed.attributes ||\n parsed.attributes.length !== 1 ||\n !parsed.attributes[0] ||\n ...
javascript
chosen
[ { "from": "system", "value": "Add a directory listing to debug heroku\n" }, { "from": "human", "value": "'use strict';\n\nimport express from 'express';\n\nconst app = express();\n\napp.get('/', function (req, res) {\n res.send('Drinkkiarkisto.');\n});\n\napp.use('/doc', express.static(__dirnam...
javascript
chosen
[ { "from": "system", "value": "Rename default extension to `tpl`, shorter\n" }, { "from": "human", "value": "var _ = require('underscore');\nvar fs = require('fs');\nvar path = require('path');\n\nvar cache = {};\n\n// Set the default template extension. Override as necessary.\n_.templateExtensio...
javascript
chosen
[ { "from": "system", "value": "Remove commented code in wifflechat js\n" }, { "from": "human", "value": "if (Meteor.isClient) {\n\n Accounts.ui.config({\n passwordSignupFields: 'USERNAME_ONLY'\n });\n\n Template.messages.helpers({\n messages: function() {\n return Messages.fi...
javascript
chosen
[ { "from": "system", "value": "Fix addAssets for production builds\n" }, { "from": "human", "value": "const createConfig = require('./base')\nconst addAssets = require('./assets')\nconst addDevelopment = require('./development')\nconst addProduction = require('./production')\nconst addHot = requi...
javascript
chosen
[ { "from": "system", "value": "Use const when it makes sense in markup tests\n" }, { "from": "human", "value": "'use strict';\n\nlet _ = require('lodash');\nlet bluebird = require('bluebird');\nlet fs = bluebird.promisifyAll(require('fs'));\nlet glob = require('glob');\nlet hljs ...
javascript
chosen
[ { "from": "system", "value": "Change error handling to catch method.\n" }, { "from": "human", "value": "var mongodb = require('mongodb');\nvar nodefn = require('when/node');\nvar util = require('util');\n\n\n// ### Errors ###\n\nfunction MongoConnectionError(error) {\n\tthis.name = 'MongoConnect...
javascript
chosen
[ { "from": "system", "value": "Fix server config in client\n" }, { "from": "human", "value": "module.exports = function(RED) {\n var artemisNet = require('./artemisNet'),\n artemisModel = require('./public/javascripts/worldmodel');\n\n function ArtemisClient(config) {\n RED.no...
javascript
chosen
[ { "from": "system", "value": "Create test the fetch function\n" }, { "from": "human", "value": "describe('indexObj', function(){\n\tvar indexObj = new Index;\n\n beforeEach(function(done){\n indexObj.createIndex.done(function(data){\n done();\n });\n })\n\tdescribe('createIndex', fu...
javascript
chosen
[ { "from": "system", "value": "Add missing reset function for recent commit\n" }, { "from": "human", "value": "import { version } from '../../../../package'\n\n// Should include the package version so we can increase the version number\n// when the structure of the state has changed to avoid load...
javascript
chosen
[ { "from": "system", "value": "Use tan for cool effects\n" }, { "from": "human", "value": "const WIDTH = 800;\nconst HEIGHT = 600;\n\nconst SPACING = 25;\n\nconst RECT_SIZE_X = 15;\nconst RECT_SIZE_Y = 2;\n\nvar setup = function() {\n createCanvas(WIDTH, HEIGHT);\n background(0);\n fill(255);\...
javascript
chosen
[ { "from": "system", "value": "Update runner according to recent modification\n" }, { "from": "human", "value": "/**\n * Run test specs in node environment\n * Usage:\n * $ cd seajs\n * $ node tests/runner-node.js\n */\n\nrequire('../lib/sea.js')\n\ndefine('./tests/node-runner', function(requ...
javascript
chosen
[ { "from": "system", "value": "Remove a TODO that's been taken care of\n\nThis piece of code is needed on Firefox because the public key is\npassed in as a string, not a JSON object.\n" }, { "from": "human", "value": "navigator.id.beginProvisioning(function(email, cert_duration) {\n $.get('/api/...
javascript
chosen
[ { "from": "system", "value": "Add defaults to Contact model\n" }, { "from": "human", "value": "ContactManager.Models.Contact = Backbone.Model.extend({\n});\n" }, { "from": "gpt", "value": "ContactManager.Models.Contact = Backbone.Model.extend({\n defaults: {\n name: null,\n te...
javascript
chosen
[ { "from": "system", "value": "Fix sort order of networks by power\n" }, { "from": "human", "value": "var AmpersandCollection = require('ampersand-collection');\n\nvar Metadata = AmpersandCollection.extend({\n mainIndex: 'id',\n comparator: 'power'\n});\n\n/*\n Convenience method to see if eac...
javascript
chosen
[ { "from": "system", "value": "Test server using body parser\n" }, { "from": "human", "value": "var restify = require('restify');\nvar knex = require('knex')({\n client: 'mysql',\n connection: {\n host : '127.0.0.1',\n user : 'root',\n password : 'root',\n database : 'brestf...
javascript
chosen
[ { "from": "system", "value": "Use list of stocks to corresponding to tabs.\n" }, { "from": "human", "value": "chrome.browserAction.onClicked.addListener(function() {\n chrome.tabs.create({url: 'http://www.google.com'});\n});\n" }, { "from": "gpt", "value": "var prefix = 'http://fi...
javascript
chosen
[ { "from": "system", "value": "Create a simple `toggleState()` method\n" }, { "from": "human", "value": "var active = true;\n\nfunction setIcon() {\n if (active) {\n chrome.browserAction.setIcon({ path: 'icon_enabled.png' });\n } else {\n chrome.browserAction.setIcon({ path: 'icon_disable...
javascript
chosen
[ { "from": "system", "value": "Make sure all bot plugins are hinted\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n 'use strict';\n\n grunt.initConfig({\n pkg: grunt.file.readJSON( 'package.json' ),\n jshint: {\n all: [\n 'Gru...
javascript
chosen
[ { "from": "system", "value": "Make sanitizeForInObject a cheap identity function when possible.\n" }, { "from": "human", "value": "meteorBabelHelpers = module.exports = {\n sanitizeForInObject: function (obj) {\n if (Array.isArray(obj)) {\n var newObj = {};\n var keys = Object.keys...
javascript
chosen
[ { "from": "system", "value": "Revise code formatting based on review suggestions\n" }, { "from": "human", "value": "var fs = require(\"fs\");\nvar env = require(\"path\").join(__dirname, \"..\", \".env\");\n\nif (fs.existsSync(env) || !(typeof process.env.NODE_ENV === 'undefined')) process.exit(...
javascript
chosen
[ { "from": "system", "value": "Add a couple more assertions\n" }, { "from": "human", "value": "var RSVP = require('rsvp');\nvar request = RSVP.denodeify(require('request'));\nvar jsdom = require(\"jsdom\").jsdom;\n\nQUnit.module('Fastboot render');\n\nQUnit.test('it renders', function(assert...
javascript
chosen
[ { "from": "system", "value": "Make sure that prompt window disappears after entering secret.\n" }, { "from": "human", "value": "var EncryptedLocations = {\n decryptAll: function(locations) {\n var dfd = $.Deferred()\n\n askForPassword().done(function(password) {\n var decryptedLocati...
javascript
chosen
[ { "from": "system", "value": "Allow to function when `Ember.getOwner` is present but owner is not set.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport FakeOwner from './fake-owner';\n\nlet getOwner;\n\nif (Ember.getOwner) {\n getOwner = Ember.getOwner;\n} else {\n getOwne...
javascript
chosen
[ { "from": "system", "value": "Update form definition, including form_email child\n" }, { "from": "human", "value": "module.exports = function context (asset) {\n var base = require('../base')(asset)\n\n return function form (name, opts) {\n if (typeof name !== 'string') {\n opts = name...
javascript
chosen
[ { "from": "system", "value": "Fix up the flow declaration for intersection of lg props and view props\n" }, { "from": "human", "value": "// @flow\n\nimport { requireNativeComponent, View } from 'react-native';\n\nexport default requireNativeComponent('BVLinearGradient', null);\n\nexport type Poi...
javascript
chosen
[ { "from": "system", "value": "Remove input pattern 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;\nMod...
javascript
chosen
[ { "from": "system", "value": "Add friendly \"error\" message and check if CERT_PASSWORD is defined\n" }, { "from": "human", "value": "const installer = require('electron-installer-windows');\nconst path = require('path');\n\nconst options = {\n src: 'build/Headset-win32-ia32',\n dest: 'build/i...
javascript
chosen
[ { "from": "system", "value": "Remove submission form for p5.js challenge with repl.it\n" }, { "from": "human", "value": "import React, { Component, Fragment } from 'react'\nimport { Heading } from '@hackclub/design-system'\nimport LoginForm from 'components/apply/LoginForm'\nimport PostForm from...
javascript
chosen
[ { "from": "system", "value": "Fix usage of fs-extra (should've been fs-extra-promise)\n" }, { "from": "human", "value": "import fs from 'fs-extra';\nimport path from 'path';\nimport app from 'app';\n\nimport BaseAutoLauncher from 'browser/components/auto-launcher/base';\nimport files from 'commo...
javascript
chosen
[ { "from": "system", "value": "Use Node 10.x within Vagrant\n" }, { "from": "human", "value": "module.exports = {\n\n config: {\n Name: \"citybuilder\",\n Vagrant: {\n Box: 'ubuntu/xenial64',\n Install: 'npm docker.io'\n }\n },\n\n software: {\n \"couchdb\": {\n Sour...
javascript
chosen