conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update tests for new bootstrap\n" }, { "from": "human", "value": "'use strict';\n\nrequire('dotenv').config({ path: __dirname + '/.env', silent: true });\n\n// load deps\nconst lab = exports.lab = require('lab').script();\nconst chai = require('chai');\n\n// chai pl...
javascript
chosen
[ { "from": "system", "value": "Stop mixing in each letter of strings\n" }, { "from": "human", "value": "// Mixin ############################################################################\n\n/**\n * Mix a key-value into Storm, protecting Storm from\n * having a pre-existing key overwritten. Of ...
javascript
chosen
[ { "from": "system", "value": "Fix the way the combineReducer handles paths.\n" }, { "from": "human", "value": "import get from 'lodash.get';\nimport isFunction from 'lodash.isfunction';\n\nexport function combineReducers(stateReducerMap, rootPath) {\n return function(state, action) {\n let c...
javascript
chosen
[ { "from": "system", "value": "Add `clearPagination` to package exports\n" }, { "from": "human", "value": "if (! window._babelPolyfill) {\n require(\"babel-polyfill\");\n}\n\nimport reducers from './reducers';\nimport sagas from './sagas';\nimport {\n getResource,\n listResource,\n allResourc...
javascript
chosen
[ { "from": "system", "value": "Check for input file before trying to use\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nimport fs from 'fs'\nimport path from 'path'\nimport postcss from 'postcss'\nimport defaultConfig from './defaultConfig'\nimport program from 'commander'\nimport tail...
javascript
chosen
[ { "from": "system", "value": "Use recursive function for traversal - babel will transform to a linear iterative process\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n deref: deref\n};\n\nfunction deref (pointer, doc) {\n const segments = compact(pointer.split('/'));\n...
javascript
chosen
[ { "from": "system", "value": "Check if source isn't object instead of is string\n\nWe may wanna pass in different types like buffers for Node.js.\n" }, { "from": "human", "value": "// Return Promise\nconst mergeImages = (sources = [], options = { format: 'image/png' }) => new Promise(resolve => ...
javascript
chosen
[ { "from": "system", "value": "Set the computed value on the View-Model itself, the way Vue does it\n" }, { "from": "human", "value": "const prefix = '_async_computed$'\n\nexport default {\n install (Vue, options) {\n options = options || {}\n\n Vue.config\n .optionMergeStrategies\n ...
javascript
chosen
[ { "from": "system", "value": "Rewrite to modern ES syntax\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport Root from './components/Root';\n\n\nwindow.document.addEventListener('DOMContentLoaded', function() {\n var $container = window.do...
javascript
chosen
[ { "from": "system", "value": "[New] Remove development mode warning log\n" }, { "from": "human", "value": "import Vue from './lib/vue';\nimport VueWrapper from './VueWrapper';\nimport './lib/matchesPolyfill';\n\nfunction createElem() {\n const elem = document.createElement('div');\n\n document...
javascript
chosen
[ { "from": "system", "value": "Update the alert template a bit. Allow closing by ESC" }, { "from": "human", "value": "angular.module('com.likalo.ui')\n .factory('uiDialog', ['ngDialog',\n function (ngDialog) {\n return {\n alert: function (title, message) {\n var infoClas...
javascript
chosen
[ { "from": "system", "value": "Fix onmouseout error when leaving window.\n" }, { "from": "human", "value": "function findAncestor(element, className) {\n while ((element = element.parentElement) && element && !hasClass(element, className));\n return element;\n}\n\nfunction hasClass(element,...
javascript
chosen
[ { "from": "system", "value": "Icon: Remove unused var in story\n" }, { "from": "human", "value": "/**\n * Icon Story: Basic Usage\n */\n\nimport React from 'react';\nimport { select, color } from '@storybook/addon-knobs';\nimport Icon from '../Icon';\nimport icons from '../icons';\nimport css fr...
javascript
chosen
[ { "from": "system", "value": "Change the types according to the names in the README\n" }, { "from": "human", "value": "var replaceAll = function( oldToken ) {\n var configs = this;\n return {\n from: function( string ) {\n return {\n to: function( newToken ) {\n var tem...
javascript
chosen
[ { "from": "system", "value": "Fix invalid route-syntax in base controller class.\nAffected route is related to PUT-routes.\nPrevious behavior was still using the name-parameter when calling a route-helper function.\n" }, { "from": "human", "value": "export default class Controller {\n constru...
javascript
chosen
[ { "from": "system", "value": "Reset changes count on editor ready\n" }, { "from": "human", "value": "import Backbone from 'backbone';\nimport { appendStyles } from 'utils/mixins';\n\nconst $ = Backbone.$;\n\nexport default Backbone.View.extend({\n initialize() {\n const { model } = this;\n ...
javascript
chosen
[ { "from": "system", "value": "Add category path in category helper\n\nThe path allows to make a category link with `url_for(category.path)`.\n\nBuilt from bbfd0979098c6e8588c95878a0b00a27bd08af55.\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nvar regexCache = {\n\tpost: {}\n};...
javascript
chosen
[ { "from": "system", "value": "Fix path to lib dir since this script moved\n" }, { "from": "human", "value": "const Promise = require('bluebird');\nconst db = require('./lib/db');\n\nPromise.resolve()\n .then( () => db.startup() )\n .then( () => db.sqlite().migrate() )\n .catch( err => console...
javascript
chosen
[ { "from": "system", "value": "Update bitso to newest api and add xrp coin\n" }, { "from": "human", "value": "const Lang = imports.lang;\n\nconst Local = imports.misc.extensionUtils.getCurrentExtension();\nconst BaseProvider = Local.imports.BaseProvider;\n\n\nconst Api = new Lang.Class({\n Name:...
javascript
chosen
[ { "from": "system", "value": "Revert \"change string and number\"\n\nThis reverts commit ed53dbe5cbed9ea00a3cdf5e0c83697a0a9df643.\n" }, { "from": "human", "value": "// Object with a diversity of properties to\n// be asserted\nvar types = {\n string: String('hey'),\n number: Number(10),\n fn:...
javascript
chosen
[ { "from": "system", "value": "Use config to build paths\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2013-2015 Memba Sarl. All rights reserved.\n * Sources at https://github.com/Memba\n */\n\n/* jshint node: true, expr: true */\n/* globals describe: false, before: false, it: false */...
javascript
chosen
[ { "from": "system", "value": "[CodeFactor] Apply fixes to commit 9d2b647\n\n[ci skip] [skip ci]\n" }, { "from": "human", "value": "/* eslint no-console:off */\nconst fs = require('fs');\nconst { Decoder } = require('./lib/ebml.js');\n\nconst decoder = new Decoder();\n\ndecoder.on('data', chunk =...
javascript
chosen
[ { "from": "system", "value": "Remove use of Math.truc() which isn't available in IE 11.\n" }, { "from": "human", "value": "/*\n * @license\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file e...
javascript
chosen
[ { "from": "system", "value": "Add query and response in function call\n" }, { "from": "human", "value": "$(document).ready(function() {\n $(\"#input\").focus();\n $(\"#input\").on(\"keydown\", function(event) {\n if (event.keyCode === 13) {\n event.preventDefault();\n controllers....
javascript
chosen
[ { "from": "system", "value": "Fix incorrect property on fallback location object\n" }, { "from": "human", "value": "import { loginUser } from '../../gateways/users';\nimport { replace } from 'react-router-redux';\nimport { authSuccess, authFailure } from '../../common/auth/actions';\nimport { st...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary node of DSL\n" }, { "from": "human", "value": "import Orchestrator from 'orchestrator'\nimport TaskBuilder from './task-builder'\n\nexport const orchestrator = new Orchestrator()\n\n/**\n * Creates a task of the given name and dependencies.\n *\n ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Use port for protocol when none is provided\"\n\nThis reverts commit b8c2f03b8e26cee0eb36153def9be41ee5adb79b.\n" }, { "from": "human", "value": "\nvar websocket = require('websocket-stream');\nvar URL = require('url');\n\nfunction buildBuilder(client, opts...
javascript
chosen
[ { "from": "system", "value": "Send data using traces format to realtime analysis.\n" }, { "from": "human", "value": "'use strict';\n\nvar sessions = require('../sessions');\n\nvar kafkaConsumer = function (kafkaConfig) {\n var kafka = require('../services/kafka')(kafkaConfig.uri);\n var pl...
javascript
chosen
[ { "from": "system", "value": "Attach to correct DOM node\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\n// import App from './components/app.jsx';\n\nclass App extends React.Component {\n render () {\n return (\n <h1>{\"JIM\"}</h1>\n ...
javascript
chosen
[ { "from": "system", "value": "Add raw `metablock` to parse result\n" }, { "from": "human", "value": "/**\n * Userscript format:\n * http://wiki.greasespot.net/Metadata_Block\n */\n\nmodule.exports = function extractMetablock (userscriptText) {\n try {\n var metablockReg = /\\B\\/\\/ ==UserSc...
javascript
chosen
[ { "from": "system", "value": "Revert \"ensure to close the file\"\n\nThis reverts commit f1d07a7b2aab2a7436e9cc7d5d05767dd5968dab.\n" }, { "from": "human", "value": "'use strict';\nvar fs = require('fs');\nvar tempfile = require('tempfile2');\n\nmodule.exports = function createWriteStream(...
javascript
chosen
[ { "from": "system", "value": "Check if title should be updated\n\nThis change prevents the document.title of being updated regardless if it had changed or not.\r\nWhen using DocumentTitle today, any time some child component updates, the current document.title updates as well, and it shouldn't." }, { ...
javascript
chosen
[ { "from": "system", "value": "Disable module transformer by default.\n" }, { "from": "human", "value": "module.exports = function buildPreset(context, options) {\n return {\n presets: [\n [require('babel-preset-latest'), { es2015: options }],\n ],\n plugins: [\n require('babe...
javascript
chosen
[ { "from": "system", "value": "Add link to additional animation\n" }, { "from": "human", "value": "\nfunction renderStatus(statusText) {\n\tdocument.getElementById('status').textContent = statusText;\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n\n\t\n\t\n});" }, { "fr...
javascript
chosen
[ { "from": "system", "value": "Refresh the JWT token on page load\n" }, { "from": "human", "value": "import { User } from './ActionTypes';\nimport { post } from '../http';\nimport { replaceWith } from 'redux-react-router';\n\nfunction putInLocalStorage(key) {\n return (payload) => {\n window....
javascript
chosen
[ { "from": "system", "value": "Load i18n Vue plugin for Jest tests\n" }, { "from": "human", "value": "import axios from '~/lib/utils/axios_utils';\n\nconst testTimeoutInMs = 300;\njest.setTimeout(testTimeoutInMs);\n\nlet testStartTime;\n\n// https://github.com/facebook/jest/issues/6947\nbeforeEac...
javascript
chosen
[ { "from": "system", "value": "Use `!` instead of `=== false`\n" }, { "from": "human", "value": "'use strict';\n\nvar each = require('lodash.foreach');\nvar get = require('jaunt').get;\n\nvar identity = function(o) {\n return o;\n};\n\nvar taxonomist = function(arr, prop, fn) {\n\n fn = fn || i...
javascript
chosen
[ { "from": "system", "value": "Make initial scene fadein slower.\n" }, { "from": "human", "value": "define(function(require){\r\n var TimeLine = require(\"timeline\");\r\n\r\n var renderer = new THREE.WebGLRenderer( {antialias: true, alpha:true} );\r\n renderer.shadowMapEnabled = true;\r...
javascript
chosen
[ { "from": "system", "value": "Fix adding the geolocation to the cache\n" }, { "from": "human", "value": "'use strict';\n\nlet geolocation = require('nativescript-geolocation');\nlet requester = require('../web/requester').defaultInstance;\nlet cacheService = require('../common/cache/cache-servic...
javascript
chosen
[ { "from": "system", "value": "Document send() extension to Stanza.\n" }, { "from": "human", "value": "exports.send = function() {\n this.connection.send(this);\n}\n" }, { "from": "gpt", "value": "/**\n * Send stanza.\n *\n * Response stanzas prepared by Junction are extended with th...
javascript
chosen
[ { "from": "system", "value": "Add hook for a view for when all its child views have been rendered\n" }, { "from": "human", "value": "define([\n 'json3',\n],\n\nfunction (JSON) {\n 'use strict';\n\n return {};\n});\n" }, { "from": "gpt", "value": "define([\n 'json3',\n 'ember',\n...
javascript
chosen
[ { "from": "system", "value": "Sort assets on client side\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport map from 'lodash/map';\n\nclass Profile extends Component {\n render() {\n const { profile, assets } = this.pr...
javascript
chosen
[ { "from": "system", "value": "fix(travis): Use a cleaner way of excluding release tags\n" }, { "from": "human", "value": "/* @flow */\nimport type { Template } from 'create-npm/lib/template'\n\nexport default function({\n encryptedNpmToken,\n encryptedGitHubToken\n}: {\n encryptedNpmToken: st...
javascript
chosen
[ { "from": "system", "value": "Make transformer more robust, was loosing annotations.\n" }, { "from": "human", "value": "/*\n Normilize Footnotes contents.\n Removes everything except textual paragraphs from Footnotes.\n*/\nexport default class NormalizeFn {\n\n import(dom) {\n let fns = do...
javascript
chosen
[ { "from": "system", "value": "Fix an issue where Browser.platform is now readonly, thus can't add cordova\n\nSigned-off-by: Yannick Gagnon <d4b2c45cb5d34b718a9a7e841e45e36d4b2966bc@lemieuxbedard.com>\n" }, { "from": "human", "value": "\"use strict\"\nBrowser.platform.cordova = (window.Phonegap |...
javascript
chosen
[ { "from": "system", "value": "Add scoping of static assets" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\n\napp.set('port', (process.env.PORT || 5000));\n\napp.use(express.static(__dirname + '/screens'));\napp.use(express.static(__dirname + '/public'));...
javascript
chosen
[ { "from": "system", "value": "Remove slash from chapters partial path\n\nThe slash must be added to ovPlayerDirectory variable, not directly to the path of the partial\n" }, { "from": "human", "value": "(function(app){\n\n \"use strict\"\n\n /**\n * Creates a new HTML element ov-index to cre...
javascript
chosen
[ { "from": "system", "value": "Support default exports with babel-jsm-plugin\n" }, { "from": "human", "value": "module.exports = function (babel) {\n var exportIds = [];\n var t = babel.types;\n return new babel.Transformer(\"babel-jsm-plugin\", {\n ExportNamedDeclaration: {\n enter: f...
javascript
chosen
[ { "from": "system", "value": "Add arrow-body-style override for consistency\n" }, { "from": "human", "value": "module.exports = {\n \"extends\": [\n \"eslint-config-airbnb\",\n \"eslint-config-standard\"\n ],\n \"parser\": \"babel-eslint\",\n \"plugins\": [\n \"flow-vars\"\n ],\n ...
javascript
chosen
[ { "from": "system", "value": "Add debug mode to hide logs." }, { "from": "human", "value": "var Generator = require('generate-js'),\n Joi = require('joi'),\n async = require('async');\n\nvar EndPoint = Generator.generate(function EndPoint(options) {\n var _ = this;\n\n _.defineProper...
javascript
chosen
[ { "from": "system", "value": "Make sure themes come in if no config present\n" }, { "from": "human", "value": "module.exports = {\n name: 'ember-cli-toggle',\n\n included: function(app) {\n app.import('vendor/ember-cli-toggle/base.css');\n\n // Use configuration to decide which theme css...
javascript
chosen
[ { "from": "system", "value": "Add bold to current category on list\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react'\nimport Relay from 'react-relay';\n\nexport default class CategoryFilter extends Component {\n\n static propTypes = {\n category: PropType...
javascript
chosen
[ { "from": "system", "value": "Remove extraneous args when function does not error\n" }, { "from": "human", "value": "var config = require('./config');\nvar redisClient = require('redis').createClient(config.redis_port, config.redis_host);\n\nvar loadedScriptStrings = {};\n\nexports.client = redi...
javascript
chosen
[ { "from": "system", "value": "Fix heading content's ID generation" }, { "from": "human", "value": "var toc = require('markdown-toc');\n\nmodule.exports = {\n book: {},\n hooks: {\n \"page:before\": function (page) {\n page.content = toc.insert(page.content, {\n ...
javascript
chosen
[ { "from": "system", "value": "Add entry point for node package\n" }, { "from": "human", "value": "const logger = require('./lib/logging')\nconst make = require('./lib/make')\nconst random = require('./lib/random')\nconst utils = require('./lib/utils')\n\nmodule.exports = {\n logger,\n rand...
javascript
chosen
[ { "from": "system", "value": "Add options for exact or globa regex\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function() {\n return new RegExp('^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$');\n}\n" }, { "from": "gpt", "value": "'use strict';\n\nmodule.exports ...
javascript
chosen
[ { "from": "system", "value": "Use passed options, overwriting file on each lap\n" }, { "from": "human", "value": "/*jshint node:true */\n\n\"use strict\";\n\nvar es = require('event-stream'),\n gutil = require('gulp-util'),\n\tpath = require('path'),\n\texec = require('child_process').exec;\n\n...
javascript
chosen
[ { "from": "system", "value": "Switch the format ES6 back to ES5 to make it compatible with IE11\n" }, { "from": "human", "value": "'use strict';\nvar PinyinHelper = require('./lib/PinyinHelper');\nvar ChineseHelper = require('./lib/ChineseHelper');\nvar PinyinFormat = require('./lib/PinyinHelper...
javascript
chosen
[ { "from": "system", "value": "Add initial tests for inView.is\n" }, { "from": "human", "value": "import test from 'ava';\n\ntest.todo('Write test for inView.is');\n" }, { "from": "gpt", "value": "import test from 'ava';\nimport inView from '../src/in-view';\nimport { inViewport } fro...
javascript
chosen
[ { "from": "system", "value": "Remove unused config file reference.\n" }, { "from": "human", "value": "const\n Hapi = require('hapi')\n , Path = require('path')\n , helper = require('./helper.js')\n , config = require('./config.js');\n\n/* Configure the Hapi server *...
javascript
chosen
[ { "from": "system", "value": "Add a return to avoid multiple callbacks\n\nwhen listing folders of an empty folder" }, { "from": "human", "value": "/**\n * @description Gulp plugin that lets you work with folders and treat them as package names\n * @see README.md\n */\nvar fs = require('fs'),\n\t...
javascript
chosen
[ { "from": "system", "value": "Update version string to 2.6.0-rc.1\n" }, { "from": "human", "value": "var\n\tSpotlight = require('./src/spotlight');\n\nSpotlight.version = '2.6.0-pre.20.1';\n\nmodule.exports = Spotlight;\n" }, { "from": "gpt", "value": "var\n\tSpotlight = require('./s...
javascript
chosen
[ { "from": "system", "value": "Fix port in connect middleware.\n" }, { "from": "human", "value": "var connect = require('connect');\n\nvar app = connect();\napp.use(connect.static(__dirname));\napp.listen(7000);" }, { "from": "gpt", "value": "var connect = require('connect');\n\nvar a...
javascript
chosen
[ { "from": "system", "value": "Create prompt if no config file found\n\n" }, { "from": "human", "value": "const\n fs = require('fs'),\n inquirer = require('inquirer');\n\nconst\n configFilePath = process.env.HOME + '/.gitauthors.json',\n authors = loadConfig(),\n choices = createCh...
javascript
chosen
[ { "from": "system", "value": "Fix an illegal invocation bug for seajs.log\n" }, { "from": "human", "value": "/**\n * util-log.js - The tiny log function\n */\n\n// The safe wrapper for `console.xxx` functions\n// log(\"message\") ==> console.log(\"message\")\n// log(\"message\", \"warn\") ==> co...
javascript
chosen
[ { "from": "system", "value": "Add callback to range change" }, { "from": "human", "value": "'use strict';\n\nvar Module = angular.module('datePicker');\n\nModule.directive('dateRange', function () {\n return {\n templateUrl: 'templates/daterange.html',\n scope: {\n start: '=',\n ...
javascript
chosen
[ { "from": "system", "value": "Change map emoji to pushpin\n" }, { "from": "human", "value": "var Botkit = require('botkit')\nvar request = require('request')\nvar mapsToken = process.env.GOOGLE_MAPS_TOKEN\n\n// Expect a SLACK_TOKEN environment variable\nvar slackToken = process.env.SLACK_TOKEN\n...
javascript
chosen
[ { "from": "system", "value": "Make setRadius and updateStyle({radius: 123 }) work.\n" }, { "from": "human", "value": "/*\r\n * L.CircleMarker is a circle overlay with a permanent pixel radius.\r\n */\r\n\r\nL.CircleMarker = L.Circle.extend({\r\n\toptions: {\r\n\t\tradius: 10,\r\n\t\tweight: 2\r\...
javascript
chosen
[ { "from": "system", "value": "Use `Promise.resolve()` to run results serially\n" }, { "from": "human", "value": "\n/* Returns a promise that will resolve on the next AnimationFrame */\nfunction nextFrame() {\n return new Promise(function(resolve, reject) {\n requestAnimationFrame(function() ...
javascript
chosen
[ { "from": "system", "value": "Add tests for new switches\n" }, { "from": "human", "value": "const tap = require('tap')\nconst nsaname = require('../lib/nsaname.js')\n\nvar name = nsaname.getNSAName()\n\ntap.true(nsaname.wordLists.first.some(function (n) { return name.indexOf(n) > -1 }))\ntap.tru...
javascript
chosen
[ { "from": "system", "value": "Return empty array if no gifs\n" }, { "from": "human", "value": "import * as _ from 'lodash'\nimport UUID from 'node-uuid';\n\nconst KEY = 'GIFS';\n\nexport const loadData = () => {\n let data = JSON.parse(localStorage.getItem(KEY));\n\n if (_.isEmpty(data)) {...
javascript
chosen
[ { "from": "system", "value": "Include resource folder for static files\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\nvar url = require('url');\nvar request = require('request');\n\nvar bodyParser = require('body-parser');\napp.use(bodyParser.json());...
javascript
chosen
[ { "from": "system", "value": "Refactor to fit more closely with standard svgo implementation in svgo-loader and image-webpack-loader\n" }, { "from": "human", "value": "var svg = require('svgo');\nvar loaderUtils = require('loader-utils');\nvar compiler = require('vue-template-compiler');\n\nmodu...
javascript
chosen
[ { "from": "system", "value": "Resolve packages relative to the package.json file instead of to the root\n\nFixes #47\n" }, { "from": "human", "value": "'use strict';\nconst path = require('path');\nconst pkgUp = require('pkg-up');\nconst multimatch = require('multimatch');\nconst arrify = requir...
javascript
chosen
[ { "from": "system", "value": "Throw error with invalid parameters\n" }, { "from": "human", "value": "function memobind(_this, funcName) {\n var func = _this[funcName];\n if (!func._memobind_cache) func._memobind_cache = {};\n var cache = func._memobind_cache;\n var args = Array.prototype.sli...
javascript
chosen
[ { "from": "system", "value": "SyntaxError: Use of const in strict mode.\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\nvar BasePlugin = require('ember-cli-deploy-plugin');\n\nmodule.exports = {\n name: 'ember-cli-deploy-firebase',\n\n createDeployPlugin: function(op...
javascript
chosen
[ { "from": "system", "value": "Fix issue with re-render occuring on initial mount.\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\n\nclass Redux extends React.Component {\n constructor(props, context) {\n super(props, context)\n\n this.sele...
javascript
chosen
[ { "from": "system", "value": "Fix bug with article titles\n" }, { "from": "human", "value": "UrlsApp.factory('webhoseFactory', ['$resource', function($resource) {\n self = {};\n\n\n self.webhoseSuggestions = function(topicKeyword, newsSource) {\n var webhoseResource = $resource(\"https://we...
javascript
chosen
[ { "from": "system", "value": "Use an object instead of a Map\n" }, { "from": "human", "value": "import path from \"path\"\nimport {readdir} from \"fs\"\n\nimport {addLocaleData} from \"react-intl\"\nimport fr from \"react-intl/locale-data/fr\"\nimport en from \"react-intl/locale-data/en\"\n\ncon...
javascript
chosen
[ { "from": "system", "value": "Fix type in dispatch function\n" }, { "from": "human", "value": "// @flow\nimport type {CurrentGameActions} from './actions/current-game'\nimport type {EntryActions} from './actions/ui/entry'\nimport type {GameState} from './reducer/current-game'\nimport type {Entry...
javascript
chosen
[ { "from": "system", "value": "Make condition threshold get the default value 0.\n\nMake it work even if number string was passed.\n" }, { "from": "human", "value": "import template from './dd_watcher_agg_threshold.html';\n\nclass DdWatcherAggThreshold {\n constructor($scope) {\n this.$scope ...
javascript
chosen
[ { "from": "system", "value": "Remove render of header and footer on dashboard\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport {BrowserRouter as Router, Route, Link} from 'react-router-dom'\nimport Auth from './Auth'\nimport Dashboard from './Dashboard'\nimport...
javascript
chosen
[ { "from": "system", "value": "Remove loadEnv middleware from auth\n\n* envars are already loaded during controller action\n" }, { "from": "human", "value": "const express = require('express');\n\nconst authRouter = express.Router();\nconst controller = require('./authController');\nconst parseTo...
javascript
chosen
[ { "from": "system", "value": "Revert async process returning promise\n\nThis isn't a good idea, a better test strategy exists.\n" }, { "from": "human", "value": "import { tracked } from '@glimmer/tracking';\nimport { Resource } from 'ember-could-get-used-to-this';\nexport default class AsyncProc...
javascript
chosen
[ { "from": "system", "value": "Convert text to ascii-art comment\n" }, { "from": "human", "value": "'use babel';\n\nimport { CompositeDisposable } from 'atom';\nimport shape from './atom-big-comment-shape';\n\nexport default {\n\n subscriptions: null,\n\n activate(state) {\n // Events subscr...
javascript
chosen
[ { "from": "system", "value": "Make setRadius and updateStyle({radius: 123 }) work.\n" }, { "from": "human", "value": "/*\r\n * L.CircleMarker is a circle overlay with a permanent pixel radius.\r\n */\r\n\r\nL.CircleMarker = L.Circle.extend({\r\n\toptions: {\r\n\t\tradius: 10,\r\n\t\tweight: 2\r\...
javascript
chosen
[ { "from": "system", "value": "Remove shebang because dist-es6 takes care of it\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar fs = require('fs');\n\nrequire('babel/register')({\n stage: 0,\n optional: ['runtime']\n});\n\nfs.exists('spec/support/jasmine.json', function(configExists...
javascript
chosen
[ { "from": "system", "value": "Fix Grunt task relative path.\n" }, { "from": "human", "value": "var path = require('path');\nvar testee = require('../lib/testee');\n\nmodule.exports = function (grunt) {\n grunt.registerMultiTask('testee', 'Run tests', function () {\n var done = this.async();\...
javascript
chosen
[ { "from": "system", "value": "Remove extra line breaks in Registry.emit tests\n" }, { "from": "human", "value": "import test from 'ava';\nimport Registry from '../src/registry';\n\ntest('Registry.emit calls each handler', t => {\n\n let registry = Registry([]);\n\n registry.on('enter', x =...
javascript
chosen
[ { "from": "system", "value": "Add PATCH to http methods \n\nPATCH is referenced but missing in the HTTP Methods object. \r\n\r\nhttps://github.com/cosmicjs/cosmicjs-node/blob/master/src/bucket/object.js#L162" }, { "from": "human", "value": "const HTTP_METHODS = {\n POST: 'post',\n GET: 'get',\...
javascript
chosen
[ { "from": "system", "value": "Send original and new directories\n" }, { "from": "human", "value": "'use strict';\r\n\r\nconst fs = require('fs-extra');\r\n\r\nfunction setDir(options) {\r\n return function setDirInner(dir) {\r\n return {\r\n to: function (location) {\r\n ...
javascript
chosen
[ { "from": "system", "value": "Test getting the code from localstorage.\n" }, { "from": "human", "value": "global.navigator = {platform: 'Mac'};\nglobal.window = {\n location: {hash: ''}\n};\nglobal.localStorage = {\n getItem: function() {}\n};\n\nimport assert from '../../_test-helper/assert';...
javascript
chosen
[ { "from": "system", "value": "Fix a bug in the bug-catching code\n\nWell this is ironic. No idea how to test this either.\n" }, { "from": "human", "value": "import stdio from './stdio'\nimport { resolve } from 'path'\nimport { inspect } from 'util'\nimport { writeFileSync, unlinkSync } from 'fs'...
javascript
chosen
[ { "from": "system", "value": "Add option to limit the output\n" }, { "from": "human", "value": "var extract = require('./extract'),\n check = require('./check');\n\n\n/**\n * Reporter that saves all messages in array.\n * Actually reporters built this way are perfect arrays themselves.\n * Th...
javascript
chosen
[ { "from": "system", "value": "Disable Vue.cong.strict until all views are fixed for it\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Styles\n */\nrequire('../less/admin.less');\n\n\n// Ensure Babel/ES6 polyfills are loaded\nrequire('babel-core/polyfill');\n\n// Catch all errors\nre...
javascript
chosen
[ { "from": "system", "value": "Validate that the function exists before execute.\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root direct...
javascript
chosen
[ { "from": "system", "value": "Use pack.main instead of string\n" }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\nconst crypto = require('crypto');\nconst zlib = require('zlib');\nconst pack = require('../package.json');\n\nconst rootDir = path.dirname(__...
javascript
chosen
[ { "from": "system", "value": "Add route for molecule mf\n" }, { "from": "human", "value": "'use strict';\n\nconst api = require('api');\n\nconst router = require('koa-router')();\n\nrouter.get('/search/em', function*() {\n const value = +this.query.value;\n if (!value) {\n return er...
javascript
chosen
[ { "from": "system", "value": "Prepare for replacing the first occurrence\n" }, { "from": "human", "value": "var replaceAll = function( occurrences ) {\n var configs = this;\n return {\n from: function( target ) {\n return {\n to: function( replacement ) {\n var template...
javascript
chosen
[ { "from": "system", "value": "Fix world size and camera follow.\n" }, { "from": "human", "value": "import Phaser from 'phaser'\n\nimport Player from '../sprites/Player'\n\nimport Curve from '../plugins/Curve'\n\nexport default class extends Phaser.State {\n create () {\n this.game.world.enab...
javascript
chosen