conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change log level to info\n" }, { "from": "human", "value": "var path = require('path');\n\nvar devConfig = {\n context: path.join(__dirname, '/app'),\n entry: [\n './app.js'\n ],\n output: {\n path: path.join(__dirname, '/build/'),\n ...
javascript
chosen
[ { "from": "system", "value": "Change libraryTarget to UMD, remove add-module-export plugin\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n regular: {\n devtool: 'source-map',\n output: {\n filename: 'meyda.js',\...
javascript
chosen
[ { "from": "system", "value": "Update test for changed layout\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport { module, test } from 'qunit';\nimport startApp from 'firedragon/tests/helpers/start-app';\n\nmodule('Acceptance | visit home', {\n beforeEach: function() {\n th...
javascript
chosen
[ { "from": "system", "value": "Add second argument to addResource for container\n" }, { "from": "human", "value": "// add-resource.js\n/*\n Copyright (c) 2011 Talis Inc, Some Rights Reserved\n Licensed under the Apache License, Version 2.0, http://www.apache.org/licenses/LICENSE-2.0\n*/\n\n(f...
javascript
chosen
[ { "from": "system", "value": "Fix bug where colour on mdast(1) persisted\n\nThe symbols used in the report to show the count of warnings, errors,\nwere coloured even when `color` was disabled on mdast(1).\n" }, { "from": "human", "value": "/**\n * @author Titus Wormer\n * @copyright 2015 Titus W...
javascript
chosen
[ { "from": "system", "value": "Update copyright year in footer" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nclass Footer extends Component {\n render() {\n return (\n <footer className=\"app-footer\">\n <a href=\"https://teamdigitale.governo.it\">T...
javascript
chosen
[ { "from": "system", "value": "Add accept only for false, check result statusCode\n\nTechnically the request is not sent with the `accept` option when you do want to accept the user. Not sure if this behavior is really important to match but people have been having problems with this function." }, { ...
javascript
chosen
[ { "from": "system", "value": "Fix relocation of hash information on startup of cluster interface\n" }, { "from": "human", "value": "/*jslint indent: 2, nomen: true, maxlen: 100, white: true, */\n/*global window, $, Backbone, document */ \n\n(function() {\n \"use strict\";\n\n $.get(\"cluster/a...
javascript
chosen
[ { "from": "system", "value": "Remove FactoryGuy from js hint\n" }, { "from": "human", "value": "'use strict';\n\nvar EOL = require('os').EOL;\n\nmodule.exports = {\n normalizeEntityName: function() {},\n\n afterInstall: function() {\n this.insertIntoFile('tests/.jshintrc',\n ' \"Fac...
javascript
chosen
[ { "from": "system", "value": "Change route to /projects2 for now. Will make testing and integration easier while we switch to the new api.\n" }, { "from": "human", "value": "module.exports = function(model) {\n 'use strict';\n\n let validateProjectAccess = require('./project-access')(model...
javascript
chosen
[ { "from": "system", "value": "Update carto config to fix account update url\n" }, { "from": "human", "value": "import getCARTOData from 'new-dashboard/store/utils/getCARTOData';\n\n// Data coming from Static Page Loading,\n// which requests user and config data from\n// /me API endpoint.\nconst ...
javascript
chosen
[ { "from": "system", "value": "Use 2 spaces for indentation\n" }, { "from": "human", "value": "/* global describe, it */\n\n(function () {\n 'use strict';\n\n describe('Give it some context', function () {\n describe('maybe a bit more context here', function () {\n it('sho...
javascript
chosen
[ { "from": "system", "value": "Fix the messaging timing extension to only message the toplevel frame.\n\nBUG=no\n\nReview URL: http://codereview.chromium.org/384133\n\ngit-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@31978 4ff67af0-8c30-449e-8e8b-ad334ec8d88c\n" }, { "from": "human", "value":...
javascript
chosen
[ { "from": "system", "value": "Add another example radio station: '4 Ever Zeppelin'.\n" }, { "from": "human", "value": "exports.stations = {\n \"4 Ever Floyd\": \"http://67.205.85.183:5500\",\n \"Feeling Floyd\": \"http://Streaming23.radionomy.com/FeelingFloyd\",\n \"KFRC\": \"http://2133.live...
javascript
chosen
[ { "from": "system", "value": "Create a dictionary of turing machines\n" }, { "from": "human", "value": "(function(){\n var node = document.getElementById('target');\n var app = Elm.TM.embed(node);\n app.ports.restart.send(JSON.stringify({\n \"tm\": {\n \"tape\": {\n ...
javascript
chosen
[ { "from": "system", "value": "Use Object.defineProperty() to define Response methods.\n\ngit-svn-id: fac99be8204c57f0935f741ea919b5bf0077cdf6@9491 688a9155-6ab5-4160-a077-9df41f55a9e9\n" }, { "from": "human", "value": "include('helma.buffer');\nimport('helma.system', 'system');\n\nsystem.addHost...
javascript
chosen
[ { "from": "system", "value": "Update with reference to global nav partial\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar cssstats = require('cssstats')\n\nvar module = require('tachyon...
javascript
chosen
[ { "from": "system", "value": "Fix one last style error\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from './template';\n\nexport default Ember.Component.extend({\n layout\n});\n" }, { "from": "gpt", "value": "import Ember from 'ember';\nimport layout ...
javascript
chosen
[ { "from": "system", "value": "Fix bug in sequelize pluralization\n" }, { "from": "human", "value": "const db = require('../db.js');\nconst languageToId = require('../seed/languages.js').languageToId;\nconst levelToId = require('../seed/levels.js').levelToId;\nconst LanguagesLevels = require('../...
javascript
chosen
[ { "from": "system", "value": "Add exception handling when call json parse\n" }, { "from": "human", "value": "var smash = require(\"../smash.js\");\nvar requestFactory = require('../core/request.js');\n//TODO\n//maybe group this with response\n//no possibility to define JSON encoder/decoder\nfunc...
javascript
chosen
[ { "from": "system", "value": "fix: Make readJson return the read file\n" }, { "from": "human", "value": "import mzFs from 'mz/fs';\n\nexport async function readJson(fileName) {\n JSON.parse(await mzFs.readFile(fileName));\n}\n" }, { "from": "gpt", "value": "import mzFs from 'mz/fs';...
javascript
chosen
[ { "from": "system", "value": "Move all documentation to README.md\n" }, { "from": "human", "value": "// Whether strings ends with given string\n\n'use strict';\n\nmodule.exports = function (searchString) {\n\tvar self, index;\n\tself = String(this);\n\tindex = self.lastIndexOf(searchString);\n\t...
javascript
chosen
[ { "from": "system", "value": "Use math.random instead of math.rand\n" }, { "from": "human", "value": "function effect(cube) {\n var water = ((ticks >> 7) % 7) + 1;\n var surface = ticks & 127;\n\n cube({z: 0}).map(function(led) {\n led.z = ((ticks >> 3) + math.rand()) & 7;\n\n ...
javascript
chosen
[ { "from": "system", "value": "Move Map and Point constructors out\n" }, { "from": "human", "value": "(function(window, google) {\n 'use strict';\n\n var Placard = {\n Map: function(el, config) {\n this.el = el;\n this.config = config;\n this._map = this._createMap();\n },\...
javascript
chosen
[ { "from": "system", "value": "Fix warning when iterating over object\n" }, { "from": "human", "value": "/*\n * Copyright 2016 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the Lice...
javascript
chosen
[ { "from": "system", "value": "Update webpack settings for v2\n" }, { "from": "human", "value": "var path = require('path');\nvar HtmlWebpackPlugin = require('html-webpack-plugin');\n\nmodule.exports = {\n context: path.join(__dirname, 'webapp', 'src'),\n entry: {\n main: './index.js...
javascript
chosen
[ { "from": "system", "value": "Change order of the subnavigation\n" }, { "from": "human", "value": "/* eslint-disable no-unused-vars */\nimport React from 'react';\n/* eslint-enable no-unused-vars */\n\nimport ContainerSettings from './service-schema/ContainerSettings';\nimport EnvironmentVariabl...
javascript
chosen
[ { "from": "system", "value": "chore: Add yarn on webpack build\n" }, { "from": "human", "value": "var path = require('path')\nconst CopyPlugin = require('copy-webpack-plugin')\n\nmodule.exports = {\n entry: './src/index.js',\n target: 'node',\n output: {\n path: path.join(__dirname, 'build...
javascript
chosen
[ { "from": "system", "value": "Add a note about webpack warnings\n" }, { "from": "human", "value": "//@ts-check\n\n\"use strict\";\n\nconst path = require(\"path\");\n\n/**\n * @type {import(\"webpack\").Configuration}\n */\nconst config = {\n\tdevtool: \"source-map\",\n\tentry: \"./src/extension...
javascript
chosen
[ { "from": "system", "value": "Remove touch handerls from buttons\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport _ from 'lodash';\n\nimport styles from './css/Button.module.css';\n\nexport default class Button extends Component {\n static propTypes = {\n ...
javascript
chosen
[ { "from": "system", "value": "Test a bit more of the pub data\n" }, { "from": "human", "value": "describe(\"Pages publication\", function() {\n beforeEach(function (done) {\n Meteor.call('fixtures/reset', done);\n });\n\n it('should not return premiumContent when a user is not logged in', ...
javascript
chosen
[ { "from": "system", "value": "Add environment variable to test recordings.\n\nAdd variable so recorded tests will pass.\n" }, { "from": "human", "value": "// This file has been autogenerated.\n\nvar profile = require('../../../lib/util/profile');\n\nexports.getMockedProfile = function () {\n va...
javascript
chosen
[ { "from": "system", "value": "Allow jQuery version 1.11 and 2.1\n\nBoth RC1's of jQuery 1.11 and 2.1 have just been released.\n\n(I screwed up last PR)\n" }, { "from": "human", "value": "/**\n@module ember\n@submodule ember-views\n*/\n\nvar jQuery = (this && this.jQuery) || (Ember.imports && Emb...
javascript
chosen
[ { "from": "system", "value": "Add a custom event trigger\n\nI needed to add a custom event trigger so I could fire specific JS code when the element came into view (animating a count of numbers), so thought I'd suggest this simple edit which made it possible.\r\n\r\nIt allowed me to then add code as follows...
javascript
chosen
[ { "from": "system", "value": "Change API URL to production one\n" }, { "from": "human", "value": "import {UnitState} from '../unit/constants';\n\nexport const API_URL = 'https://servicemat.hel.ninja/servicemap/v1'; //http://api.hel.fi/servicemap/v1';\nexport const DIGITRANSIT_API_URL = 'https://...
javascript
chosen
[ { "from": "system", "value": "Fix pause for per vertex lighting sample\n" }, { "from": "human", "value": "(function() {\n\n var width, height;\n width = height = 600;\n\n window.samples.per_vertex_lighting = {\n\n initialize: function(canvas) {\n var scene = new THREE.Scene();\n\n ...
javascript
chosen
[ { "from": "system", "value": "Fix navbar loading (for real this time)\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n angular.module('facetApp')\n\n .directive('wsNavbar', wsNavbarDirective);\n\n /* @ngInject */\n function wsNavbarDirective($location, $templat...
javascript
chosen
[ { "from": "system", "value": "Make sure the default event is been prevented on dropdown module click.\n" }, { "from": "human", "value": "describe(\"Dropdown: \", function(){\n beforeEach(function(){\n loadFixtures('dropdown_fixture.html');\n locastyle.dropdown.init();\n });\n\n describe...
javascript
chosen
[ { "from": "system", "value": "Test string parsing with a more interesting value.\n" }, { "from": "human", "value": "\n'use strict';\n\nvar vcap = require('../main/vcap-parser'),\n reappt = require('../main/reappt');\n\ndescribe('VCAP service parser', function() {\n\n it('can find Reappt se...
javascript
chosen
[ { "from": "system", "value": "Add constructor and customized class documentation\n" }, { "from": "human", "value": "var AWS = require('../core');\n\n/**\n * Note: the `AWS.CloudSearchDomain` constructor must be created with a\n * valid endpoint.\n */\nAWS.util.update(AWS.CloudSearchDomain....
javascript
chosen
[ { "from": "system", "value": "Include trailing separator in comparisons\n" }, { "from": "human", "value": "const path = require('path')\nconst Module = require('module')\n\n// Clear Node's global search paths.\nModule.globalPaths.length = 0\n\n// Clear current and parent(init.js)'s search paths....
javascript
chosen
[ { "from": "system", "value": "Add minX and minY on widget template\n" }, { "from": "human", "value": "import React from 'react';\n\nconst nbCol = 12;\nconst nbRow = 6;\n\nvar Widget = React.createClass({\n render: function () {\n var xSize = $(window).width() / nbCol,\n ySize = $(window...
javascript
chosen
[ { "from": "system", "value": "Support for denied Twitter authentication attempts.\n" }, { "from": "human", "value": "/**\n * Module dependencies.\n */\nvar util = require('util')\n , OAuthStrategy = require(\"passport-oauth\").OAuthStrategy;\n\n\n/**\n * `Strategy` constructor.\n *\n * @api pub...
javascript
chosen
[ { "from": "system", "value": "Add default parameter value. Replace var -> let\n" }, { "from": "human", "value": "\"use strict\";\n\nfunction displayTopicsPreview(topics) {\n var message = \"There are currently \" + topics.length;\n \n _displayPreviewMessage(topics, message);\n}" }, { ...
javascript
chosen
[ { "from": "system", "value": "Clean up some linter warnings\n" }, { "from": "human", "value": "var hooks = require('hooks');\nvar async = require('async');\n\nfunction Renderable(View) {\n this.data = {};\n this.mode = 'main';\n this.view = {};\n\n if (typeof View === 'function') {\n this...
javascript
chosen
[ { "from": "system", "value": "Add delay to field focus to ensure it will work\n" }, { "from": "human", "value": "import React, {Component} from 'react'\n\nimport Icon from 'react-fa'\n\nimport {EditorState, Editor, ContentState} from 'draft-js'\n\nexport class Input extends Component{\n state =...
javascript
chosen
[ { "from": "system", "value": "WIP: Fix tests for aedes-persistence mongodb\n" }, { "from": "human", "value": "'use strict'\n\nvar parent = require('aedes-persistence/abstract')\n\nmodule.exports = parent\n" }, { "from": "gpt", "value": "'use strict'\n\nvar parent = require('../aedes-...
javascript
chosen
[ { "from": "system", "value": "Fix translations path for storybook\n" }, { "from": "human", "value": "import { configure, addDecorator } from '@storybook/react';\nimport { setOptions } from '@storybook/addon-options';\nimport '../lib/global.css';\n\n\n/**\n * React intl support\n */\n\n// Load th...
javascript
chosen
[ { "from": "system", "value": "Update the twitter sample example\n" }, { "from": "human", "value": "// Twitter Sample\n//\n// Using the Twitter Streaming API. In this example, we retrieve the\n// sample of the statuses in real time.\n\n// Import node modules\nvar Twit = require('twit'), ...
javascript
chosen
[ { "from": "system", "value": "Remove images from the character description schema\n\nCharacter descriptions and backstories cannot contain images\nbecause there is no way to upload them. Until a way to do so is\nadded, remove the image element from the schema used for character\ndescriptions and backstories...
javascript
chosen
[ { "from": "system", "value": "Allow a custom log handler as optional parameter" }, { "from": "human", "value": "function log(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nexport const...
javascript
chosen
[ { "from": "system", "value": "Remove mapping of arbitrary lengths to l/w/h.\n\n - No need\n - Unknown which is which anyway\n" }, { "from": "human", "value": "let util = require(\"../util\");\n\nlet input = require(\"fs\").readFileSync(\"./data\").toString();\n\nlet presentDimensions = input\n\t...
javascript
chosen
[ { "from": "system", "value": "Add pseudo bar chart using D3 scales with JSX\n" }, { "from": "human", "value": "import React from \"react\";\nimport ReactDOM from \"react-dom\";\n\nimport tabify from \"../../utils/tabify\";\nimport * as d3 from \"d3\";\nimport \"./BarGraph.css\";\n\nexport defaul...
javascript
chosen
[ { "from": "system", "value": "Change thumbnail to display self\n" }, { "from": "human", "value": "import React from 'react'\nimport styled from 'styled-components'\n\nconst isActualThumbnail = thumbnail => thumbnail.startsWith('http')\nconst getPlaceholder = str => {\n if (['nsfw'].includes(str...
javascript
chosen
[ { "from": "system", "value": "Change order of the imports to be alphabetised\n" }, { "from": "human", "value": "/* eslint-disable no-unused-vars */\nimport React from 'react';\n/* eslint-enable no-unused-vars */\n\nimport General from './service-schema/General';\nimport Labels from './service-sc...
javascript
chosen
[ { "from": "system", "value": "Use const instead of var for typescript\n" }, { "from": "human", "value": "<% if (framework === 'angular2') { -%>\nrequire('reflect-metadata');\n<% } -%>\n\n/* globals require */\n<% if (js === 'babel') { -%>\nconst context = require.context('./app', true, /\\.spec$...
javascript
chosen
[ { "from": "system", "value": "Refactor overview so props do not mutate state in container\n" }, { "from": "human", "value": "import { connect } from 'react-redux'\nimport DatasetOverview from '../components/DatasetOverview'\nimport { makeDatasetFactDictFxn, makeColTypesCntFxn, makePublishingFact...
javascript
chosen
[ { "from": "system", "value": "Correct Catalan verbs according to the Style Guide\n\nInfinitives for verbs that \"talk\" to the system are not used in Catalan. Imperative is used instead.\r\n\r\nMS Style Guides reflect this:\r\n\r\n\"Use the 2nd person singular of the imperative (tu) to address the system. U...
javascript
chosen
[ { "from": "system", "value": "Use `.reduceRight` instead of `.reverse().reduce`\n\n `reduceRight` [has good browser support](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/ReduceRight#Browser_compatibility) and skips the [mutating `reverse`](https://developer.mozilla....
javascript
chosen
[ { "from": "system", "value": "lathe[cuboid]: Change argument order of BoxGeometry lerp().\n" }, { "from": "human", "value": "/* eslint-env es6 */\n/* global VertexIndices */\nwindow.lerpBoxVertex = (function() {\n 'use strict';\n\n return function lerpA( geometryA, vertexA ) {\n const index...
javascript
chosen
[ { "from": "system", "value": "FIX - Removing unique constraint on user.email from migration script\n" }, { "from": "human", "value": "const TABLE_NAME = 'users';\n\nexports.up = function(knex, Promise) {\n\n return Promise.all([\n knex.schema.table(TABLE_NAME, function (table) {\n table...
javascript
chosen
[ { "from": "system", "value": "Support colors not in map\n\nIf you specify a background color that isn't a key in the colors map,\nwe just assume it's an actual color value and let you use it.\n" }, { "from": "human", "value": "const postcss = require('postcss')\nconst _ = require('lodash')\n\nfu...
javascript
chosen
[ { "from": "system", "value": "Add [Tanura] badge to log messages.\n" }, { "from": "human", "value": "'use strict';\n\n/*\n * Helper functions.\n *\n * This script contains miscellaneous helpers used throughout Tanura's code.\n */\n\n/*\n * Log something.\n *\n * For now, this is just aliased to ...
javascript
chosen
[ { "from": "system", "value": "Remove image on backspace key event\n" }, { "from": "human", "value": "define([\n 'summernote/base/core/func',\n 'summernote/base/core/list',\n 'summernote/base/core/dom'\n], function (func, list, dom) {\n var ImagePopover = function (context) {\n var ui = $....
javascript
chosen
[ { "from": "system", "value": "Return an estimate if counting takes too long.\n" }, { "from": "human", "value": "/*! @license ©2013 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */\n\n/** A TtsDatasource fetches triples from a Triple File System */\n\nvar tfs = require('triple-file-...
javascript
chosen
[ { "from": "system", "value": "Return a promise in the templated migrate-mongo\n" }, { "from": "human", "value": "// In this file you can configure migrate-mongo\n\nmodule.exports = {\n mongodb: {\n // TODO Change (or review) the url to your MongoDB:\n url: \"mongodb://localhost:27017\",\n...
javascript
chosen
[ { "from": "system", "value": "Add /api/ in front of API-URLs\n" }, { "from": "human", "value": "/**\n * Created by Stein-Otto Svorstøl on 26.08.15.\n */\n'use strict';\n\nvar bookController = require('./controllers/bookController');\n\nfunction setup(app){\n var bodyParser = require('body-par...
javascript
chosen
[ { "from": "system", "value": "Create basic time regex and stub out flow\n" }, { "from": "human", "value": "var config = require('./config.js');\nvar Slack = require('slack-client');\nvar token = config.slackApiKey;\nvar slack = new Slack(token, true, true);\n\nslack.on('message', function(messag...
javascript
chosen
[ { "from": "system", "value": "Fix invalid reference before first scroll\n" }, { "from": "human", "value": "'use strict';\n\n// http://stackoverflow.com/a/872537\nfunction getScrollTop(){\n if ( typeof window.pageYOffset !== 'undefined' ) {\n // most browsers except IE before #9\n return w...
javascript
chosen
[ { "from": "system", "value": "Add black background logic to Graphics backend\n" }, { "from": "human", "value": "document.write(\"<canvas>\")\nvar Graphics = new Processing(document.querySelector('canvas'));\n\nGraphics.keyPressed = function() {\n World.query(\"keyboard\").forEach(function(e) {\...
javascript
chosen
[ { "from": "system", "value": "Remove useless header setting, since it is already set by express.\n" }, { "from": "human", "value": "'use strict';\n\nvar express = require('express');\n\nvar app = express();\nvar stationsRoutes = require('./src/routes/stations');\n\nif (!process.env['BIKE_API_KEY...
javascript
chosen
[ { "from": "system", "value": "Disable opened field when editor is off\n" }, { "from": "human", "value": "import { inject as service } from '@ember/service';\nimport Component from '@ember/component';\nimport layout from '../templates/components/cs-editor-switch';\n\nexport default Component.exte...
javascript
chosen
[ { "from": "system", "value": "Add more props to select field\n" }, { "from": "human", "value": "import { createElement as h } from 'react'\nimport PropTypes from 'prop-types'\n\nconst Select = (props) => {\n\n\treturn (\n\t\th('select', {\n\t\t\tclassName: 'select',\n\t\t\tvalue: props.value,\n\...
javascript
chosen
[ { "from": "system", "value": "Add hapi route to bower packages.\n" }, { "from": "human", "value": "'use strict';\n\nvar Hapi = require('hapi');\n\nvar server = new Hapi.Server();\n\nif( process.env.PORT ) {\n server.connection({ port: process.env.PORT });\n}\nelse {\n server.connection({ port:...
javascript
chosen
[ { "from": "system", "value": "Update postcss from 7.0.32 to 8.2.10\n" }, { "from": "human", "value": "Package.describe({\n summary: 'CSS minifier',\n version: '1.5.3'\n});\n\nNpm.depends({\n postcss: '7.0.32',\n cssnano: '4.1.10'\n});\n\nPackage.onUse(function (api) {\n api.use('ecmascript'...
javascript
chosen
[ { "from": "system", "value": "Fix flow for message function\n" }, { "from": "human", "value": "/* eslint-disable new-cap */\n/**\n * This source code is licensed under the MIT-style license found in the\n * LICENSE file in the root directory of this source tree. *\n *\n * @providesModule setupTe...
javascript
chosen
[ { "from": "system", "value": "Change text in basic template." }, { "from": "human", "value": "\"use strict\";\r\n\r\n(function (app) {\r\n app.AppComponent = ng.core\r\n .Component({\r\n selector: \"my-app\",\r\n template: \"<h1>My First Angular 2 (2.0.0-beta.0) A...
javascript
chosen
[ { "from": "system", "value": "Remove unused code in background script\n" }, { "from": "human", "value": "\"use strict\";\n\nfunction sendToggle(tabs) {\n let id = tabs[0].id;\n browser.tabs.sendMessage(id, {request: 'toggle'}).then(m => {\n if (m.toggle) {\n browser.browserAction.setBa...
javascript
chosen
[ { "from": "system", "value": "Make a kinda ghetto comment stream dump\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\n\nclass CommentStream extends Component {\n render() {\n return (\n <ul></ul>\n );\n }\n}\n\nexport default CommentStream;\n\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Use the dot test reporter.\n\nWith TAP, it's hard to get the failure info without having to scroll\nback.\n" }, { "from": "human", "value": "/*jshint node:true*/\nmodule.exports = {\n \"framework\": \"qunit\",\n \"test_page\": \"tests/index.html?hidepassed\",\n \...
javascript
chosen
[ { "from": "system", "value": "Fix wordings of test statements\n" }, { "from": "human", "value": "function focusDoc(browser, docType) {\n const devServer = browser.globals.devServerURL;\n\n browser.url(`${devServer}/`);\n browser.expect.element('#app').to.be.visible.before(5000);\n\n const cr...
javascript
chosen
[ { "from": "system", "value": "Test get request to Twitter\n" }, { "from": "human", "value": "const Twit = require('twit');\n\nconst secrets = require('./secrets');\n\nvar T = new Twit({\n consumer_key: secrets.consumer_key,\n consumer_secret: secrets.consumer_secret,\n access_token: secrets.a...
javascript
chosen
[ { "from": "system", "value": "[CLI] Print out the interface name\n" }, { "from": "human", "value": "#!/usr/bin/env node\nimport pcap from 'pcap';\nimport yargs from 'yargs';\n\nimport ArpProbes from './ArpProbes';\nimport MacAddresses from './MacAddresses';\nimport NetworkInterfaces from './Netw...
javascript
chosen
[ { "from": "system", "value": "Remove dup code in store\n" }, { "from": "human", "value": "var Fluxxor = require('fluxxor');\nvar _ = require('lodash-node');\n\nclass Store {\n constructor(name, actions) {\n var self = this;\n this.name = name;\n this.loading = false;\n this.data = {...
javascript
chosen
[ { "from": "system", "value": "SAAS-644: Embed Player -> Update embed src code and preview when an option changes\n" }, { "from": "human", "value": "window.onload = function() {\n document.getElementById('player_display_track_metadata').onchange = generateEmbedSrc;\n}\n\nfunction generateEmbed...
javascript
chosen
[ { "from": "system", "value": "Complete the test to configure the service.\n" }, { "from": "human", "value": "'use strict';\n\ndescribe('geneanetCustomCamera', function() {\n beforeEach(module('geneanetCustomCamera'));\n\n beforeEach(module(function(geneanetCustomCameraProvider) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug in service insights\n" }, { "from": "human", "value": "/* eslint-disable class-methods-use-this */\n/*\n * Copyright 2019 Expedia Group\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file ex...
javascript
chosen
[ { "from": "system", "value": "Support Thunderbird 52 and later\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/...
javascript
chosen
[ { "from": "system", "value": "Remove rootURL so netlify can deploy it\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(environment) {\n let ENV = {\n modulePrefix: 'dummy',\n environment,\n rootURL: '/',\n locationType: 'auto',\n EmberENV: {\n EX...
javascript
chosen
[ { "from": "system", "value": "Add setup hooks and use async/await\n" }, { "from": "human", "value": "import { A as emberA } from '@ember/array';\nimport groupBy from 'dummy/utils/group-by';\nimport { module, test } from 'qunit';\n\nmodule('Unit | Utility | group by');\n\ntest('It returns an empt...
javascript
chosen
[ { "from": "system", "value": ":guitar: Make custom fields viewable by guests\n" }, { "from": "human", "value": "import { Posts } from 'meteor/example-forum';\n\n/*\nLet's assign a color to each post (why? cause we want to, that's why).\nWe'll do that by adding a custom field to the Posts collect...
javascript
chosen
[ { "from": "system", "value": "Remove redundant comments from previous-path routing middleware\n" }, { "from": "human", "value": "import {LOCATION_CHANGE} from 'react-router-redux';\n\nlet previousPathname = \"\";\n// let previousAction = undefined;\n// let counter = 0;\n\nexport default () => ne...
javascript
chosen
[ { "from": "system", "value": "Add a comment explaining socket naming.\n" }, { "from": "human", "value": "//@flow\nmodule.exports =\n process.platform === \"win32\"\n ? \"\\\\\\\\.\\\\pipe\\\\elm_test-\" + process.pid\n : \"/tmp/elm_test-\" + process.pid + \".sock\";\n" }, { "from"...
javascript
chosen
[ { "from": "system", "value": "Write initial attempt at solution. Works, but not for every edge case\n" }, { "from": "human", "value": "// Is Palindrome Challenge\n\n/*Rules:\n Take any string as an argument\n Return true if palindrome\n return false if not\n*/\n\n/*PSEUDOCODE\n 1) Split...
javascript
chosen
[ { "from": "system", "value": "Fix typo transistions -> transitions" }, { "from": "human", "value": "// Relevant entry from app/transistions.js\nthis.transition(\n this.between({childOf: '#liquid-bind-demo > div'}),\n this.use('toUp')\n);\n" }, { "from": "gpt", "value": "// Relevant...
javascript
chosen
[ { "from": "system", "value": "Fix bug where text nodes beginning with newline would be ignored\n" }, { "from": "human", "value": "import NodeType from './node-type'\n\nexport default function isNodeSupported (node = {}) {\n return !(\n isTagNameIgnored(node.tagName) ||\n isNodeTypeIgnored...
javascript
chosen
[ { "from": "system", "value": "Fix tests for in promises\n" }, { "from": "human", "value": "const fs = require('fs');\n\nconst { learn, getClassifier, } = require('../src/learn');\nconst intentsFile = require('../src/intents.json').intents;\n\nconst natural = require('natural');\n\nconst intents ...
javascript
chosen
[ { "from": "system", "value": "Change enable mocha, es6 eslint env\n" }, { "from": "human", "value": "module.exports = {\n \"extends\": [\"vue\"],\n \"plugins\": [\n \"promise\",\n \"mocha\",\n \"chai-expect\"\n ],\n \"rules\": {\n \"mocha/no-exclusive-tests\": \"error\"\n }\n}\n...
javascript
chosen
[ { "from": "system", "value": "Fix lint rules for non module files\n" }, { "from": "human", "value": "const OFF = 0;\nconst ERROR = 2;\n\nmodule.exports = {\n root: true,\n parser: \"babel-eslint\",\n plugins: [\n \"node\",\n \"import\",\n \"react\",\n \"flowtype\",\n \"prettier...
javascript
chosen
[ { "from": "system", "value": "Change @typescript-eslint errors to warnings\n\nSigned-off-by: Ziyang Li <261a482ee4a4e19131e4e3f6a4a8d274da8aaeca@me.com>\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2014-2021 Bjoern Kimminich.\n * SPDX-License-Identifier: MIT\n */\n\nmodule.exports = {...
javascript
chosen