conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Upgrade for the Redux DevTools extension.\n"
},
{
"from": "human",
"value": "// This file merely configures the store for hot reloading.\n// This boilerplate file is likely to be the same for each project that uses Redux.\n// With Redux, the actual stores are in /re... | javascript | chosen |
[
{
"from": "human",
"value": "Add in an infinite list component.\n"
},
{
"from": "gpt",
"value": "import React, { Component, PropTypes } from 'react';\n\nclass InfiniteList extends Component {\n constructor(props, context) {\n super(props, context);\n }\n\n render() {\n return null;\n }... | javascript | chosen |
[
{
"from": "human",
"value": "Create a context for configuring vertical spacing of <List>\n"
},
{
"from": "gpt",
"value": "// #FIXME: use React navive context API when upgraded to v16+\nimport createReactContext from 'create-react-context';\n\nconst ListSpacingContext = createReactContext(true);\... | javascript | chosen |
[
{
"from": "human",
"value": "Create a module for commonly needed sample functionality.\n"
},
{
"from": "gpt",
"value": "module.exports = function(r) {\n return {\n removeUnusedSamples\n };\n\n function* removeUnusedSamples(sampleIds) {\n for (let i = 0; i < sampleIds.lengt... | javascript | chosen |
[
{
"from": "human",
"value": "Create a skeletal pdf generation file\n"
},
{
"from": "gpt",
"value": "const fs = require('fs');\n\nconst PDFDocument = require('pdfkit');\n\nvar doc = new PDFDocument();\ndoc.pipe(fs.createWriteStream('templates/resources/pdf/schedule.pdf'));\n\ndoc\n .moveTo(0,0... | javascript | chosen |
[
{
"from": "human",
"value": "Add test to check we can restrict alg when PEM is used\n"
},
{
"from": "gpt",
"value": "\n\ndescribe('pem-as-hmac-key', function ()\n{\n var token;\n\n before(function ()\n {\n // generate HS256 token using public PEM string as key\n var expire... | javascript | chosen |
[
{
"from": "human",
"value": "Add test for throwing on bad `this`\n\nFixes @caitp's review comment at https://codereview.chromium.org/771863002/diff/60001/test/mjsunit/harmony/array-includes-to-object.js.\n"
},
{
"from": "gpt",
"value": "// Copyright (C) 2014 Domenic Denicola. All rights reserved... | javascript | chosen |
[
{
"from": "human",
"value": "Add a new exit strategy, calling window.open() before window.close(), as a workaround for LG devices that do not currently allow window.close() if the current window was not opened by a script.\n"
},
{
"from": "gpt",
"value": "/**\r\n * @fileOverview Requirejs module... | javascript | chosen |
[
{
"from": "human",
"value": "Add a sample of Terminail.app mouse events\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env node\n\n//\n// Can Terminal.app (Mac OS X) accept mouse events?\n//\n// * click needs \"Option\" pressing\n//\n\nconsole.log('Start');\n\nprocess.stdin.setRawMode(true);\nproce... | javascript | chosen |
[
{
"from": "human",
"value": "Add a wrapper component for the queryrenders that requiere the userId. Pass any extra variables to the wrapper instead.\n"
},
{
"from": "gpt",
"value": "import React from 'react';\nimport FullScreenProgress from 'general/FullScreenProgress';\nimport { getCurrentUser ... | javascript | chosen |
[
{
"from": "human",
"value": "Add placeholder fallback for older browsers.\n"
},
{
"from": "gpt",
"value": "// Placeholder fallback for browsers that don't support it.\n//\n// Requirements:\n// Modernizr\n//\n// Instructions:\n// 1. Require sencha_base/placeholder_fallback after Modernizr and bef... | javascript | chosen |
[
{
"from": "system",
"value": "Fix initial state of list subscribers table\n"
},
{
"from": "human",
"value": "import React, { PropTypes } from 'react';\nimport { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';\nimport BSTyle from 'react-bootstrap-table/dist/react-bootstrap-table... | javascript | chosen |
[
{
"from": "human",
"value": "Add helper to start protractor\n"
},
{
"from": "gpt",
"value": "var q = require('q');\nvar childProcess = require('child_process');\n\nvar CLI_PATH = 'node /Users/andresdom/dev/protractor/lib/cli.js ' +\n '--elementExplorer true ' +\n '--debuggerServerPort 6969... | javascript | chosen |
[
{
"from": "human",
"value": "Add module 2 work out project slug from project id\n"
},
{
"from": "gpt",
"value": "var rest = require('./rest');\n\n/**\n * Fetches a project by project id, then fetches its project slug for use\n * when working with tasks.\n * \n * @param {int} projectid - AC pr... | javascript | chosen |
[
{
"from": "human",
"value": "Add initial client API with bacon bit post\n"
},
{
"from": "gpt",
"value": "'use strict';\nimport React, {\n AsyncStorage,\n AlertIOS\n} from 'react-native';\n\nvar SERVER_URL = 'https://ziiwfyoc40.execute-api.us-east-2.amazonaws.com/prod\nvar BACON_URL = SERVER_UR... | javascript | chosen |
[
{
"from": "human",
"value": "Add @jmcarp filerevision ko model from osfstorage\n"
},
{
"from": "gpt",
"value": "'use strict';\n\nvar ko = require('knockout');\nrequire('knockout-punches');\nvar $ = require('jquery');\nvar $osf = require('osfHelpers');\nvar bootbox = require('bootbox');\nvar wate... | javascript | chosen |
[
{
"from": "system",
"value": "Fix capitalization in French language file.\n"
},
{
"from": "human",
"value": "// Spectrum Colorpicker\n// French (fr) localization\n// https://github.com/bgrins/spectrum\n\n(function ( $ ) {\n\n var localization = $.spectrum.localization[\"fr\"] = {\n can... | javascript | chosen |
[
{
"from": "human",
"value": "Add library for converting slot IDs from/to NBT format\n"
},
{
"from": "gpt",
"value": "module.exports = { fromNBT, toNBT };\n\nconst replace = {\n \"100\": 8, \"101\": 7, \"102\": 6, \"103\": 5, \"-106\": 45\n}\n\nfunction fromNBT(slotId) {\n let slot;\n if (slot... | javascript | chosen |
[
{
"from": "human",
"value": "Add the example to use moment to set a full time with utc.\n"
},
{
"from": "gpt",
"value": "var moment = require('moment');\n\nconsole.log(moment(\"2014-12-11 21+0800\").format()); \nconsole.log(moment(\"2014-W50-4 21+08:00\").format()); \nconsole.log(moment(\"2014-1... | javascript | chosen |
[
{
"from": "human",
"value": "feat(worker-example): Add code to run on the main thread for Dedicated Worker example\n"
},
{
"from": "gpt",
"value": "const input = document.getElementById(\"input-message\");\nconst output = document.getElementById(\"output-message\");\n\nlet worker;\n\nfunction on... | javascript | chosen |
[
{
"from": "system",
"value": "Disable default lookup & active generation logging"
},
{
"from": "human",
"value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: '<%= modulePrefix %>',\n environment: environment,\n baseURL: '/',\n lo... | javascript | chosen |
[
{
"from": "human",
"value": "Add button that moves the collaborator from one collaborator type (uid arr) to the other.\n"
},
{
"from": "gpt",
"value": "import React from 'react';\n\nimport app from '../Firebase';\nimport Button from 'react-bootstrap/Button';\n\nimport authUtils from '../AuthUtil... | javascript | chosen |
[
{
"from": "human",
"value": "Add getting started example to the repo\n"
},
{
"from": "gpt",
"value": "\n\n/* Outside of this project, change to:\n *\n * const SBOLDocument = require('sboljs')\n */\nconst SBOLDocument = require('../lib/SBOLDocument')\n\n/* prefix string for example purposes\n *... | javascript | chosen |
[
{
"from": "human",
"value": "Add tests for marker store\n"
},
{
"from": "gpt",
"value": "\"use babel\";\n\nimport { Range } from \"atom\";\n\nimport MarkerStore from \"../../lib/store/markers\";\n\ndescribe(\"MarkerStore\", () => {\n let store;\n beforeEach(() => {\n store = new MarkerStore... | javascript | chosen |
[
{
"from": "human",
"value": "Add missing tests for 'Row'\n"
},
{
"from": "gpt",
"value": "import React from 'react';\nimport ReactTestUtils from 'react/lib/ReactTestUtils';\nimport Row from '../src/Row';\n\ndescribe('Row', function () {\n it('uses \"div\" by default', function () {\n let ins... | javascript | chosen |
[
{
"from": "system",
"value": "Add an extra blank line\n"
},
{
"from": "human",
"value": "function autosaveSnippet () {\n var $url = $('.edit_snippet')[0].action;\n var $data = $('.edit_snippet').serialize();\n $.ajax({\n type: \"PATCH\",\n url: $url,\n data: $data,\n dataType: \"t... | javascript | chosen |
[
{
"from": "human",
"value": "Add module JS to manage alerts\n\nSigned-off-by: Aitor Magán García <a93a7d273b830b2e8a26461c1a80328a1d7ad27a@conwet.com>\n"
},
{
"from": "gpt",
"value": "/**\n * Copyright (c) 2015, CoNWeT Lab., Universidad Politécnica de Madrid\n * Code licensed under BSD 3-Claus... | javascript | chosen |
[
{
"from": "human",
"value": "Add unit test for image detail\n\nChange-Id: I8ae82e37be53b8b7642534e4f6772cb1e52ef3d6\n"
},
{
"from": "gpt",
"value": "/**\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License... | javascript | chosen |
[
{
"from": "human",
"value": "Rename Gulpfile to use Babel.\n"
},
{
"from": "gpt",
"value": "const gulp = require('gulp'),\n bs = require('browser-sync').create(),\n nunjucks = require('gulp-nunjucks-render'),\n sass = require('gulp-sass'),\n sourcemaps = require('gulp-sourcem... | javascript | chosen |
[
{
"from": "human",
"value": "Add the example to the worker for RabbitMG server.\n"
},
{
"from": "gpt",
"value": "var amqp = require('amqp');\n\nvar connection = amqp.createConnection({\n host: 'localhost'\n});\n\nconnection.on('ready', function () {\n connection.queue('task-queue', { auto... | javascript | chosen |
[
{
"from": "human",
"value": "Add the package main file\n"
},
{
"from": "gpt",
"value": "\"use strict\";\n\n// Export the most important modules\n\nglobal[ \"ResourceBundle\" ] = require( \"./lib/resource-bundle\" );\nglobal[ \"Locale\" ] = require( \"./lib/locale\" );\nglobal[ \"Currency\" ] = r... | javascript | chosen |
[
{
"from": "human",
"value": "Manage default editor group on a single page\n"
},
{
"from": "gpt",
"value": "/* gettext library */\n// This function is copied from django admin path\n\nvar catalog = new Array();\n\nfunction pluralidx(count) { return (count == 1) ? 0 : 1; }\n\n\nfunction gettext(ms... | javascript | chosen |
[
{
"from": "human",
"value": "Add test cases of mecab.js\n"
},
{
"from": "gpt",
"value": "'use strict';\n\nconst assert = require('assert');\n\nconst Mecab = require('../lib/mecab');\n\ndescribe('Mecab', () => {\n const tests = [\n {argv: '本日は晴天なり', expected: ['本日', 'は', '晴天', 'なり']},\n... | javascript | chosen |
[
{
"from": "human",
"value": "Add directive to focus an element based on an expression (useful for search inputs).\n"
},
{
"from": "gpt",
"value": "/*global angular*/\n(function () {\n 'use strict';\n\n angular.module('core').directive('focusOn', [\"$timeout\", \"$parse\", function ($timeou... | javascript | chosen |
[
{
"from": "human",
"value": "Add JS date toggle file and functionality.\n"
},
{
"from": "gpt",
"value": "$(function() {\n $('.toggleDeadlineUnitDate').on('click', function(e) {\n e.preventDefault();\n $(this).replaceWith(\"<label for='project_goal_deadline_date'>Goal Deadline Date</label>... | javascript | chosen |
[
{
"from": "system",
"value": "Fix status code in documentation\n\nFix a mismatch between the documented status code (408) and the one set by the middleware"
},
{
"from": "human",
"value": "/*!\n * Connect - timeout\n * Ported from https://github.com/LearnBoost/connect-timeout\n * MIT Licensed\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Save the object itself, rather than a list of arguments\n"
},
{
"from": "human",
"value": "// node modules\nimport fs from 'fs';\n// npm modules\nimport homedir from 'homedir';\n\nconst configFilePath = `${homedir()}/.urcli/config.json`;\n\nexport class Config {\n ... | javascript | chosen |
[
{
"from": "human",
"value": "Add script showing Math.pow bug\n"
},
{
"from": "gpt",
"value": "'use strict';\n\nvar x = 10;\nvar y = 308;\nvar actual = Math.pow( x, y );\nvar expected = 1e308;\n\nconsole.log( 'pow(%d,%d) = %d. Expected: %d.', x, y, actual, expected );\n\nactual = pow( x, y );\nco... | javascript | chosen |
[
{
"from": "human",
"value": "Add status type object for consistent use across client / server.\n"
},
{
"from": "gpt",
"value": "/*\n * Copyright (c) 2017 Bonnie Schulkin. All Rights Reserved.\n *\n * This file is part of BoxCharter.\n *\n * BoxCharter is free software: you can redistribute it an... | javascript | chosen |
[
{
"from": "human",
"value": "Add solution to question 73\n"
},
{
"from": "gpt",
"value": "/**\n * @param {number[][]} matrix\n * @return {void} Do not return anything, modify matrix in-place instead.\n */\nvar setZeroes = function(matrix) {\n var zeroes = [];\n\n for (var i = 0; i < matrix... | javascript | chosen |
[
{
"from": "human",
"value": "Add a list of useful regex.\n"
},
{
"from": "gpt",
"value": "const symbols = {\n '~': 'tilde',\n '`': 'backtick',\n '!': 'exclamation',\n '@': 'at',\n '#': 'pound',\n $: 'dollar',\n '%': 'percent',\n '^': 'carat',\n '&': 'ampersand',\n '*': 'asterisk',\n '... | javascript | chosen |
[
{
"from": "human",
"value": "Add missing nav menu js\n"
},
{
"from": "gpt",
"value": "/**\n * Handle the custom post type nav menu meta box\n */\njQuery( document ).ready( function($) {\n\t$( '#submit-mlp_language' ).click( function( event ) {\n\t\tevent.preventDefault();\n\n\t\tvar items =... | javascript | chosen |
[
{
"from": "human",
"value": "Solve problem 02. Divide by 7 and 5\n"
},
{
"from": "gpt",
"value": "function solve(argument) {\n\tvar n = parseInt(argument[0]);\n\n\tif (n % 7 === 0 && n % 5 === 0) {\n\t\tconsole.log(\"true \" + n);\n\t} else {\n\t\tconsole.log(\"false \" + n);\n\t}\n}"
}
] | javascript | chosen |
[
{
"from": "human",
"value": "Move game of life module to its own file\n"
},
{
"from": "gpt",
"value": "var GameOfLife = (function () {\n var ALIVE = \"alive\", DEAD = \"dead\";\n\n function Cell(initialState) {\n var state = initialState || DEAD;\n\n function getNumberOfAlive... | javascript | chosen |
[
{
"from": "system",
"value": "Make preview pane render to an iframe\n"
},
{
"from": "human",
"value": "import React, { PropTypes } from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Widgets from './Widgets';\n\nexport default class PreviewPane extends React.Compon... | javascript | chosen |
[
{
"from": "human",
"value": "Create a script to update old photo URL to new URL\n"
},
{
"from": "gpt",
"value": "const promise = require(\"bluebird\");\nconst options = {\n // Initialization Options\n promiseLib: promise, // use bluebird as promise library\n capSQL: true, // when building SQL... | javascript | chosen |
[
{
"from": "human",
"value": "Add failing test for hasQuickActions\n"
},
{
"from": "gpt",
"value": "import { hasQuickActions } from '~/notes/stores/utils';\n\ndescribe('hasQuickActions', () => {\n it.each`\n input | expected\n ${'some comment'} ... | javascript | chosen |
[
{
"from": "human",
"value": "Test error for cen command\n"
},
{
"from": "gpt",
"value": "var cen = require(\"__buttercup/classes/commands/command.cen.js\");\n\nmodule.exports = {\n setUp: function(cb) {\n this.command = new cen();\n (cb)();\n },\n\n errors: {\n groupNotFoundThrowsErr... | javascript | chosen |
[
{
"from": "human",
"value": "Truncate a string with a specific length\n"
},
{
"from": "gpt",
"value": "const stringTruncate = (str, lgt) => {\n if (str.length > lgt) {\n return str.substring(0, lgt) + \"...\";\n }\n return str;\n};\n\nstringTruncate(\"hello mortal world\", 13);\n"
}
] | javascript | chosen |
[
{
"from": "human",
"value": "Add initial version of routes.js\n"
},
{
"from": "gpt",
"value": "var Router = (function() {\n var routes = [],\n redirects = [];\n\n /**\n * Add a set of routes and their callbacks to the Router\n * Params: alternating RegExp objects and functio... | javascript | chosen |
[
{
"from": "human",
"value": "Replace src in html with class=hash\n"
},
{
"from": "gpt",
"value": "function replaceHtml(htmlString, hashObject) {\n const filesArray = Object.keys(hashObject)\n let newHtmlString = htmlString\n \n function replaceSrc(file) {\n const srcAttributeDblQuote = `s... | javascript | chosen |
[
{
"from": "human",
"value": "Add smoke test for running the executable script\n\nIt's slow, but we only need a few of these just to ensure that\neverything has been wired together correctly.\n"
},
{
"from": "gpt",
"value": "var expect = require('chai').expect;\nvar fs = require(\"fs\");\nvar exe... | javascript | chosen |
[
{
"from": "human",
"value": "Add migration for a crowdsale contract\n"
},
{
"from": "gpt",
"value": "var NeufundTestToken = artifacts.require(\"./NeufundTestToken.sol\");\nvar Crowdsale = artifacts.require(\"./Crowdsale.sol\");\n\nmodule.exports = function (deployer) {\n /**\n * address i... | javascript | chosen |
[
{
"from": "human",
"value": "Add PhantomJS script to report test results.\n"
},
{
"from": "gpt",
"value": "var system = require('system')\n , webpage = require('webpage');\n\nvar page = webpage.create()\n , passes = 0\n , failures = 0\n , total;\n\npage.onAlert = function(msg) {\n var a = J... | javascript | chosen |
[
{
"from": "human",
"value": "Add maintenance script for recomputing indexed geometries\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env node\n/*jslint node: true */\n\n/*\n * Compute a new indexedGeometry field for every Response document.\n * We should run this if we significantly change our alg... | javascript | chosen |
[
{
"from": "human",
"value": "Add the example to change format of image via sharp.\n"
},
{
"from": "gpt",
"value": "var sharp = require('sharp');\n\nvar dirpath = 'images/';\nvar imgname = 'download-logo.png';\nvar tmppath = 'tmp/'\n\nsharp(dirpath + imgname)\n .jpeg() \n .toFile(tmppath +... | javascript | chosen |
[
{
"from": "human",
"value": "Add script to execute manually to update parkings\n"
},
{
"from": "gpt",
"value": "'use strict';\n\nconst co = require('co');\nconst logger = require('../modules').logger;\nconst mongooseHelper = require('../modules').mongooseHelper;\nconst opendata = require('../wor... | javascript | chosen |
[
{
"from": "human",
"value": "Add <html> tags to email header and footer\n"
},
{
"from": "gpt",
"value": "RocketChat.Migrations.add({\n\tversion: 95,\n\tup() {\n\t\tif (RocketChat && RocketChat.models && RocketChat.models.Settings) {\n\t\t\tconst emailHeader = RocketChat.models.Settings.findOne({... | javascript | chosen |
[
{
"from": "human",
"value": "Add lazy loader client script\n"
},
{
"from": "gpt",
"value": "import axios from 'axios';\n\nfunction Loader(options = {}) {\n this.page = options.page || 0;\n this.limit = options.limit || 1;\n this.url = options.url || '';\n\n this.nextPage = () => {\n this.... | javascript | chosen |
[
{
"from": "human",
"value": "Add simple unit test for Record model\n"
},
{
"from": "gpt",
"value": "var expect = require('chai').expect,\n models = require('../models'),\n Record = require('../models/record'),\n connection = require('../lib/datastore').connection;\n\ndescribe('Record re... | javascript | chosen |
[
{
"from": "human",
"value": "Add first prototype of LabyrinthDB.\n"
},
{
"from": "gpt",
"value": "'use strict';\n\nvar r = require('rethinkdb');\n\n\nexport class LabyrinthDB {\n constructor (conn, dbName) {\n this.conn = conn;\n this.dbName = dbName;\n\n this.tableList = ['chat'];\n\n... | javascript | chosen |
[
{
"from": "system",
"value": "Return fixture data until json feed proxy implemented\n"
},
{
"from": "human",
"value": "import {get} from 'utils/ajax'\n\nexport const getJSONFeed = url => get(url)\n"
},
{
"from": "gpt",
"value": "import {get} from 'utils/ajax'\n\nimport {fixtureJSONFe... | javascript | chosen |
[
{
"from": "human",
"value": "Examples: Add API observable server example\n"
},
{
"from": "gpt",
"value": "var lightResource,\n\tsensor = require( \"./mock-sensor\" )(),\n\tiotivity = require( \"iotivity\" ),\n\tdevice = iotivity.OicDevice(),\n\tsettings = {\n\t\trole: \"server\",\n\t\tconnection... | javascript | chosen |
[
{
"from": "human",
"value": "Write a script to setup db and a test user & post\n"
},
{
"from": "gpt",
"value": "/**\n * Generate the dbtables\n * and generate a user with a post\n *\n * username = batman\n * password = robin\n */\nconst path = require('path')\nrequire('dotenv').load({ path: path... | javascript | chosen |
[
{
"from": "human",
"value": "Add tests for fitness behaviour and bug\n"
},
{
"from": "gpt",
"value": "const {scoreScenario, boilDownIndividualScore} = require('../app/fitness-scoring.js');\n\nconst assert = require('assert');\n\ndescribe('scoreScenario', () => {\n it('assigns fitness scores for... | javascript | chosen |
[
{
"from": "human",
"value": "Read syslog data and outputs to console as JSON\n"
},
{
"from": "gpt",
"value": "var dgram = require(\"dgram\");\n\nvar socket = dgram.createSocket(\"udp4\");\n\nsocket.on(\"error\", function (err) {\n console.log(\"server error:\\n\" + err.stack);\n socket.close()... | javascript | chosen |
[
{
"from": "human",
"value": "Add the 'createHook()' function. Rather hacky but oh well...\n"
},
{
"from": "gpt",
"value": "\n/**\n * This is our \"Hook\" class that allows a script to hook into the lifecyle of the\n * \"configure\", \"build\" and \"clean\" commands. It's basically a hack into th... | javascript | chosen |
[
{
"from": "human",
"value": "Add start of tests for checking that plugin adds ids correctly on initial load\n"
},
{
"from": "gpt",
"value": "/* bender-tags: editor,unit */\n/* bender-ckeditor-plugins: autoid */\n\n'use strict';\n\nbender.editor = {\n\tconfig: {\n\t\tenterMode: CKEDITOR.ENTER_P\n... | javascript | chosen |
[
{
"from": "human",
"value": "Add method to delete users destination\n"
},
{
"from": "gpt",
"value": "function deleteDestination(place) {\n function placeToDelete(){\n return place;\n };\n\n// delete user's destination\n// NEED TO REPLACE USERNAME WITH CURRENT USER UID\n usersRef.child('san... | javascript | chosen |
[
{
"from": "human",
"value": "Update to have Children for Product2 run in JavaScript\n"
},
{
"from": "gpt",
"value": "var Product2 = module.exports = function(vlocity) {\n this.vlocity = vlocity;\n};\n\nProduct2.prototype.childrenExport = async function(inputMap) {\n\ttry {\n\t\tvar jobInfo = ... | javascript | chosen |
[
{
"from": "system",
"value": "Allow opening a file by id and name\n"
},
{
"from": "human",
"value": "var GridStore = require('mongodb').GridStore;\n\n/**\n * @param filename: filename or ObjectId\n */\nvar SkinGridStore = exports.SkinGridStore = function(skinDb) {\n this.skinDb = skinDb;\n}\n\... | javascript | chosen |
[
{
"from": "human",
"value": "Add initial API docs js injector\n"
},
{
"from": "gpt",
"value": "var DocInjector = {\n\tinit: function() {\n\t\tvar that = this;\n\t\t$.each(this.data, function(i, docReference) {\n\t\t\tthat.inject(docReference)\n\t\t});\n\t},\n\tdata: [{\n\t\t\"api_url\": \"http:/... | javascript | chosen |
[
{
"from": "human",
"value": "Implement basic representation of a trading pair\n"
},
{
"from": "gpt",
"value": "\n/*\n *\n * poloniex-unofficial\n * https://git.io/polonode\n *\n * Yet another unofficial Node.js wrapper for the Poloniex cryptocurrency\n * exchange APIs.\n *\n * Copyright (c) 2016... | javascript | chosen |
[
{
"from": "human",
"value": "Set up '/signup' to use User controller\n"
},
{
"from": "gpt",
"value": "import express from 'express';\n\nimport * as userController from '../../controllers/users';\n\nconst user = express.Router();\n\n// define route controllers for creating sign up, login and sign... | javascript | chosen |
[
{
"from": "system",
"value": "Make splitKeypath() work in old IE\n"
},
{
"from": "human",
"value": "const refPattern = /\\[\\s*(\\*|[0-9]|[1-9][0-9]+)\\s*\\]/g;\nconst splitPattern = /([^\\\\](?:\\\\\\\\)*)\\./;\nconst escapeKeyPattern = /\\\\|\\./g;\nconst unescapeKeyPattern = /((?:\\\\)+)\\1|\... | javascript | chosen |
[
{
"from": "system",
"value": "Normalize runtime name for binary installation\n"
},
{
"from": "human",
"value": "var semver = require('semver'),\n runtimeVersion = semver.parse(process.version);\n\n/**\n * Get Runtime Name\n *\n * @api private\n */\n\nfunction getRuntimeName() {\n return proc... | javascript | chosen |
[
{
"from": "human",
"value": "Add test for player eats virus\n"
},
{
"from": "gpt",
"value": "const chai = require('chai');\nconst assert = chai.assert;\n\nconst Player = require('../public/online-player');\nconst Virus = require('../lib/virus');\n\ndescribe('Player eating viruses', function(){\n... | javascript | chosen |
[
{
"from": "human",
"value": "Format numbers with thousand seperators\n"
},
{
"from": "gpt",
"value": "\"use static\";\n\nfunction numberWithCommas(number) {\n var parts = number.toString().split(\".\");\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return parts.joi... | javascript | chosen |
[
{
"from": "human",
"value": "Add initial pattern matching logic\n\nget schwifty!"
},
{
"from": "gpt",
"value": "const squanch = (...patterns) => {\n\treturn v => {\n\t\tconst primitives = ['Number', 'String', 'Boolean', 'Symbol'];\n\n\t\tconst isIdentical = (p, v) => p === v;\n\t\tconst isNull =... | javascript | chosen |
[
{
"from": "human",
"value": "Add html->md script (moved from wkoszek/me/scripts)\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env node\n\nvar fs = require('fs')\ntoMarkdown = require('to-markdown');\n\nfn = process.argv[2]\n\nfs.readFile(fn, 'utf8', function (err,data) {\n\tif (err) {\n\t\treturn... | javascript | chosen |
[
{
"from": "system",
"value": "Add csurf to protect against CSRF attacks\n"
},
{
"from": "human",
"value": "const express = require('express');\nconst redis = require(\"redis\");\nconst session = require('express-session');\nconst RedisStore = require('connect-redis')(session);\nconst passport = ... | javascript | chosen |
[
{
"from": "human",
"value": "Add a \"Hello JerryScript!\" program to the tests\n\nThe current code base does not contain any \"first JavaScript\nprogram\" for those who build JerryScript for Linux console. It\ndoes contain a LED-blinking example -- blinky.js -- but that's\nonly useful on an developer board ... | javascript | chosen |
[
{
"from": "human",
"value": "Move API functions into separate file\n"
},
{
"from": "gpt",
"value": "export function get(path) {\n return request('GET', path, '', {});\n}\n\nexport function post(path, body, signature) {\n return request('POST', path, body, signature);\n}\n\nfunction request(ver... | javascript | chosen |
[
{
"from": "human",
"value": "Add tests for time parser utility\n\n"
},
{
"from": "gpt",
"value": "/** @ignore */\nconst TimeParser = requireApp('utils/time/TimeParser');\n/** @ignore */\nconst assert = require('assert');\n\ndescribe('app/utils/time/TimeParser', () => {\n describe('#parse()', ... | javascript | chosen |
[
{
"from": "human",
"value": "Add inital test for mixin blueprint\n"
},
{
"from": "gpt",
"value": "'use strict';\n\nvar blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');\nvar setupTestHooks = blueprintHelpers.setupTestHooks;\nvar emberNew = blueprintHelpers.emberNew;\nvar em... | javascript | chosen |
[
{
"from": "system",
"value": "Fix Spanish language file encoding (UTF-8).\n"
},
{
"from": "human",
"value": "// Spectrum Colorpicker\n// Spanish (es) localization\n// https://github.com/bgrins/spectrum\n\n(function ( $ ) {\n\n var localization = $.spectrum.localization[\"es\"] = {\n ca... | javascript | chosen |
[
{
"from": "human",
"value": "Add the example to get the authorization from facebook.\n"
},
{
"from": "gpt",
"value": "var passport = require('passport');\nvar FacebookStrategy = require('passport-facebook').Strategy;\nvar express = require('express');\n\nvar cookieSession = require('cookie-sessi... | javascript | chosen |
[
{
"from": "human",
"value": "Change the email validator so it also works for optional fields"
},
{
"from": "gpt",
"value": "Ext.define('Starter.data.validator.Email', {\n\toverride: 'Ext.data.validator.Email',\n\n\tvalidate: function(value) {\n\t\tif (value === undefined || value === null || Ext... | javascript | chosen |
[
{
"from": "human",
"value": "Add basic gui reducer test\n"
},
{
"from": "gpt",
"value": "/* eslint-disable max-len */\nimport { UPDATE_LOCATION } from 'react-router-redux'\nimport { expect, // sinon\n } from '../spec_helper'\nimport * as subject from '../../src/reducers/gui'\n\ndescribe('g... | javascript | chosen |
[
{
"from": "human",
"value": "Add 7.3 variables and objects\n"
},
{
"from": "gpt",
"value": "// JavaScript Variables and Objects\n\n// I paired by myself on this challenge.\n\n// __________________________________________\n// Write your code below.\n\n\nvar secretNumber = 7;\nvar password = \"jus... | javascript | chosen |
[
{
"from": "human",
"value": "Update the database structure of the chat channels to be more flexible.\n"
},
{
"from": "gpt",
"value": "exports.up = function(db, cb) {\n db.runSql(`\n CREATE TABLE channels (\n name citext PRIMARY KEY,\n private boolean NOT NULL DEFAULT false,\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add additional jquery expose-loader to global $\n"
},
{
"from": "human",
"value": "// Common webpack configuration used by webpack.hot.config and webpack.rails.config.\n\nconst path = require('path');\n\nmodule.exports = {\n\n // the project dir\n context: __dirna... | javascript | chosen |
[
{
"from": "human",
"value": "Add code and reflection for challenge.\n"
},
{
"from": "gpt",
"value": "// Separate Numbers with Commas in JavaScript **Pairing Challenge**\n\n\n// I worked on this challenge with: Joseph Scott.\n\n// Pseudocode\n// turn number into string, split it into an array, & ... | javascript | chosen |
[
{
"from": "human",
"value": "Add entry point for node package\n"
},
{
"from": "gpt",
"value": "const logger = require('./lib/logging')\nconst make = require('./lib/make')\nconst random = require('./lib/random')\nconst utils = require('./lib/utils')\n\nmodule.exports = {\n logger,\n random,... | javascript | chosen |
[
{
"from": "human",
"value": "Add a switch to flip between electron and node\n"
},
{
"from": "gpt",
"value": "/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif ((process || {}).type === 'renderer') {\n module.exports = require('./browser');... | javascript | chosen |
[
{
"from": "human",
"value": "Add solution to question 70\n"
},
{
"from": "gpt",
"value": "/**\n * @param {number} n\n * @return {number}\n */\nvar climbStairs = function(n) {\n var ans = [1,1,2];\n\n for (var i = 3; i <= n; i++) {\n ans[i] = ans[i - 1] + ans[i - 2];\n }\n\n re... | javascript | chosen |
[
{
"from": "human",
"value": "Update project transportapi.js to 0.0.1\n"
},
{
"from": "gpt",
"value": "var TransportAPI=function(){var a=\"\",b=\"\",c=\"http://transportapi.com/v3\",d=function(){return\"app_id=\"+a+\"&api_key=\"+b+\"&callback=?\"},e=function(a,b){return function(){$.ajax({url:a,d... | javascript | chosen |
[
{
"from": "system",
"value": "Fix error - transparent not defined\n"
},
{
"from": "human",
"value": "\nvar postcss = require('postcss'),\n color = require('color');\n\nmodule.exports = postcss.plugin('postcss-lowvision', function () {\n return function (css) {\n css.walkDecls('color... | javascript | chosen |
[
{
"from": "system",
"value": "Remove infinite scroll from logs table and render only 200 most recent logs\n"
},
{
"from": "human",
"value": "import React, {PropTypes} from 'react'\n\nimport InfiniteScroll from 'shared/components/InfiniteScroll'\nimport LogsTableRow from 'src/kapacitor/components... | javascript | chosen |
[
{
"from": "human",
"value": "Add more simple modules/classes to test example\n"
},
{
"from": "gpt",
"value": "\n/**\n * This is a class/module.\n * @class class1\n * @module module1\n */\n\n/**\n * This is another class/module.\n * @class class2\n * @module module2\n */\n\n/**\n * This is a modu... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.