conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Clean up the DOM between tests\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './app.setup.js';\nimport $ from 'jquery';\n\n\nexport default function setup() {\n const component = ReactDOM.render(<A...
javascript
chosen
[ { "from": "system", "value": "Undo functionality. In case you typed the wrong number...\n" }, { "from": "human", "value": "import React from 'react';\nimport styles from \"../css/App.css\";\n\nexport class PlayerScoreComponent extends React.Component {\n\n /**\n * Constructor\n * @par...
javascript
chosen
[ { "from": "system", "value": "Fix return value for undefined parameter\n" }, { "from": "human", "value": "/**\n * Checks if \"value\" is the language type of \"Object\".\n * @param {*} value The value to check.\n * @returns {boolean} Returns true if \"value\" is an object, else false.\n */\nfunc...
javascript
chosen
[ { "from": "system", "value": "Fix broken import in migraiton script\n" }, { "from": "human", "value": "import { registerMigration } from './migrationUtils';\nimport { forEachDocumentBatchInCollection } from '../queryUtil.js';\nimport { LWEvents } from '../../lib/collections/lwevents'\nimport { R...
javascript
chosen
[ { "from": "system", "value": "Change name for default node.js runner\n" }, { "from": "human", "value": "var path = require(\"path\");\n\nmodule.exports = {\n id: \"nodejs\",\n name: \"Node.JS\",\n\n detector: path.resolve(__dirname, \"detector.sh\"),\n runner: [\n {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bad refactor on PersistenceProvider\n" }, { "from": "human", "value": "const NotificationBuilder = require('./notification/notification-builder');\n\nclass PersistenceProvider {\n constructor(bridge) {\n this.toSave = [];\n this.bridge = bridge;\n this...
javascript
chosen
[ { "from": "system", "value": "Make unique attribute required, to please sails-disk\n" }, { "from": "human", "value": "/**\n * Dependencies\n */\n\nvar Waterline = require('waterline');\n\nmodule.exports = Waterline.Collection.extend({\n\n identity: 'unique',\n tableName: 'uniqueTable',\n conn...
javascript
chosen
[ { "from": "system", "value": "Update mocha before test setup to use mongoose.\n" }, { "from": "human", "value": "process.env.MONGOHQ_URL = 'mongodb://localhost:27017/jsonresume-tests';\nvar mongoUrl = process.env.MONGOHQ_URL;\nvar mongo = require('../db');\n\n// This bit of code runs before ANY ...
javascript
chosen
[ { "from": "system", "value": "Use `iferr` to simplify tests\n" }, { "from": "human", "value": "'use strict';\n\nvar test = require('tape');\nvar nets = require('nets');\nvar requestGlobalDefaults = require('../');\n\ntest('defaulting/overriding a custom querystring', function (t) {\n t.plan(2);...
javascript
chosen
[ { "from": "system", "value": "Read test folder to get files\n" }, { "from": "human", "value": "\"use strict\";\n\nlet qUnit = require(\"qunit\");\nqUnit.setup({\n log: {\n errors: true,\n tests: true,\n globalSummary: true,\n testing: true\n },\n maxBlockDura...
javascript
chosen
[ { "from": "system", "value": "Make search for classifying tasks case insensitive.\n" }, { "from": "human", "value": "const {TASKS_TYPES} = require('./conf/consts')\n\n\nconst getTaskType = (taskName) =>{\n for (let task_type of TASKS_TYPES) {\n for (let keyword of task_type.keywords) {\n ...
javascript
chosen
[ { "from": "system", "value": "[examples] Use `action` provided by storybook\n" }, { "from": "human", "value": "import React from 'react';\n\nimport Button from 'src/Button';\nimport FlexRow from '../FlexRow';\n\nfunction handleButtonClick() {\n // eslint-disable-next-line no-console\n cons...
javascript
chosen
[ { "from": "system", "value": "Refactor tests with `runTests()` helper\n\n`runTests()` will create and run tests given parser and mock data.\n\nSince the helper creates an `it()` block for each mock object key,\nthis allows the tests to be DRY and clear. Also, debugging will be\neasier since the type of pars...
javascript
chosen
[ { "from": "system", "value": "Change expiration to 30 days\n" }, { "from": "human", "value": "{\n\n \"host\": \"localhost\",\n \"port\": 7777,\n\n \"keyLength\": 6,\n\n \"maxLength\": 400000,\n\n \"staticMaxAge\": 86400,\n\n \"recompressStaticAssets\": true,\n\n \"logging\": [\n {\n ...
javascript
chosen
[ { "from": "system", "value": "FIX Use localhost as default URL\n" }, { "from": "human", "value": "var config = {};\n\nconfig.thinkingThings = {\n logLevel: 'ERROR',\n port: 8000,\n root: '/thinkingthings',\n sleepTime: 300\n};\n\nconfig.ngsi = {\n logLevel: 'ERROR',\n defaultTy...
javascript
chosen
[ { "from": "system", "value": "Use src Microcosm in simple svg example\n" }, { "from": "human", "value": "import Circle from './stores/Circle'\nimport Microcosm from '../../../dist/Microcosm'\n\nexport default class SimpleSVG extends Microcosm {\n\n constructor() {\n super()\n\n this.ad...
javascript
chosen
[ { "from": "system", "value": "Update German, French, Spanish, and Portugese-Brasil Translations\n\nAll pulled by changing system language on PS4 and accessing Destiny in a different language.\n" }, { "from": "human", "value": "(function() {\n \"use strict\";\n\n // See https://angular-translat...
javascript
chosen
[ { "from": "system", "value": "Enable backup restore and destroy actions.\n" }, { "from": "human", "value": "import openstackBackupsService from './openstack-backups-service';\nimport openstackBackupsList from './openstack-backups-list';\nimport backupSnapshotsList from './backup-snapshots-list';...
javascript
chosen
[ { "from": "system", "value": "Set the focus to the comment box after selecting a task\n" }, { "from": "human", "value": "/**\n * @module timed\n * @submodule timed-components\n * @public\n */\nimport Component from 'ember-component'\nimport service from 'ember-service/inject'\n\nconst ENTER_CHAR...
javascript
chosen
[ { "from": "system", "value": "Refactor SignUp directive to use UsersService.\n" }, { "from": "human", "value": "{\n class UsersService {\n create () {\n console.log('CREATED!');\n console.log(user);\n }\n }\n\n angular.module('meganote.users')\n .service('UsersService', Use...
javascript
chosen
[ { "from": "system", "value": "[e2e] Clean up the github banner tests a little bit\n" }, { "from": "human", "value": "'use strict';\n\ndescribe('github banner', function() {\n beforeEach(function() {\n browser.get('http://localhost:3000/');\n });\n\n it('should load', function() {\n var ...
javascript
chosen
[ { "from": "system", "value": "Use node instead of element array for prop validation\n" }, { "from": "human", "value": "import React from 'react';\n\nfunction getViewportData() {\n let viewport = 'xs';\n if (window.innerWidth >= 544) viewport = 'sm';\n if (window.innerWidth >= 768) viewport = ...
javascript
chosen
[ { "from": "system", "value": "issue(1946): Fix to use unicode char instead of innerHTML\n" }, { "from": "human", "value": "// @flow\nconst React = require(\"react\");\nconst { DOM: dom } = React;\n\nconst ReactDOM = require(\"react-dom\");\n\nrequire(\"./ConditionalPanel.css\");\n\nfunction rend...
javascript
chosen
[ { "from": "system", "value": "Use NavHelper to ensure that backspace when nothing is selected will not go back in history\n" }, { "from": "human", "value": "import app from 'ampersand-app'\nimport React, {Component, PropTypes} from 'react'\nimport localLinks from 'local-links'\nimport * as modal...
javascript
chosen
[ { "from": "system", "value": "Make port configurable through env\n" }, { "from": "human", "value": "import express from 'express';\nimport path from 'path';\nimport lodashExpress from 'lodash-express';\nimport fs from 'fs';\n\nconst app = express();\nconst staticPath = path.join(__dirname, '../b...
javascript
chosen
[ { "from": "system", "value": "Use browserHistory instead of hashHistory\n" }, { "from": "human", "value": "import React from 'react'\nimport { Link, hashHistory } from 'react-router'\n\nexport default function App({ children }) {\n return (\n <div>\n <header>\n Links:\n {'...
javascript
chosen
[ { "from": "system", "value": "Set the view engine, set the welcome page\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\n\napp.set('port', process.env.PORT || 3000);\n\n//custom 404 page.\napp.use(function (req, res){\n res.type('text/plain');\n r...
javascript
chosen
[ { "from": "system", "value": "Make it a web service\n" }, { "from": "human", "value": "\"use strict\"\n\nvar namespace = 'azure-service-bus-nodejs',\n\taccessKey = '[Access key for this namespace]',\n\tazure = require('azure');\n\nvar client = azure.createServiceBusService(namespace, accessKey);...
javascript
chosen
[ { "from": "system", "value": "Use port and remoteUrl options\n" }, { "from": "human", "value": "var cuecard = require('cuecard');\n\ncuecard.configure({\n\ttitle: 'Getting Closure',\n\thtml: __dirname + '/slides.html',\n\tcss: __dirname + '/slides.css'\n});\n\ncuecard.server.listen(3000);" }, ...
javascript
chosen
[ { "from": "system", "value": "Configure path to index.html manually\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('Example app listening on port 3000!');\n});\n" ...
javascript
chosen
[ { "from": "system", "value": "Use sql.query instead of sql.open/conn.query\n\nThis is a bit of a shortcut, but the readability of the code is\ngreatly improved.\n" }, { "from": "human", "value": "var sql = require('msnodesql');\n// Change the connectionString. Example\n// \"Driver={SQL Server Na...
javascript
chosen
[ { "from": "system", "value": "Add helper function for joining rooms\n" }, { "from": "human", "value": "var socketio = require('socket.io');\nvar io;\nvar guestNumber = 1;\nvar nickNames = {};\nvar namesUsed = [];\nvar currentRoom = {};\n\nexports.listen = function(server) {\n io = socketio.list...
javascript
chosen
[ { "from": "system", "value": "Fix path to terminal from ROOTbook\n" }, { "from": "human", "value": "/* JupyROOT JS */\n\n// Terminal button\n$(document).ready(function() {\n $('div#header-container').append(\"<a href='terminals/1' class='btn btn-default btn-sm navbar-btn pull-right' style='ma...
javascript
chosen
[ { "from": "system", "value": "Update dummy app to use included resources.\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Controller.extend({\n fetchedNode: null,\n fetchedChild: null,\n actions: {\n fetchNodePreprintsEmbedded() {\n ...
javascript
chosen
[ { "from": "system", "value": "Use switch statement for Draft.px()\n" }, { "from": "human", "value": "var Draft = {\n mixins: {},\n\n // TODO:50 test safety checks for Draft.px()\n px: function(val) {\n var num = parseFloat(val, 10);\n var units = testUnits(val);\n\n // Remain unchang...
javascript
chosen
[ { "from": "system", "value": "Clear inputbox after click Confirm button\n" }, { "from": "human", "value": "import {Block} from '../../dist/cyclow'\nimport Confirm from './confirm'\n\nconst Field = () => Block({\n outputs: ['submission'],\n components: {confirm: Confirm()},\n on: {\n init: ...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary default of state.required to false\n" }, { "from": "human", "value": "import syntax from '@babel/plugin-syntax-jsx'\nimport pureAnnotation from './visitors/pure'\nimport minify from './visitors/minify'\nimport displayNameAndId from './visitors/dis...
javascript
chosen
[ { "from": "system", "value": "Remove old api method stubs that won't be happening anymore\n" }, { "from": "human", "value": "var creep = exports;\n\nvar _ = require('lodash');\nvar config = require('./config');\n\nrequire('./filters/js');\nrequire('./filters/coffee');\nrequire('./parsers/matter'...
javascript
chosen
[ { "from": "system", "value": "Use second subdomain as feature name\n" }, { "from": "human", "value": "// External dependencies\nconst os = require('os');\nconst Koa = require('koa');\nconst send = require('koa-send');\nconst logger = require('koa-logger');\nconst assert = require('assert');\ncon...
javascript
chosen
[ { "from": "system", "value": "Handle error case in cli\n" }, { "from": "human", "value": "'use strict'\n\nimport md5 from './md5'\nimport fs from 'fs'\nconst filename = process.argv[2]\n\nmd5(fs.ReadStream(filename)).then((sum) => {\n console.log(`MD5 sum of \"${filename}\" is ${sum}`)\n})\n" ...
javascript
chosen
[ { "from": "system", "value": "Correct warning print to only happen if the socket is not available.\n" }, { "from": "human", "value": "import { consola } from './utils';\n\nimport initWebSocket from './initWebSocket';\nimport closeWebSocket from './closeWebSocket';\nimport * as types from './type...
javascript
chosen
[ { "from": "system", "value": "Check window before referencing it to prevent issues when running in Node\n" }, { "from": "human", "value": "import { createStore, compose, applyMiddleware } from 'redux';\nimport generateCards from './middlewares/generateCards.js';\nimport calculateScore from './mi...
javascript
chosen
[ { "from": "system", "value": "Test failure modes as well\n" }, { "from": "human", "value": "var fs = require('fs')\nvar test = require('tap').test\nvar walkSync = require('../')\n\ntest('walkSync', function (t) {\n t.deepEqual(walkSync('fixtures'), [\n 'dir/',\n 'dir/bar.txt',\n 'dir/s...
javascript
chosen
[ { "from": "system", "value": "Change execution order within test\n" }, { "from": "human", "value": "module.exports = {\n 'GitHub example testing': function (test) {\n test\n .open('https://github.com')\n .waitForElement('input[name=q]')\n .assert.title().is('GitHub · Build software be...
javascript
chosen
[ { "from": "system", "value": "refactor: Add prompts to array. Split up copy code into function\n" }, { "from": "human", "value": "var chalk = require('chalk');\nvar inquirer = require('inquirer');\nvar fs = require('fs-extra');\nvar path = require('path');\n\nmodule.exports = function(libDir) {\...
javascript
chosen
[ { "from": "system", "value": "Change JiraDataService to JiraDataSource in @dl-tools/import-people-from-jira\n" }, { "from": "human", "value": "define([\n '@shared/people'\n], function() {\n\n function createPersonDataFromJiraUser(jiraUser) {\n return {\n full_name: jiraUs...
javascript
chosen
[ { "from": "system", "value": "Add safety check for `console.log` on app startup.\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n // Initialise RequireJS module loader\n require.config({\n urlArgs: 'm=' + (new Date()).getTime(),\n baseUrl: '/app/',\n ...
javascript
chosen
[ { "from": "system", "value": "Add email address to location\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\nvar LocationSchema = new Schema({\n\tname: String,\n\tcity: String,\n\taddress: String,\n\timg: String,\n\tdescription:...
javascript
chosen
[ { "from": "system", "value": "Add deleteAll() as its own method\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(app) {\n\tapp.factory('httpService', function($http, $location) {\n\n\t\t// Generic helper function\n\t\tvar http = function(method, params) {\n\n\t\t\tpa...
javascript
chosen
[ { "from": "system", "value": "Put serverVariables stuff into iliosConfig\n\nOur config service is a better home for this information since we can\ncontrol what is returned. This prevents trailing slashes from\naccidentally making it in as well as handles empty strings better.\n" }, { "from": "human"...
javascript
chosen
[ { "from": "system", "value": "patron-client: Update syntax for creating the store, to harmonize with more recent examples\n" }, { "from": "human", "value": "import { browserHistory } from 'react-router'\nimport thunkMiddleware from 'redux-thunk'\nimport { createStore, applyMiddleware, compose } ...
javascript
chosen
[ { "from": "system", "value": "Add error handling to random move.\n" }, { "from": "human", "value": "var otherPlayers = require('../../../src/command_util.js').CommandUtil.otherPlayerInRoom;\n\nexports.listeners = {\n playerEnter: chooseRandomExit\n};\n\n//FIXME: Occasionally causes crash becaus...
javascript
chosen
[ { "from": "system", "value": "Fix for overseas first - to skip the issued question\n" }, { "from": "human", "value": "module.exports = {\n '/':{\n fields: ['age-day', 'age-year', 'age-month'],\n backLink: '../filter-common/what-do-you-want-to-do-overseas',\n next: '/issued'\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug with sessions table: no createdAt needed\n" }, { "from": "human", "value": "import Sequelize from 'sequelize';\nimport db from '../db';\n\nconst Session = db.define(\n 'Session',\n {\n id: {\n type: Sequelize.STRING(255),\n primaryKey: true,\n...
javascript
chosen
[ { "from": "system", "value": "Add stacktrace to error event\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa').factory('GlobalErrorHandler', [\n '$window',\n '$analytics',\n function($window, $analytics) {\n var oldErrorHandler = $window.onerror;\n $window....
javascript
chosen
[ { "from": "system", "value": "Use array spread operator in replace method\n" }, { "from": "human", "value": "import Em from 'ember';\nimport { ArrayController } from 'ember-legacy-controllers';\nvar get = Em.get;\nvar copy = Em.copy;\n\nvar ArrayPauser = ArrayController.extend({\n\tisPaused: fal...
javascript
chosen
[ { "from": "system", "value": "Fix in CPU requirement naming" }, { "from": "human", "value": "/**\n * Author: Milica Kadic\n * Date: 2/3/15\n * Time: 3:03 PM\n */\n'use strict';\n\nangular.module('registryApp.cliche')\n .constant('rawJob', {\n inputs: {},\n allocatedResources: {\...
javascript
chosen
[ { "from": "system", "value": "Remove need to change status bar\n" }, { "from": "human", "value": "import {\n AppRegistry,\n StatusBar\n} from 'react-native';\n\nimport Garage from './app/components/garage';\n\nStatusBar.setBarStyle('light-content', true);\nAppRegistry.registerComponent('Garage...
javascript
chosen
[ { "from": "system", "value": "Add a purple circle that gets bigger when clicked\n" }, { "from": "human", "value": "/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n */\n'use strict';\n\nimport Cycle from '@cycle/core';\nimport {makeReactNativeDriver} from '@cycle/rea...
javascript
chosen
[ { "from": "system", "value": "Add isAuthenticated value in root scope\n" }, { "from": "human", "value": "angular.module('mewpipe')\n .run(run);\n\nrun.$inject = ['$rootScope','$location','$auth'];\n\nfunction run($rootScope, $location, $auth){\n\n\t$rootScope.$on('$routeChangeStart', funct...
javascript
chosen
[ { "from": "system", "value": "Hide Webpack terminal spam on test errors" }, { "from": "human", "value": "const webpackConfig = require('../webpack/webpack.test.babel');\nconst path = require('path');\n\nmodule.exports = (config) => {\n config.set({\n frameworks: ['mocha'],\n reporters: ['...
javascript
chosen
[ { "from": "system", "value": "Remove undefined class name from show-linked-media" }, { "from": "human", "value": "(function() {\n\tconst linkedImages = document.querySelectorAll('a[href$=\".gif\"], a[href$=\".jpeg\"], a[href$=\".jpg\"], a[href$=\".png\"], a[href$=\".apng\"], a[href$=\".webp\"]')...
javascript
chosen
[ { "from": "system", "value": "Fix : Drawer menu items are not centered\n" }, { "from": "human", "value": "import React, { Component, PropTypes, View, Text, TouchableHighlight } from 'react-native';\nimport Icon from '../Icon';\nimport { TYPO } from '../config';\n\nexport default class Item exten...
javascript
chosen
[ { "from": "system", "value": "Use the local LOGO image file\n" }, { "from": "human", "value": "import React from 'react'\n\nconst logo = {\n fontFamily: `'Gill Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif`,\n fontSiz...
javascript
chosen
[ { "from": "system", "value": "Set publicPath for production builds\n" }, { "from": "human", "value": "module.exports = {\n pluginOptions: {\n i18n: {\n locale: 'en',\n fallbackLocale: 'en',\n localeDir: 'locales',\n enableInSFC: false\n }\n }\n}\n" }, { "from"...
javascript
chosen
[ { "from": "system", "value": "Return a new object from reducer\n" }, { "from": "human", "value": "const requestQueue = (state = [], action) => {\n switch (action.type) {\n case 'SET_REQUEST_QUEUE':\n console.warn(`REQUEST QUEUE ${action.payload}`); // eslint-disable-line\n ...
javascript
chosen
[ { "from": "system", "value": "Remove zDepth from Paper element\n" }, { "from": "human", "value": "import React from 'react'\nimport AppBar from 'material-ui/lib/app-bar'\nimport Paper from 'material-ui/lib/paper'\n\nimport Theme from '../theme'\n\nclass App extends React.Component {\n\n getChil...
javascript
chosen
[ { "from": "system", "value": "Update build script for Rollup change\n" }, { "from": "human", "value": "import * as p from 'path';\nimport * as fs from 'fs';\nimport {rollup} from 'rollup';\nimport babel from 'rollup-plugin-babel';\n\nconst copyright = (\n`/*\n * Copyright ${new Date().getFullYea...
javascript
chosen
[ { "from": "system", "value": "Add sendTap function to js\n" }, { "from": "human", "value": "function SoftKeyboard() {}\n\nSoftKeyboard.prototype.show = function(win, fail) {\n return cordova.exec(\n function (args) { if(win) { win(args); } },\n function (args) { if(fail) { fail(args);...
javascript
chosen
[ { "from": "system", "value": "Add docs to js code\n" }, { "from": "human", "value": "/**\n *\n * @type {{}}\n */\nvar Router = {};\n\n\n/**\n *\n * @type {{}}\n */\nvar Model = {};\n\n/**\n *\n * @type {{}}\n */\nvar view = {};\n" }, { "from": "gpt", "value": "console.log(\"Loaded in...
javascript
chosen
[ { "from": "system", "value": "Modify score loading from backend.\n" }, { "from": "human", "value": "import Ember from \"ember\";\r\nimport ResetScroll from '../mixins/reset-scroll';\r\n\r\nexport default Ember.Route.extend(ResetScroll, {\r\n\tmodel: function() {\r\n\t\tthis.store.unloadAll(\"use...
javascript
chosen
[ { "from": "system", "value": "Add a hack to fix Facebook logins\n" }, { "from": "human", "value": "'use strict'\n\nconst {ipcRenderer} = require('electron')\n\nfunction navigate(url) {\n history.replaceState(null, null, url)\n const e = new Event('popstate')\n window.dispatchEvent(e)\n}\n\nip...
javascript
chosen
[ { "from": "system", "value": "Set user agent for web client\n" }, { "from": "human", "value": "/**\n * @file Centrally configured web client.\n * @module net/request\n */\n\n'use strict'\n\n// Imports\nconst requestStandard = require('request-promise-native')\n\n// Configure\nconst request = req...
javascript
chosen
[ { "from": "system", "value": "Add helmet to posts page\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport PostList from '../components/PostList';\nimport H1 from '../components/H1';\nimport { FormattedMessage } from 'react-intl';\n\nconst B...
javascript
chosen
[ { "from": "system", "value": "Add links to idvidual inventory scenes\n" }, { "from": "human", "value": "import React from 'react'\nimport InventoryContainer from '../containers/InventoryContainer'\nimport ShadowBox from '../Components/ShadowBox'\nimport FlexDiv from '../Components/FlexDiv'\n\nco...
javascript
chosen
[ { "from": "system", "value": "[entries] Normalize string and number values to return [key, value] as well\n" }, { "from": "human", "value": "/**\n * Try to make loopable any kind of javascript primitive\n * @param {array|number|string|object|Map|Set} collection - hopefully something that we ca...
javascript
chosen
[ { "from": "system", "value": "Support double-clicking tray icon in Windows\n" }, { "from": "human", "value": "import { app, Menu, Tray } from 'electron';\nimport path from 'path';\n\nfunction setTrayMenu() {\n let iconPath = path.join(__dirname, '../../../resources/tray.png');\n let tray = new...
javascript
chosen
[ { "from": "system", "value": "Refactor the replace so the types are consistent with the docs\n" }, { "from": "human", "value": "var replaceAll = function( occurrences ) {\n var configs = this;\n return {\n from: function( target ) {\n return {\n to: function( replacement ) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix application root in configuration to allow any execution path\n" }, { "from": "human", "value": "'use strict';\n\nconst bootstrap = require('hof-bootstrap');\n\nconst settings = require('./hof.settings.json');\n\nsettings.routes = settings.routes.map(route => re...
javascript
chosen
[ { "from": "system", "value": "Revert sanitizing req.params, add export function for sanitizing params of a router.\n" }, { "from": "human", "value": "/*!\n * express-sanitized\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\nvar _ = require('lodash');\nvar sanitizer = require('sanit...
javascript
chosen
[ { "from": "system", "value": "Make facebook api calls simple http requests.\n\nThis kills the preflight requests and other possible hiccups.\n" }, { "from": "human", "value": "import jsonToQueryString from 'utils/jsonToQueryString'\n\nexport default function fbapi (path, queryParams, callback) {...
javascript
chosen
[ { "from": "system", "value": "Improve error handling and fix dopey close() placement\n" }, { "from": "human", "value": "\n// asmjsunpack-worker.js: this file is concatenated at the end of unpack.js.\n\n// This file implements a worker that responds to a single initial message containing a url to...
javascript
chosen
[ { "from": "system", "value": "Split replacement pattern over multiple lines\n\nThis makes it a little more readable and maintainable.\n" }, { "from": "human", "value": "/*\n * Pattern matching the prefix of at least one stripped query string\n * parameter. We'll search the query string portion o...
javascript
chosen
[ { "from": "system", "value": "Use a better undefined check\n" }, { "from": "human", "value": "var Delegator = require('dom-delegator')\n\nmodule.exports = BaseEvent\n\nfunction BaseEvent(lambda) {\n return EventHandler;\n\n function EventHandler(fn, data, opts) {\n var handler = {\n...
javascript
chosen
[ { "from": "system", "value": "Add help text to enterprise settings\n" }, { "from": "human", "value": "hqDefine(\"accounting/js/enterprise_settings\", [\n 'jquery',\n 'knockout',\n 'underscore',\n 'hqwebapp/js/assert_properties',\n 'hqwebapp/js/initial_page_data',\n], function(\n ...
javascript
chosen
[ { "from": "system", "value": "Add find function for Matrix\n" }, { "from": "human", "value": "var Matrix = function(rowLength) {\n this.matrix = new Array;\n if(rowLength) {\n for(var i = 0; i < rowLength; i++) {\n this.matrix.push(new Array);\n }\n }\n}\n" }, { "from": "gp...
javascript
chosen
[ { "from": "system", "value": "Use font tags, whitelist the used font tags\n" }, { "from": "human", "value": "(function() {\n Discourse.Dialect.inlineBetween({\n start: \"[color=\",\n stop: \"[/color]\",\n rawContents: true,\n emitter: function(contents) {\n var matches = conte...
javascript
chosen
[ { "from": "system", "value": "Add basic html for registration component\n" }, { "from": "human", "value": "/*\n\t######################################\n\t# Authentication Components #\n\t######################################\n*/\n\n/*\n\tRegister component\n*/\n\n\n\n/*\n\tLogin compo...
javascript
chosen
[ { "from": "system", "value": "Add more private pages to access denied list\n" }, { "from": "human", "value": "/*****************************************************************************/\n/* Client and Server Routes */\n/************************************************************************...
javascript
chosen
[ { "from": "system", "value": "Add config and cascade for menu.\n" }, { "from": "human", "value": "var fs = require('fs');\nvar mdTarget = 'styleguide.md';\n\nfs.readFile(mdTarget, function(err, data) {\n if (err) throw err;\n\n var reg = /#{1,6}\\s[^\\r\\n|\\r|\\n]+/g;\n var headersArr ...
javascript
chosen
[ { "from": "system", "value": "Load plugin from entry point in electron\n" }, { "from": "human", "value": "require('babel-register')({ extensions: ['.jsx'] });\n\nconst app = require('hadron-app');\nconst React = require('react');\nconst ReactDOM = require('react-dom');\nconst AppRegistry = requi...
javascript
chosen
[ { "from": "system", "value": "Reset the access control details showing when coming back\n" }, { "from": "human", "value": "import AuthenticatedRouteMixin from 'ui/mixins/authenticated-route';\nimport Ember from 'ember';\nimport C from 'ui/utils/constants';\n\nexport default Ember.Route.extend(Au...
javascript
chosen
[ { "from": "system", "value": "Fix Gulp watch for theme files\n\nRebuild when a theme file is modified\n" }, { "from": "human", "value": "/*!\n* gulpfile\n*/\n\n// Load plugins\nvar gulp = require('gulp');\nvar stylus = require('gulp-stylus');\nvar rename = require('gulp-renam...
javascript
chosen
[ { "from": "system", "value": "Add stopLocalVideo if the user does not support getUserMedia\n" }, { "from": "human", "value": "require([\"UserMedia\", \"VideoWrapper\"], function(UserMedia, VideoWrapper) {\n \"use strict\";\n\n var startButton = document.getElementById(\"startButton\");\n ...
javascript
chosen
[ { "from": "system", "value": "Fix some logic and deferred creation bugs\n" }, { "from": "human", "value": "var Stirrup = function(library) {\n if(typeof library !== 'object' && typeof library !== 'function') {\n throw 'You must provide Stirrup with a promise library';\n }\n this.library = ...
javascript
chosen
[ { "from": "system", "value": "Change protractor framework to jasmine2.\n" }, { "from": "human", "value": "exports.config = {\n allScriptsTimeout: 11000,\n\n specs: [\n '*.js'\n ],\n\n capabilities: {\n 'browserName': 'chrome'\n },\n\n baseUrl: 'http://localhost:8000/app/',\n\n frame...
javascript
chosen
[ { "from": "system", "value": "[assets] Remove useless flag on get asset types call\n" }, { "from": "human", "value": "import client from '@/store/api/client'\n\nexport default {\n getAssetTypes (callback) {\n client.get('/api/data/asset-types?relations=true', callback)\n },\n\n getAssetTyp...
javascript
chosen
[ { "from": "system", "value": "Remove dependency on default parameters in JS\n\nApparently it's only supported by Firefox, source:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/default_parameters\n\nThis issue was brought up in #3.\n" }, { "from": "human", "value": "'use stri...
javascript
chosen
[ { "from": "system", "value": "[WLK-INSTANCE] Remove IP addresses from error reports\n" }, { "from": "human", "value": "/* global window, uw */\nimport bugsnag from 'bugsnag-js';\nimport { version } from '../../package.json';\n\nconst client = bugsnag({\n apiKey: 'a3246545081c8decaf0185c7a7f8d40...
javascript
chosen
[ { "from": "system", "value": "Use the error string if we have one for malformed json\n" }, { "from": "human", "value": "import queryString from \"query-string\";\n\nclass Api {\n static get(url, data = {}) {\n return this.request(url + (Object.keys(data).length > 0 ? ('?' + queryString...
javascript
chosen