conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change grunt task to test\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n qunit: {\n all: ['http://craighep.github.io/Dissertation/js/tests/*.html']\n },\n });\n...
javascript
chosen
[ { "from": "system", "value": "Move all files from examples folder\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n grunt.initConfig({\n 'connect': {\n demo: {\n options: {\n open: true,\n keepalive...
javascript
chosen
[ { "from": "system", "value": "Add createChannel and recreateChannel and handle channel error and close event\n" }, { "from": "human", "value": "var amqp = require('amqplib');\n\nvar amqpUrl, amqpConnection, intervalID;\n\nfunction connect(_amqpUrl) {\n amqpUrl = amqpUrl || _amqpUrl || process.e...
javascript
chosen
[ { "from": "system", "value": "Use the tracing componenet directly\n" }, { "from": "human", "value": "/* See license.txt for terms of usage */\n\n\"use strict\";\n\nvar { Cu } = require(\"chrome\");\n\nvar FBTrace = {\n sysout: function() {}\n}\n\ntry {\n var scope = {};\n Cu[\"import\"](\"res...
javascript
chosen
[ { "from": "system", "value": "Fix parsing height and width to numbers\n" }, { "from": "human", "value": "const numbers = [\n\t\"height\",\n\t\"width\",\n\t\"thumbnail_height\",\n\t\"thumbnail_width\"\n];\n\nfunction getMetadata(text) {\n\tconst parts = text.match(/\\[!\\[([^\\]]+)+\\]\\(([^\\)]+...
javascript
chosen
[ { "from": "system", "value": "[infrastructure] Allow all valid semvers as commit messages\n" }, { "from": "human", "value": "const fs = require('fs')\nconst path = require('path')\nconst chalk = require('chalk')\nconst boxen = require('boxen')\nconst childProc = require('child_process')\n\nconst...
javascript
chosen
[ { "from": "system", "value": "Use wss on https pages\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n /*global ab: false, RealtimeUpdate: false */\n\n window.wsRealtime = {\n init: function (server, port, timeline) {\n var conn = new ab.Session(\n ...
javascript
chosen
[ { "from": "system", "value": "Fix node_modules paths on Windows\n\nThis change moves 'prefix' test to happen after the absolute path is\nresolved. Without it, the prefix tests never actually fire when starting\nwith a relative path, and the resulting dirs all end up looking like\n[ '/C:..', '/C:...' ] inste...
javascript
chosen
[ { "from": "system", "value": "Change double quotes to single quotes\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('core').controller('MusicalBackgroundController', ['$scope', 'TrialData',\n function($scope, TrialData) {\n\n // Expose TrialData on scope\n $scope.trialD...
javascript
chosen
[ { "from": "system", "value": "Revert \"use strict dependency injection\"\n" }, { "from": "human", "value": "'use strict';\n/**\n * angular-select-text directive\n */\nangular.module('angular-select-text', []).\n directive('selectText', ['$window', function ($window) {\n var selectElement;\n\...
javascript
chosen
[ { "from": "system", "value": "Enable passing in a callback in promise constructors\n" }, { "from": "human", "value": "var Class = require('./Class'),\n\tinvokeWith = require('./invokeWith'),\n\tslice = require('./slice'),\n\teach = require('./each'),\n\tbind = require('./bind')\n\nmodule.exports...
javascript
chosen
[ { "from": "system", "value": "Use select instead of React Dropdown.\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport {\n Col,\n Dropdown,\n Form,\n Row\n} from 'react-bootstrap'\n\nclass DropdownOption extends Component {\n render() {\n const option = t...
javascript
chosen
[ { "from": "system", "value": "Add a bit of timeout to make it work better\n" }, { "from": "human", "value": "import { polyfill } from 'smoothscroll-polyfill';\n\npolyfill();\n\nconst previousScrolls = {};\nwindow.history.scrollRestoration = 'manual';\n\nwindow.addEventListener('scroll', (e) => {...
javascript
chosen
[ { "from": "system", "value": "Remove project: returns deleted project name" }, { "from": "human", "value": "import prompt from 'prompt';\nimport { getPrompt } from '../libs/prompt';\nimport chalk from 'chalk';\nimport Table from 'cli-table';\n\nimport config from '../config';\nimport * as specAc...
javascript
chosen
[ { "from": "system", "value": "Fix for mixed setTimeout/clearTimeout methods\n" }, { "from": "human", "value": "/*\n Shims global timers to behave like node,\n returning values with ref() and unref().\n This is on by default; you can disable with\n --no-node-timers or --no-nt\n */\n\nvar time...
javascript
chosen
[ { "from": "system", "value": "Use embed object instead of parameter string\n" }, { "from": "human", "value": "import {\n REQUEST_MARATHON_GROUPS_SUCCESS,\n REQUEST_MARATHON_GROUPS_ERROR,\n REQUEST_MARATHON_GROUPS_ONGOING\n} from '../constants/ActionTypes';\nvar AppDispatcher = require('./AppD...
javascript
chosen
[ { "from": "system", "value": "Create custom model loader so models can be mocked when testing\n" }, { "from": "human", "value": "/**\n * Incident Theatres\n * An example movie cinema guide API written in NodeJS\n * @copyright 2013 Jeremy Worboys\n */\n\nvar orm = require('orm');\nvar express = r...
javascript
chosen
[ { "from": "system", "value": "Add isPrime helper function (tests :white_check_mark:)\n" }, { "from": "human", "value": "import numbers from './number-iterator.js';\n\nfunction findPrimes(total) {\n\tconst primes = [ ...numbers(total) ].map((number) => {\n\t\t// Logic for finding next prime goes ...
javascript
chosen
[ { "from": "system", "value": "Cover bisect iteration error line\n" }, { "from": "human", "value": "/* eslint no-shadow: 0 */\n'use strict';\n\nvar test = require('tap').test;\nvar bisect = require('../src/bisect');\n\ntest('bisect', function(t) {\n t.test('can find root of sin and cos', funct...
javascript
chosen
[ { "from": "system", "value": "Test selectors and events together.\n" }, { "from": "human", "value": "describe('Events', function () {\n var component, called;\n\n var TestUtils = React.addons.TestUtils;\n\n before(function () {\n called = false;\n component = TestUtils.renderIntoDocumen...
javascript
chosen
[ { "from": "system", "value": "Simplify test DB dropping and drop it after every test\n" }, { "from": "human", "value": "'use strict';\n/* global before, after */\nvar app = require('../server')\n , mongoose = require('mongoose')\n ;\n\nbefore(function (done) {\n if (app.get('env') === 'test')...
javascript
chosen
[ { "from": "system", "value": "Use Device.js to determine mobile editor use\n\nRef #2570\n- Adds new library, device.js to determine if the user is on an ios mobile\n or tablet.\n" }, { "from": "human", "value": "/*global CodeMirror*/\nimport mobileUtils from 'ghost/utils/mobile-utils';\nimport ...
javascript
chosen
[ { "from": "system", "value": "Build runtime as separate file\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n browserify = require('gulp-browserify'),\n uglify = require('gulp-uglify'),\n gzip = require('gulp-gzip'),\n size = require('gulp-size'),\n concat = requir...
javascript
chosen
[ { "from": "system", "value": "Update shortcut keys for new signature" }, { "from": "human", "value": "$(document).ready(function() {\n $(document).keyup(function(e) {\n var tag = e.target.tagName.toLowerCase();\n if (tag != 'input' && tag != 'textarea' && tag != 'select' && !e.c...
javascript
chosen
[ { "from": "system", "value": "Check the message in advice\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\nvar request = require('request');\n\nvar adviceArray = [\"I am God's vessel. But my greatest pain in life is that I will never be able to see myse...
javascript
chosen
[ { "from": "system", "value": "[core] Fix setRequestHeader called too soon." }, { "from": "human", "value": "/*global XMLHttpRequest, XDomainRequest*/\nvar ArgumentInvalidException = require('../helpers/custom_exception').ArgumentInvalidException;\n/**\n * Create a cors http request.\n * @param m...
javascript
chosen
[ { "from": "system", "value": "Introduce some rules map validation\n" }, { "from": "human", "value": "'use strict';\n\nvar forEach = require('es5-ext/object/for-each')\n , memoize = require('memoizee/weak')\n , create = Object.create;\n\nmodule.exports = memoize(function (rules) {\n\tvar map =...
javascript
chosen
[ { "from": "system", "value": "eslint: Configure the parser to allow ES2017 features (async/await)\n" }, { "from": "human", "value": "module.exports = {\n extends: [\n 'onelint'\n ],\n env: {\n es6: true\n },\n parserOptions: null\n};\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Add rules to eslint config\n" }, { "from": "human", "value": "// http://eslint.org/\nmodule.exports = {\n \"extends\": \"eslint:recommended\",\n\n // http://eslint.org/docs/user-guide/configuring#specifying-environments\n \"env\": {\n \"browser\": tr...
javascript
chosen
[ { "from": "system", "value": "Add new line at EOF\n" }, { "from": "human", "value": "module.exports = {\n env: {\n 'jest/globals': true,\n },\n root: true,\n extends: ['@react-native-community'],\n plugins: ['jest'],\n rules: {\n \"array-bracket-spacing\": 0,\n \"no-console\": 0,\...
javascript
chosen
[ { "from": "system", "value": "Fix eslint config (copied babel conf on accident)\n" }, { "from": "human", "value": "module.exports = {\n presets: [\n ['env', {\n targets: {\n node: 'current'\n }\n }]\n ];\n}\n" }, { "from": "gpt", "value": "module.exports = {\...
javascript
chosen
[ { "from": "system", "value": "Change sending of the logout request\n" }, { "from": "human", "value": "import Ember from \"ember\";\r\nimport config from '../config/environment';\r\n\r\nexport default Ember.Component.extend({\r\n\tdidInsertElement: function() {\r\n\t\tthis._super();\r\n\t\tthis.s...
javascript
chosen
[ { "from": "system", "value": "Remove a redundant line in background page" }, { "from": "human", "value": "// /////////////////////////////////////////////////////// //\n// Load content via window.fetch in a background script, //\n// from a content script //\n/...
javascript
chosen
[ { "from": "system", "value": "Add more asserts to tests for error checking\n" }, { "from": "human", "value": "'use strict';\n\nvar assert = require('assert');\nvar ControllerInterface = require('../lib/controller-interface');\n\ndescribe('controller-interface', function() {\n beforeEach(funct...
javascript
chosen
[ { "from": "system", "value": "Add Telegram and Whatsapp Share Button\n" }, { "from": "human", "value": "import React from 'react';\n\nimport PropTypes from 'prop-types';\n\nimport { ShareButtons, generateShareIcon } from 'react-share';\n\n// import { addthis } from '../../../data/config';\n\n// ...
javascript
chosen
[ { "from": "system", "value": "Allow submitting the user message via Ctrl+Enter" }, { "from": "human", "value": "/* See license.txt for terms of usage */\n\n// ********************************************************************************************* //\n// Dialog Implementation\n\nvar UserMes...
javascript
chosen
[ { "from": "system", "value": "refactor: Change event error to event warning.\n" }, { "from": "human", "value": "/*global require, module*/\n'use strict';\n\n// bundled styling for app-header\nrequire('./main.scss');\n\nvar AppHeader = require('./src/js/AppHeader');\n\nvar instance;\n\nvar getOrC...
javascript
chosen
[ { "from": "system", "value": "Change karma log lvl to WARN\n" }, { "from": "human", "value": "const browsers = ['Firefox'];\n\nif (!process.env.CI) {\n browsers.push('Chrome');\n switch (process.platform) {\n case 'darwin':\n browsers.push('Safari');\n break;\n...
javascript
chosen
[ { "from": "system", "value": "Update blog model to match API camelCase changes\n" }, { "from": "human", "value": "import Sequelize from 'sequelize';\nimport database from '../';\nimport User from './user';\n\nconst URI = Sequelize.STRING(2048);\n\nconst blogPostDatabaseDefinition = database.defi...
javascript
chosen
[ { "from": "system", "value": "Fix Interests to be Interest.\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar db = {};\n\nmongoose.connect('mongodb://localhost/brainstormer');\nvar userModel = require('./users/user.server.model.js');\nvar ideaModel = require('./ideas/id...
javascript
chosen
[ { "from": "system", "value": "Switch to em-based media queries\n" }, { "from": "human", "value": "function buildMediaQuery(lowerBound) {\n return `@media only screen and (min-width:${lowerBound})`\n}\n\nexport const mediaQueries = {\n smallUp: buildMediaQuery(\"0px\"),\n mediumUp: buildMediaQ...
javascript
chosen
[ { "from": "system", "value": "Test fix for errors caused by CWD being different when using a systemd initiated service as compared to npm start or node ./\n" }, { "from": "human", "value": "/*\n Created by 'myth' on June 30. 2015\n\n CognacTime is licenced under the MIT licence.\n*/\n\nvar fs ...
javascript
chosen
[ { "from": "system", "value": "Add semicolon to the right place\n" }, { "from": "human", "value": "const config = require('./config');\nconst request = require('./request');\nconst debug = require('./debug');\nconst _template = require('lodash/template');\nconst cache = {};\n\nmodule.exports = {\...
javascript
chosen
[ { "from": "system", "value": "Exit 1 on failure in js helpers\n" }, { "from": "human", "value": "const parser = require(\"../lib/parser\");\n\nconst methodMap = {\n parse: parser.parse\n};\n\nfunction output(obj) {\n process.stdout.write(JSON.stringify(obj));\n}\n\nconst input = [];\nprocess.s...
javascript
chosen
[ { "from": "system", "value": "Add TreeWidget to the concatenated JavaScript output." }, { "from": "human", "value": "//= require_directory ./AbstractDocument\r\n//= require_directory ./BrowserWidget\r\n//= require_directory ./ComponentStateManager\r\n//= require_directory ./Desktop\r\n//= requir...
javascript
chosen
[ { "from": "system", "value": "Allow reverse lookup of Delta types.\n\nAlso use semantic property names in Deltas; instead of ‘data’,\n‘paragraph’ for pargraph operations and ‘section’ for section\noperations.\n" }, { "from": "human", "value": "'use strict';\n\nvar Types = {\n paragraphInsert: 1...
javascript
chosen
[ { "from": "system", "value": "Fix source and destination paths for installing plugins from local disk\n\nThey were installing into eg. my.plugin.id/plugman_dir_basename/*\ninstead of just my.plugin.id/*.\n" }, { "from": "human", "value": "var shell = require('shelljs'),\n fs = require(...
javascript
chosen
[ { "from": "system", "value": "Send headers with local queries\n" }, { "from": "human", "value": "const axios = require('axios')\nconst path = require('path')\n\nlet GraphQL\ntry {\n // do to GraphQL schema issue [see](https://github.com/graphql/graphiql/issues/58)\n GraphQL = require(path.join...
javascript
chosen
[ { "from": "system", "value": ":art: Enhance main module\n- Make promisifyAll work bluebird style\n- Return null instead of false in case of error when throwError is false\n- Return true instead of undefined in case of success when throwError is false\n- Make module exports babel styled\n" }, { "from...
javascript
chosen
[ { "from": "system", "value": "Remove exported forEachNode (now a method of AST.Node).\n" }, { "from": "human", "value": "module AST from \"AST.js\";\n\nimport { Parser } from \"Parser.js\";\nimport { Scanner } from \"Scanner.js\";\n\nexport { Parser, Scanner, AST };\n\nexport function parseModul...
javascript
chosen
[ { "from": "system", "value": "Fix emotion import assuming ES2015 imports intead of commonjs with webpack\n" }, { "from": "human", "value": "const emotionHash = require('@emotion/hash')\n\nlet cache = {}\n\nfunction hash (string) {\n if (!cache[string]) {\n cache[string] = emotionHash(string)...
javascript
chosen
[ { "from": "system", "value": "Use anonymous module when exporting via AMD\n" }, { "from": "human", "value": "// @echo header\n(function (moduleName, factory) {\n 'use strict';\n\n if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {\n //...
javascript
chosen
[ { "from": "system", "value": "Check if value is not null\n" }, { "from": "human", "value": "export function isNumber(v) {\n return typeof v === \"number\";\n}\n\nexport function isString(v) {\n return typeof v === \"string\";\n}\n\nexport function isObject(v) {\n return typeof v === \"object\...
javascript
chosen
[ { "from": "system", "value": "Add IP address to state\n" }, { "from": "human", "value": "'use strict';\n\nconst clientManager = require('./clientManager');\nconst dbg = require('debug')('anamorph:stateManager');\n\nmodule.exports = new class StateManager {\n getState(id) {\n this.clientId = ...
javascript
chosen
[ { "from": "system", "value": "Add option to watch for changes in svg icons sources\n" }, { "from": "human", "value": "// Configuration\nvar browserSync = require('browser-sync');\n\n// Init browserSync manually\nmodule.exports = function(grunt) {\n grunt.registerTask('bs-init', function () {\...
javascript
chosen
[ { "from": "system", "value": ":bug: Cover case of entering via plain youtube.com\n" }, { "from": "human", "value": "//\nchrome.webNavigation.onBeforeNavigate.addListener((details) => {\n console.log(details);\n\n if(detectYTURL(details.url) && details.url.indexOf(\"disable_polymer=true\") === ...
javascript
chosen
[ { "from": "system", "value": "Allow adding new connection from connection picker\n" }, { "from": "human", "value": "import Select from 'antd/lib/select';\nimport React from 'react';\nimport { ConnectionsContext } from '../connections/ConnectionsStore';\n\nconst { Option } = Select;\n\nfunction C...
javascript
chosen
[ { "from": "system", "value": "Add switch for byte size\n" }, { "from": "human", "value": "Template.byte.helpers({\n score: function () {\n return Session.get('score');\n },\n binary: function () {\n return Session.get('score').toString(2);\n }\n});\n\nTemplate.byte.events({\n 'click b...
javascript
chosen
[ { "from": "system", "value": "fix(shape): Migrate to new Basic shape package\n" }, { "from": "human", "value": "import Shape from 'kittik-shape-basic';\n\n/**\n * Implements Text shape which is rendering the text at specified point.\n *\n * @since 1.0.0\n * @version 1.0.0\n */\nexport default cl...
javascript
chosen
[ { "from": "system", "value": "Update Talk action to Nextcloud blue" }, { "from": "human", "value": "/**\n * @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de>\n *\n * @author Arthur Schiwon <blizzz@arthur-schiwon.de>\n *\n * @license GNU AGPL version 3 or any later version\n...
javascript
chosen
[ { "from": "system", "value": "Set the right case for directory lookup\n\n[ci skip]" }, { "from": "human", "value": "import './main.sass'\nimport 'babel-core/polyfill'\n\nimport React from 'react'\nimport thunk from 'redux-thunk'\nimport createLogger from 'redux-logger'\nimport { Router } from 'r...
javascript
chosen
[ { "from": "system", "value": "feat: Enable gmail integration to work with Drag-app popup view\n" }, { "from": "human", "value": "'use strict';\n\ntogglbutton.render('.ha:not(.toggl)', { observe: true }, function (elem) {\n const description = $('h2', elem);\n const project = $('.hX:last-of-typ...
javascript
chosen
[ { "from": "system", "value": ":+1: Change initial state value to prevent fire didMount 2-times\n" }, { "from": "human", "value": "// @flow\n\nimport * as React from 'react'\nimport { connect } from 'react-redux'\nimport { withRouter } from 'react-router-dom'\n\nimport AppFooter from './App/AppFo...
javascript
chosen
[ { "from": "system", "value": "Add some default options, add prototype for update these options\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('lodash');\nvar path = require('path');\nvar fs = require('fs');\nvar Crawler = require('./crawler');\n\n(function() {\n\tvar Instanc...
javascript
chosen
[ { "from": "system", "value": "Change admin_room scope to view_room\n" }, { "from": "human", "value": "var ack = require('ac-koa').require('hipchat'),\n pkg = require('./package.json'),\n app = ack(pkg),\n _ = require('lodash');\n\nvar addon = app.addon()\n .hipchat()\n .allowRoom(tr...
javascript
chosen
[ { "from": "system", "value": "Use textarea to handle linebreaks in text.\n" }, { "from": "human", "value": "import React from 'react'\n\nclass Input extends React.Component {\n constructor() {\n super()\n }\n\n render() {\n return (\n <input onKeyUp={this.props.onType} type=\"text\...
javascript
chosen
[ { "from": "system", "value": "Remove eslint-ignore and use test() instead of it()\n" }, { "from": "human", "value": "describe('caniuseYarn', () => {\n const caniuseYarn = require('../../lib'); // eslint-disable-line global-require\n const shelljs = require('shelljs'); // eslint-disable-line gl...
javascript
chosen
[ { "from": "system", "value": "Add a missing export statement\n" }, { "from": "human", "value": "import { Router } from 'express';\n\nconst router = new Router();\n\nrouter.post(\"/\", function (request, response) {\n response.sendStatus(200);\n});\n" }, { "from": "gpt", "value": "im...
javascript
chosen
[ { "from": "system", "value": "Clean up entry point validation\n" }, { "from": "human", "value": "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nvar JupyterLab = require('jupyterlab/lib/application').JupyterLab;\n\n// ES6 Promise polyfil...
javascript
chosen
[ { "from": "system", "value": "Add ability to bypass the chosen plugin, because sometimes it isn't necessary\n" }, { "from": "human", "value": "var console = require('browser/console'),\n calendar = require('lalala/modules/calendar'),\n editor = require('lalala/modules/editor'),\n grid =...
javascript
chosen
[ { "from": "system", "value": "Allow to change the leaflet imageOverlay.\n" }, { "from": "human", "value": "var React = require(\"react\");\nvar Leaflet = require(\"leaflet\");\n\nvar boundsType = require(\"./types/bounds\");\nvar mapLayerMixin = require(\"./mixins/mapLayer\");\n\nmodule.exports ...
javascript
chosen
[ { "from": "system", "value": "Remove resolve in top level\n" }, { "from": "human", "value": "import commonjs from '@rollup/plugin-commonjs';\nimport glslify from 'rollup-plugin-glslify';\nimport resolve from '@rollup/plugin-node-resolve';\nimport copy from \"rollup-plugin-copy\";\n\n\nexport def...
javascript
chosen
[ { "from": "system", "value": "fix(joystick): Merge beam's agar angle handling\n\n" }, { "from": "human", "value": "'use strict';\n// Mostly borrowed from https://github.com/WatchBeam/agar-node-robot/blob/master/index.js\nconst ANGLE_OFFSET = Math.PI / 2;\nconst multiplier = 20;\nfunction clamp(v...
javascript
chosen
[ { "from": "system", "value": "Remove job route debug line\n" }, { "from": "human", "value": "App.JobRoute = Ember.Route.extend({\n exit: function () {\n var job = this.get('currentModel');\n job.transaction.rollback();\n },\n setupController: function (controller, model) ...
javascript
chosen
[ { "from": "system", "value": "Make use of the stored capabilities\n" }, { "from": "human", "value": "import {browser} from '../mini-testium-mocha';\nimport assert from 'assertive';\n\ndescribe('console', () => {\n before(browser.beforeHook);\n\n before(async () => {\n await browser.navigate...
javascript
chosen
[ { "from": "system", "value": "Fix the server exiting too soon.\n" }, { "from": "human", "value": "var common = require('../common');\nvar when = require('when');\n\nfunction run(argv, options, loader) {\n argv = [\n options.device ? 'run' : 'emulate'\n ];\n\n if (options._.length) {\n a...
javascript
chosen
[ { "from": "system", "value": "Use Object.assign if no Ember.assign. And Ember.merge if no Object.assign\n" }, { "from": "human", "value": "import Ember from 'ember'\nconst {assign} = Ember\n\nimport any from './any'\nimport array from './array'\nimport arrayOf from './array-of'\nimport bool from...
javascript
chosen
[ { "from": "system", "value": "Update createStore for new function names\n" }, { "from": "human", "value": "const { StateSnapshot } = require('./state-snapshot');\n\nclass Store {\n constructor(backingStore) {\n this._backingStore = backingStore;\n }\n\n registerReducer(reducer) {\n if (...
javascript
chosen
[ { "from": "system", "value": "Use hash history in routing\n\nMakes routing use hash history instead of HTML5 history\nto better work in staging environment.\nRefs #34.\n" }, { "from": "human", "value": "import createHistory from 'history/lib/createBrowserHistory';\nimport { compose, createStore,...
javascript
chosen
[ { "from": "system", "value": "Stop importing submodule of prosemirror-state\n\nIt's not in the NPM package\n\nCloses prosemirror/prosemirror#707\n" }, { "from": "human", "value": "const {selFor} = require(\"prosemirror-state/test/state\")\nconst {EditorView} = require(\"../dist\")\nconst {Editor...
javascript
chosen
[ { "from": "system", "value": "Use \" instead of '" }, { "from": "human", "value": "/*\n * MODERNIZR: Modernizr builder\n */\nmodule.exports = {\n prepare: {\n devFile: \"remote\",\n outputFile: \"lib/tmp/modernizr-custom.js\",\n extra: {\n touch: true,\n ...
javascript
chosen
[ { "from": "system", "value": "Remove unncessary and wrong way to check for empty or null in js\n" }, { "from": "human", "value": "import React, { Component } from \"react\";\nimport LoaderImage from \"../assets/img/small-loader.svg\";\n\nclass Util extends Component {\n static Row(label, item, ...
javascript
chosen
[ { "from": "system", "value": "Adjust loglevel and user agent for elastic integration.\n" }, { "from": "human", "value": "StockXmlImport = require('./main').StockXmlImport\n\nexports.process = function(msg, cfg, next, snapshot) {\n console.log(\"Got elastic.io msg: %j\", msg);\n config = {\n ...
javascript
chosen
[ { "from": "system", "value": "Update computed property used via ember-watson\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Controller.extend({\n needs: ['people', 'application'],\n selectedPerson: Ember.computed.alias('controllers.people.selectedPerson')...
javascript
chosen
[ { "from": "system", "value": "Disable turbolinks since it breaks the navigation menu\n" }, { "from": "human", "value": "//= require turbolinks\n\n//= require jquery\n//= require jquery_ujs\n//= require jquery.nested_attributes\n\n// require sb-admin-2/jquery-1.11.0\n//= require sb-admin-2/bootst...
javascript
chosen
[ { "from": "system", "value": "Implement 'Back' pressing in android platform\n" }, { "from": "human", "value": "if (navigator.userAgent.indexOf('Android') >= 0) {\n\tlog = function(dummy) {\n\t\tCOPY_ARGS(args, 0)\n\t\tconsole.log(\"[QML] \" + args.join(\" \"))\n\t}\n\n\tlog(\"Android detected\")...
javascript
chosen
[ { "from": "system", "value": "Disable p2p exploration in HTTP mode\n" }, { "from": "human", "value": "var assert = require('assert');\nvar expect = require('chai').expect;\n\nvar Fabric = require('../');\n\ndescribe('App', function () {\n\n it('should expose a constructor', function () {\n a...
javascript
chosen
[ { "from": "system", "value": "Make sure everything is in lowercase.\n" }, { "from": "human", "value": "var toNumber = require(\"underscore.string/toNumber\"),\n ltrim = require(\"underscore.string/ltrim\");\n\n// Generate a random justinfan username\nfunction generateJustinfan() {\n\treturn \...
javascript
chosen
[ { "from": "system", "value": "Make RECENT mode title consistent." }, { "from": "human", "value": "import {ChangeEmitter} from \"../utils/ChangeEmitter.js\";\nimport AppDispatcher from \"../dispatcher/AppDispatcher.js\";\n\nimport ContainerConstants from \"../constants/ContainerConstants.js\";\ni...
javascript
chosen
[ { "from": "system", "value": "Update the list of void elements\n\nCloses #1262\n" }, { "from": "human", "value": "\n/*!\n * Jade - self closing tags\n * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>\n * MIT Licensed\n */\n\nmodule.exports = [\n 'area'\n , 'base'\n , 'br'\n , 'col'\...
javascript
chosen
[ { "from": "system", "value": "Make the application check working\n\nNot so good because I don't find any way to know how to know the\napplication is loaded (the event $viewContentLoaded is never emmited ...)\n" }, { "from": "human", "value": "//\n// A PhantomJS script used to check that the host...
javascript
chosen
[ { "from": "system", "value": "Handle opening files directly from native OS\n\nRelying on `open-file` event. Couldn't be any simpler.\n\nYou'll need a built copy of nteract to use this (with our new dist hooks).\n" }, { "from": "human", "value": "import app from 'app';\n\nimport {\n launchFilena...
javascript
chosen
[ { "from": "system", "value": "Add scene items for hamburger menu\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { Scene, Router } from 'react-native-router-flux'\nimport Styles from './Styles/NavigationContainerStyle'\nimport NavigationDrawer from './Navigati...
javascript
chosen
[ { "from": "system", "value": "Disable line-ending rule, cries on Windows\n" }, { "from": "human", "value": "module.exports = {\n 'extends': [\n 'fbjs-opensource',\n 'prettier',\n ],\n 'plugins': [\n 'flowtype',\n 'prettier',\n ],\n 'rules': {\n 'babel/no-await-in-loop': 0,\n ...
javascript
chosen
[ { "from": "system", "value": "Fix resolving .jsx for 'indico/...' paths\n" }, { "from": "human", "value": "/* This file is part of Indico.\n * Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).\n *\n * Indico is free software; you can redistribute it and/or\n * modify i...
javascript
chosen
[ { "from": "system", "value": "Fix up message.url equal blank case by using the stack frame" }, { "from": "human", "value": "// See Purple/license.txt for Google BSD license\n// Copyright 2011 Google, Inc. johnjbarton@johnjbarton.com\n\ndefine(['lib/domplate/lib/domplate', 'log/ConsoleEntryRep'],...
javascript
chosen
[ { "from": "system", "value": "Add chapter 2, exercise 1\n" }, { "from": "human", "value": "let str = \"\";\nfor (let i = 0; i < 7; ++i) {\n str += \"#\";\n console.log(str)\n}\n\n// Nicer solution: use loop like\n// for (let str = \"#\"; str.length < 8; str += \"#\")\n" }, { "from"...
javascript
chosen
[ { "from": "system", "value": "Use second callback to then instead of catch\n" }, { "from": "human", "value": "import createLocalStorageStore from './storage/localStorage'\nimport { AUTHENTICATE } from './actionTypes'\nimport { authenticateFailed, authenticateSucceeded, restore } from './actions'...
javascript
chosen
[ { "from": "system", "value": "Remove 'ecmaVersion' override in eslint config\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n parserOptions: {\n ecmaVersion: 2018,\n sourceType: 'module'\n },\n plugins: [\n 'ember'\n ],\n extends: [\n 'eslint:recommended',\...
javascript
chosen
[ { "from": "system", "value": "Include path with img data\n" }, { "from": "human", "value": "'use strict';\n\nvar gm = require('gm');\n\nclass Methods {\n /**\n *\n * @param path {String}\n * @returns {Promise}\n */\n static size (path) {\n let promise = new Promise(function (resolve...
javascript
chosen