conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add new tests to assert that several elements of the modal load into the DOM.\n" }, { "from": "human", "value": "describe('Launchy', () => {\n\n beforeEach(() => {\n fixture.base = 'brochure';\n fixture.load('index.html');\n });\n\n afterEach(...
javascript
chosen
[ { "from": "system", "value": "Fix payload structure for text\n" }, { "from": "human", "value": "const request = require('request'),\n TOKEN = process.env.PAGE_ACCESS_TOKEN;\n\n\n/**\n * Send message to API.\n *\n * @param {object} json Data to send.\n * @param {function} callback Called a...
javascript
chosen
[ { "from": "system", "value": "Fix project list page sorting\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.ArrayController.extend({\n actions: {\n showCreateProject() {\n this.set('showCreateDialog', true);\n },\n startProject() {\n...
javascript
chosen
[ { "from": "system", "value": "Fix scenario expansion with onlyStrict flag\n" }, { "from": "human", "value": "var util = require('util');\n// Returns a function that takes a test and returns an iterator for copies\n// of test for each scenario required.\n// Currently only strictness is supported....
javascript
chosen
[ { "from": "system", "value": "Correct one comment: Node 0.10 -> 0.12\n" }, { "from": "human", "value": "/**\n * grunt-inline-images\n * https://github.com/EE/grunt-inline-images\n *\n * Author Michał Gołębiowski <michal.golebiowski@laboratorium.ee>\n * Licensed under the MIT license.\n */\n\n'us...
javascript
chosen
[ { "from": "system", "value": "Hide statements if there are no variables\n" }, { "from": "human", "value": "import React from 'react';\nimport {connect} from 'react-redux';\nimport VariableEditor from './variable-editor';\nimport StatementEditor from './statement-editor';\nimport ActionButton fro...
javascript
chosen
[ { "from": "system", "value": "Test: Increase timeout duration for \"scroll\"\n" }, { "from": "human", "value": "const { Tracker } = Sentinel;\n\n/* Constants */\nconst targetSize = 200;\nconst container = document.getElementById('container');\nconst bounds = document.getElementById('bounds');\n\...
javascript
chosen
[ { "from": "system", "value": "Update Prettier settings to fix deprecations\n" }, { "from": "human", "value": "/* eslint-env node */\n\nmodule.exports = {\n arrowParens: 'always',\n bracketSpacing: true,\n endOfLine: 'lf',\n htmlWhitespaceSensitivity: 'strict',\n insertPragma: false,\n jsxB...
javascript
chosen
[ { "from": "system", "value": "Fix the world's stupidest typo :D\n" }, { "from": "human", "value": "// Runs the webpack dev server and respawns \n// the server when pages,components, and tags\n// are created or destroyed.\n//\n// This is required because the webpack \n// static site generator plu...
javascript
chosen
[ { "from": "system", "value": "Adjust displaying Dribbble on template\n" }, { "from": "human", "value": "(function() {\n\n var DRIBBBLE_API_TOKEN = '2982b6f5520299137430aac46d2532cc3b00583ff8c39378471b5e5cf6117c61';\n\n $.get('https://api.dribbble.com/v1/users/tylerpearson/shots?access_toke...
javascript
chosen
[ { "from": "system", "value": "Fix a path of manifest file\n" }, { "from": "human", "value": "const path = require('path');\nconst webpack = require('webpack');\nconst ManifestPlugin = require('webpack-manifest-plugin');\n\nmodule.exports = {\n entry: './resources/assets/js/app.js',\n outpu...
javascript
chosen
[ { "from": "system", "value": "Remove instanbul preloader for dev\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path'),\n webpack = require('webpack');\n\nmodule.exports = {\n cache: true,\n entry: {\n main: './client/src/js/main.js'\n },\n output: {\n path: p...
javascript
chosen
[ { "from": "system", "value": "Update blueprints to support addons\n" }, { "from": "human", "value": "module.exports = {\n afterInstall: function () {\n return this.addPackagesToProject([\n {name: 'redux', target: '^3.4.0'},\n {name: 'redux-thunk', target: '^2.0.1'}\n ])\n ....
javascript
chosen
[ { "from": "system", "value": "Fix for esquire.untli() not working with linked list nodes\n" }, { "from": "human", "value": "'use strict'\n\n\n/*\n * Assumes exclusive ownership of each removal\n */\nfunction until(onRemove, removals) {\n onRemove.listenOnce(function() {\n removals.forE...
javascript
chosen
[ { "from": "system", "value": "Fix the empty strings doing some weirdness\n" }, { "from": "human", "value": "class CensorBuilder {\n constructor(values) {\n if (values && !Array.isArray(values)) throw new TypeError(\"The values parameter is not an array\");\n this.values = values...
javascript
chosen
[ { "from": "system", "value": "Add Promise for node 0.10 compatibility" }, { "from": "human", "value": "'use strict'\n\nvar purify = require('purify-css')\nvar extend = require('extend')\n\nexports.name = 'purifycss'\nexports.outputFormat = 'css'\n\nvar defaults = {\n content: ''\n}\n\nexports.r...
javascript
chosen
[ { "from": "system", "value": "Return JSON as string. yaml-loader should be chained with json-loader.\n" }, { "from": "human", "value": "var yaml = require('js-yaml');\n\nmodule.exports = function (source) {\n this.cacheable && this.cacheable();\n var res = yaml.safeLoad(source);\n return 'mod...
javascript
chosen
[ { "from": "system", "value": "Use utils.getOptions() to get loader options\n\nDrop manually reading/parsing the options passed through Loader API in favor for the getOptions method already provided by loader-utils, soon to be integrated into webpack5 itself.\r\n\r\nTested and working with both inline query ...
javascript
chosen
[ { "from": "system", "value": "Create bigger window by default.\n" }, { "from": "human", "value": "'use strict';\n\nconst electron = require('electron'); \nconst {app, BrowserWindow, ipcMain} = electron; \n\nconsole.log('Electron: \\n' + electron); // TODO: ???\n\nlet win;\n\nfunction cr...
javascript
chosen
[ { "from": "system", "value": "Allow to customize the address classeur listens to\n\nThe behavior of listen is a little queer, especially in regard of binding to an IPv6 socket. Some OS consider such socket to be listening both for IPv4 or IPv6, other OS have IPv6 sockets listening only to IPv6, and not to I...
javascript
chosen
[ { "from": "system", "value": "Add repo scope in GitHub OAuth request\n" }, { "from": "human", "value": "'use strict'\n\nvar express = require('express')\nconst querystring = require('querystring')\n\nconst config = require('../config/environment')\n\nvar router = express.Router()\n\nrouter.get('...
javascript
chosen
[ { "from": "system", "value": "Update security to support read-only access.\n\nAlso support a database admin (without server admin rights).\n" }, { "from": "human", "value": "function (newDoc, oldDoc, userCtx) {\n function forbidden(message) { \n throw({forbidden : message});\n };\n \n ...
javascript
chosen
[ { "from": "system", "value": "Remove MessageScript injection for ExecService\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst {\n FileService,\n ExecService,\n TermApplication,\n ListScriptsCommand,\n RunScriptCommand,\n ConfigService,\n OPTION_PATH_FILE_TOKEN,\n getOption...
javascript
chosen
[ { "from": "system", "value": "Fix tiny typo - will help for google searches!" }, { "from": "human", "value": "/*!\n{\n \"name\": \"Local Storage\",\n \"property\": \"localstorage\",\n \"caniuse\": \"namevalue-storage\",\n \"tags\": [\"storage\"],\n \"knownBugs\": [],\n \"notes\": [],\n \"...
javascript
chosen
[ { "from": "system", "value": "Send a message instead of posting error. Let us free up more document memory.\n" }, { "from": "human", "value": "// ==UserScript==\n// @include http://youtube.com/html5\n// @include http://www.youtube.com/html5\n// @include https://youtube.com/html5\n// @include htt...
javascript
chosen
[ { "from": "system", "value": "Increase timeout for node integration tests to 30seconds\n" }, { "from": "human", "value": "// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n'use strict';\n\nva...
javascript
chosen
[ { "from": "system", "value": "Adjust viewport for Office webviewer and mobile devices\n" }, { "from": "human", "value": "'use strict';\n\nimport \"es5-shim\";\nimport \"es6-shim\";\nimport * as ready from './ready';\nimport * as language from './language';\nimport * as expander from './expander'...
javascript
chosen
[ { "from": "system", "value": "Comment on creating MapView as it is required\n" }, { "from": "human", "value": "define(['backbone', 'core/views/MapView', 'hbs!core/templates/map-browse'], function(Backbone, MapView, mapBrowseTemplate) {\n\n var MapBrowseLayout = Backbone.Layout.extend({\n ...
javascript
chosen
[ { "from": "system", "value": "Tweak image widening JS to compensate for 1px border\n" }, { "from": "human", "value": "!function()\n{\n\tvar images = document.querySelectorAll('#post-body p > img');\n\tfor (var i = 0; i < images.length; i++) {\n\t\t// Only apply to wide images\n\t\tif ( images[i]...
javascript
chosen
[ { "from": "system", "value": "Allow for different execution modes between the sys and app domains.\n" }, { "from": "human", "value": "var AVM2 = (function () {\n\n function AVM2(builtinABC, mode) {\n if (!builtinABC) {\n throw new Error(\"Cannot initialize AVM2 without builtin.abc\");\n...
javascript
chosen
[ { "from": "system", "value": "Allow time checking on phone\n" }, { "from": "human", "value": "import Entity from '../Entity.js';\nimport printMessage from '../printMessage.js';\nimport action from '../action.js';\nimport time from '../time.js';\nimport state from '../state.js';\nimport { addItem...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect highlighting of post excerpts\n" }, { "from": "human", "value": "import Component from 'flarum/component';\nimport avatar from 'flarum/helpers/avatar';\nimport username from 'flarum/helpers/username';\nimport humanTime from 'flarum/helpers/human-time';...
javascript
chosen
[ { "from": "system", "value": "Add ability to run only a single test for debugging\n" }, { "from": "human", "value": "\n/////////////////////////\n// Helpers and globals //\n/////////////////////////\n\nconst expect = chai.expect;\n\nexport function run(lang, description, code, result) {\n it(...
javascript
chosen
[ { "from": "system", "value": "Allow test reporter to be specified with MOCHA_REPORTER\n" }, { "from": "human", "value": "import {createRunner} from 'atom-mocha-test-runner';\nimport chai from 'chai';\nimport chaiAsPromised from 'chai-as-promised';\n\nimport until from 'test-until';\n\nchai.use(c...
javascript
chosen
[ { "from": "system", "value": "MMB: Make fill travel document header fit on mobile\n" }, { "from": "human", "value": "// @flow strict\n\nimport * as React from 'react';\nimport { HeaderTitle } from '@kiwicom/mobile-navigation';\nimport { Translation } from '@kiwicom/mobile-localization';\n\nimpor...
javascript
chosen
[ { "from": "system", "value": "Fix undefined XHR state on reload success\n" }, { "from": "human", "value": "\nfunction adminHandleFieldType(e) {\n if (ADMIN_FIELD_TIMEOUT)\n clearTimeout(ADMIN_FIELD_TIMEOUT);\n\n ADMIN_FIELD_TIMEOUT = setTimeout(function () {\n $(e.target).tri...
javascript
chosen
[ { "from": "system", "value": "Apply Chrome Headless fix for Travis builds\n" }, { "from": "human", "value": "/* eslint-env node */\n\nmodule.exports = function (config) {\n config.set({\n basePath: 'public',\n browsers: ['ChromeHeadless'],\n files: ['scripts/modules.js', 'scripts/test....
javascript
chosen
[ { "from": "system", "value": "Add coveralls to karma plugins list.\n" }, { "from": "human", "value": "module.exports = function(config){\n config.set({\n\n basePath : './',\n\n files : [\n 'app/bower_components/angular/angular.min.js',\n 'app/bower_components/angular-ui-router/r...
javascript
chosen
[ { "from": "system", "value": "Fix order by doc comment.\n" }, { "from": "human", "value": "// DecentCMS (c) 2015 Bertrand Le Roy, under MIT. See LICENSE.txt for licensing details.\n'use strict';\n\n/**\n * Builds indexes from content items and map functions.\n */\nfunction Index(scope) {\n this...
javascript
chosen
[ { "from": "system", "value": "Remove that question mark :)\n" }, { "from": "human", "value": "'use strict';\n\nvar Backbone = require('backbone');\nvar $ = require('jquery');\nBackbone.$ = $;\n\nvar Router = require('./routes/router');\nvar router = new Router();\n\nBackbone.history.start(); // ...
javascript
chosen
[ { "from": "system", "value": "Update default preference for encrypted mail headers\n" }, { "from": "human", "value": "pref(\"extensions.torbirdy.protected\", false);\npref(\"extensions.torbirdy.proxy\", 0);\npref(\"extensions.torbirdy.first_run\", true);\npref(\"extensions.torbirdy.warn\", true)...
javascript
chosen
[ { "from": "system", "value": "Update badge to show number of sensors currently in breach\n" }, { "from": "human", "value": "import { generalStrings } from '../localization';\nimport { UIDatabase } from '../database';\n\nconst routeList = {\n customerRequisitions: 'ResponseRequisition',\n suppl...
javascript
chosen
[ { "from": "system", "value": "Remove required children to silence warning\n" }, { "from": "human", "value": "import React from 'react';\nimport NavbarContainer from './Navigation/NavbarContainer';\n\nconst App = ({ children }) =>\n <div>\n <NavbarContainer />\n { children }\n </div>;\n\n...
javascript
chosen
[ { "from": "system", "value": "Update formatting and add missing semicolon" }, { "from": "human", "value": "/*!\n * Chrome Extension that forces all Google products to use English.\n *\n * @license MIT\n * @author Tomas Varaneckas <tomas.varaneckas@gmail.com>\n */\nchrome.webRequest.onBeforeReque...
javascript
chosen
[ { "from": "system", "value": "Add auth header to challenge browsers\n" }, { "from": "human", "value": "Meteor.startup(function () {\n var stack;\n\n if (process.env.RESTRICT_ENV) {\n // Ensure credentials are provided\n if (!Meteor.settings.basicAuth) {\n throw new...
javascript
chosen
[ { "from": "system", "value": "Change the live users endpoint\n" }, { "from": "human", "value": "var isOpen = false;\n\nfunction checkStatus(text) {\n let num = parseInt(text, 10);\n if (num > 0) {\n chrome.browserAction.setTitle({ title: 'λspace is open' });\n chrome.browserAction.setBad...
javascript
chosen
[ { "from": "system", "value": "Set $HOME to /home to avoid colliding .npmrc\n\nfrom npm, projectConf is /.npmrc, let\ndefaultUserConfig==resolvedUserConfig==/home/.npmrc, not /.npmrc, hit\nthe first if() clause not else() body in:\n\n // If you're doing `npm --userconfig=~/foo.npmrc` then you'd expect\n ...
javascript
chosen
[ { "from": "system", "value": "Make benchmark actually useful by reducing problem set.\n\nBefore it would always blow the memory limit. While it'd be nice to fix\nthis, should have a functional benchmark in the meantime.\n" }, { "from": "human", "value": "var test = require('tape')\nvar fs = requ...
javascript
chosen
[ { "from": "system", "value": "Use a different convention for colocating reducers with selectors\n" }, { "from": "human", "value": "import { combineReducers } from 'redux'\nimport { default as cart, getQuantity, getAddedIds } from './cart'\nimport { default as products, getProduct } from './produ...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix some bugs in ActionSET and ActionINCR\n" }, { "from": "human", "value": "\n\n\"use strict\";\nvar Main = module.parent.exports;\n\nMain.ActionSet = function(Child, Request){\n Main.ValidateArguments(Main.ARGS_EVEN, Request.length);\n for(let Number = 0; ...
javascript
chosen
[ { "from": "system", "value": "Add preventDefault to login form to prevent new page on submission\n" }, { "from": "human", "value": "$('#loginModal').on('shown.bs.modal', function () {\n $('#loginInput').focus()\n $(this).find('input[type=\"submit\"]').on('submit', function(event) {\n event....
javascript
chosen
[ { "from": "system", "value": "Add a new env variable to the hardening list\n" }, { "from": "human", "value": "const path = require('path');\n\nconst electronIsDev = require('electron-is-dev');\n\nlet environment;\n\n// In production mode, NODE_ENV cannot be customized by the user\nif (electronIs...
javascript
chosen
[ { "from": "system", "value": "Set user to empty object after submiting user\n" }, { "from": "human", "value": "angular.module('voteApp').controller('createUserController',\n['$scope', 'userService', 'alertService', 'cardKeyService', function($scope, userService, alertService, cardKeyService) {\n...
javascript
chosen
[ { "from": "system", "value": "Simplify characters URL in the API module\n" }, { "from": "human", "value": "var request = require('superagent');\nvar Q = require('q');\n\n// Marvel public API key\nrequire('./api-key');\n\nvar baseUrl = 'http://gateway.marvel.com'\nvar charactersUrl = baseUrl+'/v1...
javascript
chosen
[ { "from": "system", "value": "Test on the Yo COmmand\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function yo(controller) {\n controller.hears('yo', ['direct_mention'], function(bot, message) {\n bot.reply(message, 'Yo!');\n });\n}\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Make tooltip's container the page's body\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Mixin.create({\n\n /**\n * Enables the tooltip functionality, based on component's `title` attribute\n * @method enableTooltip\n...
javascript
chosen
[ { "from": "system", "value": "Remove needless newline from cli so Chance output can be properly piped\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar Chance = require('../chance.js');\nvar argv = require('minimist')(process.argv.slice(2),{string:\"pool\"});\n\n// Check which genera...
javascript
chosen
[ { "from": "system", "value": "Put controller block in Meteor.startup()\n" }, { "from": "human", "value": "var daysPerPage = 5;\n\nvar coreSubscriptions = new SubsManager({\n // cache recent 50 subscriptions\n cacheLimit: 50,\n // expire any subscription after 30 minutes\n expireIn: 30\n});\n...
javascript
chosen
[ { "from": "system", "value": "Work with nodes instead of elements. Simplify checks.\n" }, { "from": "human", "value": "import init from './init';\nimport createFromHtml from '../util/create-from-html';\n\nconst DocumentFragmentPrototype = DocumentFragment.prototype;\nconst slice = Array.prototyp...
javascript
chosen
[ { "from": "system", "value": "Build without env vars in repo settings\n" }, { "from": "human", "value": "'use strict';\n'format es6';\n\nimport './module/index';\nimport './directives/index';\n\nimport moduleName from './name';\n\nexport function bootstrap() {\n\n //Bootstrap the ng application...
javascript
chosen
[ { "from": "system", "value": "Fix inverted comma (and opinionated newline)\n\nfun question: do back ticks actually work?\r\nnew issue: add style guide (or re-use someones...)" }, { "from": "human", "value": "const path=require(\"path\");\nconst fs=require(\"fs\");\n\nvar siteconfig = {}\n\nfunct...
javascript
chosen
[ { "from": "system", "value": "Verify waitFor does not reschedule the check after timing out\n" }, { "from": "human", "value": "const waitFor = require('./waitFor')\n\ndescribe('Utils > waitFor', () => {\n it('waits for the condition', async () => {\n let conditionValid = false\n\n setTime...
javascript
chosen
[ { "from": "system", "value": "Add src in path for dev javascript\n" }, { "from": "human", "value": "module.exports = {\n all: {\n files: [\n { expand: true, src: ['config.json'], dest: 'dist' },\n { expand: true, src: ['javascript.json'], dest: 'dist' },\n ...
javascript
chosen
[ { "from": "system", "value": "Remove call to removed JSCS task\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\n\ngulp.task('default', [\n 'lint',\n 'jscs',\n 'test',\n 'doc-build'\n]);\n" }, { "from": "gpt", "value": "'use strict';\n\nvar ...
javascript
chosen
[ { "from": "system", "value": "[SYN5-201] Fix stripe icon in billing section\n" }, { "from": "human", "value": "import React from 'react';\nimport _ from 'lodash';\nimport PaymentIcon from '../PaymentIcon';\n\nconst PaymentIcons = ({ number, cardNiceType }) => {\n const styles = {\n paymentIc...
javascript
chosen
[ { "from": "system", "value": "Add update user income to server\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(data) {\n return {\n getUserAccountsDetails(req, res) {\n let currentUserId = req.user.id;\n\n return data.getAccountsByUse...
javascript
chosen
[ { "from": "system", "value": "Use latest v1 client by default\n" }, { "from": "human", "value": "'use strict';\n\nconst events = require('events');\n\nconst utils = require('./utils');\nconst Listener = require('./listener');\n\nclass Server extends events.EventEmitter {\n constructor(user_opti...
javascript
chosen
[ { "from": "system", "value": "Disable premium support for cost mode (SAAS-751)\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('ncsaas')\n .constant('MODE', {\n modeName: 'modeCostTracking',\n toBeFeatures: [\n 'resources',\n 'payment',\n 'eventlog',\n ...
javascript
chosen
[ { "from": "system", "value": "Use string template in place of concatenation (STRIPES-100)\n" }, { "from": "human", "value": "import React from 'react';\nimport Route from 'react-router-dom/Route';\nimport { connectFor } from '@folio/stripes-connect';\nimport { modules } from 'stripes-loader'; //...
javascript
chosen
[ { "from": "system", "value": "Replace Ember bindings with aliases\n" }, { "from": "human", "value": "define([\n\t\"Ember\",\n\t\"text!templates/components/infinitescroll.html.hbs\"\n], function( Ember, template ) {\n\n\tvar get = Ember.get;\n\tvar or = Ember.computed.or;\n\n\treturn Ember.Compon...
javascript
chosen
[ { "from": "system", "value": "Use config helper for loading config\n\n" }, { "from": "human", "value": "/* justcord-3\n * A JC3MP-Discord bridge.\n *\n * Author: MD678685\n * Licensed under the MIT license.\n *\n * Uses Eris, a Discord library licensed under the MIT license.\n * Requires the cha...
javascript
chosen
[ { "from": "system", "value": "Allow app to run standalone with internal python webserver\n" }, { "from": "human", "value": "var app = require('app'); // Module to control application life.\nvar BrowserWindow = require('browser-window'); // Module to create native browser window.\n\n// Report c...
javascript
chosen
[ { "from": "system", "value": "Add links to harvester dump sites\n" }, { "from": "human", "value": "module.exports = function (creep) {\n if(creep.memory.currentTarget) {\n creep.memory.currentTarget = Game.getObjectById(creep.memory.currentTarget.id);\n }\n\n // Aquire target\n ...
javascript
chosen
[ { "from": "system", "value": "Make bundle the default gulp task.\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n vulcanize = require('gulp-vulcanize');\n\ngulp.task('default', function () {\n console.log('it works!');\n});\n\ngulp.task('bundle', function () {\n return g...
javascript
chosen
[ { "from": "system", "value": "Handle download errors since testing environment doesn't have fetch\n" }, { "from": "human", "value": "const FluentDOM = require('@fluent/dom');\nconst Fluent = require('@fluent/bundle');\n\nconst availableLanguages = {\n 'en-US': ['/fluent/en-US/main.ftl'],\n 'es...
javascript
chosen
[ { "from": "system", "value": "Change restrict to a Element: <routeStrips></routeScripts>. Change replaceWith for de new DOM\n" }, { "from": "human", "value": "/**\n * Created by Victor Avendano on 1/10/15.\n * avenda@gmail.com\n */\n 'use strict';\n(function(){\n\n var mod = angular.module('r...
javascript
chosen
[ { "from": "system", "value": "Write grid and level constructors\n" }, { "from": "human", "value": "var SandwichTime = (function () {\n\n function Slab(width, height, upperLeft, paint) {\n var width, height, upperLeft, paint;\n this.width = width;\n this.height = height;\n this.upper...
javascript
chosen
[ { "from": "system", "value": "Check if the property exists\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Load configuration file\n */\n\nvar merchant_arg = process.argv.indexOf('-merchantKey');\nvar google_arg = process.argv.indexOf('-googleAnalyticsID');\nvar bugsense_arg = proces...
javascript
chosen
[ { "from": "system", "value": "Fix queue screen AngularJS module loading\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/j...
javascript
chosen
[ { "from": "human", "value": "Add constants for user actions\n" }, { "from": "gpt", "value": "export const AUTH_USER = 'AUTH_USER';\nexport const UNAUTH_USER = 'UNAUTH_USER';\nexport const AUTH_ERROR = 'AUTH_ERROR';\nexport const SET_USER_DATA = 'SET_USER_DATA';" } ]
javascript
chosen
[ { "from": "system", "value": "Remove semi-colon for sails lift to run correctly\n" }, { "from": "human", "value": "/**\n * Default model configuration\n * (sails.config.models)\n *\n * Unless you override them, the following properties will be included\n * in each of your models.\n *\n * For mor...
javascript
chosen
[ { "from": "system", "value": "Update to table names\n* all table names are singular now\n* fixes to seed and migrations files that caused errors\n" }, { "from": "human", "value": "exports.seed = function(knex, Promise) {\n return Promise.all([\n knex('class_user').insert({\n user_id: kn...
javascript
chosen
[ { "from": "system", "value": "Update to core start button button colour\n" }, { "from": "human", "value": "/*\n Copyright 2016 Paul Bevis\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a co...
javascript
chosen
[ { "from": "system", "value": "Convert Sample Proportino class to ES6\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Internal dependencies\n */\nlet NormalDistribution = require( './normal-distribution' );\n\nfunction SampleProportion( participants, conversions ) {\n\tlet mean = conv...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix SSR when importing svg\n\nBabel-register & Node doesn’t know how to handle `.svg` files\n" }, { "from": "human", "value": "import path from 'path';\nimport Express from 'express';\nimport compression from 'compression';\nimport bodyParser from 'body-parser...
javascript
chosen
[ { "from": "system", "value": "Change serve port to 80\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\n\napp.use(express.static('public'));\n\napp.listen(3000, function () {\n console.log('Server started');\n});" }, { "from": "gpt", "value"...
javascript
chosen
[ { "from": "system", "value": "Increase keepalive to 24 hrs.\n" }, { "from": "human", "value": "'use strict';\n\nlet mqtt = require('mqtt');\nlet mqttClient;\n\nmodule.exports = {\n\tconnect: function (options, callback) {\n\t\tmqttClient = mqtt.connect(options.url, {\n\t\t\tkeepalive: 300,\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Increase default decimal precision in console\n\n" }, { "from": "human", "value": "$(function() {\n /* global Handlebars, panthrLang, $ */\n var webConsole, outputTemplate;\n\n webConsole = panthrLang.Console.web();\n\n outputTemplate = Handlebars.compile($(...
javascript
chosen
[ { "from": "system", "value": "Fix server require statement paths\n" }, { "from": "human", "value": "var userController = require('../users/userController.js');\nvar listingController = require('../listings/listingController.js');\n\nmodule.exports = (app, db) => {\n\n // Routes for all users\n ...
javascript
chosen
[ { "from": "system", "value": "Fix de la page de démarrage" }, { "from": "human", "value": "\r\n\r\nangular.module('ModuleGlobal')\r\n\t.controller('TopController', ['LoginService', '$location', function(LoginService, $location) {\r\n\t\tvar ctrl = this;\r\n\t\t\r\n\t\t\r\n\t\tctrl.error = {};\r\...
javascript
chosen
[ { "from": "system", "value": "Fix stupid circular dependency bug - sorry\n" }, { "from": "human", "value": "'use strict';\nvar path = require('path');\nvar yeoman = require('../..');\n\n/**\n * Receives a `namespace`, and an Hash of `options` to invoke a given\n * generator. The usual list of ar...
javascript
chosen
[ { "from": "system", "value": "Revert \"[ncl] fix Font examples\"\n\nThis reverts commit 7af688afaac71c74de68b5ab42aed38f0196fd0d.\n\nfbshipit-source-id: b91e873\n" }, { "from": "human", "value": "import React from 'react';\nimport { Platform, ScrollView, Text, View } from 'react-native';\nimport...
javascript
chosen
[ { "from": "system", "value": "Rewrite logic as per latest syntax -@locks review\n" }, { "from": "human", "value": "import AnchorComponent from 'ember-anchor/components/ember-anchor';\nimport config from 'ember-api-docs/config/environment';\nimport getOffset from 'ember-api-docs/utils/get-offset'...
javascript
chosen
[ { "from": "system", "value": "Add file dimensions when we read in images\n" }, { "from": "human", "value": "import { Meteor } from 'meteor/meteor';\nimport { ImageFiles } from '/imports/api/imageFiles/imageFiles';\nimport fs from 'fs';\nimport _ from 'lodash';\nimport sizeOf from 'image-size';\n...
javascript
chosen
[ { "from": "system", "value": "Normalize newlines in comparison strings to ensure proper comparison\n" }, { "from": "human", "value": "var jsdiff = require('diff');\n\n// Taken from diff.js\nfunction removeEmpty(array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n if...
javascript
chosen
[ { "from": "system", "value": "Remove logging in overview data parser\n" }, { "from": "human", "value": "'use strict';\n\nconst D3 = require('D3');\n\nexports.parser = function(rows) {\n\n var overviewResponse = rows;\n\n var overview = D3.nest()\n .key(function(d) {\n ret...
javascript
chosen
[ { "from": "system", "value": "Fix not creating message objects\n" }, { "from": "human", "value": "/* global client */\n\nvar messageArea = document.getElementById('messages');\n\nclient.haveMessage = function haveMessage(message){\n var messageCard = document.createElement('div');\n messageCar...
javascript
chosen
[ { "from": "system", "value": "Configure CardView based on `owner`\n" }, { "from": "human", "value": "(function() {\n var CardView = Backbone.View.extend({\n tagName: 'li',\n className: 'dc-card',\n\n template: (function() {\n var source = $('#card-view-template').html();\n va...
javascript
chosen
[ { "from": "system", "value": "Add a warning message for Edge\n" }, { "from": "human", "value": "import _ from 'underscore';\nimport UAParser from 'ua-parser-js';\n\nimport View from '../view';\n\nimport BrowserAlertTemplate from './browserAlert.pug';\nimport './browserAlert.styl';\n\nconst Brows...
javascript
chosen
[ { "from": "system", "value": "Stop the context menu from injecting multiple times.\n\nOtherwise this causes an infinite loop on KitKat, since loading more\nscripts triggers onPageFinished to fire again, which triggers injection\nof the context menu again, etc.\n" }, { "from": "human", "value": "...
javascript
chosen