conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix the plugin, get the file contents\n" }, { "from": "human", "value": "var gutil = require('gulp-util');\nvar fs = require('fs');\nvar _ = require('lodash');\nvar through = require('through2');\nvar Parker = require('parker');\nvar path = require('path');\nvar ext...
javascript
chosen
[ { "from": "system", "value": "Make Browserify bundle work in ES3 environments\n\nFixes #90\n" }, { "from": "human", "value": "/* jshint node:true */\n\n'use strict';\n\nvar IntlMessageFormat = require('./lib/main').default;\n\n// Add all locale data to `IntlMessageFormat`. This module will be ig...
javascript
chosen
[ { "from": "system", "value": "Remove then functionality from promise function\n" }, { "from": "human", "value": "var Q = require('q');\n\nmodule.exports = function(AWS){\n\tAWS.Request.prototype.promise = function(promiseCallback){\n\t\tvar deferred = Q.defer();\n\n\t\tthis.\n\t\ton('success', f...
javascript
chosen
[ { "from": "system", "value": "Format tidying and adding configurability\n" }, { "from": "human", "value": "var MjpegCamera = require('mjpeg-camera');\nvar fs = require('fs');\nvar express = require('express');\n\nvar app = express();\n//app.use(express.static(__dirname + '/snapshot'));\n\napp.li...
javascript
chosen
[ { "from": "system", "value": "Use `execa.stdout` to get `stdout` directly\n" }, { "from": "human", "value": "'use strict';\nconst execa = require('execa');\nconst linuxBattery = require('linux-battery');\nconst osxBattery = require('osx-battery');\n\nconst linux = () => linuxBattery().then(res =...
javascript
chosen
[ { "from": "system", "value": "Create function to work with polyfills\n" }, { "from": "human", "value": "var exports = module.exports;\n\nfunction fetchReject(...params) {\n return fetch(...params)\n .then(handleErrors)\n}\n\nfunction handleErrors(response) {\n if (response.ok) {\n return...
javascript
chosen
[ { "from": "system", "value": "Use `ignore case` flag in regex\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(options) {\n options = options || {};\n var regexBase = '([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})';\n\n return options.exact ? new RegExp('^' + regexBase ...
javascript
chosen
[ { "from": "system", "value": "Tweak server to bind to right port for heroku\n" }, { "from": "human", "value": "var express = require('express');\n\nvar app = express();\napp.use('/', express.static('./app', {\n index: 'data.xml'\n}));\n\napp.listen(3000);\n" }, { "from": "gpt", "val...
javascript
chosen
[ { "from": "system", "value": "Allow other trees to be returned.\n\nIf you override `treeFor` but do not return anything for\n`treeFor('addon')` or `treeFor('app')` no code will be shipped to the\nbrowser.\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar pickFiles ...
javascript
chosen
[ { "from": "system", "value": "Use more specific selector to just get tree nodes\n\nThis is increases the test performance.\n" }, { "from": "human", "value": "\"use strict\";\n\ndescribe('Read tokens from xml url', function(){\n var sentence1Url = 'http://services.perseids.org/llt-data/1999.02.0...
javascript
chosen
[ { "from": "system", "value": "Add .log folder, used by tools like tsserver\n\nCo-authored-by: Mark Wubben <f1b5a91d4d6ad523f2610114591c007e75d15084@novemberborn.net>" }, { "from": "human", "value": "'use strict'\n\nexports.directories = () => [\n '.git', // Git repository files, see <https://gi...
javascript
chosen
[ { "from": "system", "value": "Remove Box wrapping List component\n" }, { "from": "human", "value": "// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP\n\nimport React, { Component, PropTypes } from 'react';\nimport classnames from 'classnames';\nimport Box from './Box';\nimport...
javascript
chosen
[ { "from": "system", "value": "Check parent.children before splice, accommodate jest\n\nWhen used with jest, `parent.children` will be undefined.\n`console.log(module)`:\n{ exports: [Function: requireFromString],\n filename: 'E:/Projects/repos/cosmiconfig/node_modules/require-from-string/index.js',\n ...
javascript
chosen
[ { "from": "system", "value": "Add theme for code highlight\n" }, { "from": "human", "value": "import React from \"react\";\nimport { render } from \"react-dom\";\n\nimport Presentation from \"./presentation\";\n\nrender(<Presentation/>, document.getElementById(\"root\"));\n" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Fix property fallback removes attribute\n" }, { "from": "human", "value": "import List from './List';\n\nclass Property extends List {\n link(node, name, value) {\n const accessor = this.resolveProperty(node, name);\n\n this.engine._link(value, {\n value...
javascript
chosen
[ { "from": "system", "value": "Simplify logic by removing nested ternaries\n\nAlso dropped the use strict line\n" }, { "from": "human", "value": "'use strict'\nvar isObject = require('is-object')\nvar isWindow = require('is-window')\n\nfunction isNode (val) {\n return !isObject(val)\n ? false...
javascript
chosen
[ { "from": "system", "value": "Add a method that returns the type of order from the order id\n" }, { "from": "human", "value": "let id_regex = /\\b\\d+(\\.\\d+){2}\\b/;\n\nvar Utils = {\n get_object_id: (obj_id) => {\n let id_regex_res = id_regex.exec(obj_id);\n return id_regex_r...
javascript
chosen
[ { "from": "system", "value": "Add link to comment and new WebChannel port comment." }, { "from": "human", "value": "\n\nexport async function onDocumentReady(firebaseApp) {\n\n //[START fs_emulator_connect]\n //firebaseApp previously initialized using firebase.initializeApp()\n const db = fir...
javascript
chosen
[ { "from": "system", "value": "Text: Fix deserialization when usin tags\n" }, { "from": "human", "value": "TextAdapter = {\n\tname: 'TextAdapter',\n\n\thandles : [\n\t\t'text',\n\t\t'heading',\n\t\t'ck_editor',\n\t\t'quote',\n\t\t'widget'\n\t],\n\n\ttags : { // Relates the st type with the html t...
javascript
chosen
[ { "from": "system", "value": "Deploy to GitHub pages [ci skip]\n" }, { "from": "human", "value": "export default {\n BackgroundsPlus: require(\"./backgrounds-plus.jpg\")\n};\n" }, { "from": "gpt", "value": "import React from \"react\";\nimport Image from \"../../../components/Image\...
javascript
chosen
[ { "from": "system", "value": "Set default unmountDelay to 1000, removed unnecessary const\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\n\nconst createConfirmation = (Component, unmountDelay) => {\n return (props) => {\n const wrapper = docu...
javascript
chosen
[ { "from": "system", "value": "Add the team counter generator function\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n angular\n .module('owcast')\n .service('counterGenerator', counterGenerator);\n\n function counterGenerator() {\n this.getCount...
javascript
chosen
[ { "from": "system", "value": "Use dark theme for monaco editor.\n" }, { "from": "human", "value": "let currentEditor;\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const config = {\n apiKey: 'AIzaSyA1r_PfVDCXfTgoUNisci5Ag2MKEEwsZCE',\n databaseURL: \"https://fulfillment-dec...
javascript
chosen
[ { "from": "system", "value": "Throw error if no config passed to errorHandler factory (instead of using example config)\n" }, { "from": "human", "value": "/*\n * Error handling middleware factory\n *\n * @see module:midwest/util/format-error\n * @see module:midwest/util/log-error\n */\n'use stri...
javascript
chosen
[ { "from": "system", "value": "Return string from array of macro configuration in applyMacro\n" }, { "from": "human", "value": "const { assign, omit, isFunction, isArray, map } = require('lodash')\nconst queryString = require('query-string')\n\nmodule.exports = {\n serviceTitle: 'Data Hub',\n p...
javascript
chosen
[ { "from": "system", "value": "Update link to Signup to use Link component\n" }, { "from": "human", "value": "import React from 'react'\nimport {\n Link\n} from 'react-router-dom'\n\nconst Nav = () => {\n return (\n <ul>\n <div className=\"navbar-left\">\n <li><Link to=\"/\">Hom...
javascript
chosen
[ { "from": "system", "value": "Make search by name default\n" }, { "from": "human", "value": "const api = require('./src/api');\n\nfunction isRoute(route) {\n return slot => {\n return slot.l === route;\n }\n}\n\n// http://stackoverflow.com/questions/18082/validate-decimal-numbers-in...
javascript
chosen
[ { "from": "system", "value": "Add HTML Comment remover to normal template processing.\n\nAll of the other plugins are using the `lintTree` hook, which cannot\nmodify the resulting generated template. This commit adds the\nRemoveConfigurationHtmlComments plugin as part of the normal\nember-cli-htmlbars prepr...
javascript
chosen
[ { "from": "system", "value": "Use env port per default.\n" }, { "from": "human", "value": "var Hapi = require('hapi');\n\nvar server = new Hapi.Server();\nserver.connection({ port: 3000 });\n\nserver.route({\n method: 'GET',\n path: '/',\n handler: function (request, reply) {\n r...
javascript
chosen
[ { "from": "system", "value": "Use creed shim for better Promises.\n" }, { "from": "human", "value": "// This is the app bootstrapper.\n// If we're in dev mode, run from src.\nprocess.env.NODE_ENV === 'dev'\n ? require('./src/main').main()\n : require('./build/main').main()\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Make sure our ReadableStream can be written to\n" }, { "from": "human", "value": "module.exports = function(runtime) {\n\n var STREAM_MODULE = 'stream';\n\n function Readable() {\n Readable.$super.call(this);\n this._args = arguments;\n th...
javascript
chosen
[ { "from": "human", "value": "Create v0.0.1 without documentation and tests.\n" }, { "from": "gpt", "value": "function Medium () {\n this.channels = {};\n\n return this;\n}\n\nMedium.prototype.subscribe = function (channel, listener) {\n\n if (channel === undefined || listener === undefi...
javascript
chosen
[ { "from": "system", "value": "Move main logic to lib/\n" }, { "from": "human", "value": "/**\n * @fileoverview TinyIterator definition.\n * @author Nathan Buchar\n */\n\n'use strict';\n\n/**\n * Iterates over an array. For each value in the array, we pass it and a\n * \"done\" callback function ...
javascript
chosen
[ { "from": "system", "value": "Allow contextDependencies to be specified" }, { "from": "human", "value": "var utils = require('loader-utils');\nvar sass = require('node-sass');\nvar path = require('path');\n\n\nmodule.exports = function(content) {\n var root;\n\n this.cacheable && this.cacheabl...
javascript
chosen
[ { "from": "system", "value": "Support either global or local locale\n\nThe global locale should be set by using `Globalize.locale()` prior to\nthe rendering.\n\nA local locale should be set via a property `locale` in the React\ncomponent.\n" }, { "from": "human", "value": "var Globalize = requir...
javascript
chosen
[ { "from": "system", "value": "Add an helper to apply multiple extras\n\n* See #15\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n byGroupAndType : require('./src/byGroupAndType'),\n byType : require('./src/byType.js'),\n markdown: require('./src/markdown'),\n display...
javascript
chosen
[ { "from": "system", "value": "Fix output paths so they do not include input tree paths.\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar GlobFilter = require('broccoli-glob-filter');\nvar path = require('path');\n\nfunction LodashRenderer(inputTree, options) {\n if (!(this ins...
javascript
chosen
[ { "from": "system", "value": "Add out param support for edge cases\n" }, { "from": "human", "value": "var lerp = require('lerp-array');\n\nfunction interpolateArrays(arrays, t, out) {\n if (t >= 1) {\n return arrays[arrays.length - 1];\n }\n if (arrays.length == 1) {\n ret...
javascript
chosen
[ { "from": "system", "value": "Allow to pass compiler options" }, { "from": "human", "value": "var _ = require('lodash');\n\nmodule.exports = function (source) {\n this.cacheable && this.cacheable();\n var template = _.template(source);\n return 'module.exports = ' + template;\n};\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Determine homepage from the repository field\n" }, { "from": "human", "value": "'use strict';\n\nvar npmconf = require('npmconf')\n , opn = require('opn');\n\nvar path = require('path');\n\n\nvar pkgFromDirectory = function (directory, cb) {\n npmconf.Conf().findP...
javascript
chosen
[ { "from": "system", "value": "Fix another bug in Redux counter implementation\n" }, { "from": "human", "value": "const defaultState = {\n reduxCount: 1\n};\n\nexport default function(state = defaultState, action) {\n switch (action.type) {\n case 'COUNTER_INCREMENT':\n return {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix stupid bug. Shame on me!\n" }, { "from": "human", "value": "var SassPlotter = require('sass-plotter');\nvar through = require('through');\nvar path = require('path');\nvar fs = require('...
javascript
chosen
[ { "from": "system", "value": "Add the redacter display name to the redaction text\n" }, { "from": "human", "value": "/*\nCopyright 2015, 2016 OpenMarket Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou...
javascript
chosen
[ { "from": "system", "value": "Revert \"Override `_pxBoundsToTileRange` instead of `_getTiledPixelBounds`.\"\n\nThis reverts commit 89edebf902a9d5024da5388f3c9df174e263c99e.\n" }, { "from": "human", "value": "(function(previousMethods){\n\nif (typeof previousMethods === 'undefined') {\n\t// Defi...
javascript
chosen
[ { "from": "system", "value": "Fix code edior isn't loading old-prefixed solutions\n" }, { "from": "human", "value": "// depends on: codeUri\nwindow.common = (function(global) {\n const {\n localStorage,\n common = { init: [] }\n } = global;\n\n var codeStorage = {\n getStoredValue(ke...
javascript
chosen
[ { "from": "system", "value": "Remove extraneous require of util\n" }, { "from": "human", "value": "// jshint esversion:6\n\n/**\n * @module extensive\n * @desc extensive exports the {@link extensive~extend} function.\n */\nconst extensive = (function() {\n \"use strict\";\n\n const _ ...
javascript
chosen
[ { "from": "system", "value": "Add Ripple & remove List component\n" }, { "from": "human", "value": "export { COLOR, TYPO, PRIMARY_COLORS, THEME_NAME } from './config';\nexport { default as Avatar } from './Avatar';\nexport { default as Button } from './Button';\nexport { default as Card } from '...
javascript
chosen
[ { "from": "system", "value": "Add support to Portuguese and Spanish" }, { "from": "human", "value": "/**\n * worder\n * Get the words from the input text.\n *\n * @name worder\n * @function\n * @param {String} s The input string.\n * @return {Array} An array of strings representing the text word...
javascript
chosen
[ { "from": "system", "value": "Add \"last\" property to enable the calling application to get the file path of the last loaded config file\n" }, { "from": "human", "value": "\"use strict\";\n\nvar use = require(\"alamid-plugin/use.js\");\n\nvar path = require(\"path\"),\n argv = require(\"mini...
javascript
chosen
[ { "from": "system", "value": "Disable button and change colour/text when not enough stock.\n" }, { "from": "human", "value": "(function() {\n $(function() {\n var number_of_units, quantity, quantity_spinner, radios, selectedRadio, unit_amount;\n\n unit_amount = 0;\n quantity = 0;\n\n ...
javascript
chosen
[ { "from": "system", "value": "Remove middlewares attribute and update docs\n" }, { "from": "human", "value": "/**\n * StackedHttpKernel.js\n *\n * @author: Harish Anchu <harishanchu@gmail.com>\n * @copyright Copyright (c) 2015-2016, QuorraJS.\n * @license See LICENSE.txt\n */\n\nfunction Stacked...
javascript
chosen
[ { "from": "system", "value": "Clean up blueprint a bit\n" }, { "from": "human", "value": "module.exports = {\n normalizeEntityName: function() {\n },\n\n beforeInstall: function(options) {\n return this.addBowerPackageToProject('chartist', '~0.7.4');\n }\n};" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Fix WeDo extension chip wording\n" }, { "from": "human", "value": "const EXTENSION_INFO = {\n microbit: {\n name: 'micro:bit',\n icon: 'extension-microbit.svg',\n hasStatus: true\n },\n music: {\n l10nId: 'project.musicExtensionC...
javascript
chosen
[ { "from": "system", "value": "Add conditional logic to support asset path resolution for both autocomplete-python and atom-plugin.\n" }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\n\nconst WEBPACK_FILELOADER_PATH_KEY = \"default\";\n\nconst LogoPath = r...
javascript
chosen
[ { "from": "human", "value": "Add basic structure of module and Morse map\n" }, { "from": "gpt", "value": "module.exports = {\n encode: encode,\n decode: decode\n};\n\nvar map = {\n 'A': '.-',\n 'B': '-...',\n 'C': '-.-.',\n 'D': '-..',\n 'E': '.',\n 'F': '..-.',\n 'G': '--.',\n 'H': '....
javascript
chosen
[ { "from": "system", "value": "Remove copy-to-clipboard text in title.\n" }, { "from": "human", "value": "/*jslint indent: 2, unparam: true*/\n/*global $: false, document: false, togglbutton: false, createTag: false*/\n'use strict';\n\ntogglbutton.render('#tickets-show:not(.toggl)', {observe: tru...
javascript
chosen
[ { "from": "system", "value": "Use path.sep for windows electron detection in node\n\n" }, { "from": "human", "value": "const fs = require(\"fs\")\nconst JSON5 = require(\"json5\");\nconst path = require(\"path\");\n\nif (process.argv.length < 3) {\n process.exit(1);\n}\n\nconst last = arr => ar...
javascript
chosen
[ { "from": "system", "value": "Change error handling in dev mode\n" }, { "from": "human", "value": "if (!global.DEV_MODE) {\n process.on('uncaughtException', (error) => {\n console.error(error);\n Emitter.sendToGooglePlayMusic('error', {\n error: {\n message: error.message,\n ...
javascript
chosen
[ { "from": "system", "value": "Use lodash method instead of vanilla js\n" }, { "from": "human", "value": "import React, {PropTypes} from 'react'\nimport classnames from 'classnames'\n\nconst VisHeader = ({views, view, onToggleView, name}) => (\n <div className=\"graph-heading\">\n {views.leng...
javascript
chosen
[ { "from": "system", "value": "Fix linter error after update\n" }, { "from": "human", "value": "const vscode = require('vscode'); // eslint-disable-line import/no-unresolved\n\nmodule.exports = (config =>\n ({\n autosave: config.get('autosave'),\n lastPart: config.get('lastPart'),\n pre...
javascript
chosen
[ { "from": "system", "value": "Enable sanatize html output of marked\n" }, { "from": "human", "value": "import marked from 'marked';\n\n// TODO: Ensure security\nconst renderer = new marked.Renderer();\nrenderer.link = (href, title, text) =>\n `<a target=\"_blank\" href=\"${href}\" title=\"${tit...
javascript
chosen
[ { "from": "system", "value": "Remove <p> tags from rendered markdown\n" }, { "from": "human", "value": "$(\"[name='submit']\").click(function(e) {\n e.preventDefault();\n var form = $(this).parents('form:first');\n var flag = $(\"input[name='flag']\", form).val();\n var pid = $(\"inp...
javascript
chosen
[ { "from": "system", "value": "Check Window type in UIEvent\n" }, { "from": "human", "value": "\"use strict\";\n\nconst EventImpl = require(\"./Event-impl\").implementation;\n\nclass UIEventImpl extends EventImpl {\n initUIEvent(type, bubbles, cancelable, view, detail) {\n if (this._dispatchF...
javascript
chosen
[ { "from": "system", "value": "Change the url when clicking on a kata group." }, { "from": "human", "value": "import React from 'react';\n\nexport default class KataGroups extends React.Component {\n render() {\n const {kataGroups} = this.props;\n return (\n <div id=\"nav\" className=...
javascript
chosen
[ { "from": "system", "value": "Use Yahoo UI Library to abstract away some clunky code for css-class manipulation and event handling.\n\nsvn commit r11816\n" }, { "from": "human", "value": "function SwatActions(id, values, selected)\n{\n\tvar self = this;\n\tvar is_ie = (document.addEventListener)...
javascript
chosen
[ { "from": "system", "value": "Add basic test for integrate\n" }, { "from": "human", "value": "/* global describe, it, expect, Vector3, Particle */\ndescribe('Particle', function () {\n 'use strict';\n\n it('should be a constructor function', function () {\n expect(typeof Particle).toBe('fun...
javascript
chosen
[ { "from": "system", "value": "Reduce duplicate info stored in _data_list\n" }, { "from": "human", "value": "\nvar _data_list = [];\n\nfunction fetchDataAndRenderContent () {\n console.log(\"fetchDataAndRenderContent first time!\");\n _data_list = [];\n extractDataAndUpdateContent();\n}\n\nfun...
javascript
chosen
[ { "from": "system", "value": "Use ES6 features in test\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\n\nfunction read(filename) {\n return fs.readFileSync(filename, {'encoding': 'utf8'});\n}\n\nexports.revision = {\n 'build': function(test) {\n var actual = rea...
javascript
chosen
[ { "from": "system", "value": "Set eslint config as root\n" }, { "from": "human", "value": "module.exports = {\n \"extends\": \"airbnb-base/legacy\",\n \"parserOptions\": {\n \"ecmaVersion\": 5\n },\n \"env\": {\n \"browser\": true,\n \"node\": true\n },\n \"rules\": {\n \"inden...
javascript
chosen
[ { "from": "system", "value": "Test replacing the first substring occurrence\n" }, { "from": "human", "value": "var replace = require( \"../src/str-replace\" );\n\nmodule.exports = {\n replace_all: function( assert ) {\n var actual = replace\n .all( \"/\" )\n .from( \"/home/dir\" ...
javascript
chosen
[ { "from": "system", "value": "Add flag to skip queue subscription.\n" }, { "from": "human", "value": "/**\n * Module dependencies.\n */\n\n\nexports = module.exports = function(adapter, settings, logger) {\n\n return function subscribe(done) {\n var config = settings.get('connection') || {}\...
javascript
chosen
[ { "from": "system", "value": "Remove unused leftover from a removed import\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this file,\n * You can obtain one at http://mozi...
javascript
chosen
[ { "from": "system", "value": "Trim before testing for equality on unit tests." }, { "from": "human", "value": "var FILE = require(\"file\");\nvar ASSERT = require(\"assert\");\n\nvar Haml = require(\"../lib/haml\");\n\nFILE.glob(\"test/*.haml\").forEach(function(hamlFile) {\n exports[\"test \...
javascript
chosen
[ { "from": "system", "value": "viewport: Correct testcase to reflect updated isWindow/isDOMDocument methods\n" }, { "from": "human", "value": "/* eslint-env node, mocha, browser */\n/* global expect */\n\nimport viewport from '../viewport';\n\ndescribe('\"viewport\"', () => {\n it('Should return...
javascript
chosen
[ { "from": "system", "value": "Add initial tests for inViewport\n" }, { "from": "human", "value": "import test from 'ava';\n\ntest.todo('Write test for utils.inViewport');\n" }, { "from": "gpt", "value": "import test from 'ava';\nimport { inViewport } from '../src/viewport';\n\nwindow...
javascript
chosen
[ { "from": "system", "value": "Move vendor chunk to BASE_CONFIG\n" }, { "from": "human", "value": "'use strict';\nconst webpack = require('webpack');\nconst merge = require('webpack-merge');\nconst validate = require('webpack-validator');\nconst config = require('./buildConfig');\n\nconst BASE_CO...
javascript
chosen
[ { "from": "system", "value": "Load JSX from jsx folder\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar path = require('path');\n\nvar BUILD_DIR = path.resolve(__dirname, 'views/js');\nvar APP_DIR = path.resolve(__dirname, 'jsx');\n\nvar config = {\n entry: {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug where production build fails because of gl-matrix being ES6.\n" }, { "from": "human", "value": "module.exports = {\n entry: \"./src/exports.js\",\n output: {\n filename: 'bundle.js',\n library: 'ModelViewer',\n libraryTarget: 'var'...
javascript
chosen
[ { "from": "system", "value": "Change browser build to UMD\n" }, { "from": "human", "value": "'use strict';\n\nvar webpack = require('webpack');\n\nvar plugins = [\n new webpack.DefinePlugin({\n 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)\n }),\n new webpack.optimize.Occure...
javascript
chosen
[ { "from": "system", "value": "Revert \"Fix order of eslint-loader\"\n\nThis reverts commit 58b53a99e486c39ad1b8d44bb8a3de82764c659e.\n" }, { "from": "human", "value": "const ExtractTextPlugin = require('extract-text-webpack-plugin')\nconst externals = require('webpack-node-externals')\nconst pat...
javascript
chosen
[ { "from": "system", "value": "Add plugin to ignore moment.js language packs.\n" }, { "from": "human", "value": "module.exports = {\n entry: \"./src/app.js\",\n output: {\n path: \"./build\",\n filename: \"bundle.js\",\n publicPath: 'http://localhost:8090/assets'\n },\n module: {\n ...
javascript
chosen
[ { "from": "system", "value": "Print sample server URL at startup\n" }, { "from": "human", "value": "var app = require('./app');\nvar config = require('../config.json');\napp.listen(config.port);\n" }, { "from": "gpt", "value": "var app = require('./app');\nvar config = require('../co...
javascript
chosen
[ { "from": "system", "value": "test(withDirectory): Fix breaking usages of an updated version of tempy\n" }, { "from": "human", "value": "import tempy from 'tempy'\nimport fs from 'fs-extra'\n\nexport default function (test) {\n test.beforeEach(async (t) => {\n const directory = tempy.directo...
javascript
chosen
[ { "from": "system", "value": "Add comment on intercom link ID\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\n\nmoduleForComponent('intercom-launcher',\n 'Integration | Component | interc...
javascript
chosen
[ { "from": "system", "value": "Use libdefs for fbjs instead of types from node_modules\n\nSummary:\nWhen code depends on a module from fbjs, its types come from the node_modules\ndirectory. This is problematic when Flow is deployed, since we can't codemod the\nparts that come from node_modules.\n\nReviewed B...
javascript
chosen
[ { "from": "system", "value": "Update \"X-Molotov-Agent\" header for Molotov version 1.2.2.\n" }, { "from": "human", "value": "chrome.webRequest.onBeforeSendHeaders.addListener(\n function(details) {\n details.requestHeaders.push({\n name: \"X-Molotov-Agent\",\n va...
javascript
chosen
[ { "from": "system", "value": "Update build dependencies, especially broccoli.\n" }, { "from": "human", "value": "var browserify = require('broccoli-browserify');\nvar concat = require('broccoli-concat');\nvar ENV = process.env.ENVIRONMENT || 'development';\nvar es6class = require('es6-class');\n...
javascript
chosen
[ { "from": "system", "value": "Return JSON in error handlers\n" }, { "from": "human", "value": "var express = require('express');\nvar logger = require('morgan');\nvar bodyParser = require('body-parser');\n\nvar index = require('./routes/index');\n\nvar app = express();\n\nif (process.env.NODE_EN...
javascript
chosen
[ { "from": "system", "value": "Add self to list of filtered users for editors\n\nCloses #4412\n" }, { "from": "human", "value": "import AuthenticatedRoute from 'ghost/routes/authenticated';\nimport PaginationRouteMixin from 'ghost/mixins/pagination-route';\nimport styleBody from 'ghost/mixins/sty...
javascript
chosen
[ { "from": "system", "value": "Use lastModifiedAt in the sitemap if possible\n" }, { "from": "human", "value": "\nsitemaps.add('/reports.xml', function() {\n var out = [], reports = Reports.find({}).fetch();\n _.each(reports, function(report) {\n out.push({\n page: 'rapport/' + report._...
javascript
chosen
[ { "from": "system", "value": "Fix issue with js caching\n" }, { "from": "human", "value": "/*\n* Copyright (C) Sam Parkinson 2014\n*\n* This file is part of ASLO.\n*\n* ASLO is free software: you can redistribute it and/or modify it under\n* the terms of the GNU Affero General Public License as ...
javascript
chosen
[ { "from": "system", "value": "Add sample points API call\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\n/* GET home page. */\nrouter.get('/', function(req, res, next) {\n res.render('index', { title: 'Express' });\n});\n\nvar XMLHttpReque...
javascript
chosen
[ { "from": "system", "value": "Update permission for local development" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { CrossStorageHub } from 'cross-storage';\n\nimport App from './App';\n\nCrossStorageHub.init([\n\t{ origin: /\\.appbase.io...
javascript
chosen
[ { "from": "system", "value": "Remove logging and redundant js\n\n" }, { "from": "human", "value": "(function() {\n 'use strict'\n\n angular\n .module('webApp')\n .controller('boneController', boneController)\n .directive('boneTab', boneTab);\n\n boneController.$inject = ['$http'];\n\...
javascript
chosen
[ { "from": "system", "value": "Test Fixes\n\t- Fixes tests related to the generator\n" }, { "from": "human", "value": "var Class = new Marionette.Application();\n\nClass.addRegions({\n //Add application regions here\n});\n\n//Navigate to specific route\nClass.navigate = function (route, options)...
javascript
chosen
[ { "from": "system", "value": "Fix mocked URL in artists test\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport { test } from 'ember-qunit';\nimport startApp from '../helpers/start-app';\nvar App;\n\nmodule(\"Artist recommendation tests\", {\n setup: function() {\n App = s...
javascript
chosen
[ { "from": "system", "value": "Fix legend gradient label text to use update set.\n" }, { "from": "human", "value": "import {Perc, Label, GuideLabelStyle} from './constants';\nimport guideMark from './guide-mark';\nimport {TextMark} from '../marks/marktypes';\nimport {LegendLabelRole} from '../mar...
javascript
chosen
[ { "from": "system", "value": "Fix ol/ul bug under firefox.\n" }, { "from": "human", "value": "/*\n jquery.popline.list.js 0.1.0-dev\n\n Version: 0.1.0-dev\n Updated: Aug 11th, 2014\n\n (c) 2014 by kenshin54\n*/\n;(function($) {\n\n $.popline.addButton({\n orderedList: {\n iconClass:...
javascript
chosen
[ { "from": "system", "value": "Fix requestAnimationFrame case for SSR\n" }, { "from": "human", "value": "/** @flow */\n\ntype Callback = (timestamp: number) => void;\ntype CancelAnimationFrame = (requestId: number) => void;\ntype RequestAnimationFrame = (callback: Callback) => number;\n\n// Prope...
javascript
chosen
[ { "from": "system", "value": "Fix result's grammar issue. Show a message when inputs are invalid.\n" }, { "from": "human", "value": "(function init() {\n document.getElementById(\"input1\").addEventListener(\"input\", calc);\n document.getElementById(\"input2\").addEventListener(\"input\",...
javascript
chosen