conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove obsolute async util import\n" }, { "from": "human", "value": "import { transformFile } from 'babel-core'\nimport { then } from '../util/async'\nimport { debug } from '../util/stdio'\nimport { default as es2015 } from 'babel-preset-es2015'\nimport { default as...
javascript
chosen
[ { "from": "system", "value": "Add /keys endpoint for setting & getting from Redis\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\nvar redis = require('redis').createClient(process.env.REDIS_URL);\n\napp.get('/', function(req, res){\n res.send('hello w...
javascript
chosen
[ { "from": "system", "value": "Return an empty array instead of `null`\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (arr) {\n\tvar arch = process.arch === 'x64' ? 'x64' : process.arch === 'arm' ? 'arm' : 'x86';\n\tvar platform = process.platform;\n\n\tif (!arr.len...
javascript
chosen
[ { "from": "system", "value": "Add comment about binary res.json()\n" }, { "from": "human", "value": "const jsonMask = require('json-mask')\n\nmodule.exports = function (opt) {\n opt = opt || {}\n\n function partialResponse(obj, fields) {\n if (!fields) return obj\n return jsonMask(obj, f...
javascript
chosen
[ { "from": "system", "value": "Make it easy to use mocked/stubbed connections for testing\n" }, { "from": "human", "value": "var express = require('express');\nvar Connection = require('./lib/backend/connection').Connection;\nvar restAdaptor = require('./lib/frontend/rest-adaptor');\nvar socketIo...
javascript
chosen
[ { "from": "system", "value": "Remove http_server from nodeca context.\n" }, { "from": "human", "value": "\"use strict\";\n\n\n// stdlib\nvar Fs = require('fs');\n\n\n// nodeca\nvar NLib = require('nlib');\n\n\n// 3rd-party\nvar StaticLulz = require('static-lulz');\nvar FsTools = NLib.Vendor.FsTo...
javascript
chosen
[ { "from": "system", "value": "Use task property for require func\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n gutil = require('gulp-util');\n\nfunction loadTasks(config) {\n var tasks = Object.keys(config);\n tasks.forEach(function (name) {\n var taskConfig = ...
javascript
chosen
[ { "from": "system", "value": "Add property assignments to the DOM node being created\n" }, { "from": "human", "value": "function neymar(type, props, ...children) {\n props = props || {}\n return {\n type,\n props,\n children: Array.prototype.concat.apply([], children)\...
javascript
chosen
[ { "from": "system", "value": "Check for `randomBytes` before trying to use Node.js crypto\n\nBrowserify's `require()` will return an empty Object here, which evaluates to\n`true`, so check for the function we need before trying to use it.\n" }, { "from": "human", "value": "var window = require('...
javascript
chosen
[ { "from": "system", "value": "Add declaration to top of script\n" }, { "from": "human", "value": "(function() {\n var Dependument = require('dependument').Dependument;\n\n var d = new Dependument({\n source: 'package.json',\n output: 'DEPENDENCIES.md'\n });\n\n d.process();\n})();\n" ...
javascript
chosen
[ { "from": "system", "value": "Remove init in public api\n\n" }, { "from": "human", "value": "const RunPluginScriptCommand = require('./src/commands/runPluginScript')\nconst CreateProjectCommand = require('./src/commands/createProject')\nconst AddPluginsCommand = require('./src/commands/addPlugin...
javascript
chosen
[ { "from": "system", "value": "Add message for starting the server\n" }, { "from": "human", "value": "'use strict'\nconst http = require('http')\nconst express = require('express')\nconst bodyParser = require('body-parser')\nconst Bot = require('messenger-bot')\n\nlet bot = new Bot({\n token: pr...
javascript
chosen
[ { "from": "system", "value": "Add shouldComponentUpdate to excludeMethods array." }, { "from": "human", "value": "var excludeMethods = [\n /^constructor$/, \n /^render$/, \n /^component[A-Za-z]+$/\n];\n\nvar displayNameReg = /^function\\s+([a-zA-Z]+)/;\n\nfunction isExcluded(methodName) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix casing of require('isarray') for cross-platform compatibility\n" }, { "from": "human", "value": "var isArray = require('isArray');\n\n/**\n * Returns the maximum array depth of the array, meaning the maximum number of nests in the nested arrays.\n * @param {Any...
javascript
chosen
[ { "from": "system", "value": "Fix can not read property of undefined error\n" }, { "from": "human", "value": "var once = require('once');\n\nmodule.exports = function () {\n\n var collections = [].slice.call(arguments);\n\n if(!Array.isArray(collections[0])) {\n\n collections = [ co...
javascript
chosen
[ { "from": "system", "value": "Add file as second param\n" }, { "from": "human", "value": "/*jslint indent: 2, vars: true */\nvar es = require('event-stream');\nvar gutil = require('gulp-util');\nvar Buffer = require('buffer').Buffer;\n\nvar cheerio = require('cheerio');\n\nfunction modify(elem, ...
javascript
chosen
[ { "from": "system", "value": "Refactor algorithm to perform better\n" }, { "from": "human", "value": "'use strict'\n\nvar visit = require('unist-util-visit')\nvar toString = require('nlcst-to-string')\nvar posjs = require('pos')\n\nmodule.exports = pos\n\nvar tagger = new posjs.Tagger()\n\nfunct...
javascript
chosen
[ { "from": "system", "value": "Fix ordering issue when launching lightgallery from the button\n" }, { "from": "human", "value": "/* Launches project gallery lightbox from button on project show pages */\n\n$(\"#launch-gallery\").on(\"click\", function(event) {\n event.preventDefault();\n $(\"#p...
javascript
chosen
[ { "from": "system", "value": "Make sure the username is lower case when imported from ldap\n\nOtherwise the meteor accounts package cannot find the user document which leads to errors when logging in with an username that has upper case letters\n" }, { "from": "human", "value": "let _ = require(...
javascript
chosen
[ { "from": "system", "value": "Add `adaptTimeout` helper that changes timeouts during Travis test.\n" }, { "from": "human", "value": "/*! resol-vbus | Copyright (c) 2013-2014, Daniel Wippermann | MIT license */\n'use strict';\n\n\n\nvar _ = require('lodash');\nvar Q = require('q');\n\n\n\nvar tes...
javascript
chosen
[ { "from": "system", "value": "Fix issue when edit is clicked on more than one post and then cancelled on both.\n" }, { "from": "human", "value": "\nvar oldContents = null;\n\nvar editForumPost = function(postId, postNumber) {\n var postSelector = $(\"#\" + postNumber);\n\n // We grab the t...
javascript
chosen
[ { "from": "system", "value": "fix: Fix issue with 2 embed modals interferring with YouTube close\n" }, { "from": "human", "value": "$('.close-modal').click(function () {\n $('#yt-player').hide();\n $('#yt-player iframe').attr(\"src\", jQuery(\"#yt-player iframe\").attr(\"src\"));\n});" }...
javascript
chosen
[ { "from": "system", "value": "Remove trailing comma in define array. Close gh-1336.\n" }, { "from": "human", "value": "define([\n\t\"../core\",\n\t\"../selector\",\n\t\"../effects\",\n], function( jQuery ) {\n\tjQuery.expr.filters.animated = function( elem ) {\n\t\treturn jQuery.grep(jQuery.time...
javascript
chosen
[ { "from": "system", "value": "Add new Delegated Authentication Protocol\n\nAdd new simpler POST route to support delegated authentication, which\nutilises a default action.\n" }, { "from": "human", "value": "module.exports.routes = {\n 'post /register': 'UserController.create',\n 'post /logout...
javascript
chosen
[ { "from": "system", "value": "Update a sample of ES6\n" }, { "from": "human", "value": "#!/usr/bin/env babel-node\n\nimport assert from 'assert';\n\n\nfunction getObj() {\n return {\n x: 2,\n y: 3\n };\n}\n\nlet {\n x,\n y,\n z = 6\n} = getObj();\n\n\nassert.strictEqual(x, 2);\nassert...
javascript
chosen
[ { "from": "system", "value": "Switch to use two separate events instead of the single event to prevent the CSS transition problem.\n" }, { "from": "human", "value": "/**\n * Created by Zack Boman on 1/31/14.\n * http://www.zackboman.com or tennisgent@gmail.com\n */\n\n(function(){\n\n var mod...
javascript
chosen
[ { "from": "system", "value": "Sort output in build files\n" }, { "from": "human", "value": "const fs = require('fs');\nconst glob = require('glob');\nconst yaml = require('js-yaml');\nconst extendify = require('extendify');\n\nglob(\"templates/*.yml\", function (er, files) {\n const contents = ...
javascript
chosen
[ { "from": "system", "value": "Make the appRoot param optional\n" }, { "from": "human", "value": "var Server = require(\"./server.js\").Server;\nvar Config = require(\"./config.js\").Config;\n\nexports.nails = appRoot => {\n var cfg = new Config(appRoot + \"/config.json\");\n cfg.set('appRoot',...
javascript
chosen
[ { "from": "system", "value": "Use a different message if GraphQL errors and we show a flash\n" }, { "from": "human", "value": "import EventEmitter from 'eventemitter3';\n\nclass FlashesStore extends EventEmitter {\n constructor() {\n super(...arguments);\n this.ERROR = \"error\";\n }\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix annotations in MediaReadyState util\n\nFor some reason, the new compiler in the master branch let this by,\nbut the old compiler in the v2.5.x branch complained when I\ncherry-picked the utility.\n\nChange-Id: I1e688f72594b74ed7d2a7c2801eb179b8ec13e8c\n" }, { "from"...
javascript
chosen
[ { "from": "system", "value": "Add a semicolon to address ESLint issue\n\nThis might be the cause of a failed Travis build.\n" }, { "from": "human", "value": "/**\n * Gets whether the AMP story's featured image has the right minimum dimensions.\n *\n * The featured image populates teh AMP story p...
javascript
chosen
[ { "from": "system", "value": "Make the spacebar usable for inline edit" }, { "from": "human", "value": "/*!\n * Copyright 2012 Sakai Foundation (SF) Licensed under the\n * Educational Community License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the Li...
javascript
chosen
[ { "from": "system", "value": "Attach the URL to the event.\n\nSigned-off-by: François de Metz <5187da0b934cc25eb2201a3ec9206c24b13cb23b@stormz.me>\n" }, { "from": "human", "value": "var icalendar = require('icalendar');\n\nexports.generateIcal = function(boards) {\n var ical = new icalendar.i...
javascript
chosen
[ { "from": "system", "value": "Upgrade IDBan command to do some more checking\n" }, { "from": "human", "value": "import BaseCommand from './BaseCommand';\n\n/**\n * Simple command to ban a uaer by their ID.\n */\nclass IDBanCommand extends BaseCommand {\n constructor(bot) {\n super(bot)...
javascript
chosen
[ { "from": "system", "value": "Add action to set active donation\n" }, { "from": "human", "value": "export const FETCH_QUEUE = 'FETCH_QUEUE'\nexport const FETCH_QUEUE_DONE = 'FETCH_QUEUE_DONE'\nexport const FETCH_ACCOUNTS = 'FETCH_ACCOUNTS'\nexport const FETCH_TAGS = 'FETCH_TAGS'\nexport const AD...
javascript
chosen
[ { "from": "system", "value": "Disable the proxy when Mirage is enabled\n\nThis is to prevent max socket connection errors that can stop\nthe live reload server from responding.\n" }, { "from": "human", "value": "'use strict';\n\n// Issue to improve: https://github.com/hashicorp/nomad/issues/7465...
javascript
chosen
[ { "from": "system", "value": "Add GH method for retrieving maintainerd config file.\n" }, { "from": "human", "value": "const fetch = require(\"node-fetch\");\nconst qs = require(\"qs\");\nconst { load } = require(\"js-yaml\");\n\nconst { getInstallationToken } = require(\"./installation-token\")...
javascript
chosen
[ { "from": "system", "value": "Fix all config for Eslint 4" }, { "from": "human", "value": "/* eslint-disable global-require */\n\n'use strict';\n\nconst allRules = {\n 'no-unused-styles': require('./lib/rules/no-unused-styles'),\n 'no-inline-styles': require('./lib/rules/no-inline-styles'),\n ...
javascript
chosen
[ { "from": "system", "value": "Disable linting for generated file\n" }, { "from": "human", "value": "const paths = require('./paths');\nconst fs = require('fs-extra');\nconst glob = require('glob');\n\n/**\n * Build the breakpoint\n *\n * @param {*} breakpoint\n * @param {*} count\n */\nfunction ...
javascript
chosen
[ { "from": "system", "value": "Make sure the extractBody is set (not just body)\n" }, { "from": "human", "value": "// --------------------------------------------------------------------------------------------------------------------\n//\n// metadata-config.js - config for AWS Instance Metadata\...
javascript
chosen
[ { "from": "system", "value": "Initialize state in class-based component\n" }, { "from": "human", "value": "import React, { Component } from 'react'\n\n//class-based component (ES6)\nclass SearchBar extends Component {\n render() { //method definition in ES6\n return <input onChange={event =>...
javascript
chosen
[ { "from": "system", "value": "Add author information for SEO purposes\n" }, { "from": "human", "value": "module.exports = {\n js: {\n lintNatives: true,\n name: '<%= pkg.name %>',\n url: '<%= pkg.homepage %>',\n version: '<%= pkg.version %>',\n description: ...
javascript
chosen
[ { "from": "system", "value": "Remove svg from file-loader test pattern\n" }, { "from": "human", "value": "export default () => {\n return {\n test: /\\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/i,\n loader: \"file\",\n query: { name: \"assets/[name]-[hash].[ext]\" }\n };\n}\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Add comments for functions that handle user account info submission\n" }, { "from": "human", "value": "angular.module('shortly.shorten', [])\n\n.controller('AccountsController', function ($scope, $window, $location, $http, Links) {\n\n // $scope.hasStripeConnectAcc...
javascript
chosen
[ { "from": "system", "value": "docs: Add doc comments for file templater\n" }, { "from": "human", "value": "\"use strict\";\n\nvar fs = require('fs');\nvar path = require('path');\nvar extend = require('extend');\nvar template = require('lodash/template');\n\nvar errorHandler = require('./errorHa...
javascript
chosen
[ { "from": "system", "value": "Remove unused container in instance initializer\n" }, { "from": "human", "value": "import ActiveModelAdapter from 'active-model-adapter';\nimport ActiveModelSerializer from 'active-model-adapter/active-model-serializer';\n\nexport default {\n name: 'active-model-ad...
javascript
chosen
[ { "from": "system", "value": "Update example with customDatesStyles and markedDates.\n\n" }, { "from": "human", "value": "/**\n * Sample React Native Calendar Strip\n * https://github.com/BugiDev/react-native-calendar-strip\n * @flow\n */\n\nimport React, { Component } from 'react';\nimport Cale...
javascript
chosen
[ { "from": "system", "value": "Remove template file when done configuring\n" }, { "from": "human", "value": "module.exports = {\n \"replace\": {\n \"_i18n/template.en-US.json\": {\n \"author\": /docprofsky/g,\n \"info-name\": \"info.name\",\n \"info-use\": \"info.use\",\n ...
javascript
chosen
[ { "from": "system", "value": "Load the tasks from lib/tasks" }, { "from": "human", "value": "var gulp = require('gulp')\n , gutil = require('gulp-util')\n , help = require('gulp-help')\n , path = require('path')\n , packageJson = require(path.resolve(__dirname, 'pa...
javascript
chosen
[ { "from": "system", "value": "Use only-dev-server to not reload on syntax errors\n" }, { "from": "human", "value": "\"use strict\";\n\nvar _ = require(\"lodash\"); // devDependency\nvar base = require(\"./webpack.config.dev\");\n\n// Clone our own module object.\nvar mod = _.cloneDeep(base.modul...
javascript
chosen
[ { "from": "system", "value": "Fix to return true for NaN\n" }, { "from": "human", "value": "/**\n * Checks if 'value' is a number.\n * Note: NaN is considered a number.\n * @param {*} value The value to check.\n * @returns {Boolean} Returns true if 'value' is a number, else false.\n */\n...
javascript
chosen
[ { "from": "system", "value": "Fix wrong class name in CardSupportingText\n" }, { "from": "human", "value": "import m from 'mithril';\nimport attributes from './attributes';\n\nexport let Card = {\n\tview(ctrl, args, ...children) {\n\t\targs = args || {};\n\t\tlet attr = attributes(args);\n\t\tle...
javascript
chosen
[ { "from": "system", "value": "Add configBasedir to properly look up the plugins\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar stylelint = require('stylelint');\nvar STYLELINT_CONFIG = require('./config/stylelint');\nvar glob = require('glob');\n\nvar ruleUtils = require('./r...
javascript
chosen
[ { "from": "system", "value": "Update to gulp watch js folder\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n sass = require('gulp-sass'),\n rename = require('gulp-rename'),\n minifyCss = require('gulp-minify-css'),\n autoprefixer = require('gulp-autoprefixer'),\n ...
javascript
chosen
[ { "from": "system", "value": "Clear compiled projects when a project is created or switched to\n\nIf you create a new project, or start the process of switching to an\nexisting project, we want to clear the preview state. Otherwise:\n\n* When you create a new project, the old project sticks around\n* When s...
javascript
chosen
[ { "from": "system", "value": "Remove hardcoding of port number for Heroku\n" }, { "from": "human", "value": "var express = require('express');\n\nvar bodyParser = require('body-parser');\n\nvar app = express();\n\n// host static client files on server\n// app.use(express.static(__dirname + '/cli...
javascript
chosen
[ { "from": "system", "value": "Use alternate way of setting git author\n" }, { "from": "human", "value": "import {exec} from 'node-promise-es6/child-process';\nimport fs from 'node-promise-es6/fs';\n\nasync function run() {\n const {linkDependencies = {}} = await fs.readJson('package.json');\n ...
javascript
chosen
[ { "from": "system", "value": "Add support for margins in column layout.\n\n" }, { "from": "human", "value": "export default class ColumnLayout {\n constructor (options) {\n this._options = {\n columns: 5\n };\n Object.assign(this._options, options);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Use real env var for custom mix file\n\nThe previous approach doesn’t work with current webpack cli now.\n" }, { "from": "human", "value": "let argv = require('yargs').argv;\n\nclass Paths {\n /**\n * Create a new Paths instance.\n */\n constructor() {...
javascript
chosen
[ { "from": "system", "value": "Add Python server to localhost\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require( 'gulp' );\nvar g = require( 'gulp-load-plugins' )();\n\nvar allTestFiles = './tests/**/*.js';\n\ngulp.task( 'assets', function() {\n gulp.src([\n 'node_modules...
javascript
chosen
[ { "from": "system", "value": "Change browsersync to listen for changes to JS/LESS as well\n" }, { "from": "human", "value": "var elixir = require('laravel-elixir');\n\n/*\n |--------------------------------------------------------------------------\n | Elixir Asset Management\n |----------------...
javascript
chosen
[ { "from": "system", "value": "Add notification to restart atom when switching to/from LSP\n" }, { "from": "human", "value": "/* @flow */\n\nconst useLSP = atom.config.get('flow-ide.useLSP')\n\n// possible improvement: check if flow really supports lsp\n\nif (useLSP === true) {\n // eslint-disab...
javascript
chosen
[ { "from": "system", "value": "Use path.relative to create the bundles glob\n" }, { "from": "human", "value": "var NwBuilder = require(\"node-webkit-builder\");\nvar asap = require(\"pdenodeify\");\nvar path = require(\"path\");\nvar rimraf = require(\"rimraf\");\n\nmodule.exports = function(opti...
javascript
chosen
[ { "from": "system", "value": "Add missing setup in class.\n" }, { "from": "human", "value": "const { BadRequest } = require('@feathersjs/errors');\n\nconst userDataFilter = user => ({\n\tuserId: user._id,\n\temail: user.email,\n\tfirstName: user.firstName,\n\tlastName: user.lastName,\n\timportHa...
javascript
chosen
[ { "from": "system", "value": "Fix javascript dependencies for a couple other plugins that aren't AMD modules\n" }, { "from": "human", "value": "// Common configuration for RequireJS\nvar require = {\n baseUrl: \"/scripts\",\n paths: {\n \"jquery\": \"bower_components/jquery/dist/jq...
javascript
chosen
[ { "from": "system", "value": "Use brackets to indicate negative values on overview table\n" }, { "from": "human", "value": "import { Map as map } from 'immutable';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Editable from '../../../editable';\nimport { formatCurrency...
javascript
chosen
[ { "from": "system", "value": "Fix JSHint errors & warnings\n" }, { "from": "human", "value": "/* jshint devel:true */\n/* global exports, require, URI */\n\nexports.parser = function(url, callbacks) {\n if (url) {\n var queryMap = new URI(url).search(true);\n if (queryMap.CFTemp...
javascript
chosen
[ { "from": "system", "value": "Remove duplcate init property on RouteHandler\n" }, { "from": "human", "value": "import { genKey } from './key';\n\nexport default class RouteHandler {\n\tconstructor(conf) {\n\t\tthis.id = genKey();\n\t\tthis.init = conf.init;\n\t\tthis.beforeInit = conf.beforeInit...
javascript
chosen
[ { "from": "system", "value": "chore(build-doc): Update root url for prod\n" }, { "from": "human", "value": "var algoliaComponents = require('algolia-frontend-components');\nvar fs = require('fs');\n\nimport {rootPath} from './path';\n\nconst prod = process.env.NODE_ENV === 'production';\nconst d...
javascript
chosen
[ { "from": "system", "value": "Add push flow, but test fail\n" }, { "from": "human", "value": "var express = require('express');\nvar Git = require(\"nodegit\");\nvar router = express.Router();\nvar token = process.env.GITHUB_TOKEN;\n\nrouter.post('/issues', function(req, res, next) {\n Git.Clon...
javascript
chosen
[ { "from": "system", "value": "Fix typo in server rendering view\n" }, { "from": "human", "value": "const assert = require('assert')\nconst choo = require('../../../')\n\nmodule.exports = function (params, state, send) {\n const serverMessage = state.message.server\n const clientMessage = state...
javascript
chosen
[ { "from": "system", "value": "Add user to session when they create a new account\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\nimport encryptUtils from '../utilities/encrypt';\nimport userUtils from '../utilities/users_service.js';\n\nimp...
javascript
chosen
[ { "from": "system", "value": "Add env override for mongodb url\n" }, { "from": "human", "value": "module.exports = {\n db: {\n qrest_api:{\n $filter: 'env',\n $base: {\n options: {}\n },\n production: {\n url: 'm...
javascript
chosen
[ { "from": "system", "value": "feat: Add in base CLI interface\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconsole.log('hits cli.js file');" }, { "from": "gpt", "value": "#!/usr/bin/env node\n\nvar program = require('commander');\nvar prompt = require('inquirer');\nvar p...
javascript
chosen
[ { "from": "system", "value": "Allow binary_japan to have dir\n" }, { "from": "human", "value": "module.exports = {\n all: {\n options: {\n separator: ';',\n },\n files: {\n 'dist/js/binary.js': [\n 'src/javascript/lib/jquery.js',\n ...
javascript
chosen
[ { "from": "system", "value": "Handle failed geocoder requests correct\n" }, { "from": "human", "value": "anol.geocoder.Base = function(_options) {\n if(_options === undefined) {\n return;\n }\n this.url = _options.url;\n this.options = _options;\n};\n\nanol.geocoder.Base.proto...
javascript
chosen
[ { "from": "system", "value": "Fix placement of translators comment.\n" }, { "from": "human", "value": "/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * External dependencies\n */\nimport { sanitizeHTML } from 'assets/js/util';\n\nexport const setting...
javascript
chosen
[ { "from": "system", "value": "Fix reference to Gravatar img tag\n" }, { "from": "human", "value": "function renderDeliciousLinks(items) {\n var output = '<ul class=\"divided\">';\n for (var i = 0, l = items.length; i < l; i++) {\n output += '<li><a href=\"' + items[i].u + '\" title=...
javascript
chosen
[ { "from": "human", "value": "Split out error dialog into component\n" }, { "from": "gpt", "value": "import React from 'react';\n\nimport Dialog from 'material-ui/lib/dialog';\nimport FlatButton from 'material-ui/lib/flat-button';\n\nexport default ({ open, closeMe }) => (\n <Dialog\n title=\...
javascript
chosen
[ { "from": "system", "value": "Use named import for uglify rollup plugin\n" }, { "from": "human", "value": "import uglify from 'rollup-plugin-uglify';\nimport commonjs from 'rollup-plugin-commonjs';\nimport resolve from 'rollup-plugin-node-resolve';\n\nexport default {\n name: 'KeyCode',\n ...
javascript
chosen
[ { "from": "system", "value": "Make it so HTML and EJS are both rendering via EJS.\n" }, { "from": "human", "value": "var routeList = require('../config/routeList');\nvar router = require('koa-router'); \nvar controllers = require('./controllers')\nvar views = require('./views'); \n\nmodule.expor...
javascript
chosen
[ { "from": "system", "value": "Update interestGroup to fetch all members\n" }, { "from": "human", "value": "import { compose } from 'redux';\nimport { connect } from 'react-redux';\nimport prepare from 'app/utils/prepare';\nimport {\n joinGroup,\n leaveGroup,\n fetchGroup,\n fetchMemberships,...
javascript
chosen
[ { "from": "system", "value": "Fix Loop dependency in OrbitControls\n\n\n\nFormer-commit-id: 8a856c3abacefad6dd5679baa714fe7bc24446ee" }, { "from": "human", "value": "import {Vector3} from 'three';\nimport {ThreeOrbitControls} from './lib/ThreeOrbitControls';\n\nexport class OrbitModule {\n cons...
javascript
chosen
[ { "from": "system", "value": "Fix umd and cjs export names\n" }, { "from": "human", "value": "import babel from 'rollup-plugin-babel';\nimport resolve from 'rollup-plugin-node-resolve';\nimport commonjs from 'rollup-plugin-commonjs';\nimport { terser } from 'rollup-plugin-terser';\n\nimport pkg ...
javascript
chosen
[ { "from": "system", "value": "Allow doc to be passed in as the lone first param\n" }, { "from": "human", "value": "// Loaded ready states\nconst loadedStates = ['interactive', 'complete'];\n\n// Return Promise\nmodule.exports = (cb, doc) => new Promise(resolve => {\n\t// Use global document if w...
javascript
chosen
[ { "from": "system", "value": "Transform sidebar into traditional class and add type and color selectors\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nimport GBox from 'grommet/components/Box';\nimport GParagraph from 'grommet/components/Paragraph';\nimport GHead...
javascript
chosen
[ { "from": "system", "value": "Fix “checkRunning” to return right container’s running status" }, { "from": "human", "value": "var exec = require('child_process').exec\n\nmodule.exports.asyncIterate = function(array, callback, done) {\n function iterate(idx) {\n var current = array[idx]\...
javascript
chosen
[ { "from": "system", "value": "Change broken url for one with usefull info.\n" }, { "from": "human", "value": "index = 0;\nconfig = self.getConfig();\n\nfunction add(url, title, description, icon)\n{\n if (config.BoolValue(url, false) == false) {\n self.addRecommendation(0.0, url, title...
javascript
chosen
[ { "from": "system", "value": "Simplify deserialization call and remove unnecessary logging.\n" }, { "from": "human", "value": "const logger = require('../logging');\nconst passport = require('passport');\nconst { setupOIDC } = require('./oidc');\nconst { deserializeUser } = require('./user');\n\...
javascript
chosen
[ { "from": "system", "value": ":new: Add rgba support to regex\n" }, { "from": "human", "value": "'use babel'\n\nconst COLOR_EXTRACTION_REGEXP = /rgb\\(\\d+, \\d+, \\d+\\)|\\#[0-9a-f]{3,6}/\n\nexport function isColor(textEditor, bufferPosition) {\n const lineText = textEditor.getTextInRange([[bu...
javascript
chosen
[ { "from": "system", "value": "Disable inline source map when optimization enabled\n" }, { "from": "human", "value": "'use strict'\n\nlet sass = require('node-sass')\n\n/*\n * Transform SASS to CSS.\n * @public\n * @param {string} folderPath - Path to the folder containing the SASS file.\n * @par...
javascript
chosen
[ { "from": "system", "value": "Check whether liftedStore is initiated\n" }, { "from": "human", "value": "export default function createDevToolsStore(onDispatch) {\n let currentState = {\n committedState: {},\n stagedActions: [],\n computedStates: [],\n skippedActions: {},\n curren...
javascript
chosen
[ { "from": "system", "value": "Add version to debug info" }, { "from": "human", "value": "import { debug, context } from './utils'\n\nconst version = require('../package.json').version\n\nimport config from './config/config'\nimport setup from './config/setup'\nimport groups from './registry/regi...
javascript
chosen
[ { "from": "system", "value": "Use real pathname from location\n" }, { "from": "human", "value": "import React from \"react\";\nimport { View } from \"react-native\";\nimport { withRouter } from \"react-router\";\n\nimport ListingProvider from \"../app/ListingProvider\";\nimport PostListSort from...
javascript
chosen
[ { "from": "system", "value": "Remove unused dependencies from toolbar component\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @module opa\n */\n\n(function(app) {\n\n /**\n * Manages opaToolbar component.\n *\n * @class OpaToolbarController\n * @constructor\n * @param {O...
javascript
chosen
[ { "from": "system", "value": "Clean up overly verbose test output\n" }, { "from": "human", "value": "/**\n * General test runner\n */\n\nvar fs = require('fs');\nvar files = fs.readdirSync(fs.realpathSync('./test'));\n\nconsole.log(files);\n\nfor (var i in files) {\n var pattern = /^(test)\\w*\...
javascript
chosen
[ { "from": "system", "value": "Add comments & cleanup formatting.\n" }, { "from": "human", "value": "var speculation = function speculation (fn) {\n // Don't cancel by default:\n var cancel = (\n arguments.length > 1 &&\n arguments[1] !== undefined\n ) ? arguments[1] : Promise.reject();\...
javascript
chosen
[ { "from": "system", "value": "fix(tests): Include all TypeScript files in coverage\n" }, { "from": "human", "value": "module.exports = {\n\ttransform: {\n\t\t\".(ts|tsx)\": \"ts-jest\"\n\t},\n\t\"testEnvironment\": \"node\",\n\t\"testRegex\": \"(/__tests__/.*|\\\\.(test|spec))\\\\.(ts|tsx|js)$\"...
javascript
chosen
[ { "from": "system", "value": "Allow decode of characters between 1 and 3 digits long\n" }, { "from": "human", "value": "/*jslint node: true*/\n'use strict';\n\n/**\n * Decode the value.\n *\n * @param value The value.\n * @returns The value.\n */\nmodule.exports = function (value) {\n\t// Check ...
javascript
chosen
[ { "from": "system", "value": "Use new RootView also on Android\n" }, { "from": "human", "value": "/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n * @flow\n */\n\nimport React, { Component } from 'react';\nimport {\n AppRegistry,\n StyleSheet,\n Text,\n View\n} ...
javascript
chosen