conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Enhance entry output path resolution from stats and json stats\n" }, { "from": "human", "value": "const {resolve} = require('path')\n\nfunction getEntryOutputPathFromStats (stats, assetName) {\n if (!assetName) {\n assetName = Object.keys(stats.compilation.asset...
javascript
chosen
[ { "from": "system", "value": "Change config.certs to include an object for each certification with name, id and price\n" }, { "from": "human", "value": "const fs = require('fs')\nconst path = require('path')\nconst cli = require('commander')\nconst apiCall = require('./apiCall')\nconst config = ...
javascript
chosen
[ { "from": "system", "value": "Check for presence of callback\n" }, { "from": "human", "value": "'use strict';\n\nvar evalInScope = require('./helpers/eval-in-scope');\n\n/*eslint-disable*/\n\nfunction evalBEST(source, builder, extras) {\n evalInScope(source, { component: builder }, extras);\n...
javascript
chosen
[ { "from": "system", "value": "Remove stub router context from TodosAdd\n" }, { "from": "human", "value": "import 'app/client/components/helpers/jsdom-support.js';\n\nimport { assert } from 'chai';\nimport sinon from 'sinon';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport ...
javascript
chosen
[ { "from": "system", "value": "Fix spelling of 'quarter' in comment\n" }, { "from": "human", "value": "var _ = require('underscore');\n\n/*\n * Approx timings for how often we should notify\n * 360 (~5mins) : every 58mins\n * 4500 (~hourly) : every 58mins\n * 90000 (~day) : every 58m...
javascript
chosen
[ { "from": "system", "value": "Clean up structure a little\n" }, { "from": "human", "value": "var remark = require('remark');\nvar visit = require('unist-util-visit');\nvar remove = require('unist-util-remove');\n\nvar processor = remark().use(function () {\n return function(ast, file) {\n vi...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect usage of polyfill when bundled\n" }, { "from": "human", "value": "module.exports = require('eventsource-polyfill/dist/eventsource')\n" }, { "from": "gpt", "value": "/* eslint-disable no-var */\nvar evs = require('eventsource-polyfill/dist/e...
javascript
chosen
[ { "from": "system", "value": "Replace Navigator with NavigatorIOS; import Login component; comment out unnecessary functions\n" }, { "from": "human", "value": "/**\n * Puppy Play Date\n * https://github.com/Tooconfident/Puppy_PlayDate\n * @flow\n */\n\nimport React, { Component } from 'react';\n...
javascript
chosen
[ { "from": "system", "value": "Return the bower result so that it waits correctly.\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar less = require('gulp-less');\nvar bower = require('gulp-bower');\nvar minifyCSS = require('gulp-minify-css');\n\nvar paths = {\n css: 'src/styles...
javascript
chosen
[ { "from": "system", "value": "Add a gulp task to clean the build\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar oghliner = require('oghliner');\nvar fse = require('fs-extra');\n\ngulp.task('default', function() {\n fse.removeSync('dist');\n fse.mkdirSync('dist');\n fse.co...
javascript
chosen
[ { "from": "system", "value": "Add eager loading of reviews for single product.\n" }, { "from": "human", "value": "'use strict'\n\nconst db = require('APP/db');\nconst Product = db.model('products');\nconst Review = db.model('review');\nconst router = require('express').Router();\n\n\nrouter.get(...
javascript
chosen
[ { "from": "system", "value": "Revise for loop for timezones to work with Chrome\n" }, { "from": "human", "value": "window.onload = function main() {\n var timezones = document.querySelectorAll('.timezone');\n\n var getCalendarOffset = function getCalendarOffset(timezone) {\n var localTime =...
javascript
chosen
[ { "from": "system", "value": "Make removal of host a bit safer\n" }, { "from": "human", "value": "const Connection = require('./connection');\n\nclass ConnectionPool {\n constructor() {\n this.hosts = [];\n this.nextHostID = 1; // not an index for array\n\n this.addHost = this.addHost....
javascript
chosen
[ { "from": "system", "value": "Move and modify list of required Gulp tasks.\n" }, { "from": "human", "value": "/**\n * Entry point for defining Gulp tasks.\n */\n\n// Pull in the tasks from the gulp-tasks directory.\nrequire('require-dir')('./gulp-tasks');\n" }, { "from": "gpt", "valu...
javascript
chosen
[ { "from": "system", "value": "Remove unused `namespace` key from Gulp configuration\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar browserify = require('browserify');\nvar source = require('vinyl-source-stream');\nvar streamify = require('gulp-streamify');\n...
javascript
chosen
[ { "from": "human", "value": "Add tasks to compile and minify *.scss files, compress images, and minify *.js files.\n" }, { "from": "gpt", "value": "var gulp = require('gulp');\nvar sass = require('gulp-sass');\nvar autoprefixer = require('gulp-autoprefixer');\nvar uglify = require('gulp-uglify')...
javascript
chosen
[ { "from": "system", "value": "Fix groupIndex for stacked graphs.\n\nWhen there is more than one line on a graph they are applied with the class .group(index)\n" }, { "from": "human", "value": "module.exports = {\n\n stack: function (browser, selector, index) {\n index = index || '';\n ret...
javascript
chosen
[ { "from": "system", "value": "Set gulp serve prot to 3002\n" }, { "from": "human", "value": "const conf = require('./gulp.conf');\n\nmodule.exports = function () {\n return {\n server: {\n baseDir: [\n conf.paths.tmp,\n conf.paths.src\n ]\n },\n open: false\n }...
javascript
chosen
[ { "from": "system", "value": "Fix memoize bug, use custom hash method\n" }, { "from": "human", "value": "(function(w) {\n\n \"use strict\";\n var angular = w.angular;\n var _ = w._;\n\n var deps = [];\n\n function PluckFilter() {\n return _.memoize(function(input, field) {\n if(Arra...
javascript
chosen
[ { "from": "system", "value": "Fix for test with multiple scripts\n\nPrevious version was always failing tests for let statement and generator functions. The reason for this was the fact, that `eval('if (false) { true }')` returns `undefined`, which was causing failing tests." }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Send event object with arrow key press events\n" }, { "from": "human", "value": "import Em from 'ember';\n\nvar KEY_LEFT = 37;\nvar KEY_UP = 38;\nvar KEY_RIGHT = 39;\nvar KEY_DOWN = 40;\n\n/**\n * Fires custom events on the implementor when arrow keys are pressed.\n...
javascript
chosen
[ { "from": "system", "value": "Correct paths for require statements.\n" }, { "from": "human", "value": "require('_animate');\nrequire('_copyright');\nrequire('_faq');\nrequire('_nav-scroll');\nrequire('_nav-transparent');\nrequire('_nav');\nrequire('_scroll');\nrequire('_top-home');\nrequire('_to...
javascript
chosen
[ { "from": "system", "value": "Fix JS crashing when no countdown on page\n" }, { "from": "human", "value": "var finish_utc;\n$(document).ready(function(){\n var finish_utc_args = JSON.parse($('#countdown-finish-time').html());\n finish_utc = new Date(Date.UTC(finish_utc_args[0],\n ...
javascript
chosen
[ { "from": "system", "value": "Make error handling on the same line\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n coffee = require('gulp-coffee'),\n gutil = require('gulp-util');\n\ngulp.task('default', function(){\n gulp.src('src/*.coffee')\n .pipe(coffee({so...
javascript
chosen
[ { "from": "system", "value": "Add watch files in nodemon task\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar nodemon = require('gulp-nodemon');\nvar concat = require('gulp-concat');\nvar sass = require('gulp-sass');\n\nvar cssPath = [\n './vendor/webuploader_fex/dist/webu...
javascript
chosen
[ { "from": "system", "value": "Fix gulp file to no longer use deprecated gulp.run\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n gutil = require('gulp-util'),\n concat = require('gulp-concat'),\n uglify = require('gulp-uglify'),\n rename = require('gulp-rename'),\...
javascript
chosen
[ { "from": "system", "value": "Remove deprecated class name props to Dropzone component\n" }, { "from": "human", "value": "import React from \"react\";\nimport Dropzone from \"react-dropzone\";\nimport classNames from \"classnames\";\nimport \"./DropHandler.css\";\n\nexport default class DropHand...
javascript
chosen
[ { "from": "system", "value": "Send an id in all API request\n" }, { "from": "human", "value": "function makeRequest(authToken, path, data) {\n const d = $.extend({}, { format: 'json', auth_token: authToken }, data);\n const u = `https://api.pinboard.in/v1/${path}`;\n\n console.log('%cmakeRequ...
javascript
chosen
[ { "from": "system", "value": "Allow component styles to be editable in React Dev Tools\n" }, { "from": "human", "value": "import flattenStyle from './flattenStyle';\nimport StyleRegistry from './registry';\n\nconst absoluteFillObject = {\n position: 'absolute',\n left: 0,\n right: 0,\n top: ...
javascript
chosen
[ { "from": "system", "value": "Fix redirect after new pledge form is sent\n" }, { "from": "human", "value": "import { connect } from 'react-redux'\nimport I18n from 'i18n-js'\nimport { toggleSessionPopup } from '../../UserSession/actions/sessionActions'\nimport { setEntity } from '../../lib/actio...
javascript
chosen
[ { "from": "system", "value": "Check for a valid trip key when first searching in url\n" }, { "from": "human", "value": "/* exported configureTripKeyForPath, getTripKeyFromUrl, setProgressBar */\n/** \n* Sets Progress Bar to correct location based on the page number\n* @param {int} pageNumber\n*/...
javascript
chosen
[ { "from": "system", "value": "Add category color by server\n" }, { "from": "human", "value": "angular.module(\"proBebe.services\")\n.factory('ChildAgePresenter', function() {\n\n function Presenter() {}\n\n Presenter.build = function(messages){\n messages.forEach(function(message){\n m...
javascript
chosen
[ { "from": "system", "value": "Handle exceptions inside requiring module" }, { "from": "human", "value": "import { resolve as resolvePath } from 'path';\n\n/**\n * Require local file or node modules\n *\n * @param {String} path\n * @returns {*}\n */\nexport default function requireLocalFileOrNode...
javascript
chosen
[ { "from": "system", "value": "Remove hard coded socket provider class.\n" }, { "from": "human", "value": "/*\n * Copyright: 2012, V. Glenn Tarcea\n * MIT License Applies\n */\n\nangular.module('AngularStomp', []).\n factory('ngstomp', function($rootScope) {\n Stomp.WebSocketClass = Soc...
javascript
chosen
[ { "from": "system", "value": "Fix code style for pm2 module\n" }, { "from": "human", "value": "import express from 'express'\nimport session from 'express-session'\nimport cookieParser from 'cookie-parser'\nimport bodyParser from 'body-parser'\nimport morgan from 'morgan'\nimport passport from '...
javascript
chosen
[ { "from": "system", "value": "Move query to line 33\n" }, { "from": "human", "value": "// Bulk Operation\nexports.updateOperation = (id, actionType, contentType, connection) => {\n return connection(contentType)\n .where(`${contentType}.id`, '=', id)\n .update(`${contentType}.status`, actionT...
javascript
chosen
[ { "from": "system", "value": "Remove menu links as triggers.\n\nIssue created with the preventing default function where a menu link wouldn't redirect the page." }, { "from": "human", "value": "jQuery( document ).ready(function( $ ) {\n\n\t// Variables\n\tvar open \t\t\t = false, // Set the stat...
javascript
chosen
[ { "from": "system", "value": "Change exports, add vue plugin installation support\n" }, { "from": "human", "value": "import Button from './components/Button/Button.vue';\nimport FileSelect from './components/FileSelect/FileSelect.vue';\nimport Icon from './components/Icon/Icon.vue';\nimport Inpu...
javascript
chosen
[ { "from": "system", "value": "feat(CLI): Add uninstall option when installing app\n" }, { "from": "human", "value": "// @flow\n\nimport 'babel-polyfill';\n\nimport program from 'commander';\nimport { blue, green, gray } from 'chalk';\nimport installer from '../installer';\nimport { androidClient...
javascript
chosen
[ { "from": "system", "value": "Fix for UNKNOWN constants when used as object key\n" }, { "from": "human", "value": "module.exports = {\n UNKNOWN: '',\n BROWSER: 'browser',\n BROWSER_TEXT: 'browser:text',\n APP: 'app',\n APP_EMAIL: 'app:email',\n APP_GAME: 'app:game',\n APP_MEDIAPLAYER: 'ap...
javascript
chosen
[ { "from": "system", "value": "Use next to make endless scroll work.\n" }, { "from": "human", "value": "const nest = require('depnest')\nconst pull = require('pull-stream')\nconst Scroller = require('pull-scroll')\nconst next = require('../../../junk/next-stepper')\n\nexports.gives = nest('router...
javascript
chosen
[ { "from": "system", "value": "Add check for empty todo text\n" }, { "from": "human", "value": "import ContentAdd from 'material-ui/lib/svg-icons/content/add';\nimport IconButton from 'material-ui/lib/icon-button';\nimport TextField from 'material-ui/lib/text-field';\nimport React, { Component } ...
javascript
chosen
[ { "from": "system", "value": "Add gcc 11.3 released on April 21, 2022" }, { "from": "human", "value": "const ALL_COMPILERS = ['clang-3.8', 'clang-3.9', 'clang-4.0', 'clang-5.0',\n 'clang-6.0', 'clang-7.0', 'clang-7.1', 'clang-8.0', 'clang-9.0',\n 'clang-10.0', 'clang-11.0', 'clang-11.1', '...
javascript
chosen
[ { "from": "system", "value": "Add disclaimer comment in ES6 base\n" }, { "from": "human", "value": "\"use strict\";\n\nvar _ = require(\"lodash\");\n\nmodule.exports = _.merge({},\n require(\"./es5.js\"),\n require(\"../../rules/eslint/es6/walmart.js\"), {\n \"rules\": {\n \"strict\": ...
javascript
chosen
[ { "from": "system", "value": "Rename Build to Builder and use /tools/builder as the routing url\n" }, { "from": "human", "value": "import Vue from 'vue';\nimport Router from 'vue-router';\n\nimport Home from '../components/Home';\nimport About from '../components/About';\nimport Help from '../co...
javascript
chosen
[ { "from": "system", "value": "Change status on add friend\n" }, { "from": "human", "value": "$(document).ready(function() {\n // Listen events\n $('.btn-add').click(function() {\n // POST Add friend\n $.post('/api/users/' + this.id + '/friends', function(data) {\n console.log(data);...
javascript
chosen
[ { "from": "system", "value": "Add test case for no key in \"property\"\n" }, { "from": "human", "value": "import { strictEqual } from 'assert'\nimport { property } from '../src'\n\ndescribe('property', () => {\n\n it('should generate a named property accessor for the provided string key', () =>...
javascript
chosen
[ { "from": "system", "value": "Simplify a bit and obey code convention\n" }, { "from": "human", "value": "var istanbul = require('istanbul'),\n\n/**\n * Expose `Istanbul`.\n */\nexports = module.exports = Istanbul;\n\n/**\n * Initialize a new Istanbul reporter.\n *\n * @param {Runner} runner\n * ...
javascript
chosen
[ { "from": "system", "value": "Use Error object in Army\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar np = require('named-parameters');\n\nmodule.exports = function(args) {\n var parsedArgs = np.parse(args).\n require('name', 'string').\n require('pieces', 'object').\n...
javascript
chosen
[ { "from": "system", "value": "Use regexp special char in testcase description\n\nTestcase for #54 (Fix invalid use of \"--grep\" regexp option).\n" }, { "from": "human", "value": "const expect = require('chai').expect;\n\nconst myParseInt = require('../src/parse-int.js');\n\ndescribe('my parse i...
javascript
chosen
[ { "from": "system", "value": "Fix bug causing components to not show up in data-selection\n" }, { "from": "human", "value": "import Service from '@ember/service';\nimport Evented from '@ember/object/evented';\n\nexport default Service.extend(Evented, {\n\n shownComponents: null,\n data: null,\...
javascript
chosen
[ { "from": "system", "value": "Update grunt file to run coverage tests\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(grunt) {\n\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n jshint: {\n allFiles: ['Gruntfile.js', 'li...
javascript
chosen
[ { "from": "system", "value": "Use object notation to insert values to the db, looks nicer.\n" }, { "from": "human", "value": "var request = require('request')\nvar Q = require('Q')\nvar xml2js = require('xml2js')\n\nvar requestQ = function(url) {\n\tvar defer = Q.defer()\n\n\trequest(url, functi...
javascript
chosen
[ { "from": "system", "value": "Fix definition of a global variable" }, { "from": "human", "value": "var spawn = require('child_process').spawn,\n objectAssign = require('object-assign');\n\nmodule.exports = function exec(script, program) {\n var dotenvConfig = objectAssign({ silent: true }, {...
javascript
chosen
[ { "from": "system", "value": "Add sourcemap options to uglify.\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\n /**\n * Configuration.\n */\n\n grunt.initConfig({\n uglify: {\n default: {\n options: {\n preserveComments: 'some'\n },\...
javascript
chosen
[ { "from": "system", "value": "Update style on cookie warning\n" }, { "from": "human", "value": "Ensembl.LayoutManager.showCookieMessage = function() {\n var cookiesAccepted = Ensembl.cookie.get('cookies_ok');\n\n if (!cookiesAccepted) {\n $(['<div class=\"cookie-message hidden\">',\n '...
javascript
chosen
[ { "from": "system", "value": "Disable incognito check because its not working\n" }, { "from": "human", "value": "import './styles/styles.scss'\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { useRouterHistory } from 'react-router'\nimport { syncHistoryWithStore } from 're...
javascript
chosen
[ { "from": "system", "value": "Make the panel slightly taller.\n" }, { "from": "human", "value": "var { ToggleButton } = require('sdk/ui/button/toggle');\nvar tabs = require(\"sdk/tabs\");\n\nvar button = ToggleButton({\n id: \"tweet-that\",\n label: \"Tweet that link\",\n icon: {\n \"16\":...
javascript
chosen
[ { "from": "system", "value": "Check function and branch coverage\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.loadNpmTasks(\"grunt-mocha-test\");\n grunt.loadNpmTasks(\"grunt-mocha-istanbul\");\n\n var testOutputLocation = process.env.CIRCLE_TEST_REPORTS...
javascript
chosen
[ { "from": "system", "value": "Remove unused dependency and variable\n" }, { "from": "human", "value": "var module = angular.module('ldsNavigation', ['ngRoute']);\n\nmodule.directive('ldsNavigation', [function () {\n return {\n restrict: \"E\",\n scope: true,\n controller...
javascript
chosen
[ { "from": "system", "value": "Revert \"Ignore demo-specific statements from coverage\"\n\nThis reverts commit dd924121f5e7856217ad49a61107d73d74adcfaa.\n" }, { "from": "human", "value": "const test = require('tape-catch');\n\nimport doxie from './module/index';\n\ntest('Does what the demo says',...
javascript
chosen
[ { "from": "system", "value": "Add tasks (development & production)\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n 'use strict';\n\n var config = require('./grunt_tasks/config');\n grunt.config.init(config);\n\n var packages = grunt.file.readJSON('./package.j...
javascript
chosen
[ { "from": "system", "value": "[BUGFIX] Fix the mapping for the cssmetrics grunt task\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\t\"use strict\";\n\n\t// Display the execution time of grunt tasks\n\trequire(\"time-grunt\")(grunt);\n\n\t// Load all grunt-tasks in 'Buil...
javascript
chosen
[ { "from": "system", "value": "Add Astral shift to the absorbed ThroughputTracker\n" }, { "from": "human", "value": "import SPELLS from 'common/SPELLS';\nimport CoreCooldownThroughputTracker, { BUILT_IN_SUMMARY_TYPES } from 'parser/shared/modules/CooldownThroughputTracker';\n\nclass CooldownThrou...
javascript
chosen
[ { "from": "system", "value": "Use lodash assign to support earlier Node versions\n" }, { "from": "human", "value": "var hogan = require('hogan.js');\nvar fs = require('fs');\nvar path = require('path');\nvar _ = require('lodash');\nvar getServiceProperties = require('./serviceProperties');\n\nva...
javascript
chosen
[ { "from": "system", "value": "Revert \"Fix headless unit test running\"\n\nThis reverts commit d2652f66c5cd09730a789373fe1cc0f51d357b7d.\n\nThat commit just made us not run the unit tests from Gulp any more.\n" }, { "from": "human", "value": "/*\nCopyright 2014 Spotify AB\n\nLicensed under the A...
javascript
chosen
[ { "from": "system", "value": "Move Search handler to Home component.\n" }, { "from": "human", "value": "/**\n * Poster v0.1.0\n * A React webapp to list upcoming movies and maintain a watchlist, powered by TMDb\n *\n * Author: Kushal Pandya <kushalspandya@gmail.com> (https://doublslash.com)\n * ...
javascript
chosen
[ { "from": "system", "value": "Use `_.extend` instead of `Object.assign` in Node code\n\n…to support environments without ES2015 support\n" }, { "from": "human", "value": "module.exports = function bindSassMiddleware (keystone, app) {\n\t// the sass option can be a single path, or array of paths\...
javascript
chosen
[ { "from": "system", "value": "Handle CSRC count in the RTP header\n" }, { "from": "human", "value": "const { createHash } = require(\"crypto\");\nconst { spawn } = require(\"child_process\");\n\nfunction parseRTPPacket(buffer) {\n const hasExtensions = (buffer[0] << 3) >>> 7;\n\n const payload...
javascript
chosen
[ { "from": "system", "value": "Return the stream from all tasks so deps work.\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar rename = require('gulp-rename');\nvar uglify = require('gulp-uglify');\nvar sass = require('gulp-sass');\n\ngulp.task('scripts', function() {\n return...
javascript
chosen
[ { "from": "system", "value": "Add functionality for validating currency input\n\nThis will match the validation that is on the back end" }, { "from": "human", "value": "// ($(this).val() && Number($(this).val()) > 0)\n\nfunction isValidAmount(input) {\n return input && Number(input) > 0\n}\n\...
javascript
chosen
[ { "from": "system", "value": "Add pixel ratio renderer size support\n" }, { "from": "human", "value": "var Renderer = {\n create: function() {\n this.renderer = new THREE.WebGLRenderer();\n this.renderer.setSize(window.innerWidth, window.innerHeight);\n document.body.appe...
javascript
chosen
[ { "from": "system", "value": "Bring in punctuation cleaning logic from romaji-name.\n" }, { "from": "human", "value": "var rules = [\n [/(\\d{4})/, function(match, date) {\n date.start = match[0];\n date.end = match[1];\n }]\n];\n\nmodule.exports = {\n parse: function(str)...
javascript
chosen
[ { "from": "system", "value": "Fix external script invocation failing with ENOENT error\n" }, { "from": "human", "value": "'use strict';\n\nconst childProcess = require('child_process');\nconst fs = require('fs');\n\nmodule.exports = function(type) {\n process.argv.shift();\n process.argv.s...
javascript
chosen
[ { "from": "system", "value": "Create a simple backbone view to test new ajax endpoint\n" }, { "from": "human", "value": "$(document).ready(function() {\n $('form input[name=\"subreddit\"]').focus();\n});\n" }, { "from": "gpt", "value": "$(document).ready(function() {\n $('form inpu...
javascript
chosen
[ { "from": "system", "value": "Fix let/var in occurencecounter hash\n" }, { "from": "human", "value": "/**\n * Convert a string to a number\n * @param {string} str\n * @returns {number} the hashed string\n * @see https://stackoverflow.com/a/51276700\n */\nfunction hash(str) {\n let hash = 0x811c...
javascript
chosen
[ { "from": "system", "value": "Fix Texture objects in BaseTextureCache\n" }, { "from": "human", "value": "var core = require('../core');\n\nmodule.exports = function ()\n{\n return function (resource, next)\n {\n // create a new texture if the data is an Image object\n if (res...
javascript
chosen
[ { "from": "system", "value": "Add OrderCreator to global scope\n" }, { "from": "human", "value": "/**\n * This file is part of Shuup.\n *\n * Copyright (c) 2012-2018, Shuup Inc. All rights reserved.\n *\n * This source code is licensed under the OSL-3.0 license found in the\n * LICENSE file in t...
javascript
chosen
[ { "from": "system", "value": "Use Enny to get the types\n" }, { "from": "human", "value": "var Deffy = require(\"deffy\")\n , Typpy = require(\"typpy\")\n ;\n\nvar SEPARATOR = \"_\";\n\nfunction SubElmId(type, name, parent) {\n\n if (Typpy(type, SubElm)) {\n parent = name;\n n...
javascript
chosen
[ { "from": "system", "value": "Increase timeout for request test\n" }, { "from": "human", "value": "import should from 'should'\nimport getJson from './getJson'\n\nlet endpoint = '/stats/homepagev2'\nlet query = {\n GameScope: 'Season',\n LeagueID: '00',\n PlayerOrTeam: 'Player',\n PlayerScop...
javascript
chosen
[ { "from": "system", "value": "Change Disc Priest's completeness to Good since it doesn't have the module changes yet\n" }, { "from": "human", "value": "import SPECS from 'common/SPECS';\nimport SPEC_ANALYSIS_COMPLETENESS from 'common/SPEC_ANALYSIS_COMPLETENESS';\n\nimport CombatLogParser from '....
javascript
chosen
[ { "from": "system", "value": "Write bearer token to user home dir.\n" }, { "from": "human", "value": "// @flow\n\n/* eslint-disable no-console */\n\nimport os from 'os';\nimport path from 'path';\nimport { sshConnect, sshExec } from '../util/ssh';\nimport { readFile } from '../util/fs';\nimport ...
javascript
chosen
[ { "from": "system", "value": "Make readFile utility return trimmed strings\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar mkdirp = require('mkdirp');\nvar Path = require('path');\n\nfunction path () {\n var segments = [].slice.call(arguments);\n segments.unshi...
javascript
chosen
[ { "from": "system", "value": "Add getRouterState for server render.\n" }, { "from": "human", "value": "import Promise from 'bluebird';\nimport Immutable from 'immutable';\n\nexport default function userState() {\n\n return (req, res, next) => {\n loadUserData(req).then(loadedData => {\n ...
javascript
chosen
[ { "from": "system", "value": "Add `request.headers` object to `FastBootInfo`\n" }, { "from": "human", "value": "var cookie = require('cookie');\n\n/*\n * A class that encapsulates information about the\n * current HTTP request from FastBoot. This is injected\n * on to the FastBoot service.\n */\...
javascript
chosen
[ { "from": "system", "value": "Initialize and set state best example\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nclass SearchBar extends Component {\n render(){\n return <input onChange={ event => console.log(event.target.value)} />;\n }\n}\n\nexport defau...
javascript
chosen
[ { "from": "system", "value": "Remove blend tabs and tree-view\n" }, { "from": "human", "value": "'use babel';\n\nimport toggleClassName from '../helper/toggle-class-name';\n\natom.config.observe('atom-material-ui.tabs.tintedTabBar', (value) => {\n toggleClassName('amu-tinted-tab-bar', value);...
javascript
chosen
[ { "from": "system", "value": "Remove obsolete setting. Tweak comments.\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport { connect } from 'stripes-connect';\nimport PatronForm from './PatronForm';\n\n// One of multiple stripes-connected components in...
javascript
chosen
[ { "from": "system", "value": "Use jquery's document.ready instead of our custom asynchronous loader.\n" }, { "from": "human", "value": "/*======================================================================\n * Exhibit auto-create\n * Code to automatically create the database, load the data ...
javascript
chosen
[ { "from": "system", "value": "Add Rushing Jade Wind to CHI_SPENDERS[] constant\n" }, { "from": "human", "value": "import SPELLS from 'common/SPELLS';\n\nexport const ABILITIES_AFFECTED_BY_MASTERY = [\n SPELLS.TIGER_PALM.id,\n SPELLS.BLACKOUT_KICK.id,\n SPELLS.FISTS_OF_FURY_CAST.id,\n SPELLS....
javascript
chosen
[ { "from": "system", "value": "Fix args.data nesting for GraphQL schema\n" }, { "from": "human", "value": "'use strict';\n\nconst { omit } = require('../../../../../../../utilities');\n\n// Create nested models definitions\nconst getNestedModel = function (def, { inputObjectType, topDef }) {\n c...
javascript
chosen
[ { "from": "system", "value": "runtime: Add function to attach readonly property\n" }, { "from": "human", "value": "import * as Primitive from \"./primitive.js\";\n\nexport\nfunction isEqual(v1, v2) {\n if (Primitive.check(v1)) {\n\treturn v1.equals(v2);\n } else {\n\treturn v1 === v2;\n ...
javascript
chosen
[ { "from": "system", "value": "Support ordered iteration in keysMap\n" }, { "from": "human", "value": "// Create new object with same values, but remapped keys\n\n'use strict';\n\nvar f = require('../../Function/functionalize')\n , forEach = require('./for-each').call;\n\nmodule.exports = ...
javascript
chosen
[ { "from": "system", "value": "Fix global \"event\" being generated.\n" }, { "from": "human", "value": "define([], function () {\n\n var refInput = {\n\n init: function (canvas) {\n this.canvas = canvas.getElement();\n return this;\n },\n\n on: functi...
javascript
chosen
[ { "from": "system", "value": "Fix error when trying to edit a category with empty slug\n" }, { "from": "human", "value": "/**\n Application route for Discourse\n\n @class ApplicationRoute\n @extends Ember.Route\n @namespace Discourse\n @module Discourse\n**/\nDiscourse.ApplicationRoute = Em...
javascript
chosen
[ { "from": "system", "value": "fix(checkbox): Change default value for indeterminate\n" }, { "from": "human", "value": "import {CheckableComponentViewModel} from './mdc-knockout-base';\nimport template from './templates/checkbox.html';\n\nexport default class CheckboxViewModel extends CheckableCo...
javascript
chosen
[ { "from": "system", "value": "Use root element instead of global in CSS" }, { "from": "human", "value": "// ==UserScript==\n// @name Firefox GTK+ dark themes fix\n// @version 0.3\n// @description Resets colors in all pages to match those of a bright theme and, hopefully, fix annoying inconsisten...
javascript
chosen
[ { "from": "system", "value": "Add .isEmpty() on slate value container\n" }, { "from": "human", "value": "import toSlate from './conversion/toSlate'\nimport fromSlate from './conversion/fromSlate'\n\nexport default class SlateValueContainer {\n static deserialize(value, context) {\n const sta...
javascript
chosen
[ { "from": "system", "value": "Fix key for the method\n" }, { "from": "human", "value": "Meteor.methods({\n\tgameDelete: function(game) {\n\t\tcheck(game, {\n\t\t\t_id: String\n\t\t});\n\t\tGames.remove({\n\t\t\t_id: game.id\n\t\t});\n\t}\n});\n" }, { "from": "gpt", "value": "Meteor.m...
javascript
chosen
[ { "from": "system", "value": "Fix bug in wrong parameter for ms formatting fun\n" }, { "from": "human", "value": "angular.module('ng').filter('formatNumber', function () {\n return function (value) {\n return numeral(value).format('0,0');\n }\n});\nangular.module('ng').filter('forma...
javascript
chosen