conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add new class config, both required and optional.\n" }, { "from": "gpt", "value": "export default class {\n constructor({\n apiKey,\n cacheTtl = 604800, // 7 days\n fallback = 'exact',\n specificity = 'general',\n }) {\n console.log(apiKey, cacheTtl,...
javascript
chosen
[ { "from": "system", "value": "Remove redundant getEcmaVersion wrapper. Use path.join.\n" }, { "from": "human", "value": "'use strict'\nconst fs = require('fs');\nconst { promisify } = require('util');\nconst parsePackageString = require('npm-package-arg');\nconst enhancedResolve = require('enhan...
javascript
chosen
[ { "from": "system", "value": "Allow for options to be passed to client\n\n(as noted in the README for testing)" }, { "from": "human", "value": "var Delighted = require('./lib/Delighted');\n\nmodule.exports = function(key) {\n return new Delighted(key);\n};\n" }, { "from": "gpt", "va...
javascript
chosen
[ { "from": "system", "value": "Make sure cookie-service gets enabled\n" }, { "from": "human", "value": "/* load after build_application.js */\r\n\r\nwindow.app.builders.CookieManager || ( window.app.builders.CookieManager = {} );\r\n\r\n/**\r\n * @param {Object} service the service description ...
javascript
chosen
[ { "from": "system", "value": "Remove left over comment from copy and pasting code :(\n" }, { "from": "human", "value": "// Global accessor that the popup uses.\nfunction updateTickets(tabId) {\n chrome.pageAction.hide(tabId);\n chrome.tabs.sendRequest(tabId, {supported: true}, function(support...
javascript
chosen
[ { "from": "system", "value": "Use standard apostrophe string mode\n" }, { "from": "human", "value": "/*\n Language: Backus–Naur Form\n Author: Oleg Efimov <efimovov@gmail.com>\n */\n\nfunction(hljs){\n return {\n contains: [\n // Attribute\n {\n className: 'attr',\n b...
javascript
chosen
[ { "from": "system", "value": "Add attack details to scavenger\n" }, { "from": "human", "value": "import {\n child, avenger, protector, persecutor,\n scorpion,\n} from 'emoji';\n\nexport default {\n\n /* The Good Guys */\n\n child: {\n name: `Child`,\n emoji: child,\n type: true,\n ...
javascript
chosen
[ { "from": "system", "value": "Add beforeEach as an available global instead of disabling eslint\n" }, { "from": "human", "value": "import getProp from '../src/getProp';\n\nconst nodeVersion = parseInt(process.version.match(/^v(\\d+)\\./)[1], 10);\n\nexport const fallbackToBabylon = nodeVersion <...
javascript
chosen
[ { "from": "system", "value": "Check for intro command to reset state\n" }, { "from": "human", "value": "import { fromJS } from 'immutable'\nimport * as types from 'actions/types'\n\nconst INITIAL_TERMINAL = fromJS([])\n\n\nexport const terminalReducer = (state = INITIAL_TERMINAL, action) => {\n\...
javascript
chosen
[ { "from": "system", "value": "Add love button and link\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport {withStyles} from 'material-ui/styles';\nimport AppBar from 'material-ui/AppBar';\nimport Toolbar from 'material-ui/Toolbar';\nimport ...
javascript
chosen
[ { "from": "system", "value": "Handle all casing formats for page menu links\n" }, { "from": "human", "value": "import React from 'react';\nimport { Link } from 'react-router';\n\nclass PageMenu extends React.Component {\n shouldComponentUpdate(nextProps, nextState, nextContext) {\n const { l...
javascript
chosen
[ { "from": "system", "value": "Add mid key and value for multiline comments\n" }, { "from": "human", "value": "const config = {\n 'c': {\n single: {\n value: '//',\n match: /\\s*(?=\\/)\\/(?=\\/)\\//g\n },\n multiple: {\n begin: {\n value: '/*',\n match: /\\...
javascript
chosen
[ { "from": "system", "value": "Revert \"Added autoPanMapOnSelection to recenter the map by clicking a feature within the grid\"\n\nThis reverts commit c5270d13ab270e97610fe9c3c87573177f0261a1.\n" }, { "from": "human", "value": "/**\n * The grid in which summits are displayed\n * @extends Ext.grid...
javascript
chosen
[ { "from": "system", "value": "Add method show to error page\n" }, { "from": "human", "value": "'use strict';\n\nconst template = require('../../views/pages/ErrorPage.hbs');\n\nclass ErrorPage {\n\tconstructor() {\n\t\tthis.container = document.createElement('div');\n\t\tthis.container.classList....
javascript
chosen
[ { "from": "system", "value": "Set width and height game controls and words\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react'\nimport { connect } from 'react-redux'\nimport {cellClickAction, startGameAction, selectGameAction} from '../actions/wordSearch'\nimpo...
javascript
chosen
[ { "from": "system", "value": "Make it obvious if succeeded or failed.\n" }, { "from": "human", "value": "var controllers = require('./controllers')()\n , Q = require('q');\n\nQ.nfcall(controllers.npm.getModule, 'modulus')\n .then(function(meta) {\n return Q.nfcall(controllers.gitH...
javascript
chosen
[ { "from": "system", "value": "Add movement to the stage\n" }, { "from": "human", "value": "(function (PIXI) {\n 'use strict';\n\n var stage = new PIXI.Stage(0x66FF99);\n var renderer = PIXI.autoDetectRenderer(400, 300);\n document.body.appendChild(renderer.view);\n\n window.requestAnimation...
javascript
chosen
[ { "from": "system", "value": "Add Navigation to export list\n\nCloses #594\n" }, { "from": "human", "value": "import Calendar from './Calendar';\nimport CenturyView from './CenturyView';\nimport DecadeView from './DecadeView';\nimport YearView from './YearView';\nimport MonthView from './MonthVi...
javascript
chosen
[ { "from": "system", "value": "Update bundle so that it can export a value\n" }, { "from": "human", "value": "/*\n * leaflet-geocoder-mapzen\n * Leaflet plugin to search (geocode) using Mapzen Search or your\n * own hosted version of the Pelias Geocoder API.\n *\n * License: MIT\n * (c) Mapzen\n ...
javascript
chosen
[ { "from": "system", "value": "Make sure we check data.expires is a number\n" }, { "from": "human", "value": "'use strict';\n\nclass Keyv {\n\tconstructor(opts) {\n\t\tthis.opts = opts || {};\n\t\tthis.opts.store = this.opts.store || new Map();\n\t}\n\n\tget(key) {\n\t\tconst store = this.opts.st...
javascript
chosen
[ { "from": "system", "value": "Set Boule defaultteamsize to 3\n" }, { "from": "human", "value": "/**\n * Boule presets: swiss as played in the PVO, round similar to chess, and ko\n * with a matched cadrage. Point-based rankings.\n *\n * @return Presets\n * @author Erik E. Lorenz <erik@tuvero.de>\...
javascript
chosen
[ { "from": "system", "value": "Test Keyv cannot be invoked without \\'new\\'\n" }, { "from": "human", "value": "import test from 'ava';\nimport Keyv from '../';\n\ntest('Keyv is a function', t => {\n\tt.is(typeof Keyv, 'function');\n});\n" }, { "from": "gpt", "value": "import test fro...
javascript
chosen
[ { "from": "system", "value": "Handle cases where console may not be defined.\n" }, { "from": "human", "value": "import AJV from 'ajv';\nconst ajv = AJV();\n\nfunction safeEscapeQuotes(str) {\n return str.replace(/\\\\([\\s\\S])|(')/g,\"\\\\$1$2\").replace(/\\\\([\\s\\S])|(\")/g,\"\\\\$1$2\"); /...
javascript
chosen
[ { "from": "system", "value": "Add layout path and replace tabs with spaces.\n" }, { "from": "human", "value": "import Hapi from 'hapi'\nimport Path from 'path'\nimport controllers from './controllers/index'\nimport _ from './extensions'\nimport Lazy from 'lazy.js'\n\nvar server = new Hapi.Server...
javascript
chosen
[ { "from": "system", "value": "Add in compression to production preset\n" }, { "from": "human", "value": "const merge = require('webpack-merge');\nconst commonPreset = require('knapsack-preset-common');\nconst hashedModules = require('knapsack-plugin-hashed-modules');\nconst uglify = require('kna...
javascript
chosen
[ { "from": "system", "value": "Remove connect task from gruntfile\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.loadNpmTasks('grunt-typescript');\n grunt.loadNpmTasks('grunt-contrib-less');\n grunt.loadNpmTasks('grunt-contrib-watch');\n grunt.loadNpmTasks('grun...
javascript
chosen
[ { "from": "system", "value": "Use default formatter in dev env in unit-tests" }, { "from": "human", "value": "module.exports = function (grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n mochaTest: {\n test: {\n options: {\n reporter: 'spec'\...
javascript
chosen
[ { "from": "system", "value": "Add alias \"test\" to \"nodeunit\" task\n" }, { "from": "human", "value": "module.exports = function( grunt ) {\n \"use strict\";\n\n grunt.initConfig({\n bump: {\n options: {\n files: [ \"package.json\" ],\n\n /...
javascript
chosen
[ { "from": "system", "value": "Configure gh-pages commit user name and email\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n 'use strict';\n\n grunt.loadNpmTasks('grunt-contrib-connect');\n grunt.loadNpmTasks('grunt-contrib-uglify');\n grunt.loadNpmTasks('grunt-gh-pag...
javascript
chosen
[ { "from": "system", "value": "Add axes config to user satisfaction graphs so they can get a table\n" }, { "from": "human", "value": "define([\n 'extensions/controllers/module',\n 'common/views/visualisations/completion_rate',\n 'common/collections/user-satisfaction'\n],\nfunction (ModuleContr...
javascript
chosen
[ { "from": "system", "value": "Test Onionoo instance contains expected endpoints\n" }, { "from": "human", "value": "import test from 'ava'\nimport Onionoo from '../'\n\ntest('Onionoo is a function', t => {\n t.is(typeof Onionoo, 'function')\n})\n\ntest('Onionoo cannot be invoked without \\'new\\...
javascript
chosen
[ { "from": "system", "value": "Add Chartist as a dependency" }, { "from": "human", "value": "/**\n * umd\n * ===\n *\n * Wraps the library into an universal module definition (AMD + CommonJS + Global).\n *\n * Link: https://github.com/bebraw/grunt-umd\n */\n\n'use strict';\n\nmodule.exports = fun...
javascript
chosen
[ { "from": "system", "value": "Move the babel task to the test task.\n" }, { "from": "human", "value": "'use strict';\n\nconst loadGruntTasks = require('load-grunt-tasks');\nconst rollupPluginBabel = require('rollup-plugin-babel');\n\n\nmodule.exports = function register(grunt) {\n loadGruntTask...
javascript
chosen
[ { "from": "system", "value": "Add a first way to store information of current logged in user\n" }, { "from": "human", "value": "define([\n\t'marionette',\n\t'router',\n\t'module/account/router',\n], function (Marionette, AppRouter, AccountRouter)\n{\n\t\"use strict\";\n\n\tvar App = new Marionet...
javascript
chosen
[ { "from": "system", "value": "Add angular filter `second2time`, `unitResize`.\n" }, { "from": "human", "value": "/*jshint asi:true, laxcomma:true, devel:true */\n\n\"use strict\";\n\nangular.module('gmcadmin.filters', [])\n" }, { "from": "gpt", "value": "/*jshint asi:true, laxcomma:t...
javascript
chosen
[ { "from": "system", "value": "Enable development assets to aid debugging\n" }, { "from": "human", "value": "var path = require('path');\nvar landRegistryElements = require('land-registry-elements');\n\n/**\n * Call the land registry elements pattern library to grab our assets\n */\nlandRegistryE...
javascript
chosen
[ { "from": "system", "value": "Add feedback and increase blink delay\n" }, { "from": "human", "value": "const gpio = require('rpi-gpio');\n\n// The pin we want to manipulate\nlet pin = 7;\n\n// The delay between each time it lights up (in millisseconds)\nlet blinkDelay = 500;\n\n// Here we're set...
javascript
chosen
[ { "from": "system", "value": "Add default for possible undefined destructuring\n" }, { "from": "human", "value": "import debugModule from \"debug\";\nconst debug = debugModule(\"debugger:session:selectors\");\n\nimport { createSelectorTree, createLeaf } from \"reselect-tree\";\n\nimport evm from...
javascript
chosen
[ { "from": "system", "value": "Add a few debug logs\n" }, { "from": "human", "value": "import debugModule from \"debug\";\nconst debug = debugModule(\"debugger:session:selectors\");\n\nimport { createSelectorTree, createLeaf } from \"reselect-tree\";\n\nimport evm from \"lib/evm/selectors\";\nimp...
javascript
chosen
[ { "from": "system", "value": "Clean up doc updating, make sure collab changes also update markers\n" }, { "from": "human", "value": "import {Step, applyStep} from \"./step\"\nimport {nullMap} from \"./map\"\n\nexport class TransformResult {\n constructor(doc, map = nullMap) {\n this.doc = do...
javascript
chosen
[ { "from": "system", "value": "feat(animation): Rewrite animation to new basic animation\n\nBREAKING CHANGE: animate() method accepts shape and cursor now\n" }, { "from": "human", "value": "import Animation from 'kittik-animation-basic';\n\n/**\n * Print animation that simulates text typing or re...
javascript
chosen
[ { "from": "system", "value": "Support locales into the component\n" }, { "from": "human", "value": "import { translate } from './translator'\n\nvar Vue\n\nvar data = {\n lang: { value: '' },\n locales: {}\n}\n\nclass Locale {\n constructor (locales, lang = 'en') {\n if (!Locale.installed) ...
javascript
chosen
[ { "from": "system", "value": "Make sure to also swap out the options\n" }, { "from": "human", "value": "import React from 'react';\nimport _Story from './components/Story';\nexport const Story = _Story;\n\nconst defaultOptions = {\n inline: false,\n header: true,\n source: true,\n};\n\nexport...
javascript
chosen
[ { "from": "system", "value": "Change default time function to year." }, { "from": "human", "value": "'use strict';\n/* globals window, angular */\n\nangular.module('vlui', [])\n .constant('_', window._)\n // datalib, vegalite, vega\n .constant('dl', window.dl)\n .constant('vl', window.vl)\n ...
javascript
chosen
[ { "from": "system", "value": "Fix indent for the comment of source code\n" }, { "from": "human", "value": "import hljs from './assets/lib/highlightjs/highlight.pack';\nimport Parallax from './js/parallax';\nimport Share from './js/share';\n\nrequire('./sass/main.scss');\n\n/**\n * Enable paralla...
javascript
chosen
[ { "from": "system", "value": "Update library reference to fix last commit\n" }, { "from": "human", "value": "const express = require('express');\nconst bodyParser = require('body-parser');\nconst createClient = require('rabblerouser-stream-client');\n\nconst config = require('./config');\nconst ...
javascript
chosen
[ { "from": "system", "value": "Remove Linux/android@5.1 from automated tests\n" }, { "from": "human", "value": "var args = require('yargs').argv;\n\nmodule.exports = {\n extraScripts: args.dom === 'shadow' ? ['test/enable-shadow-dom.js'] : [],\n registerHooks: function(context) {\n // The Go...
javascript
chosen
[ { "from": "system", "value": "Add utility methods to Languages object\n" }, { "from": "human", "value": "import Settings from 'utils/Settings';\n\nimport cs from './lang/cs';\nimport en_gb from './lang/en-gb';\nimport en_us from './lang/en-us';\nimport es from './lang/es';\nimport nl from './lan...
javascript
chosen
[ { "from": "system", "value": "Correct unit test as naming is no homogeneous\n" }, { "from": "human", "value": "/* global casper */\n\nvar kernel_prefix = 'conda-root-py',\n kernel_suffix = '',\n kernel_label = 'Python [conda root]';\n\ncasper.notebook_test_kernel(kernel_prefix, kernel_suffix, ...
javascript
chosen
[ { "from": "system", "value": "Exclude npdc-common assets from appcache\n" }, { "from": "human", "value": "var task = function (gulp, config) {\n 'use strict';\n\n var manifest = require('gulp-manifest');\n\n gulp.task('manifest', function(){\n return gulp.src([config.dist.root + '/**/*'])\...
javascript
chosen
[ { "from": "system", "value": "Remove missing 'color' module that made build fail\n\nThis module is not installed, causing the build to fail. However, it is also not used in this file. Therefore it can safely be removed." }, { "from": "human", "value": "import Color from 'color';\n\nimport { Plat...
javascript
chosen
[ { "from": "system", "value": "Change to export `Trait` class\n\nAdd `Trait` class\nExport class\n" }, { "from": "human", "value": "let factory=(block)=>{\n\tlet trait={};\n\n\tfor(let name in block){\n\t\tObject.defineProperty(trait,name,{\n\t\t\tvalue:block[name],\n\t\t\tenumerable:true,\n\t\t\...
javascript
chosen
[ { "from": "system", "value": "Work on the spectra viewer along with the node server.\n" }, { "from": "human", "value": "// This is the node.js server for AstroWebServices.com.\n\nvar http = require('http');\nvar url = require('url');\nvar fs = require('fs');\n\nvar server = http.createServer(fun...
javascript
chosen
[ { "from": "system", "value": "Add special case for directory\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nexports.command = {\n description: 'get an attribute for a project',\n arguments: '<project> <attribute>'\n};\n\nif (require.main !== module) {\n return;\n}\n\nvar program = ...
javascript
chosen
[ { "from": "system", "value": "Add extra checking of TV status\n" }, { "from": "human", "value": "module.exports = function (RED) {\n\tfunction LgtvRequest2Node(n) {\n\t\tRED.nodes.createNode(this, n);\n\t\tvar node = this;\n\t\tthis.tv = n.tv;\n\n\t\tthis.tvConn = RED.nodes.getNode(this.tv);\n\n...
javascript
chosen
[ { "from": "system", "value": "Add `.catch` to all API calls\n" }, { "from": "human", "value": "import { expect } from 'chai';\nimport util from './util';\n\ndescribe('Employees API', () => {\n describe('fetch', () => {\n\n it('should get employee list', (done) => {\n const fsapi = util....
javascript
chosen
[ { "from": "system", "value": "Use externalized message for \"Page not found\"\n\n\"Page not found\" was hardcoded in the JSX fragment for the NotFoundPage component." }, { "from": "human", "value": "import React from \"react\";\n\nclass NotFoundPage extends React.Component {\n\n render() {\n ...
javascript
chosen
[ { "from": "system", "value": "Update websocket url to use dynamic host rather than fixed\n\n\nFormer-commit-id: f04b7d503048424669a9d139ce67b11c277435ad\nFormer-commit-id: 3e4a3612aa6a7173b17b02119663a1833b285469\nFormer-commit-id: 558d23de277ed4c459fc917f6574e97f528e0a7c" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Fix wrong state name for selected dates.\n" }, { "from": "human", "value": "\"use strict\";\n\n// @param {object} _state - live _state see README for how to use.\nexport default function placeToEat(_state) {\n _state.datesChoosen = _state.datesChoosen || [];\n\n ...
javascript
chosen
[ { "from": "system", "value": "Delete margin-right class from nav\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { Link, IndexLink } from 'react-router'\n\nexport class Nav extends Component {\n constructor(props) {\n super(props)\n }\n\n render() {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove diacritics from search terms\n" }, { "from": "human", "value": "import React from 'react';\nimport { Query } from 'react-apollo';\nimport { Switch, Route } from 'react-router-dom';\n\nimport parseRoute from 'react/util/parseRoute';\n\nimport searchUiStateQuer...
javascript
chosen
[ { "from": "system", "value": "Fix extension to work with latest state changes\n\nRefs flarum/core#2156.\n" }, { "from": "human", "value": "import { extend } from 'flarum/extend';\nimport DiscussionControls from 'flarum/utils/DiscussionControls';\nimport DiscussionPage from 'flarum/components/Dis...
javascript
chosen
[ { "from": "system", "value": "Fix test fails by loading Chart.js on runtime\n" }, { "from": "human", "value": "import React, { PropTypes } from \"react\";\nimport Chart from \"chart.js\";\nimport { getLabelDisplay } from \"./stat\";\n\nexport default class StatsChart extends React.Component {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove error responsibility from APIResponse\n" }, { "from": "human", "value": "import {\n TYPES,\n thingType,\n COMMENT,\n USER,\n LINK,\n MESSAGE,\n } from './thingTypes';\n\nexport default class APIResponse {\n constructor(meta={}) {\n this.meta = meta;...
javascript
chosen
[ { "from": "system", "value": "Replace all `@` with `%40`.\n\nOtherwise Twitter thinks the URL has ended.\n" }, { "from": "human", "value": "$(function () {\n var host, encoded;\n if (location.search.length) {\n var text = unescape(location.search.substring(1));\n converter = new Showdown...
javascript
chosen
[ { "from": "system", "value": "Fix mailbox password type password\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { c } from 'ttag';\nimport { Input, Label } from 'react-components';\n\nconst UnlockForm = ({ password, setPassword }) => {\...
javascript
chosen
[ { "from": "system", "value": "Increase max length to 120\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n\n env: {\n browser: true,\n node: true,\n es6: true,\n },\n\n rules: {\n 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',\n 'no-...
javascript
chosen
[ { "from": "system", "value": "Clarify why rules are used\n" }, { "from": "human", "value": "module.exports = {\n\n \"env\": {\n \"amd\": true,\n \"browser\": true,\n \"mocha\": true,\n \"node\": true\n },\n\n \"parserOptions\": {\n \"ecmaVersion\": 6\n },\n\n \"globals\": {\n...
javascript
chosen
[ { "from": "system", "value": "Write DOM load check more efficiently\n" }, { "from": "human", "value": "// Check if DOM has already loaded as we're loading async\nif(['interactive', 'complete'].indexOf(document.readyState) >= 0) {\n init();\n} else {\n document.addEventListener('DOMContentLoade...
javascript
chosen
[ { "from": "system", "value": "Utils/draw: Fix duplicate `g` elements, add `--delete-on-update` class\n" }, { "from": "human", "value": "// remove all children of the main `g` element\n// prepare for re-drawing (e.g. during resize) with margins\nexport default ({\n g,\n margin\n}) => {\n g.sel...
javascript
chosen
[ { "from": "system", "value": "Add ability to sign cookies.\n" }, { "from": "human", "value": "const _ = require('lodash')\nconst glob = require('glob')\nconst bodyParser = require('body-parser')\nconst cookieParser = require('cookie-parser')\n\nconst logger = require('../src/logger')\n\n// Set d...
javascript
chosen
[ { "from": "system", "value": "utilities/get-package-base-name: Add version stripping unit test\n" }, { "from": "human", "value": "'use strict';\n\nvar expect = require('chai').expect;\nvar getPackageBaseName = require('../../../lib/utilities/get-package-base-name');\n\ndescribe('ge...
javascript
chosen
[ { "from": "system", "value": "Hide fields if \"One Way\" is selected\n" }, { "from": "human", "value": "$(document).ready(function () {\n if (!id_type_0.checked && !id_type_1.checked){\n $(\"#id_institution\").parents('.row').hide();\n $(\"#id_department\").parents('.row').hide(...
javascript
chosen
[ { "from": "system", "value": "Rewrite test with utility methods\n" }, { "from": "human", "value": "var expect = require('expect.js')\nvar mongo = require('mongodb')\nvar http = require('http')\n\ndescribe(\"User registration\", function () {\n var user = { username: \"KtorZ\", password: \"pas...
javascript
chosen
[ { "from": "system", "value": "Update tests to add option test\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n grunt.initConfig({\n nugetpack: {\n dist: {\n src: 'tests/Package.nuspec',\n dest: 'tests/'\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Update dist typings with a main module\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\trequire('grunt-dojo2').initConfig(grunt);\n};\n" }, { "from": "gpt", "value": "module.exports = function (grunt) {\n\trequire('grunt-dojo2')....
javascript
chosen
[ { "from": "system", "value": "Convert AlignmentView to use the new DatatableComponent.\n" }, { "from": "human", "value": "/**\n * @fileoverview List of alignments.\n */\n\n\ngd.AlignmentView = Backbone.View.extend({\n el: '#gd-page-container',\n\n initialize: function() {\n this.render();\n...
javascript
chosen
[ { "from": "system", "value": "[minor] Remove useless call to Error constructor\n" }, { "from": "human", "value": "'use strict';\n\nvar util = require('util');\n\n//\n// Expose the contructor.\n//\nmodule.exports = ParseError;\n\n/**\n * An error thrown by the parser on unexpected input.\n *\n * ...
javascript
chosen
[ { "from": "system", "value": "UI: Fix typo in ArtifactRepositories observable\n" }, { "from": "human", "value": "\nimport TypeList from \"ui-observables/type_list\";\n\nclass CodeRepositories extends TypeList {\n constructor(initialOpts) {\n const defaultOpts = {\n type: \"a...
javascript
chosen
[ { "from": "system", "value": "Fix import for run command\n" }, { "from": "human", "value": "const initCommand = require('./init/init.command')\nconst runCommand = require('./run.command')\nconst deployCommand = require('./deploy.command')\n\nmodule.exports = exports = {\n initCommand,\n runCom...
javascript
chosen
[ { "from": "system", "value": "Add min and max validation" }, { "from": "human", "value": "/**\n * Mongoose validator for Elefrant Framework\n *\n * @package elefrant-mongoose-validator\n * @author Marcos Sanz <marcos.sanz@13genius.com>\n */\n\n'use strict';\n\nvar validator = require('mongoose-v...
javascript
chosen
[ { "from": "system", "value": "Set attributes via prototype & remove custom toJSON\n" }, { "from": "human", "value": "\"use strict\";\n\nvar util = require(\"util\");\n\nvar AbstractError = require(\"./AbstractError.js\"),\n defaultRenderer = require(\"./defaultRenderer.js\");\n\n/**\n * gener...
javascript
chosen
[ { "from": "system", "value": "Print key on click (try 2)\n" }, { "from": "human", "value": "function displayKeys() {\n\n // Retrieve all keyPairs\n var sql = \"select K.name from key K\";\n\n dbRetrieve(sql, [], function(res) {\n\n // Populate key list\n var html = '<hr>';...
javascript
chosen
[ { "from": "system", "value": "Optimize create method in PusherService a little bit\n" }, { "from": "human", "value": "var APNNotification = require('./APNNotification');\nvar GCMNotification = require('./GCMNotification');\n\nmodule.exports = {\n create: function (type, options) {\n switch (...
javascript
chosen
[ { "from": "system", "value": "Switch to es5 to match the rest of the lib\n" }, { "from": "human", "value": "function Sites( api ) {\n\tthis.api = api;\n}\n\nSites.prototype.query = function( args ) {\n\treturn new Promise( function( resolve, reject ) {\n\t\tthis.api\n\t\t\t.get( '/sites' )\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Fix: Make compatible with Matt's additions\n" }, { "from": "human", "value": "/* global guardianAPIKey, createUrl, fetchAPI, fromGuardianToStandardArticleFormat */\n\nconst buildArticleNode = template => article => {\n template.querySelector('h2').textContent = art...
javascript
chosen
[ { "from": "system", "value": "Set up `process.env` for development build\n\nLooks like React will fail without this as it cannot find `process.env`.\n" }, { "from": "human", "value": "'use strict';\nvar extend = require('xtend');\nvar webpack = require('webpack');\n\nvar common = require('./webp...
javascript
chosen
[ { "from": "system", "value": "Change extend from Content to Widget as additional level not needed\n" }, { "from": "human", "value": "/* ***********************************************************************************************\n\n Unify Project\n\n Homepage: unify-project.org\n Lic...
javascript
chosen
[ { "from": "system", "value": "Modify the hasDate function to check if an actual end date exists on the project as well\n" }, { "from": "human", "value": "angular\n .module('app')\n .directive('projectQuickView', function() {\n return {\n restrict: 'E',\n replace: false,\n tem...
javascript
chosen
[ { "from": "system", "value": "Hide slideshow images but the first one\n\n * modified slidethis.js\n" }, { "from": "human", "value": "/* SlideThis\n\nCopyright (c) 2013 Liam Keene\nAvailable under the MIT License\n*/\n(function($) {\n $.fn.slidethis = function(options) {\n\n // Default ...
javascript
chosen
[ { "from": "system", "value": "Add notifications on incoming call\n" }, { "from": "human", "value": "export function CustomListeners () {\n return (worker) => new CustomListenersImpl(worker)\n}\n\nexport class CustomListenersImpl {\n\n setup (ops) {}\n\n constructor () {}\n\n}" }, { "f...
javascript
chosen
[ { "from": "system", "value": "Add a function for easily getting the top level domain of a URL\n" }, { "from": "human", "value": "var Class = require('./Class')\n\nvar URL = Class(function() {\n\n this._extractionRegex = new RegExp([\n '^', // start at the beginning of the string\n '((\\\\...
javascript
chosen
[ { "from": "system", "value": "Change to JS event to click buttons\n" }, { "from": "human", "value": "'use strict';\n\n\n/**\n * Class to fetch the feed list and draw the aside\n */\nvar Feeds = new Class({\n feeds: [],\n initialize: function () {\n this.loadFeeds();\n },\n\n /...
javascript
chosen
[ { "from": "system", "value": "Fix API method sendFile not accepting any body messages\n" }, { "from": "human", "value": "import { API_URL } from './config';\nimport { forEach } from 'lodash';\n\nconst sendRequest = (url, method, body) => {\n let data = new FormData();\n forEach(body, (value, k...
javascript
chosen
[ { "from": "system", "value": "Update listening port from localhost to 0.0.0.0" }, { "from": "human", "value": "var express = require('express');\nvar packageInfo = require('./package.json');\nvar bodyParser = require('body-parser');\n\nvar app = express();\napp.use(bodyParser.json());\n\napp.get...
javascript
chosen
[ { "from": "system", "value": "Fix main fn to not rethrow\n" }, { "from": "human", "value": "// Core coroutine runner\nfunction run(coroutine) {\n\treturn new Promise(function (resolve, reject) {\n\t\t(function next(value, exception) {\n\t\t\tvar result;\n\t\t\ttry {\n\t\t\t\tresult = exception ?...
javascript
chosen
[ { "from": "system", "value": "Change browser action icon on chrome startup\n" }, { "from": "human", "value": "import SettingsFactory from '../common/settings_factory';\nimport { setBrowserActionIcon } from '../common/functions';\nimport initialiseOmniboxBookmarksSearch from './omnibox';\n\nconst...
javascript
chosen
[ { "from": "system", "value": "Remove localStorage boxClosed for testing\n" }, { "from": "human", "value": "function hideBox() {\n $(\"#copyright-campaign-box\").hide();\n if(typeof(Storage)!==\"undefined\") {\n localStorage.boxClosed = true;\n }\n}\n\n$(document).ready(function (...
javascript
chosen
[ { "from": "system", "value": "Add missing space to function declaration\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nvar $ = Ember.$;\n\nvar openDatepicker =function(element) {\n $(element).click();\n\n return PikadayInteractor;\n};\n\nvar PikadayInteractor = {\n selectorF...
javascript
chosen
[ { "from": "system", "value": "Fix sdgs feach coming from ndcs\n" }, { "from": "human", "value": "import { createAction } from 'redux-actions';\nimport { createThunkAction } from 'utils/redux';\nimport isEmpty from 'lodash/isEmpty';\n\nconst fetchSdgGoalsInit = createAction('fetchSdgGoalsInit');\...
javascript
chosen