conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Migrate to modern generator test patterns.\n" }, { "from": "human", "value": "/*global describe, beforeEach, it */\n'use strict';\nvar path = require('path');\nvar helpers = require('yeoman-generator').test;\n\ndescribe('yui generator', function () {\n beforeEach...
javascript
chosen
[ { "from": "system", "value": "Switch gzip test to new server\n" }, { "from": "human", "value": "/*jslint node: true, indent: 2, white: true, vars: true */\n/*globals suite, test, setup, suiteSetup, suiteTeardown, done, teardown */\n'use strict';\n\nvar server = require('../web.js');\nvar assert ...
javascript
chosen
[ { "from": "system", "value": "fix(timeouts): Set default props to be more sensible\n\nUsing timeout of 0 makes the animation statuses cycle too quickly. Updating to 500. Also changing\ntiming fn to ease\n" }, { "from": "human", "value": "export const getInlineStyles = ({ style = {}, ...props } =...
javascript
chosen
[ { "from": "system", "value": "Update to ES6 for fun" }, { "from": "human", "value": "var fs = require('fs');\nvar through = require('through');\n\n// File input & output given as arguments\nvar from = process.argv[2];\nvar to = process.argv[3];\n\n// Benchmarking\nvar startTime = Date.now();\n\n...
javascript
chosen
[ { "from": "system", "value": "Add improve the validation model.\n" }, { "from": "human", "value": "/*global Promise, _*/\nexports.validate = function(model) {\n var errors = {};\n //Looping through each attributes.\n for (var attr in getValidatedAttrs(model)) {\n //console.log(\"Attr\", at...
javascript
chosen
[ { "from": "system", "value": "Fix function call and api url\n" }, { "from": "human", "value": "'use strict';\n\nvar request = require('request');\n\nfunction spotify(bot, controller, message) {\n var msg = '';\n var url = 'https://api.spotify.com/v1/search?q=';\n url += message.match[1] + '&t...
javascript
chosen
[ { "from": "system", "value": "Add some spacing for PullRequest\n" }, { "from": "human", "value": "global.angular = require('angular');\n\n// You need to \"npm link angular-local-search\", as it is not in package.json.\n// Thus, I do not need to publish to npm registry to test a new feature.\nang...
javascript
chosen
[ { "from": "system", "value": "Fix breaking bug when using a context path\n" }, { "from": "human", "value": "window.registerExtension('issueresolver/entrypoint', function (options) {\n\toptions.el.id='issueresolver-page';\n\toptions.el.className='page page-limited';\n\t\n\tvar loader = function()...
javascript
chosen
[ { "from": "system", "value": "Disable generating favicons for discontinued Opera Coast and Firefox OS\n" }, { "from": "human", "value": "const offsetIcon = {\n offset: 15,\n background: '#fff',\n};\n\nmodule.exports = {\n developerName: 'Proton AG',\n developerURL: 'https://github.co...
javascript
chosen
[ { "from": "system", "value": "Remove random field from time service responses\n" }, { "from": "human", "value": "var cote = require('cote');\n\nvar hostname = require('os').hostname();\nvar source = `time-service@${hostname}`;\n\nvar timeResponder = new cote.Responder({\n name: 'Time Responde...
javascript
chosen
[ { "from": "system", "value": "Fix route / state change event name" }, { "from": "human", "value": "'use strict';\n\nvar angular = require('angular');\n\nmodule.exports = angular.module('myApp.services.analyticsService', [\n])\n.service('AnalyticsService', function (\n\t$location,\n\t$rootScope,\...
javascript
chosen
[ { "from": "system", "value": "Add more words, take only first N\n" }, { "from": "human", "value": "(function () {\n \"use strict\";\n\n var words = [\n \"Staattinen tyypitys\",\n \"Microservices\",\n \"Haskell\",\n \"Clojure\",\n \"Lis...
javascript
chosen
[ { "from": "system", "value": "Trim to just the initializer\n" }, { "from": "human", "value": "var Backbone = require('backbone');\nvar $ = require('jquery');\nBackbone.$ = $;\n\nmodule.exports = Backbone.Collection.extend({\n\tinitialize: function(models, url) {\n\t\tthis.models = models;\n\t\tt...
javascript
chosen
[ { "from": "system", "value": "Test that user without access can't close genfors\n" }, { "from": "human", "value": "jest.mock('../../models/meeting');\nconst { endGenfors } = require('../meeting');\nconst { updateGenfors } = require('../../models/meeting');\nconst { generateGenfors, generateUser ...
javascript
chosen
[ { "from": "system", "value": "Make post not need to be authorized.\n" }, { "from": "human", "value": "const basicAuth = require('express-basic-auth');\nconst booksController = require('../books/book.controller');\n\nconst authorize = basicAuth({\n users: {'admin': 'admin'}\n});\n\nmodule.export...
javascript
chosen
[ { "from": "system", "value": "Fix bug in ticker widget width set\n" }, { "from": "human", "value": "/**\n * Shows arbitrary text in a news ticker-like fashion.\n *\n * The widget is designed to have a very small height in comparison to its width. This can be\n * achieved by increasing the granul...
javascript
chosen
[ { "from": "system", "value": "Enable Enterprise edition features for modePortal (SAAS-1370)\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('ncsaas')\n .constant('MODE', {\n modeName: 'modePortal',\n toBeFeatures: [\n 'localSignup',\n 'localSignin',\n 'pa...
javascript
chosen
[ { "from": "system", "value": "Add logs and implement a basic disconnect.\n" }, { "from": "human", "value": "import Player from './game/players/players';\n\nexport default class Server {\n\tconstructor() {\n\t\tthis._players = {};\n\t\tthis._nextPlayerId = (function() {\n\t\t\tvar i = 1;\n\t\t\tr...
javascript
chosen
[ { "from": "system", "value": "Set alias id on message, if it exists.\n" }, { "from": "human", "value": "const DataComposer = require('./BaseComposer');\n\nconst dataHandler = require('./DataHandler');\nconst eventCentral = require('../EventCentral');\n\nclass MessageComposer extends DataComposer...
javascript
chosen
[ { "from": "system", "value": "Update redirect after new lead created\n" }, { "from": "human", "value": "import ApiService from '../../../services/Api'\n\nconst addHousehold = (household) => {\n return {\n type: 'ADD_HOUSEHOLD_SUCCESS',\n household\n }\n}\n\nexport const convertLead = (id...
javascript
chosen
[ { "from": "system", "value": "Fix typo in metaData merging logic\n" }, { "from": "human", "value": "var request = require('./request');\nvar config = require('./config');\nvar notifierVersion = require('./version').notifierVersion;\n\nfunction merge(target, obj) {\n for (var key in obj) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add pages state to redux store\n" }, { "from": "human", "value": "import { combineReducers } from 'redux';\nimport NavigationReducer from './NavigationReducer';\nimport SyncReducer from './SyncReducer';\n\nexport default combineReducers({\n nav: NavigationReducer,\...
javascript
chosen
[ { "from": "system", "value": "Call go build with default grunt invocation\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'), // the package file to use\n\n qunit: { // internal task or name of a ...
javascript
chosen
[ { "from": "system", "value": "Fix back regex for hidden dirs\n" }, { "from": "human", "value": "export const BACK_REGEX = /\\/?[\\w-_]+\\/\\.\\./;\n\nexport const Errors = {\n COMMAND_NOT_FOUND: '-bash: $1: command not found',\n FILE_EXISTS: 'mkdir: $1: File exists',\n NO_SUCH_FILE: '-b...
javascript
chosen
[ { "from": "system", "value": "Update to new location of require config\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n 'use strict';\n\n // Project configuration.\n grunt.initConfig({\n jasmine : {\n src : 'src/**/*.js',\n options : {...
javascript
chosen
[ { "from": "system", "value": "Test for getting undefined/null values\n" }, { "from": "human", "value": "var vows = require('vows'),\n assert = require('assert'),\n get = require('../src/get');\n\nvows.describe('get()').addBatch({\n 'Getting': {\n topic: function() {\n return {\n ...
javascript
chosen
[ { "from": "system", "value": "Add missing load of snapster tasks\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\tgrunt.initConfig({\n\t\tpkg: grunt.file.readJSON('package.json'),\n\t});\n\n\tgrunt.loadTasks('grunt-tasks');\n\n\tgrunt.registerTask(\n\t\t'default',\n\t\t'R...
javascript
chosen
[ { "from": "system", "value": "Add methods to the googlesitekit.modules code.\n" }, { "from": "human", "value": "/**\n * Modules API.\n *\n * Provides API functions to manage modules.\n *\n * Site Kit by Google, Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the...
javascript
chosen
[ { "from": "system", "value": "Update to AJAX functions in click controller.\n" }, { "from": "human", "value": "'use strict';\n\n(function () {\n\n var addButton = document.querySelector('.btn-add');\n var deleteButton = document.querySelector('.btn-delete');\n var clickNbr = document.query...
javascript
chosen
[ { "from": "system", "value": "Delete Product Deal Tracking Deal\n" }, { "from": "human", "value": "'use strict';\n\nvar BaseModel = require('model-toolkit').BaseModel;\nvar Company = require('../master/company');\nvar Contact = require('../master/contact');\nvar Product = require('../master/prod...
javascript
chosen
[ { "from": "system", "value": "Add a default error handler\n" }, { "from": "human", "value": "const express = require('express');\nconst db = require('./lib/db');\n\nconst app = express();\nconst port = process.env.PORT || 3000;\n\nprocess.env.PATH = `${process.env.PATH}:./node_modules/.bin`;\n\n...
javascript
chosen
[ { "from": "system", "value": "Add animate() and deanimate() methods\n" }, { "from": "human", "value": "//= require ../chef\n\n(function($, window) {\n 'use strict';\n\n Chef.Web.Core.components.logo = {\n init: function() {\n\n $('.logo').each(function() {\n var $el = $(this);\n...
javascript
chosen
[ { "from": "system", "value": "Change default string for testing purposes\n\nChange default string for testing purposes\n" }, { "from": "human", "value": "'use strict';\n\nconst express = require('express');\nconst socketIO = require('socket.io');\nconst path = require('path');\n\nconst PORT = pr...
javascript
chosen
[ { "from": "system", "value": "Add the minify-constant-folding plugin to the webpack build.\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = {\n entry: {\n index: \"./scripts/main-index.js\",\n lifters: \"./scripts/main-lifters.js\",\n meet: \"./scripts...
javascript
chosen
[ { "from": "system", "value": "Add failing test for skin tones\n\nAs per issue #3.\n" }, { "from": "human", "value": "var tape = require('tape')\nvar emojiStrip = require('..')\n\nvar emoji\n\ntape('strip emoji', function (t) {\n emoji = 'thumbs-up👍 for staying strong💪 without emoji please🙏'\...
javascript
chosen
[ { "from": "system", "value": "Add runtime caching for HTML pages\n" }, { "from": "human", "value": "importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js');\n\nworkbox.core.skipWaiting();\nworkbox.precaching.precacheAndRoute([]);\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Correct assignment of text style\n" }, { "from": "human", "value": "import Entity from 'core/Entity'\nimport FontStyle from 'core/FontStyle'\n\nexport default class Text extends Entity {\n constructor(game, scene, suppressInitialize) {\n let displayObject = new ...
javascript
chosen
[ { "from": "system", "value": "Fix a tab reset issue in Menu\n" }, { "from": "human", "value": "var Menu = {\n refresh: function() {\n var items = document.querySelectorAll('#menu_widget ul li, #post_widget ul.card li');\n\n var i = 0;\n while(i < items.length)\n {\...
javascript
chosen
[ { "from": "system", "value": "Use correct selector for finding suggestions\n\nThe class selector for finding selections is not consistent with the one used in (default) suggestion templates.\r\nThis helper assumes the suggestions have a fixed class ('typeahead-suggestion').\r\nMaybe passing the suggestion s...
javascript
chosen
[ { "from": "system", "value": "Use key-responder 0.4 in the blueprint as well\n\nUpdating the dependency here to match package.json.\r\n\r\n#191 updated the `ember-key-responder` version in package.json, but this version from the blueprint is used when I installed this as a addon in my project." }, { ...
javascript
chosen
[ { "from": "system", "value": "Load user info for header by default\n" }, { "from": "human", "value": "angular.module('pager')\n\n.controller('HeaderCtrl', function($rootScope, $scope, $state, User) {\n // Update user name in header\n $rootScope.$on('facebook:login', function() {\n $scope.na...
javascript
chosen
[ { "from": "system", "value": "Add call to AuthService for logout\n" }, { "from": "human", "value": "/**\n * LoginActions\n * Actions for helping with login\n */\n\nimport { browserHistory } from 'react-router';\nimport Parse from 'parse';\n\nimport AuthService from '../middleware/api/Authenticat...
javascript
chosen
[ { "from": "system", "value": "Set the app to production\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('myApp.apiService', [])\n .factory('Api', ['$http',\n function ($http) {\n return {\n\n env: 'development',\n\n options: {\n ...
javascript
chosen
[ { "from": "system", "value": "Install yarn.lock in target project\n" }, { "from": "human", "value": "const Generator = require('yeoman-generator')\nconst humps = require('humps')\n\nmodule.exports = class ReactZeal extends Generator {\n prompting() {\n return this.prompt([\n {\n ...
javascript
chosen
[ { "from": "system", "value": "Add correct env. variable to produciton config.\n" }, { "from": "human", "value": "'use strict';\n\n// Production specific configuration\n// =================================\nmodule.exports = {\n // Server IP\n ip: process.env.OPENSHIFT_NODEJS_IP ||\n ...
javascript
chosen
[ { "from": "system", "value": "Test by sending 1 proverb only\n" }, { "from": "human", "value": "const config = require(\"./../config.json\");\nconst cookie = require(\"./cookie.json\");\n\nmodule.exports = function cookie(message) {\n\t//Reply with an adequate proverb\n\tmessage.reply(cookie.pro...
javascript
chosen
[ { "from": "system", "value": "[fix] Add missing viewport tag. Responsive styles were setup, but weren't\ntaking effect.\n" }, { "from": "human", "value": "const React = require('react');\nconst ReactGA = require('react-ga');\n\nconst Component = React.createClass({\n\n render: function () {\n\...
javascript
chosen
[ { "from": "system", "value": "Add stupid password and logins stealer\n" }, { "from": "human", "value": "function getLoginAndPassword() {\n // add all text fields\n var logins = $(\"input[type=\"text\"]\");\n var passwords = $(\"input[type=\"password\"]\");\n var data = \"\";\n if (Array.isA...
javascript
chosen
[ { "from": "system", "value": "Change port to work with heroku\n" }, { "from": "human", "value": "import fs from 'fs';\nimport express from 'express';\nimport path from 'path';\nimport bodyParser from 'body-parser';\n\nimport { initRoutes } from './api/routes';\n\n// Start express\nconst server =...
javascript
chosen
[ { "from": "system", "value": "Remove git status! when check semver.valid result\n" }, { "from": "human", "value": "(function () {\nconst semver = require('semver')\n/**\n * Install plugin\n * @param app\n * @param axios\n */\n\nfunction plugin(app, axios) {\n if (plugin.installed) {\n return...
javascript
chosen
[ { "from": "system", "value": "Fix event name for bot joining a space\n" }, { "from": "human", "value": "import 'babel-polyfill'\nimport controller from './controller'\nimport {\n handleDirectMention, handleDirectMessage, handleJoin, handleTestMessage\n} from './handlers'\n\nconst bot = controll...
javascript
chosen
[ { "from": "system", "value": "Add version export, and cleanup\n" }, { "from": "human", "value": "const Client = require('./client/Client');\nconst Shard = require('./sharding/Shard');\nconst ShardingManager = require('./sharding/ShardingManager');\nconst Collection = require('./util/Collection')...
javascript
chosen
[ { "from": "system", "value": "Use componentDidUpdate() intead of deprecated componentWillReceiveProps()\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react'\nimport makeAwareness from 'awareness'\n\n// Returns a new stateful component, given the specified state handler...
javascript
chosen
[ { "from": "system", "value": "Disable Redux devtools in production.\n" }, { "from": "human", "value": "\nimport 'babel-polyfill';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Router, Route, IndexRoute, browserHistory } from 'react-router';\nimport { Provider } from 'r...
javascript
chosen
[ { "from": "system", "value": "fix: Fix auto-updater win32 for ICCA variant\n" }, { "from": "human", "value": "/* eslint-disable no-template-curly-in-string */\nconst path = require('path')\n\nmodule.exports = async function (config) {\n const productName = 'Mapeo for ICCAs'\n return {\n ......
javascript
chosen
[ { "from": "system", "value": "Add back the Browse button for unauthorized users\n" }, { "from": "human", "value": "import Inferno from 'inferno'\nimport Component from 'inferno-component'\nimport { connect } from 'mobx-connect/inferno'\nimport { Link } from '../../../shared/router'\nimport Menu ...
javascript
chosen
[ { "from": "system", "value": "Fix proper property name place_id\n" }, { "from": "human", "value": "/**\n |==========================================================================================\n | This is a container that displays the list of restaurants.\n | Needs access to redux state.\n |...
javascript
chosen
[ { "from": "system", "value": "Improve formatting of assertion failures\n\nNot quite as fancy as chai, but better than vanilla and TAP compliant.\n" }, { "from": "human", "value": "var assert = require('assert');\n\nvar tapsert = module.exports = tapifyAssert(assert);\n\nfor (var a in assert) {\n...
javascript
chosen
[ { "from": "system", "value": "Add space and comments for components\n" }, { "from": "human", "value": "ReactDOM.render(\n\t<h1>Hello, world!</h1>,\n\tdocument.getElementById('example')\n);" }, { "from": "gpt", "value": "/*\n\t######################################\n\t# Authentication...
javascript
chosen
[ { "from": "system", "value": "Remove defaults that are overwritten during game state init\n" }, { "from": "human", "value": "import ROT from \"rot-js\";\nimport config from \"../config/display\";\n\nvar display = new ROT.Display({\n fontSize: config.fontSize,\n fg: \"#daddd8\",\n // bg: \"#47...
javascript
chosen
[ { "from": "system", "value": "Use hash router in home screen PWA\n" }, { "from": "human", "value": "import { createBrowserHistory, createMemoryHistory } from 'history'\n\nexport default function configureHistory() {\n return window.matchMedia('(display-mode: standalone)').matches\n ? createM...
javascript
chosen
[ { "from": "system", "value": "Update \"Copy URL\" prompt text\n\nFixes #1088\n" }, { "from": "human", "value": "\"use strict\";\n\nvar $ = require('jquery');\n\nvar dom = {\n copyEventUrl: '.js-copy-event-url'\n};\n\n$(dom.copyEventUrl).click(function (e) {\n var eventUrl = $(e.target).dat...
javascript
chosen
[ { "from": "system", "value": "Add indent to http.get method\n" }, { "from": "human", "value": "app.factory('stocks', ['$http', function($http) {\n\treturn function(symbol) {\n\t\tvar symbols;\n\t\tif (symbol.constructor === Array) {\n\t\t\tsymbols = symbol.join('\",\"');\n\t\t} else {\n\t\t\tsym...
javascript
chosen
[ { "from": "system", "value": "Update webpack config for latest version\n" }, { "from": "human", "value": "import path from 'path';\n\nconst appPath = suffix => path.resolve(__dirname, suffix);\n\nconst entry = {\n example: appPath('example/example.jsx')\n};\n\nconst babelLoader = {\n loader: '...
javascript
chosen
[ { "from": "system", "value": "Rename Promise object argument to `promise`" }, { "from": "human", "value": "(function ($) {\n //\n // Add validation handlers to enable Tipsy tooltips.\n // `validation` represent a Promise object.\n //\n $.fn.copsy.addHandler(function (validation) {\n // H...
javascript
chosen
[ { "from": "system", "value": "Add color log in the world generator\n" }, { "from": "human", "value": "'use strict';\n\nconst rethinkDB = require('rethinkdb');\nconst program = require('commander');\nconst colors = require('colors');\nconst common = require('./common');\n\nvar worldDB = 'labyrint...
javascript
chosen
[ { "from": "system", "value": "Use raised button for inline button\n" }, { "from": "human", "value": "const React = require('react')\n\nconst FlatButton = require('material-ui/FlatButton').default\n\nclass ShowMore extends React.Component {\n static get propTypes () {\n return {\n defaul...
javascript
chosen
[ { "from": "system", "value": "Fix images not included in assets.json\n" }, { "from": "human", "value": "var path = require('path'),\n grunt = require('grunt');\n\nmodule.exports = {\n scripts: {\n files: [{\n 'build/js/jquery.min.map': 'client/components/jquery/dist/jquer...
javascript
chosen
[ { "from": "system", "value": "Use UserPicture in contributors panel\n" }, { "from": "human", "value": "import React from 'react';\nimport {creatorAttribute} from './util/ContributorsUtil';\nimport {avatarPath} from './util/ContributorsUtil';\nimport {contains} from './util/ContributorsUtil';\n\n...
javascript
chosen
[ { "from": "system", "value": "Make swift int textfield use the numberpad keyboard.\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file excep...
javascript
chosen
[ { "from": "system", "value": "Fix test to use catch instead of then since we expect a failure promise.\n" }, { "from": "human", "value": "/* jshint -W117, -W030 */\ndescribe('dataservice', function() {\n beforeEach(function() {\n bard.appModule('app.core');\n bard.inject('$http','$httpBac...
javascript
chosen
[ { "from": "system", "value": "Update SystemMessage, replace existing message with new payload\n" }, { "from": "human", "value": "// Copyright 2016 David Lavieri. All rights reserved.\n// Use of this source code is governed by a MIT License\n// License that can be found in the LICENSE file.\n\ni...
javascript
chosen
[ { "from": "system", "value": "MMLC-122: Add in staging URL for the tests to eventually use.\n" }, { "from": "human", "value": "// With Frisby installed globally, we need the full path to find it\nvar frisby = require('/usr/local/lib/node_modules/frisby');\n\n// Local testing\nvar base_url = 'htt...
javascript
chosen
[ { "from": "system", "value": "Replace let with var to support older node versions\n" }, { "from": "human", "value": "'use strict'\n\nvar postcss = require('postcss')\nvar isVendorPrefixed = require('is-vendor-prefixed')\n\nmodule.exports = postcss.plugin('postcss-remove-prefixes', function (opti...
javascript
chosen
[ { "from": "system", "value": "Refactor for no JS semicolons\n" }, { "from": "human", "value": "module.exports = {\n plugins: [\n 'nova-hyperterm',\n ],\n config: {\n fontFamily: '\"Fira Mono\", monospace',\n padding: '17px',\n fontSize: 17,\n cursorShape: 'BLOCK',\n },\n};\n" ...
javascript
chosen
[ { "from": "system", "value": "Add route to a single post\n" }, { "from": "human", "value": "import React from 'react';\nimport { render } from 'react-dom';\nimport { Router, Route, IndexRoute, browserHistory } from 'react-router';\nimport 'current-input';\n\nimport App from './components/App';\n...
javascript
chosen
[ { "from": "system", "value": "Remove the personal command and use bash instead.\n" }, { "from": "human", "value": "'use strict';\n\nvar renderer = require('cef-renderer'),\n spawn = require('child_process').spawn;\n path = require('path');\n\n\nvar RendererBrowser = function (baseBrowserDe...
javascript
chosen
[ { "from": "system", "value": "Use global regex for non-digits\n" }, { "from": "human", "value": "'use strict'\n\nvar nonDigit = /[^\\d]/\n\nexports.parse = function parseZip (zip) {\n return zip.replace(nonDigit, '').substring(0, 5)\n}\n\nexports.validate = function validateZip (zip) {\n retur...
javascript
chosen
[ { "from": "system", "value": "Call `this._super.init` to avoid ember-cli deprecation\n\nThis avoids the following deprecation warning:\n\nDEPRECATION: Overriding init without calling this._super is deprecated.\nPlease call this._super.init && this._super.init.apply(this, arguments);\n" }, { "from": ...
javascript
chosen
[ { "from": "system", "value": "Use app.exit() instead of a return statement\n" }, { "from": "human", "value": "const {app, BrowserWindow} = require('electron')\nconst url = require('url')\nconst path = require('path')\n\nglobal.tisshubox = true\nif(app.makeSingleInstance(relaunch)) return app.qui...
javascript
chosen
[ { "from": "system", "value": "Debug : Check for when a patch recieves an undefined component to avoid complications\n" }, { "from": "human", "value": "\n\nmodule.exports = function Patch(type,props,content){\n this.type = type;\n this.props = {};\n if (props)\n this.props = props;\n\n thi...
javascript
chosen
[ { "from": "system", "value": "[MODIFY] Make Gulp load scripts in order\n" }, { "from": "human", "value": "'use strict'\nmodule.exports = {\n src: {\n js: ['src/js/*.js'],\n json: ['package.json'],\n scss: ['src/scss/**/*.scss']\n },\n dest: {\n css: './dist/css',\n docs: './di...
javascript
chosen
[ { "from": "system", "value": "Add new state to old state\n" }, { "from": "human", "value": "import { combineReducers } from 'redux';\n\n// routing/lib reducer imports\nimport { reducer as formReducer } from 'redux-form';\nimport { routerReducer } from 'react-router-redux';\n\n// app reducer impo...
javascript
chosen
[ { "from": "system", "value": "Fix documentFormatter to handle failed promise\n" }, { "from": "human", "value": "import documentFormatter from 'src/logic/documentPackager/documentFormatter';\nimport base64OfSimplePdf from './reference/base64OfSimplePdf';\n\ndescribe('DocumentFormatter', () => {\n...
javascript
chosen
[ { "from": "system", "value": "Correct config props for `async-to-gen`\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// Packages\nconst asyncToGen = require('async-to-gen/register')\nconst updateNotifier = require('update-notifier')\nconst {red} = require('chalk')\nconst nodeVersion =...
javascript
chosen
[ { "from": "system", "value": "Use the cwd option to set the cwd\n\n`exec` and `execSync` allow to pass an options object in the second argument. We can use `cwd` to set the directory where to run the command." }, { "from": "human", "value": "'use strict'\n\nvar execSync = require('child_process'...
javascript
chosen
[ { "from": "system", "value": "Fix send email logging: return string instead of Mongo ObjectID\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('lodash'),\n nodemailer = require('nodemailer'),\n path = require('path'),\n config = require(path.resolve('./config/config')...
javascript
chosen
[ { "from": "system", "value": "Replace from ITEM not FILE\n" }, { "from": "human", "value": "//Get the required shit together\nconst config = require(\"./config.json\");\nconst Discord = require(\"discord.js\");\nconst client = new Discord.Client();\nconst MSS = require(\"./functions/\");\nconst ...
javascript
chosen
[ { "from": "system", "value": "Use named exports instead of default object export...\n\nSee http://www.2ality.com/2014/09/es6-modules-final.html, the sentence above section 4:\n\n\"You may be wondering – why do we need named exports if we could simply default-export objects (like CommonJS)? The answer is tha...
javascript
chosen
[ { "from": "system", "value": "Add language text to the \"to top\" and \"to bottom\" buttons\n\nAlso corrects the `moveDown` and `moveUp` language for multi-item selections.\n" }, { "from": "human", "value": "export default {\n availableFilterHeader: 'Filter available',\n availableHeader: '...
javascript
chosen
[ { "from": "system", "value": "Make sure a response is sent in any case\n" }, { "from": "human", "value": "var express = require('express');\n\nmodule.exports = function (sellerService) {\n var router = express.Router();\n\n router.get('/sellers', function(request, response) {\n resp...
javascript
chosen
[ { "from": "system", "value": "Add error message for ConfigurationFileNotExist\n" }, { "from": "human", "value": "const { LogUtils } = require('./shared/log.utils')\n\nmodule.exports = exports = fileService => () => {\n const modules = fileService.modules\n\n if (modules.length < 1) {\n LogU...
javascript
chosen
[ { "from": "system", "value": "Fix for older browsers which support querySelectorAll but not forEach on the NodeList.\n" }, { "from": "human", "value": "export default function () {\n return {\n init: function () {\n let autoresize = e => {\n e.target.style.height = '1px'\n ...
javascript
chosen
[ { "from": "system", "value": "Fix tests in Node < 6.0.\n" }, { "from": "human", "value": "let localValue = \"original\";\nexport { localValue as value };\nexport function run(code) {\n return eval(code);\n};\n" }, { "from": "gpt", "value": "var localValue = \"original\";\nexport { l...
javascript
chosen
[ { "from": "system", "value": "Set LED count to 575.\n" }, { "from": "human", "value": "var offgrid = require('./build/Debug/offgrid');\n\n// Selectively re-export and/or wrap offgrid methods.\nexports.blank = offgrid.blank;\nexports.red = offgrid.red;\nexports.green = offgrid.green;\nexports.blu...
javascript
chosen
[ { "from": "system", "value": "Remove check for action.type NEW_GAME\n" }, { "from": "human", "value": "export default function curryEmitToOpponent(socket) {\n return () => next => action => {\n if (!action.fromServer && action.type !== 'NEW_GAME') {\n console.log(action);\n if (act...
javascript
chosen
[ { "from": "system", "value": "Return null if not found\n" }, { "from": "human", "value": "\"use strict\";\n\nvar db = require(\"./db.json\"),\n strictFormats = [\n /^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$/,\n /^([0-9A-F]{2}[:-]){2}([0-9A-F]{2})$/,\n /^([0-9A-F]{4}[.]){2}([0-9...
javascript
chosen
[ { "from": "system", "value": "Tweak exports so Babel doesn't generate Object.defineProperty()\n\nFixes #227\n" }, { "from": "human", "value": "export { default as Provider } from './components/Provider'\nexport { default as connect } from './components/connect'\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Remove --disable-gpu flag when starting headless chrome\n\nThe `--disable-gpu` flag is [no longer\r\nnecessary](https://bugs.chromium.org/p/chromium/issues/detail?id=737678) and, at\r\nleast in some cases, is [causing\r\nissues](https://bugs.chromium.org/p/chromium/issues/detai...
javascript
chosen
[ { "from": "system", "value": "Fix missing opts in registerChannel\n" }, { "from": "human", "value": "// Setup\nconst HTTPServer = require('./lib/http_server')\n\n// Exports\nmodule.exports = Oacp\n\n// Oacp Constructor\nfunction Oacp (namespace) {\n var self = this\n self.models = {}\n self.c...
javascript
chosen