conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add library for handling morse code.\nThis will be tapped when we want to send a pattern from the \"not-yet-created\" lights module.\n\nThe current example is taking the number of active-builds and using that value as a pattern.\nEx.) three active builds => ...-- where each dit/...
javascript
chosen
[ { "from": "human", "value": "Add binary with v1 code.\n" }, { "from": "gpt", "value": "#!/usr/bin/env node\n\nprocess.title = 'npm-yarn-compare';\n\nlet child_process = require('child_process'),\n prettyMs = require('pretty-ms'),\n clc = require('cli-color');\n\nlet packageName = process.a...
javascript
chosen
[ { "from": "human", "value": "Structure of the operators if else\n" }, { "from": "gpt", "value": "// operator if..elseif..else\n/*\nJavaScript has a similar set of control structures to other languages in the C family. \nConditional statements are supported by if and else; you can chain them toge...
javascript
chosen
[ { "from": "human", "value": "Base: Add loader for Arduino firmware\n\nPoint the Javascript URL to this URL:\nhttp://raw.githubusercontent.com/salbahra/Sprinklers/master/www/js/\n\nThis will automatically intercept the UI and load the mobile app instead\n" }, { "from": "gpt", "value": "// Insert ...
javascript
chosen
[ { "from": "human", "value": "Add help text for trading types\n" }, { "from": "gpt", "value": "export default ({\n CALL: 'You win the payout if the exit spot is strictly higher than the entry spot.',\n PUT: 'You win the payout if the exit spot is strictly lower than the entry spot.',\n C...
javascript
chosen
[ { "from": "human", "value": "Test for time conversion fix" }, { "from": "gpt", "value": "if(typeof exports === 'object') {\n\tvar assert = require(\"assert\");\n\tvar alasql = require('..');\n}\ndescribe('Test 431 error in 8 and 108 convert formats', function() {\n\n it('1. Should format time c...
javascript
chosen
[ { "from": "human", "value": "Test for duplicate name added.\n" }, { "from": "gpt", "value": "// Test suite for woad.\n// Run from 'test' subfolder\n'use strict';\nconst lg = require('../woad.js');\nconst test = require('unit.js');\nconst fs = require('fs');\n\nfunction testFunc() {\n\tconsole.lo...
javascript
chosen
[ { "from": "human", "value": "Introduce GridBlock component that doesn't parse markdown\n\nReviewed By: jstejada\n\nDifferential Revision: D26202230\n\nfbshipit-source-id: fa3fc259e1fc34ef5ce383c142ee45963e3354d6\n" }, { "from": "gpt", "value": "/**\n * Copyright (c) Facebook, Inc. and its affili...
javascript
chosen
[ { "from": "human", "value": "Add minimal sanity test for hamjest exports\n" }, { "from": "gpt", "value": "'use strict';\n\nvar _ = require('lodash-node')\n\t, hamjest = require('../lib/hamjest')\n\t, assertFalse = require('./asserts').assertFalse\n\t;\n\ndescribe('hamjest', function () {\n\tit('...
javascript
chosen
[ { "from": "human", "value": "Add fishing and consume example\n\n" }, { "from": "gpt", "value": "const mineflayer = require('mineflayer')\n\nif (process.argv.length < 4 || process.argv.length > 6) {\n console.log('Usage : node scoreboard.js <host> <port> [<name>] [<password>]')\n process.exit(1...
javascript
chosen
[ { "from": "human", "value": "Create handling of accountKit in client side\n" }, { "from": "gpt", "value": "// initialize Account Kit with CSRF protection\n AccountKit_OnInteractive = function () {\n AccountKit.init(\n {\n appId: '169812573551460',\n state: 'csrf',\n ...
javascript
chosen
[ { "from": "human", "value": "Add the controller for the type racer game." }, { "from": "gpt", "value": "function TypeRacerCtrl($scope) {\n this.selectedLevelName;\n this.selectedLevelSpeed;\n this.playerName;\n \n this.$onInit = function() {\n this.levels = [\n {...
javascript
chosen
[ { "from": "human", "value": "Update: Add tests to Spinner component\n" }, { "from": "gpt", "value": "/* eslint-env jest */\n\nimport React from 'react';\nimport { render, cleanup } from 'react-testing-library';\nimport Spinner from './Spinner';\n\nbeforeEach(cleanup);\n\nit('does not include tit...
javascript
chosen
[ { "from": "human", "value": "Add test script for the Nippon kiosk printer" }, { "from": "gpt", "value": "const minimist = require('minimist')\nconst SerialPort = require('serialport')\n\nconst portOptions = {\n autoOpen: false,\n baudRate: 115200,\n parity: 'odd',\n dataBits: 8,\n stopBits:...
javascript
chosen
[ { "from": "human", "value": "Add reducer test for ENHANCE_CAN_DROP_PIECE.\n" }, { "from": "gpt", "value": "import shogi from '../../../frontend/reducers/shogi';\nimport * as Action from '../../../frontend/actions';\nimport Piece from '../../../frontend/src/shogi/piece';\nimport Board from '../.....
javascript
chosen
[ { "from": "human", "value": "Add input plugin test.\n- client plugin added.\n" }, { "from": "gpt", "value": "var client = require('../../../lib/plugin/in/client.js'),\n nock = require('nock'),\n here = require('here').here;\n\ndescribe('input plugin: client', function(){\n var mockApiUrl ...
javascript
chosen
[ { "from": "human", "value": "Add template json schema test\n" }, { "from": "gpt", "value": "const fs = require('fs');\nconst path = require('path');\nconst jsYaml = require('js-yaml');\nconst should = require('should');\n// eslint-disable-next-line no-unused-vars\nconst Config = require('../../l...
javascript
chosen
[ { "from": "human", "value": "Add test for bitwise hash\n" }, { "from": "gpt", "value": "var assert = require('assert'),\n BitwiseHash = require('./../lib/BitwiseHash');\n\ndescribe('BitwiseHash', function () {\n it('Should create instance', function () {\n var hash = new BitwiseHash...
javascript
chosen
[ { "from": "system", "value": "Tweak log formating to append colon and space to stdout type.\n" }, { "from": "human", "value": "var Logger = function (config) {\n this.config = config;\n this.backend = this.config.backend || 'stdout'\n this.level = this.config.level || \"LOG_INFO\"\n if (t...
javascript
chosen
[ { "from": "human", "value": "Add the example to resize the image file via garphicsmagick.\n" }, { "from": "gpt", "value": "var gm = require('gm');\nvar dirpath = 'images/';\nvar imgname = 'download-logo.png';\nvar tmppath = 'tmp/';\n\ngm(dirpath + imgname) \n\n .resize(300, 200) \n .write...
javascript
chosen
[ { "from": "human", "value": "Add promise wrapper over the child compiler\n" }, { "from": "gpt", "value": "var extend = require('extend');\nvar Promise = require('bluebird');\nvar PluginError = require('../utils/PluginError');\n\n/**\n * @param {Compilation} compilation\n * @param {Object} option...
javascript
chosen
[ { "from": "human", "value": "Add tests for board vue component\n" }, { "from": "gpt", "value": "import Board from '../src/components/kanban-board.vue'\n\ndescribe(\"KanbanBoard\", () => {\n it(\"should have child components\", () => {\n expect(Board.components.KanbanList).to.be.an('obj...
javascript
chosen
[ { "from": "system", "value": "Allow backbone on the server also.\n\nAlso, add json dependency.\n" }, { "from": "human", "value": "Package.describe({\n summary: \"A minimalist client-side MVC framework\"\n});\n\nPackage.on_use(function (api) {\n // XXX Backbone requires either jquery or zepto\n...
javascript
chosen
[ { "from": "human", "value": "Add ES6 variant using classes\n" }, { "from": "gpt", "value": "// ES6 variation with classes for \"Classical inheritance in JS ES5\".\n//\n// Eli Bendersky [http://eli.thegreenplace.net]\n// This code is in the public domain.\n\nclass Shape {\n constructor(x, y) {\n...
javascript
chosen
[ { "from": "human", "value": "Add LPD8 script for cross-device identification\n" }, { "from": "gpt", "value": "// Bitwig controller script for AKAI LPD\n// by Nick Donaldson, 2016\n//\n// Global constants\n\nvar SCRIPT_API_VERSION = 1;\nvar SCRIPT_VERSION = \"0.1\";\nvar SCRIPT_UUID = \"b5a7af1c-...
javascript
chosen
[ { "from": "human", "value": "Create sketch for adding chart.\\n\\nStill need to investigate adding when associations (user, note, etc.) already exist.\n" }, { "from": "gpt", "value": "// const User = require('./user')\n// const Key = require('./note-key').Key\n// const Note = require('./note-key...
javascript
chosen
[ { "from": "human", "value": "Implement basic Hue API control\n" }, { "from": "gpt", "value": "HueBridge = function(server, username) {\n this.server = server;\n this.username = username;\n}\n\nHueBridge.prototype = {\n\n _apiCall: function(method, path, data, callback) {\n HTTP.call(method...
javascript
chosen
[ { "from": "human", "value": "Add skeleton of mixer tests for play and pause\n" }, { "from": "gpt", "value": "describe(\"Mixer\", function(){\n var mixer;\n var song;\n\n beforeEach(function(){\n mixer = [];\n song = new Howl({\n urls: \"https://s3.amazonaws.com/the-golden-record/Mu...
javascript
chosen
[ { "from": "human", "value": "Add master run file to repo. Oops.\n" }, { "from": "gpt", "value": "(function () {\n function run () {\n \n // (reads from quizServer.cfg and mypwd.txt)\n var config = require('./lib/config').config;\n\n var optsModule = require('./lib/o...
javascript
chosen
[ { "from": "human", "value": "tests: Add tests for prompt options module\n" }, { "from": "gpt", "value": "var chai = require('chai');\nvar expect = chai.expect;\n\nvar promptOptionsModule = require('../../bin/promptOptions')();\n\nchai.should();\n\ndescribe('As a user of the promptOptions module'...
javascript
chosen
[ { "from": "human", "value": "Add working draft of a saving scenario\n" }, { "from": "gpt", "value": "'use strict';\n\n//https://github.com/angular/protractor/blob/master/docs/api.md\n//GetAttribute() returns \"boolean\" values and will return either \"true\" or null\ndescribe('Reports', function...
javascript
chosen
[ { "from": "system", "value": "Implement a proper Fisher-Yates shuffle.\n" }, { "from": "human", "value": "const Card = require('./card.js');\n\nclass Deck {\n constructor() {\n this.cards = [];\n for (let suit of Card.Suits()) {\n for (let rank of Card.Ranks()) {\n let card = ...
javascript
chosen
[ { "from": "human", "value": "Add story for bookmarklet component\n" }, { "from": "gpt", "value": "import React from 'react'\nimport { storiesOf } from '@storybook/react'\n\nimport Specimen from 'v2/stories/__components__/Specimen'\n\nimport Bookmarklet from 'v2/components/Bookmarklet/components/...
javascript
chosen
[ { "from": "human", "value": "Write the second version of \"Fizz Buzz.\"\n\nThis version handles all the cases in the actual game:\n\n* Print \"FizzBuzz\" if the value is evenly divisible by both 3 and 5\n* Print \"Fizz\" if the value is evenly divisible by 3\n* Print \"Buzz\" if the value is evenly divisble...
javascript
chosen
[ { "from": "human", "value": "Add test coverage for actions\n" }, { "from": "gpt", "value": "import * as actions from '../tasks';\n\ndescribe('Task Actions', () => {\n let defaultId,\n defaultTask;\n\n beforeEach(() => {\n defaultId = 'someUniqueId';\n defaultTask = {\n...
javascript
chosen
[ { "from": "human", "value": "Add project team stats on learning Object section\n" }, { "from": "gpt", "value": "const team = {\n _players:[\n {\n firstName: 'Cristiano',\n lastName: 'Ronaldo',\n age: 36\n },\n {\n firstName: 'Lionel',\n lastNa...
javascript
chosen
[ { "from": "human", "value": "Create JS Olympics file for 7.6\n" }, { "from": "gpt", "value": "/*\n\n PEER PARING CHALLENGE 7.6: JAVASCRIPT OLYMPICS\n\n WE PAIRED ON THIS CHALLENGE: Becca Nelson & Lars Johnson\n THIS CHALLENGE TOOK US: ___ Hours\n\n*/\n// ######################################...
javascript
chosen
[ { "from": "human", "value": "Add types for @storybook/addon-actions package\n" }, { "from": "gpt", "value": "// flow-typed signature: 824de8c4d861db90a6471d410d3df917\n// flow-typed version: <<STUB>>/@storybook/addon-actions_v4.0.0/flow_v0.90.0\n\n/**\n * This is an autogenerated libdef stub for...
javascript
chosen
[ { "from": "human", "value": "WE: Define the data structure for addon settings.\n\nThis is a straight-forward translation of the XPCOM-based configuration.\n(Few options are missing for compatibility reasons, though)\n\nSee 'reload-on-idle/content/config.xul' for details.\n" }, { "from": "gpt", "...
javascript
chosen
[ { "from": "system", "value": "Use nextProps for comparison not nextState\n\nAuditors: da39a3ee5e6b4b0d3255bfef95601890afd80709@bridiver\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 dist...
javascript
chosen
[ { "from": "human", "value": "Add a variation on the Angular UI Bootstrap code which keeps the dropdown open as long as the clicks are inside the menu\n" }, { "from": "gpt", "value": "/**\n * Enhances the angular bootstrap directive to allow it to stay open when the\n * user clicks inside the men...
javascript
chosen
[ { "from": "human", "value": "Update as Day 10 Customer Model\n" }, { "from": "gpt", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar mongoose = require('mongoose'),\n\tSchema = mongoose.Schema;\n\n/**\n * Customer Schema\n */\nvar CustomerSchema = new Schema({\n\tfirstName: {\n\...
javascript
chosen
[ { "from": "human", "value": "Add tests for `ref` :)\n" }, { "from": "gpt", "value": "import { h, render, Component } from '../../src/preact';\n/** @jsx h */\n\ndescribe('refs', () => {\n\tlet scratch;\n\n\tbefore( () => {\n\t\tscratch = document.createElement('div');\n\t\t(document.body || docum...
javascript
chosen
[ { "from": "human", "value": "Add tests for path module.\n" }, { "from": "gpt", "value": "var path = require(\"path\");\nprocess.mixin(require(\"./common\"));\n\nvar f = __filename;\n\nassert.equal(path.basename(f), \"test-path.js\");\nassert.equal(path.basename(f, \".js\"), \"test-path\");\nasse...
javascript
chosen
[ { "from": "human", "value": "Create test file for cache.\n" }, { "from": "gpt", "value": "module.exports = {\n setUp: function (callback) {\n var path = require('path');\n\n this.cache = require('../lib/utils/cache');\n this.cache.init({\n \"path\" : path.resol...
javascript
chosen
[ { "from": "human", "value": "Add mock mixin for Polymer.IronFitBehavior\n\nPolymer.IronFitBehavior doesn't have a mixin and should be added to\ncomponent using Polymer.mixinBehavior([Polymer.IronFitBehavior]).\nPolymer linter doesn't process this correctly. To workaround it the mock\nmixin was added. It wil...
javascript
chosen
[ { "from": "human", "value": "Add Physics placeholder. Planned to be implemented soon.\n" }, { "from": "gpt", "value": "/**\n * @module Joy.Behaviour\n */\n(function(J) {\n /**\n * TODO: Wouldn't it be nice?\n */\n var Physics = J.Behaviour.extend({\n INIT: function (options) {},\n UP...
javascript
chosen
[ { "from": "system", "value": "Add an extra safety check to trailingSemicolon\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n name: 'trailingSemicolon',\n nodeTypes: ['rule', 'atrule'],\n message: 'All property declarations should end with a semicolon.',\n\n l...
javascript
chosen
[ { "from": "human", "value": "Add support for auth0-side application access restriction override\nThis fails authentication for specific applications directly from auth0,\ninstead of letting the application decide. Mainly used for applications\nthat do not have proper OIDC or SAML support with authorization\...
javascript
chosen
[ { "from": "human", "value": "Add initial tests for inView.offset\n" }, { "from": "gpt", "value": "import test from 'ava';\nimport inView from '../src/in-view';\n\ntest('inView.offset returns the offset', t => {\n t.true(inView.offset(50) === 50);\n});\n\ntest('inView.offset returns current of...
javascript
chosen
[ { "from": "human", "value": "Test for multiple addBatch() calls\n" }, { "from": "gpt", "value": "// test-multiple-batch.js -- Multiple calls to addBatch()\n//\n// Copyright 2016 fuzzy.ai <evan@fuzzy.ai>\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use...
javascript
chosen
[ { "from": "human", "value": "Add temporary simple LED button\n" }, { "from": "gpt", "value": "var MeshbluSocketIO = require('meshblu');\nvar SerialPort = require('serialport');\nvar tinycolor = require('tinycolor2');\n\nvar cfg = require('./meshblu.json');\n\nvar serport = null;\nvar meshblu = n...
javascript
chosen
[ { "from": "human", "value": "Update project require-css to 0.1.8\n" }, { "from": "gpt", "value": "define(function(){if(\"undefined\"==typeof window)return{load:function(e,t,n){n()}};var e=document.getElementsByTagName(\"head\")[0],t=window.navigator.userAgent.match(/Trident\\/([^ ;]*)|AppleWebKi...
javascript
chosen
[ { "from": "human", "value": "chore: Create function that merge 2 arrays\n" }, { "from": "gpt", "value": "//function to combine two one dimensional arrays to one\n\nfunction array_merge2(arr1, arr2) {\n\treturn arr1.concat(arr2);\n}\n\nconsole.log(array_merge2([1, 2, 3], [4, 5]));\n\t\n" } ]
javascript
chosen
[ { "from": "human", "value": "Add a github release upload script\n" }, { "from": "gpt", "value": "\"use strict\"\n\nlet version = process.argv[2]\nlet auth = process.argv[3]\n\nif (!auth) {\n console.log(\"Usage: upload-release.js [TAG] [github-user:password]\")\n process.exit(1)\n}\n\nrequire(...
javascript
chosen
[ { "from": "human", "value": "Add YoutubeTrack class to represent a youtube track\nFor future soundcloud support.\n" }, { "from": "gpt", "value": "var ytdl = require('ytdl-core');\n\nmodule.exports = YoutubeTrack = function(vid, cb) {\n var _this = this;\n var requestUrl = 'http://www.youtube.c...
javascript
chosen
[ { "from": "human", "value": "Create exports folder for namespacing imports/exports.\n" }, { "from": "gpt", "value": "import {\n Asset,\n BondBase,\n BondCorporate,\n BondGovernment,\n BondMortgage,\n Currency,\n CustomAsset,\n Derivative,\n BondOption,\n CFD,\n Equity,\n ForeignExcha...
javascript
chosen
[ { "from": "human", "value": "Add tests for the Scrollbar component\n" }, { "from": "gpt", "value": "import React from 'react';\nimport { mount } from 'enzyme';\nimport Scrollbar from '../../../src/components/Scrollbar/Scrollbar';\n\ndescribe('<Scrollbar />', function () {\n beforeEach(function...
javascript
chosen
[ { "from": "human", "value": "Add language pack for Simplified Chinese.\n" }, { "from": "gpt", "value": "plupload.addI18n({\"Stop Upload\":\"停止上传\",\"Upload URL might be wrong or doesn't exist.\":\"上传的URL可能是错误的或不存在。\",\"tb\":\"tb\",\"Size\":\"大小\",\"Close\":\"关闭\",\"Init error.\":\"初始化错误。\",\"Add...
javascript
chosen
[ { "from": "human", "value": "Add pairs with given difference\n" }, { "from": "gpt", "value": "const test = require('tape')\n\n/**\n * Given an array arr of distinct integers and a nonnegative integer k,\n * write a function that returns an array of all pairs [x,y],\n * such that x - y = k. If no...
javascript
chosen
[ { "from": "human", "value": "Add script to pull piwik data, inject into posts" }, { "from": "gpt", "value": "var superagent = require('superagent');\nvar _ = require('lodash');\nvar fs = require('fs');\nvar path = require('path');\nvar frontMatter = require('front-matter');\n\nvar postsPath = pa...
javascript
chosen
[ { "from": "human", "value": "Create new timeslot with ajax call\n" }, { "from": "gpt", "value": "$(document).ready(function(){\n\n $(\"#new-timeslot-form\").submit(function(event){\n event.preventDefault();\n var data = createDate();\n $(\"#modal_new_timeslot\").modal('toggle');\n $...
javascript
chosen
[ { "from": "human", "value": "Add field component tests on tags.\n" }, { "from": "gpt", "value": "describe('Test the field component', function() {\n\n /**\n * Get the textarea component\n */\n function getFieldComponent(field) {\n var editorAdvancedFieldComponent = Vue.exten...
javascript
chosen
[ { "from": "human", "value": "Test for mark as fav\n" }, { "from": "gpt", "value": "var expect = chai.expect;\n\ndescribe('markAsFavouriteService', function () {\n\n\t// console.log(angular.module('APP'))\n\tvar $httpBackend;\n\n\t// var APP;\n\tvar video = {\n\t\t_id: '123'\n\t}\n\n\tvar apiUrl ...
javascript
chosen
[ { "from": "human", "value": "Add script for lessee reservation list\n" }, { "from": "gpt", "value": "$(document).ready(function() {\n\t$('#reservation-table').DataTable({});\n}); \n\n$('.btn-cancel').on('click', function() {\n\tif (confirm('Are you sure to cancel this reservation?')) {\n\t\tcons...
javascript
chosen
[ { "from": "human", "value": "Create container for SignUpForm component\n" }, { "from": "gpt", "value": "import React, { Component } from 'react';\nimport logo from '../../public/images/logo.png';\nimport PageFooter from '../PageFooter';\nimport SignUpForm from './SignUpForm';\nimport { connect }...
javascript
chosen
[ { "from": "human", "value": "Complete 'Reject a promise' challenge in 'Promise it won't hurt' tutorial\n" }, { "from": "gpt", "value": "var q = require('q');\nvar deferred = q.defer();\ndeferred.promise.then(null, function(err) {\n console.log(err.message);\n});\n\nsetTimeout(deferred.reject, 3...
javascript
chosen
[ { "from": "human", "value": "Add command to get the hash of the git commit that is currently being run\n" }, { "from": "gpt", "value": "var exec = require('child_process').exec;\n\nvar hash;\n\nmodule.exports.init = function(b) {\n\texec('git rev-parse HEAD', function(error, stdout, stderr) {\n\...
javascript
chosen
[ { "from": "human", "value": "Add preview how we're going to organize as ES6 module\n" }, { "from": "gpt", "value": "// note we can also import/export in CS2\n\n// fragment.js\n\nfunction replace() {\n}\n\nfunction extract() {\n}\n\nfunction three() {\n}\n\nexport default { one, two }\n\n\n\n// ...
javascript
chosen
[ { "from": "human", "value": "Add filter plugin for dataTables\n\nThis is a simple client-side plugin for handling Perl module names in\nDataTables.\n" }, { "from": "gpt", "value": "/**\n * This filtering plugin will allow matching of module names in either\n * form of 'Foo::Bar', or 'Foo-Bar'.\n...
javascript
chosen
[ { "from": "human", "value": "Add end-to-end tests for autocomplete\n" }, { "from": "gpt", "value": "module.exports = {\n 'Should autocomplete words on home page': function (browser) {\n browser\n .url('http://localhost:8000/')\n .waitForElementVisible('body', 1000)\n .setValue...
javascript
chosen
[ { "from": "human", "value": "Add some common HTTP error helpers\n" }, { "from": "gpt", "value": "function httpError ( message, code ) {\n\n var err = new Error( message );\n err.status = code;\n\n return err;\n\n}\n\n\nexports.system = function ( message ) {\n\n return httpError( mes...
javascript
chosen
[ { "from": "human", "value": "Add customised asciimath plugin library for webpack\n" }, { "from": "gpt", "value": "/**\n * Code were taken from https://github.com/quertt/markdown-it-asciimath\n * and modified for use with webpack, since the original npm package\n * wasn't meant for use with webpa...
javascript
chosen
[ { "from": "human", "value": "Add initial module definition boilerplate\n\nThe module definition supports both AMD and browser globals.\n" }, { "from": "gpt", "value": "(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous mod...
javascript
chosen
[ { "from": "human", "value": "Add failing test for Plotband.Label updating together with axis\n" }, { "from": "gpt", "value": "import React from 'react';\nimport Highcharts from 'highcharts';\nimport {\n HighchartsChart,\n Debug,\n HighchartsProvider,\n PlotBand,\n YAxis\n} from '../../../sr...
javascript
chosen
[ { "from": "system", "value": "Add grid col for search bar more beauty\n" }, { "from": "human", "value": "/**\n * Widget Header Directive\n */\n\nangular\n .module('RDash')\n .directive('rdWidgetHeader', rdWidgetTitle);\n\nfunction rdWidgetTitle() {\n var directive = {\n requires:...
javascript
chosen
[ { "from": "human", "value": "Add integration test of OAuth2\n" }, { "from": "gpt", "value": "const express = require('express');\nconst e2p = require('event-to-promise');\nconst simpleOAuth2 = require('simple-oauth2');\n\nconst {server, chai} = require('../common');\n\ndescribe('oauth/', functio...
javascript
chosen
[ { "from": "human", "value": "Add tests for parseCommand function\n" }, { "from": "gpt", "value": "import { parseCommand, Spreadsheet } from './models';\n\ndescribe('parseCommand', () => {\n const ast = parseCommand('A0 = A1 + A2');\n\n it('parses simple assignment', () => {\n expect(ast.typ...
javascript
chosen
[ { "from": "human", "value": "chore(docs): Add script to publish docs to ui-router.github.io\n" }, { "from": "gpt", "value": "#!env node\n\nlet package = require('../package.json').name;\nlet version = require('../package.json').version;\n\nlet corePackage = require('../../core/package.json').nam...
javascript
chosen
[ { "from": "human", "value": "Add test for the common function\n" }, { "from": "gpt", "value": "var helper = require('../helper')\n , expect = require('chai').expect;\n\ndescribe('orchestrate.io/common', function () {\n describe('.merge', function () {\n it('returns a merger object', functio...
javascript
chosen
[ { "from": "human", "value": "Test environment instrumentation: tiny script to modify a value in memcached that will trigger test starts.\n" }, { "from": "gpt", "value": "var Memcached = require('memcached');\nvar KeyGen = require('./mcKeyGenerator.js');\n\nvar mc = new Memcached(\"localhost:1121...
javascript
chosen
[ { "from": "system", "value": "Use absolute locations for plugins and presets in packager babel config\n\nReviewed By: davidaurelio\n\nDifferential Revision: D5044244\n\nfbshipit-source-id: ab1af28d0158c22d0426a7a3b3f1bb0a63abac4e\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2015-pres...
javascript
chosen
[ { "from": "system", "value": "Print better errors when ecmascript compilation fails.\n" }, { "from": "human", "value": "function BabelCompiler() {}\n\nvar BCp = BabelCompiler.prototype;\n\nBCp.processFilesForTarget = function (inputFiles) {\n inputFiles.forEach(function (inputFile) {\n var s...
javascript
chosen
[ { "from": "human", "value": "Add example of classfile generation.\n" }, { "from": "gpt", "value": "// The Java \"NervousText\" example ported to JavaScript.\n// Compile using jsc -extends java.applet.Applet -implements java.lang.Runnable NervousText.js\n/* \nAdapted from Java code by\n Danie...
javascript
chosen
[ { "from": "human", "value": "Add data object for cars.\n" }, { "from": "gpt", "value": "'use strict';\n\nvar mongoose = require('mongoose'),\n Car = mongoose.model('Car'),\n BBPromise = require('bluebird');\n\nmodule.exports = {\n getCarById: function (id) {\n // TODO: Find a spe...
javascript
chosen
[ { "from": "human", "value": "Move pathway functions to new file\n" }, { "from": "gpt", "value": "import uniqBy from 'lodash/uniqBy';\n\nexport function getPathwaysModelOptions(query, filtersMeta, filter) {\n if (!query || !query.locations) return filtersMeta[filter];\n const locationsSelected ...
javascript
chosen
[ { "from": "system", "value": "Use _.mixin for i18n translation function\n" }, { "from": "human", "value": "(function(root,undefined) {\n\n var _ = root._;\n\n var langopts = root.DC_LANGUAGE_CODES ? _.clone(root.DC_LANGUAGE_CODES) : { language: 'eng', fallback: 'eng' };\n langopts.namespace =...
javascript
chosen
[ { "from": "human", "value": "Add script for sending s3 events to slack" }, { "from": "gpt", "value": "const aws = require('aws-sdk');\nconst s3 = new aws.S3({ apiVersion: '2006-03-01' });\n\nconst https = require('https');\nconst url = require('url');\n\nconst slackUrl = 'https://hooks.slack.com...
javascript
chosen
[ { "from": "human", "value": "Add Task Circle unit test\n" }, { "from": "gpt", "value": "/* eslint-env mocha, jest */\n\nimport React from 'react';\nimport { shallow } from 'enzyme';\n\nimport Circle from '../Circle';\n\nit('should render', () => {\n shallow(<Circle />);\n});\nit('should be a <p...
javascript
chosen
[ { "from": "human", "value": "Solve 272 Closest Binary Search Tree Value II\n" }, { "from": "gpt", "value": "'use strict';\n/**\n * Definition for a binary tree node.\n * function TreeNode(val) {\n * this.val = val;\n * this.left = this.right = null;\n * }\n */\n/**\n * @param {TreeNode} ...
javascript
chosen
[ { "from": "human", "value": "Add test for Player model\n" }, { "from": "gpt", "value": "'use strict';\n\nvar expect = require('chai').expect;\nvar Player = require('../app/scripts/player');\n\ndescribe('player', function () {\n\n it('should initialize player', function () {\n var player = ne...
javascript
chosen
[ { "from": "human", "value": "Add boilerplate function to handle the request\n" }, { "from": "gpt", "value": "const Report = require('./report');\nconst Hipchat = require('./Hipchat');\n\nfunction Reporter( request, reply ) {\n console.log(request.query);\n return reply({});\n}\n\nmodule.export...
javascript
chosen
[ { "from": "system", "value": "Refactor Endless Plains to use opponent targeting\n" }, { "from": "human", "value": "const ProvinceCard = require('../../provincecard.js');\n\nclass EndlessPlains extends ProvinceCard {\n setupCardAbilities(ability) {\n this.reaction({\n when: {...
javascript
chosen
[ { "from": "human", "value": "Fix syntax highlighting in the styleguide\n" }, { "from": "gpt", "value": "import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\nimport RSVP from 'rsvp';\n\nexport default Route.extend({\n emberFreestyle: service(),\n\n bef...
javascript
chosen
[ { "from": "human", "value": "Create resource handler script for CNTL" }, { "from": "gpt", "value": "define(['mac/roman'], function(macintoshRoman) {\n\n 'use strict';\n \n return function(resource) {\n var dv = new DataView(resource.data.buffer, resource.data.byteOffset, resource.data.byte...
javascript
chosen
[ { "from": "human", "value": "Create resource handler script for MENU" }, { "from": "gpt", "value": "define(['mac/roman'], function(macintoshRoman) {\n\n 'use strict';\n \n return function(resource) {\n var dv = new DataView(resource.data.buffer, resource.data.byteOffset, resource.data.byte...
javascript
chosen
[ { "from": "human", "value": "Initialize express and its routes\n" }, { "from": "gpt", "value": "'use strict'\n\nvar express = require('express');\n\nvar app = express();\n\napp.get('/', function(req, res) {\n res.send('<a href=\"/authenticate\">Log in!</a>');\n});\n\napp.get('/authenticate');\n...
javascript
chosen
[ { "from": "human", "value": "Add Task DueDate unit test\n" }, { "from": "gpt", "value": "/* eslint-env mocha, jest */\n\nimport React from 'react';\nimport { shallow } from 'enzyme';\n\nimport DueDate from '../DueDate';\n\nit('should render', () => {\n shallow(<DueDate />);\n});\nit('should be ...
javascript
chosen
[ { "from": "human", "value": "[TEST] Add spec for inbound bridge.\n" }, { "from": "gpt", "value": "var RIPPLE_ADDRESS = '';\nvar COIN_ADDRESS = '';\nvar COIN_TRANSACTION_HASH = '';\n\ndescribe('Crypto Coin Inbound Bridge', function() {\n describe('a bitcoin bridge with no fee', function() {\n ...
javascript
chosen
[ { "from": "human", "value": "Configure on create account notification util\n" }, { "from": "gpt", "value": "// Sends account creation notification (as an input it takes data as submitted with form)\n\n'use strict';\n\nvar ensureCallable = require('es5-ext/object/valid-callable')\n , compileTpl ...
javascript
chosen