conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change casing from livescript to LiveScript\n\nHi.\r\n\r\nInterpret currently fails at loading LiveScript files because of the (unfortunate) casing of the module :\r\nhttps://www.npmjs.org/package/livescript vs https://www.npmjs.org/package/LiveScript\r\n\r\nBug found while att...
javascript
chosen
[ { "from": "system", "value": "Use query rather than params to read GET params\n" }, { "from": "human", "value": "var express = require('express');\nvar fs = require('fs');\nvar app = express();\nvar storagePath = \"./toilet_status.txt\";\n\napp.set('port', (process.env.PORT || 5000));\napp.use(e...
javascript
chosen
[ { "from": "system", "value": "Change pure ES6 class declaration syntax for consistency with React classes\n" }, { "from": "human", "value": "class Book {\n logSomething() {\n console.log( 'Book.logSomething has been called' );\n }\n}\n\nmodule.exports = Book;\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Fix bug that throws error for empty string\n\nPrevents function from throwing an error when `str` is null/undefined" }, { "from": "human", "value": "'use strict';\nvar filenameReservedRegex = require('filename-reserved-regex');\n\nmodule.exports = function (str) {\n...
javascript
chosen
[ { "from": "system", "value": "[master] Add start and nb argument to cli\n" }, { "from": "human", "value": "\nrequire('dotenv').config();\n\nconst vorpal = require('vorpal')();\nconst importer = require('./src/modules/importer');\n\nvorpal\n .command('import', 'Launch the import script')\n ...
javascript
chosen
[ { "from": "system", "value": "Use `call()` to correctly assign `this` in handler\n\nThe handler function's `this` should refer to the element to which the\nlistener is bound, rather than the `window` object. This also ensures\nthat `this` is equal to `e.currentTarget`.\n" }, { "from": "human", "...
javascript
chosen
[ { "from": "system", "value": "Add missing reference to covistra system\n" }, { "from": "human", "value": "/**\n\n Copyright 2015 Covistra Technologies Inc.\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 Y...
javascript
chosen
[ { "from": "system", "value": "Convert RegExp to strings by using RegExp.prototype.source\n" }, { "from": "human", "value": "'use strict';\n\nconst rest = require('midwest/middleware/rest');\nconst formatQuery = require('midwest/middleware/format-query');\nconst paginate = require('midwest/middle...
javascript
chosen
[ { "from": "system", "value": "Add some more clear migration debug logs.\n" }, { "from": "human", "value": "/**\n * Migrates the database from one version to another.\n */\nfunction migrateStorage() {\n\tvar extensionVersion = getExtensionVersion().major;\n\n\tgetStorageVersion(function(storageVe...
javascript
chosen
[ { "from": "system", "value": ":white_check_mark: Add specs for new element behavior\n" }, { "from": "human", "value": "/* @flow */\n\nimport Element from '../lib/element'\n\ndescribe('Element', function() {\n let element\n\n beforeEach(function() {\n element = new Element()\n spyOn(eleme...
javascript
chosen
[ { "from": "system", "value": "Add API for retrieving matches\n" }, { "from": "human", "value": "'use strict';\n\nvar server = require('restify').createServer();\n\nserver.get('/matches', function(req, res) {\n\treturn res.send(200, { 'hello': 'world' });\n});\n\nmodule.exports = server;\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Refactor to use export * from ...\n" }, { "from": "human", "value": "import uuid from 'uuid'\nimport {\n loadPictureRequest, loadPictureSuccess,\n fetchPictureFromPath, fetchPictureFromUrl, fetchPictureIfNeeded\n} from './pictures.js'\n\nexport { loadPictureReques...
javascript
chosen
[ { "from": "system", "value": "Scale up images to Full HD\n" }, { "from": "human", "value": "var http = require('http');\nvar Canvas = require('canvas');\nvar fs = require('fs');\n\nvar noise = require('../perlin.js').noise;\n\neval(fs.readFileSync('../seedrandom.min.js')+'');\neval(fs.readFileSy...
javascript
chosen
[ { "from": "system", "value": "Add publish command to gruntfile\n" }, { "from": "human", "value": "/*global exports:true, require:true */\nmodule.exports = exports = function(grunt) {\n 'use strict';\n\n grunt.initConfig({\n casper: {\n },\n coffee: {\n compile...
javascript
chosen
[ { "from": "system", "value": "Use Denver if we can't automatically locate the user\n" }, { "from": "human", "value": "require('./geoLocationService');\n\nvar mapStyles = require('./map/styles/avocado.json');\n\nrequire('./akermap').controller('AkerMapController', function($scope, geoLocation) {\...
javascript
chosen
[ { "from": "system", "value": "Add user id field to snapshot migration\n" }, { "from": "human", "value": "const TABLE_NAME = 'snapshots';\n\nexports.up = function(knex) {\n\n function table(t) {\n t.increments().primary();\n t.string('organizationId').unsigned().references('organizations.i...
javascript
chosen
[ { "from": "system", "value": "Allow checked value to be dynamic on page load\n" }, { "from": "human", "value": "// ==UserScript==\n// @name SFF.SE Toggle all spoilers on a question\n// @version 1.1.1\n// @description Adds a checkbox to SFF.SE questions to show/hide all spoilers on ...
javascript
chosen
[ { "from": "system", "value": "Include post number in mention notification" }, { "from": "human", "value": "import Notification from 'flarum/components/notification';\nimport username from 'flarum/helpers/username';\n\nexport default class PostMentionedNotification extends Notification {\n view(...
javascript
chosen
[ { "from": "system", "value": "Add the author, and build HTML with jQuery\n" }, { "from": "human", "value": "$(function() {\n\t$('.band_messages, .fan_messages').each(function() {\n\t\tvar $this = $(this)\n\t\tvar url = $this.attr('data-update-uri')\n\t\t$.getJSON(url+'?callback=?', function(json...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"Revert \"Revert \"Try child process\"\"\"\"\n\nThis reverts commit 59eec97713488c95c2e8869e8b73ce0d0eab09bb.\n" }, { "from": "human", "value": "module.exports = {\n onPreBuild({ utils: { status: { show } } }) {\n show({ summary: 'Test' })\n }\...
javascript
chosen
[ { "from": "system", "value": "Make sure source doesn't get overwritten so we can continue to parse for specs.\n" }, { "from": "human", "value": "\nfunction Spec (name, js, hb) {\n this.name = name\n this.js = js\n this.hb = hb\n}\n\nfunction extractJS (source) {\n return /``js\\s([^(``)]...
javascript
chosen
[ { "from": "system", "value": "Set new password action name change\n" }, { "from": "human", "value": "function submitChange() {\n\tif ($(\"#passwdNew\").val() != $(\"#passwdConfirm\").val()) {\n\t\t$(\"#errMsg\").text(\"Passwords do NOT match!\");\n\t\t$(\"#alertDiv\").attr(\"style\", \"display: ...
javascript
chosen
[ { "from": "system", "value": "Add new hook for users\n" }, { "from": "human", "value": "const level = require('level');\nconst path = require('path');\nconst SubLevel = require('level-sublevel');\n\nconst dbPath = process.env.DB_PATH || path.join(__dirname,'graftonDB');\nconst db = SubLevel(leve...
javascript
chosen
[ { "from": "system", "value": "Update sw-precache config to cache the polyfills in runtimeCaching\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright (c) 2017 Abdón Rodríguez Davila (@abdonrd). All rights reserved.\n * This code may only be used under the MIT style license found at ...
javascript
chosen
[ { "from": "system", "value": "Fix product remove from cart\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\n\nexport default class Cart extends Component {\n\n constructor(props) {\n super(props);\n this.removeProductFromCart = this.removeProductFromCart.bin...
javascript
chosen
[ { "from": "system", "value": "Fix typo in user script gen, s/versiom/version/\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// Note: This is written in a semi-generic way, but only supports 1 script.\nconst manifestPath = __dirname + '/manifest.json';\nconst outPath = __dirname + '/d...
javascript
chosen
[ { "from": "system", "value": "Add chapter 6, exercise 4\n" }, { "from": "human", "value": "let map = {one: true, two: true, hasOwnProperty: true};\n\n// Fix this call\nconsole.log(Object.prototype.hasOwnProperty.call(map, \"one\"));\n// → true\n" }, { "from": "gpt", "value": "let map...
javascript
chosen
[ { "from": "system", "value": "Add projects and project_addresses tables" }, { "from": "human", "value": "'use strict';\n\nvar config = require('./config.js');\n\nmodule.exports = {\n\t// database connection\n\tknex : require('knex')({\n\t\tclient: 'mysql',\n\t\tconnection: config.dbOptions\n\t}...
javascript
chosen
[ { "from": "system", "value": "Add a comment to addFieldsDict\n" }, { "from": "human", "value": "import Users from 'meteor/vulcan:users';\n\nexport const generateIdResolverSingle = ({collectionName, fieldName}) => {\n return async (doc, args, context) => {\n if (!doc[fieldName]) return null\n...
javascript
chosen
[ { "from": "system", "value": "Fix bug introduced in efdd3d6\n" }, { "from": "human", "value": "import angular from 'angular';\nimport template from './authorityView.html';\n\nexport const authorityViewComponentName = 'appAuthorityView';\n\nexport const authorityViewComponent = {\n template,\n...
javascript
chosen
[ { "from": "system", "value": "Use normalized linefeed for concatenation\n" }, { "from": "human", "value": "/*\n * grunt-autoprefixer\n *\n *\n * Copyright (c) 2013 Dmitry Nikitenko\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nmodule.exports = function(grunt) {\n\n var autopref...
javascript
chosen
[ { "from": "system", "value": "Fix typo in setting up dropbox api\n" }, { "from": "human", "value": "import dropboxFs from 'dropbox-fs'\nimport fs from 'fs'\nimport { promisify } from 'util'\n\nimport { dropboxApiKey } from '../config'\n\nexport const readFile = (...options) => {\n return dropbo...
javascript
chosen
[ { "from": "system", "value": "Set default port to 4000 (rails uses 3000)\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar prerender = require('./lib');\n\nvar server = prerender({\n workers: process.env.PHANTOM_CLUSTER_NUM_WORKERS,\n iterations: process.env.PHANTOM_WORKER_ITERAT...
javascript
chosen
[ { "from": "system", "value": "Add ratio as a config option\n" }, { "from": "human", "value": "import React from 'react';\nimport Chartist from 'chartist';\n\nexport default class Chart extends React.Component {\n componentDidMount() {\n this.updateChart(this.props);\n }\n\n componentWillRe...
javascript
chosen
[ { "from": "system", "value": "Disable animation effects on barogram.\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport Chart from 'chart.js';\n\nclass LineChart extends React.Component {\n constructor(props, context) {\n super(props, context);\n }\n\n com...
javascript
chosen
[ { "from": "system", "value": "Update GA event tracking code" }, { "from": "human", "value": "$(function(){\n $('.poll button').click(function(){\n $.ajax({\n type: 'PUT',\n url: '/poll',\n data: {'value': $(this).attr('value')}\n });\n $('...
javascript
chosen
[ { "from": "system", "value": "Fix the missing this/other in BoxCollider\n" }, { "from": "human", "value": "'use strict';\r\n\r\nexport default class BoxCollider {\r\n\tconstructor(sprite, x, y, width, height) {\r\n\t\tthis.sprite = sprite;\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.width ...
javascript
chosen
[ { "from": "system", "value": "Move functions out of render and into getters\n" }, { "from": "human", "value": "import React, {PureComponent} from 'react'\nimport PropTypes from 'prop-types'\nimport {DYGRAPH_CONTAINER_XLABEL_MARGIN} from 'shared/constants'\nimport {NULL_HOVER_TIME} from 'shared/c...
javascript
chosen
[ { "from": "system", "value": "Introduce test to verify resolving multiple promises\n" }, { "from": "human", "value": "'use strict';\n\nconst Promise = require('promise');\nconst chai = require('chai');\nconst expect = chai.expect;\nconst chaiAsPromised = require('chai-as-promised');\nchai.use(ch...
javascript
chosen
[ { "from": "system", "value": "Add filter on getCaptures to only return valid captures\n" }, { "from": "human", "value": "import EventEmitter from 'eventemitter2'\nimport store from '../store/store'\nimport { actions } from '../store/actions'\n\nconst events = new EventEmitter()\nstore.subscribe(...
javascript
chosen
[ { "from": "system", "value": "Add hint about the port\n" }, { "from": "human", "value": "const micro = require('micro');\nconst fs = require('fs');\nconst path = require('path');\n\nconst document = path.join(__dirname, 'index.html');\nconst html = fs.readFileSync(document);\n\nconst server = mi...
javascript
chosen
[ { "from": "system", "value": "Add socket event : `key`\n\nSend the pressed key to the TV\n" }, { "from": "human", "value": "var express = require('express');\nvar http = require('http');\nvar socket = require('socket.io');\nvar SamsungRemote = require('samsung-remote');\n\nvar app = express();\n...
javascript
chosen
[ { "from": "system", "value": "Revert \"make some changes that will be undone\"\n\nThis reverts commit 0321c6fc0d445be8db71fee1a09b7c5f952d7ca8.\n" }, { "from": "human", "value": "'use strict';\n/**\n * Module dependencies.\n */\nvar init = require('./config/init')(),\n\tconfig = require('./confi...
javascript
chosen
[ { "from": "system", "value": "Remove loading class when finished loading." }, { "from": "human", "value": "$().ready(loadContentSection);\n\n$(\"body\").on('click', '.keyword', function() {\n $(this).addClass(\"active\");\n $(\".base\").hide(200);\n $(\"#real-body\").addClass(\"focus\");\n});...
javascript
chosen
[ { "from": "system", "value": "Add database connection initialization logic\n" }, { "from": "human", "value": "/**\n * Entry point of hyperion server\n * @module server/server\n */\n'use strict';\n\nvar express = require('express');\n\nvar log = require('logger')(__filename);\nvar routes = requir...
javascript
chosen
[ { "from": "system", "value": "Add es6 polyfills for IE11\n" }, { "from": "human", "value": "import React from 'react'\nimport Document, { Head, Main, NextScript } from 'next/document'\nimport flush from 'styled-jsx/server'\n\nexport default class MyDocument extends Document {\n static getInitia...
javascript
chosen
[ { "from": "system", "value": "Use Chrome and not chromium\n" }, { "from": "human", "value": "module.exports = {\n test_page: 'tests/index.html?hidepassed',\n disable_watching: true,\n launch_in_ci: [\n 'chromium'\n ],\n launch_in_dev: [\n 'Chrome'\n ],\n browser_args: {\n Chrome:...
javascript
chosen
[ { "from": "system", "value": "Add new line on the end of every message\n" }, { "from": "human", "value": "'use strict';\n\nconst dateformat = require('dateformat');\nconst directory = require('./directory');\nconst fs = require('fs');\nconst path = require('path');\n\nmodule.exports = {\n '_g...
javascript
chosen
[ { "from": "system", "value": "Fix problem with empty source\n" }, { "from": "human", "value": "const escapeText = source => {\n return source\n .replace(/([\"\\\\])/g, '\\\\$1')\n .replace(/[\\f]/g, '\\\\f')\n .replace(/[\\b]/g, '\\\\b')\n .replace(/[\\n]/g, '\\\\n...
javascript
chosen
[ { "from": "system", "value": "Add more tests for amd modulator.\n" }, { "from": "human", "value": "require(\"../include/include.js\");\n\nvar amd = ephox.bolt.kernel.modulator.amd;\n\nvar idTransformer = function (id) {\n return id.replace(/\\./g, '/');\n};\n\nvar loader = {\n load: function (...
javascript
chosen
[ { "from": "system", "value": "Fix invalid hostname on browser\n" }, { "from": "human", "value": "import fetch from 'isomorphic-fetch'\nimport url from 'url'\n\nimport config from '../config'\n\nexport default class APIClient {\n \n constructor({ path, method, query, body }) {\n const apiUrl...
javascript
chosen
[ { "from": "system", "value": "Use .reduce to filter out null flags and account for new individuals for audit via Graphiql\n" }, { "from": "human", "value": "\n// @flow\nimport { manager } from '../../../../core/service-providers/manager'\nimport { Auditor } from '../../../../core/auditor'\nimpor...
javascript
chosen
[ { "from": "system", "value": "Update data distribution check style\n" }, { "from": "human", "value": "import React from 'react'\nimport { translate } from 'react-i18next'\nimport PropTypes from 'prop-types'\n\nimport Check from './check'\n\nconst DistributionCheck = ({ distributions, isValid, t ...
javascript
chosen
[ { "from": "system", "value": "App: Add logic to run npmInstall\n" }, { "from": "human", "value": "'use strict';\n\nvar generators = require('yeoman-generator'),\n chalk = require('chalk');\n\nmodule.exports = generators.Base.extend({\n constructor: function () {\n generators.Base.apply(this...
javascript
chosen
[ { "from": "system", "value": "Update trim birthday script to run longer\n\nThe previous version would break when the cursor expired. This\nscans more gradually.\n" }, { "from": "human", "value": "var query = {birthday: {$exists: true}, $where: 'this.birthday.length > 7'};\ndb.users.find(query, {...
javascript
chosen
[ { "from": "system", "value": "Fix issue where result form was not populated with existing points\n" }, { "from": "human", "value": "import $ from 'jquery'\nimport \"bootstrap-sass\"\n\n$('#modal-result-form').on('show.bs.modal', function(event) {\n const $button = $(event.relatedTarget)\n cons...
javascript
chosen
[ { "from": "system", "value": "Make the check of whether a component was built not depend on persistence\n" }, { "from": "human", "value": "'use strict';\n\nfunction getDependenciesMissing(wanted, found) {\n var missing = {};\n for (var depName in wanted) {\n if (!found[depName]) {\n...
javascript
chosen
[ { "from": "system", "value": "Fix an Error in Main.js" }, { "from": "human", "value": "$(document).ready(function(event){\n $('#submit').click(function(event){\n getData();\n \n });\n $('#formThing').submit(function(event){\n event.preventDefault();\n getData();\n });...
javascript
chosen
[ { "from": "system", "value": "Change click event to change event\n" }, { "from": "human", "value": "var settings = {\n api_url: \"http://127.0.0.1:8000/api/\",\n agency_id: \"SPTRANS\"\n};\n\nstart();\n\nfunction start(){\n\n var api_url = settings.api_url;\n var agency_id = settings.agency_...
javascript
chosen
[ { "from": "system", "value": "Use our own js Error parser\n" }, { "from": "human", "value": "'use strict';\nimport {NativeModules} from 'react-native';\nlet {Instabug} = NativeModules;\nlet stacktraceParser = require('stacktrace-parser');\n\nlet parseErrorStack = (error) => {\n if (!error ||...
javascript
chosen
[ { "from": "system", "value": "Send out a content-type attachment header with a prettier name\n" }, { "from": "human", "value": "var fs = require('fs');\n\nvar WebshotAPI = require('../api');\n\n/*!\n * Generate an image\n */\nexports.generate = function(req, res) {\n var url = req.param('url'...
javascript
chosen
[ { "from": "system", "value": "Change the enabled checkbox for new bonuses to be default on\n" }, { "from": "human", "value": "import moment from 'moment';\n\nexport const emptyAccount = {\n accountId: -1,\n username: '',\n firstname: '',\n lastname: '',\n fullName: '',\n balanc...
javascript
chosen
[ { "from": "system", "value": "Redux: Store Methods: getState(), dispatch() and subscribe()\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nReactDOM.render(<App />, document.getElementById('app'));\n" }, { "from...
javascript
chosen
[ { "from": "system", "value": "Refactor pascalCase function to use custom compose function\n" }, { "from": "human", "value": "import R from 'ramda';\nimport capitalize from './capitalize.js';\nimport spaceCase from './space-case.js';\n\n// a -> a\nconst pascalCase = R.compose(\n R.join(''),\n R...
javascript
chosen
[ { "from": "system", "value": "Use const when it makes sense in detect tests\n" }, { "from": "human", "value": "'use strict';\n\nlet bluebird = require('bluebird');\nlet fs = bluebird.promisifyAll(require('fs'));\nlet hljs = require('../../build');\nlet path = require('path');\nlet ...
javascript
chosen
[ { "from": "system", "value": "Use singular for project, visualization directories.\n" }, { "from": "human", "value": "TileMill.controller.list = function() {\n TileMill.backend.list('projects', function(projects) {\n TileMill.backend.list('visualizations', function(visualizations) {\n v...
javascript
chosen
[ { "from": "system", "value": "Increase global http connection limit\n" }, { "from": "human", "value": "var express = require('express'),\n initialize = require('express-initializers'),\n logger = require('./logger'),\n\n app = express();\n\nlogger.profile('startup');\n// Let the initia...
javascript
chosen
[ { "from": "system", "value": "Use 50 times the page size for faceting\n" }, { "from": "human", "value": "\"use strict\";\nvar search = require('../lib/search');\n\nmodule.exports = function (input, callback) {\n if (typeof input.query.plan !== 'undefined' && typeof input.query.plan.esquery !=...
javascript
chosen
[ { "from": "system", "value": "Remove client logic from Etherscan chain agent\n" }, { "from": "human", "value": "/**\n * @file Chain agent interfacing with Etherscan.\n * @module chain/etherscan\n */\n\n'use strict'\n\n// Imports\nconst config = require('config')\n\n/**\n * Private members store....
javascript
chosen
[ { "from": "system", "value": "Fix site:doctor to work with generator-statisk\n" }, { "from": "human", "value": "'use strict';\nconst gulp = require('gulp');\nconst shell = require('shelljs');\nconst size = require('gulp-size');\nconst argv = require('yargs').argv;\n\n// 'gulp jekyll:tmp' -- copi...
javascript
chosen
[ { "from": "system", "value": "Fix the cloud type warning on build\n" }, { "from": "human", "value": "import React from 'react'\nimport { Provider } from 'rebass'\nimport { Head } from 'react-static'\nimport Nav from '../components/Nav'\nimport Bubbles from '../components/Bubbles'\nimport Stripe ...
javascript
chosen
[ { "from": "system", "value": "Add the i. domain under which a lot of websites host their images\n" }, { "from": "human", "value": "IRG.constants = (function(){\n \n var approvedDomains = function(){\n return [\"imgur.com\", \"flickr.com\", \"cdn.diycozyhome.com\", \"pbs.twimg.com\",...
javascript
chosen
[ { "from": "system", "value": "Remove database sync by sequalize\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2014 TopCoder, Inc. All rights reserved.\n */\n'use strict';\n\n\nvar postgresql = require('postgresql-sequelize');\nvar Sequelize = postgresql.Sequelize;\nvar sequelize = pos...
javascript
chosen
[ { "from": "system", "value": "Fix keyboard navigation on snapshot page\n\nCommit 0843a604ba made the entire snapshot card clickable (awesome!) but\nunfortunately broke keyboard navigation on the snapshot page. I can't\nblame anyone, the js is fragile for DOM changes. We should probably\nintroduce some js (J...
javascript
chosen
[ { "from": "system", "value": "Fix utils export from module\n" }, { "from": "human", "value": "import columnUtils from './columnUtils';\nimport compositionUtils from './compositionUtils';\nimport dataUtils from './dataUtils';\nimport rowUtils from './rowUtils';\nimport sortUtils from './sortUtils...
javascript
chosen
[ { "from": "system", "value": "Set full commit message as tooltip\n\nResolves: #880\n" }, { "from": "human", "value": "import React from 'react';\nimport Relay from 'react-relay';\nimport PropTypes from 'prop-types';\n\nimport Octicon from '../../views/octicon';\n\nexport class Commit extends Rea...
javascript
chosen
[ { "from": "system", "value": "Tests/RN-native-nav: Use promise instead of callback for starting Bugsnag\n" }, { "from": "human", "value": "/**\n * @format\n */\n\nimport {Navigation} from 'react-native-navigation';\nimport HomeScreen from './screens/Home';\nimport DetailsScreen from './screens/D...
javascript
chosen
[ { "from": "system", "value": "Allow passing viewOptions to FileSettingsDialogTabs\n" }, { "from": "human", "value": "pageflow.FileSettingsDialogView = Backbone.Marionette.ItemView.extend({\n template: 'templates/file_settings_dialog',\n className: 'file_settings_dialog editor dialog',\n\n mix...
javascript
chosen
[ { "from": "system", "value": "Allow console statements in server code\n" }, { "from": "human", "value": "module.exports = {\n\n env: {\n\n 'browser': false\n\n }\n\n};\n" }, { "from": "gpt", "value": "module.exports = {\n\n env: {\n\n 'browser': false\n\n },\n\n rules: {\n...
javascript
chosen
[ { "from": "system", "value": "Add handling for invalid JSON returned\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.stringify(data)...
javascript
chosen
[ { "from": "system", "value": "Change dancers to be its own list\n" }, { "from": "human", "value": "import update from 'react-addons-update';\n\nvar dancers = [\n {\n position: {\n top: 200, left: 90\n },\n name: 'Ryan'\n },\n {\n position: {\n top: 100, left: 20\n },\...
javascript
chosen
[ { "from": "system", "value": "Add `build` and `default` tasks.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar gulp = require(\"gulp\")\n , $ = require(\"gulp-load-plugins\")()\n , del = require(\"del\")\n\ngulp.task(\"img\", function () {\n return gulp.src(\"img/*.sketch\")\n .p...
javascript
chosen
[ { "from": "system", "value": "Fix gaia-reader bug where wrong storageRootDirectory config key was being used in file GETs.\n" }, { "from": "human", "value": "/* @flow */\n\nimport express from 'express'\nimport expressWinston from 'express-winston'\nimport logger from 'winston'\nimport cors from...
javascript
chosen
[ { "from": "system", "value": "Refactor - modify file require\n" }, { "from": "human", "value": "const indexer = require('../../src/Inverted-index');\n\n\ndescribe('Inverted Index Tests', function() {\n let fileName = './books.json';\n\n beforeEach(function(done) {\n indexer.createIndex(file...
javascript
chosen
[ { "from": "system", "value": "Use `getOwnPropertyNames` instead of `keys` to retrieve list of keys\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst [major, minor] = Ember.VERSION.split('.');\nconst isGlimmer = major > 2 || (major == 2 && minor >= 10); // >= 2.10\n\nlet hasB...
javascript
chosen
[ { "from": "system", "value": "Add setting of undefined rather than an empty string\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { TextInput, StyleSheet } from 'react-native';\nimport { DARKER_GREY, LIGHT_GREY } from '../../../globalSt...
javascript
chosen
[ { "from": "system", "value": "Use map instead of for loop.\n" }, { "from": "human", "value": "const createHashTable = require('../DataStructures/HashTable')\n/**\n * Given two arrays, find the difference between them.\n * Example:\n * [1, 2, 3] and [2, 4, 1] => [3, 4]\n * ['A', 'B'] and ['C', 'D...
javascript
chosen
[ { "from": "system", "value": "Handle bare text nodes in lists slightly better\n" }, { "from": "human", "value": "var children = node.childNodes;\nif (children.length === 0) { return false; }\n\nfor (var i = 0; i < children.length; i++) {\n\tif ([1, 3].indexOf(children[i].nodeType) === -1) { cont...
javascript
chosen
[ { "from": "system", "value": "Fix 'Dynamic load not allowed: help/keyboardShortcuts.json' caused by using relative path\n" }, { "from": "human", "value": "define(['require', 'app', 'backbone.marionette', 'backbone', 'marked',\n 'underscore', 'json!./keyboardShortcuts.json'],\n function (requ...
javascript
chosen
[ { "from": "system", "value": "Add route configuration for partials\n" }, { "from": "human", "value": "\nvar searchApp = angular.module('searchApp', []);\n\nsearchApp.controller('SimpleController', function($scope){\n $scope.customers = [\n {name: 'Gendelman', city: 'West Bloomfield'},\n {name...
javascript
chosen
[ { "from": "system", "value": "Add body-parser middleware to correctly parse urlencoded\n" }, { "from": "human", "value": "var express = require('express');\nvar http = require('http');\nvar util = require('util');\n\nvar port = 8081;\nvar status;\n\nvar app = express();\n\napp.post('/men', funct...
javascript
chosen
[ { "from": "system", "value": "Fix loading of users in autocomplete\n" }, { "from": "human", "value": "/*****************************************************************************/\n/* UserPill: Event Handlers */\n/*****************************************************************************/\n...
javascript
chosen
[ { "from": "system", "value": "chore: Allow mailhaven as valid provider\n" }, { "from": "human", "value": "export const whiteListDomains = [\n 'hush.com',\n 'opayq.com',\n 'mailhero.io',\n 'mailinator.com',\n 'sudomail.com',\n 'maildrop.cc',\n 'neverbox.com',\n 'thrott.com',\n 'gmial.com...
javascript
chosen
[ { "from": "system", "value": "Add a getter to scheduled task's time field\n" }, { "from": "human", "value": "const { PhoneNumberUtil } = require('google-libphonenumber');\nconst scheduledTasksSchemaFunc = require('./schemas/scheduled-tasks-schema');\nconst phoneUtil = PhoneNumberUtil.getInstance...
javascript
chosen
[ { "from": "system", "value": "Make global error msg available to header\n" }, { "from": "human", "value": "import { connect } from 'react-redux'\nimport {ensureState} from 'redux-optimistic-ui'\nimport Header from './Header'\nimport { requestPlay, requestPause } from 'routes/Queue/modules/queue'...
javascript
chosen
[ { "from": "system", "value": "Move to production - DO NOT CHANGE\n" }, { "from": "human", "value": "var backandGlobal = {\n url: \"http://localhost:4109/backapi\", //\"https://api.backand.com:8080\",// \n defaultApp: null,\n};\n\n//load the backand banner\n$(document).ready(function () {\n...
javascript
chosen
[ { "from": "system", "value": "Add tests for no \\t and ' in index.html\n\nCloses #82\n" }, { "from": "human", "value": "var assert = require(\"assert\");\nvar fs = require(\"fs\");\nvar html5Lint = require(\"html5-lint\");\n\ndescribe(\"Splash Page\", function() {\n it(\"should have valid HTM...
javascript
chosen
[ { "from": "system", "value": "Change user agent for batch api client\n" }, { "from": "human", "value": "'use strict';\n\nvar qs = require('querystring');\n\nvar request = require('request');\n\nvar dot = require('dot');\nvar hostHeader = dot.template('{{=it.username}}.localhost.lan');\n\nvar deb...
javascript
chosen
[ { "from": "system", "value": "Add helpful comment for future me.\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function(ecs, data) {\n\tecs.addEach(function(entity, elapsed) { // jshint ignore:line\n\t\tif (entity.center.x) {\n\t\t\tentity.position.x = Math.floor(data.ca...
javascript
chosen
[ { "from": "system", "value": "Fix logger level isIn bug\n" }, { "from": "human", "value": "// Copyright 2014, Renasar Technologies Inc.\n/* jshint: node:true */\n\n'use strict';\n\nvar di = require('di');\n\nmodule.exports = loggingProtocolFactory;\n\ndi.annotate(loggingProtocolFactory, new di.P...
javascript
chosen