conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Implement numbers divisible by 5\n" }, { "from": "human", "value": "var pingPongOutput = function(inputNumber) {\n if(inputNumber % 3 === 0) {\n return \"ping\";\n } else {\n return inputNumber;\n }\n};\n" }, { "from": "gpt", "value": "var pingP...
javascript
chosen
[ { "from": "system", "value": "Remove code for pingPong, leaving pingPongType and isPingPong as functions\n" }, { "from": "human", "value": "var pingPong = function(i) {\n if (isPingPong(i)) {\n return pingPongType(i)\n } else {\n return false;\n }\n}\n\nvar pingPongType = function(i) {\...
javascript
chosen
[ { "from": "system", "value": "[Green] Fix the issue by calling constructor and checking for initialize\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('underscore');\n\nmodule.exports = function extend (Superclass, prototypeFragment) {\n prototypeFragment = prototypeFragme...
javascript
chosen
[ { "from": "system", "value": "Add some mixins to main lib\n" }, { "from": "human", "value": "'use strict';\n\n\n// internal\nvar mixin = require('./mincer/common');\n\n\nmodule.exports = {\n VERSION: '0.0.0',\n\n EngineTemplate: require('./mincer/engine_template'),\n Environment: re...
javascript
chosen
[ { "from": "system", "value": "Connect router history to redux.\n" }, { "from": "human", "value": "import { createStore as _createStore, applyMiddleware } from 'redux';\n\nimport fetchMiddleware from './middleware/fetchMiddleware';\nimport reducer from './modules/reducer';\n\n\nexport default fun...
javascript
chosen
[ { "from": "system", "value": "Remove empty code to prevent jslint errors\n" }, { "from": "human", "value": "import ExecutorBase from '../../action/Executor';\nimport types from '../../action/types';\n\nexport default class Executor extends ExecutorBase {\n\n _onAttack(action, world) {\n\n ...
javascript
chosen
[ { "from": "system", "value": "Increase browser inactivity timeout for test runs.\n" }, { "from": "human", "value": "// Karma configuration file, see link for more information\n// https://karma-runner.github.io/1.0/config/configuration-file.html\n\nmodule.exports = function (config) {\n config.s...
javascript
chosen
[ { "from": "system", "value": "Correct SocketIO path for Karma tests\n\nThe tests should no longer be erroring out.\n" }, { "from": "human", "value": "/* eslint-env node */\n\nmodule.exports = function (config) {\n config.set({\n basePath: 'public',\n browsers: ['ChromeHeadlessCustom'],\n ...
javascript
chosen
[ { "from": "system", "value": "Test that collect returns a Jarg instance\n" }, { "from": "human", "value": "'use strict';\n\n(function () {\n\n var expect = require('chai').expect;\n\n var collect = require('../src/collect');\n\n describe('collect.js', function () {\n\n it('should exist', f...
javascript
chosen
[ { "from": "system", "value": "Remove now unneeded requires from compile test.\n" }, { "from": "human", "value": "goog.provide('Main');\n// Core\n// Either require 'Blockly.requires', or just the components you use:\ngoog.require('Blockly');\ngoog.require('Blockly.FieldDropdown');\ngoog.require('...
javascript
chosen
[ { "from": "system", "value": "Stop event bubbling when clicking on document toolbar\n" }, { "from": "human", "value": "$(document).ready(function(){\n var i=0;\n var $td;\n var state;\n\n function checkDocumentsStatuses(){\n $.getJSON(\"/api/documents_states\", function(data){\n var ...
javascript
chosen
[ { "from": "system", "value": "Reset sigint hook when readline closes.\n" }, { "from": "human", "value": "var sigintHooked = false;\n\nmodule.exports = function sigintHook( fn ) {\n\tif ( sigintHooked ) {\n\t\treturn;\n\t}\n\tsigintHooked = true;\n\t// ctrl+c should stop this task and quit grunt ...
javascript
chosen
[ { "from": "system", "value": "Fix check for ShadyCSS polyfill\n" }, { "from": "human", "value": "customElements.define('declarative-shadow-dom', class extends HTMLTemplateElement {\n static get observedAttributes() {\n return [];\n }\n\n constructor(self) {\n // assignment...
javascript
chosen
[ { "from": "system", "value": "Set focus back to textarea after button was pressed\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\n\n/* Component with a state */\nexport default class AddChatMessage extends React.Component {\n\tconstructor(props) ...
javascript
chosen
[ { "from": "system", "value": "Add failing beta version test\n" }, { "from": "human", "value": "import test from 'ava';\nimport fn from '../source/libs/compare-versions';\n\ntest('Compare versions', t => {\n\tt.is(-1, fn('1', '2'));\n\tt.is(-1, fn('v1', '2'));\n\tt.is(-1, fn('1.1', '1.2'));\n\tt....
javascript
chosen
[ { "from": "system", "value": "Break a test of the new suite\n" }, { "from": "human", "value": "describe(\"m.withAttr()\", function () {\n\t\"use strict\"\n\n\tit(\"calls the handler with the right value/context without callbackThis\", function () { // eslint-disable-line\n\t\tvar spy = sinon.spy...
javascript
chosen
[ { "from": "system", "value": "Fix zoom interpretation in helper\n" }, { "from": "human", "value": "var path = require('path'),\n assert = require('assert'),\n fs = require('fs');\n\nvar carto = require('../lib/carto');\nvar tree = require('../lib/carto').tree;\nvar helper = require('./supp...
javascript
chosen
[ { "from": "system", "value": "Make sure CSS files are watched\n" }, { "from": "human", "value": "import gulp from 'gulp'\nimport path from 'path'\nimport BrowserSync from 'browser-sync'\nimport { compiler, handleWebpackResults } from '../webpack/compiler'\n\nconst browserSync = BrowserSync.creat...
javascript
chosen
[ { "from": "system", "value": "fix(expo-cli): Add API hook command should say what it's going to do\n" }, { "from": "human", "value": "const prompts = require('prompts')\nconst addHook = require('../lib/add-hook')\nconst { onCancel } = require('../lib/utils')\nconst { blue, yellow } = require('kl...
javascript
chosen
[ { "from": "system", "value": "Set data-id on ref component.\n" }, { "from": "human", "value": "import { NodeComponent } from 'substance'\nimport { renderEntity } from '../../entities/entityHelpers'\n\nexport default class RefComponent extends NodeComponent {\n\n render($$) {\n const db = thi...
javascript
chosen
[ { "from": "system", "value": "Drop parens for arrow function\n" }, { "from": "human", "value": "var words = 'Hello Camp JS'.split(' ');\nwords.forEach((word) => document.body.innerHTML += '<p>' + word + '</p>');\n" }, { "from": "gpt", "value": "var words = 'Hello Camp JS'.split(' ');...
javascript
chosen
[ { "from": "system", "value": "Remove default setting for Avails command\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar packageJson = require('../package.json');\n\nvar program = require('commander');\n\nprogram\n .version(packageJson.version)\n .description(packageJson.descripti...
javascript
chosen
[ { "from": "system", "value": "Hide video facility contents from non-financial clients\n" }, { "from": "human", "value": "const BinaryPjax = require('../base/binary_pjax');\nconst Client = require('../base/client');\nconst defaultRedirectUrl = require('../base/url').defaultRed...
javascript
chosen
[ { "from": "system", "value": "Add a link to attrs in the docs\n" }, { "from": "human", "value": "import md from 'components/md'\n\nconst WhenToUseAttrs = () => md`\n ## When to use attrs?\n\n You can pass in attributes to styled components using \\`attrs\\`, but\n it is not always sensible to...
javascript
chosen
[ { "from": "system", "value": "Enable distinct results for calendar preview\n" }, { "from": "human", "value": "import {\n DEFAULT_LIMIT,\n DEFAULT_OFFSET,\n} from './base'\n\nimport {\n EventBelongsToManyImage,\n EventBelongsToPlace,\n EventHasManySlots,\n} from '../database/associations'\n\...
javascript
chosen
[ { "from": "system", "value": "Allow method URL to be an empty string\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nmodule.exports = function (methodName, config) {\n\n\t// Ensure the minimum parameters have been passed\n\tif (!methodName || !_.isString(methodName)) {\n\t\tthro...
javascript
chosen
[ { "from": "system", "value": "fix(server): Remove unique emails for teams\n" }, { "from": "human", "value": "'use strict';\n\nlet mongoose = require('mongoose');\nlet Schema = mongoose.Schema;\n\nlet teamSchema = new Schema({\n name : {\n type: String,\n required: true,\n ...
javascript
chosen
[ { "from": "system", "value": "Add sort for host list subscription.\n" }, { "from": "human", "value": "ListController = RouteController.extend({\n layoutTemplate: 'Layout',\n\n subscriptions: function () {\n this.subscribe('hosts');\n },\n\n action: function () {\n this.render('HostList...
javascript
chosen
[ { "from": "system", "value": "Add story for a selected chip.\n" }, { "from": "human", "value": "/**\n * Chip Component Stories.\n *\n * Site Kit by Google, Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in ...
javascript
chosen
[ { "from": "system", "value": "Update PreviewFilter for invalid/non-returned timestamps (v3).\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc filter\n * @name dockstore.ui.filter:PreviewFilter\n * @function\n * @description\n * # PreviewFilter\n * Filter in the dockstore.ui.\n ...
javascript
chosen
[ { "from": "system", "value": "Fix promisifySync case of promise arguments\n" }, { "from": "human", "value": "// Promisify synchronous function\n\n'use strict';\n\nvar callable = require('es5-ext/lib/Object/valid-callable')\n , deferred = require('../../deferred')\n , isPromise ...
javascript
chosen
[ { "from": "system", "value": "Use public API route to add tests\n\nAvoid sending credentials" }, { "from": "human", "value": "var ACCEPTANCE_TESTS_ENDPOINT = 'http://paie.sgmap.fr/tests/api/acceptance-tests',\n\tACCEPTANCE_TESTS_GUI_URL = 'http://paie.sgmap.fr/tests/';\n\nfunction createTest() {...
javascript
chosen
[ { "from": "system", "value": "Add version to update url\n" }, { "from": "human", "value": "const autoUpdater = require('electron').autoUpdater\nconst Menu = require('electron').Menu\n\nvar state = 'checking'\n\nexports.initialize = function () {\n autoUpdater.on('checking-for-update', function ...
javascript
chosen
[ { "from": "system", "value": "Add more patterns to no-only-test task\n" }, { "from": "human", "value": "// Lint and build CSS\nmodule.exports = function (grunt) {\n 'use strict';\n\n grunt.registerTask('default', [\n 'clean:build',\n 'phantomjs',\n 'webpack:dev',\n ]);\n\n grunt.reg...
javascript
chosen
[ { "from": "system", "value": "Enable header for every story\n" }, { "from": "human", "value": "import { configure, addDecorator } from '@storybook/react';\nimport { setDefaults } from '@storybook/addon-info';\nimport { setOptions } from '@storybook/addon-options';\nimport backgroundColor from 'r...
javascript
chosen
[ { "from": "system", "value": "Update babel IE target version to 11\n" }, { "from": "human", "value": "const presets = [\n [\n \"@babel/env\",\n {\n targets: {\n edge: \"18\",\n firefox: \"66\",\n chrome: \"73\",\n safari: \"12\",\n ie: \"9\"\n ...
javascript
chosen
[ { "from": "system", "value": "Fix doubled event of visibility change\n" }, { "from": "human", "value": "\"use strict\";\n\nangular\n .module('app')\n .run([\n '$document',\n '$rootScope',\n function($document, $rootScope) {\n function visibilitychanged() {\n var d = $docum...
javascript
chosen
[ { "from": "system", "value": "Add source maps to get better debugging in the browser\n\n" }, { "from": "human", "value": "const path = require('path');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\nconst ExtractTextPlugin = require('extract-text-webpack-plugin');\n\nmodule.exports ...
javascript
chosen
[ { "from": "system", "value": "Clear dist on every build\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar fs = require('fs');\n\nvar config = {\n entry: {\n 'app': './app/index.js'\n },\n devtool: 'source-map',\n output: {\n path: __dirname + '/dist',\n filen...
javascript
chosen
[ { "from": "system", "value": "Fix key and cert file params when using personal version\n" }, { "from": "human", "value": "module.exports = ServerFactory => class HttpsServerFactory extends ServerFactory {\n create (options) {\n const fs = require('fs')\n const https = require('https')\n ...
javascript
chosen
[ { "from": "system", "value": "Use full source map in production\n" }, { "from": "human", "value": "const path = require('path');\n\nconst webpack = require('webpack');\nconst CopyWebpackPlugin = require('copy-webpack-plugin');\nconst Dotenv = require('dotenv-webpack');\n\n\nmodule.exports = {\n ...
javascript
chosen
[ { "from": "system", "value": "Check if src dir has been formatted\n" }, { "from": "human", "value": "import { message, danger } from \"danger\"\nmessage(\":tada:, this worked @\" + danger.github.pr.user.login)\n" }, { "from": "gpt", "value": "import { message, danger } from \"danger\...
javascript
chosen
[ { "from": "system", "value": "Exclude Proxy code from production build\n" }, { "from": "human", "value": "// this Proxy handler will be used to preserve the unaltered behavior of the window global by default\nconst doNothingHandler = {\n get(target, prop) {\n const value = Reflect.get(target...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix fail on error for CLI\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\nvar program = require('commander'),\n meta = require('../package.json'),\n lint = require('../index');\n\nvar detects;\n\nprogram\n .version(meta.version)...
javascript
chosen
[ { "from": "system", "value": "Make the client use the reset channel (Let the server reload the client)\n" }, { "from": "human", "value": "const MuxDemux = require('mux-demux')\nconst debug = require('../debug').sub('shoe')\nconst pull = require('pull-stream')\nconst stps = require('st...
javascript
chosen
[ { "from": "system", "value": "Add periods to end of encode/decode comments.\n" }, { "from": "human", "value": "angular.module(\"Prometheus.services\").factory('UrlConfigDecoder', function($location) {\n return function(defaultHash) {\n var hash = $location.hash() || defaultHash;\n if (!ha...
javascript
chosen
[ { "from": "system", "value": "STYLE: Use the register function from server when discovering the hapi-jwt-couch plugin\n" }, { "from": "human", "value": "var Boom = require('boom');\n\nexports.register = function (server, conf, next) {\n\n\tconst validate = function(req, decodedToken, callback){\...
javascript
chosen
[ { "from": "system", "value": "Validate date fields as ISO-format dates.\n" }, { "from": "human", "value": "// Validation for bookmark payloads.\n'use strict';\n\nvar Hoek = require('hoek');\nvar Joi = require('joi');\n\nvar validators = {};\n\nvalidators.bookmarkID = Joi.string().guid();\n\n// B...
javascript
chosen
[ { "from": "system", "value": "Set vm.error in register and login on AuthController.\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n angular\n .module('app.auth')\n .controller('AuthController', AuthController);\n\n AuthController.$inject = ['$location', 'authService...
javascript
chosen
[ { "from": "system", "value": "Change function declaration to function expression\n" }, { "from": "human", "value": "$(function() {\n var $loadMore = $('#load-more');\n\n if ($loadMore.length) {\n\n var $spinner = $('#spinner');\n\n function init() {\n $spinner.hide();\n $.ajaxP...
javascript
chosen
[ { "from": "system", "value": "Add button to new post page\n" }, { "from": "human", "value": "import _ from 'lodash';\nimport React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { fetchPosts } from '../actions';\n\nclass PostsIndex extends Component {\n componentDi...
javascript
chosen
[ { "from": "system", "value": "Add board reducer case for filtering\n" }, { "from": "human", "value": "import initialState from './initialState';\nimport { \n BOARD_REQUESTED, \n BOARD_LOADED, \n BOARD_DESTROYED, \n BOARD_SCROLLED_BOTTOM\n} from '../constants'\n\nexport default functi...
javascript
chosen
[ { "from": "system", "value": "Use site metadata to find registered plugins/schemas.\n\nThis simplifies loading schemas, and eliminates some dependencies.\nWe also stash site metadata in the schema object, since it's useful\nfor tests.\n" }, { "from": "human", "value": "// This module loads and e...
javascript
chosen
[ { "from": "system", "value": "Change var from jquery to normal js var\n" }, { "from": "human", "value": "<!--[if lt IE 9]>\ndocument.createElement('video');\n<!--[endif]-->\n\n$(window).unload(function() {\n $.rails.enableFormElements($($.rails.formSubmitSelector));\n});\n\n// Cool title effect...
javascript
chosen
[ { "from": "system", "value": "Fix an issue with embed previews.\n\n[Fixes #137488987](https://www.pivotaltracker.com/story/show/137488987)\n[Fixes #137491203](https://www.pivotaltracker.com/story/show/137491203)\n" }, { "from": "human", "value": "/* eslint-disable react/no-danger */\n\nimport Re...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary import [rev: minor]\n" }, { "from": "human", "value": "/*\n * Copyright 2014-2015 Hewlett-Packard Development Company, L.P.\n * Licensed under the MIT License (the \"License\"); you may not use this file except in compliance with the License.\n */...
javascript
chosen
[ { "from": "system", "value": "Fix Tael container top resizing\n" }, { "from": "human", "value": "function resizeTaelContainer() {\n $('.tael-container').css('bottom', 16);\n}\n\n$(document).ready(function () {\n var header_bbox = $('.header')[0].getBoundingClientRect();\n $('.tael-conta...
javascript
chosen
[ { "from": "system", "value": "Add logged in user details\n" }, { "from": "human", "value": "import Service from '@ember/service';\nimport { computed } from '@ember/object';\nimport { inject as service } from '@ember/service';\n\nexport default Service.extend({\n session: service(),\n\n init() ...
javascript
chosen
[ { "from": "system", "value": "Comment out console.log for debug\n" }, { "from": "human", "value": "import { connect } from 'react-redux';\n\nimport { buildJKFPlayerFromState } from \"../playerUtils\";\nimport { inputMove, changeComments } from '../actions';\nimport BoardSet from '../components/B...
javascript
chosen
[ { "from": "system", "value": "Fix annot read property '/' of undefined\n" }, { "from": "human", "value": "import SocketIONamespace from \"./namespace\";\n\nexport default class SocketIOServer {\n constructor(io) {\n this._io = io;\n this._sockets = this.of(\"/\");\n this....
javascript
chosen
[ { "from": "system", "value": "Clean up some prod tasks\n" }, { "from": "human", "value": "/**\n * `linkAssetsBuildProd`\n *\n * ---------------------------------------------------------------\n *\n * This Grunt tasklist is not designed to be used directly-- rather\n * it is a helper called by th...
javascript
chosen
[ { "from": "system", "value": "Allow an initial isOpen property to be set\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux'\nimport Modal from 'react-modal'\nimport { closeDialog } from './actions';\n\nconst reduxDialog = (dialogPr...
javascript
chosen
[ { "from": "system", "value": "Disable console log for server connection\n" }, { "from": "human", "value": "var MongoClient = require('mongodb').MongoClient;\nvar URICS = \"mongodb://tonyli139:RDyMScAWKpj0Fl1O@p2cluster-shard-00-00-ccvtw.mongodb.net:27017,p2cluster-shard-00-01-ccvtw.mongodb.net:2...
javascript
chosen
[ { "from": "system", "value": "Remove variables that are defined but never used\n" }, { "from": "human", "value": "// Karme Edge Launcher\n// =================\n\n// Dependencies\n// ------------\n\nvar urlparse = require('url').parse\nvar urlformat = require('url').format\nvar exec = require('ch...
javascript
chosen
[ { "from": "system", "value": "Save random; load random cat on 'random' option\n" }, { "from": "human", "value": "function renderCat(catGifId) {\n var container = document.getElementById('cat');\n container.innerHTML =\n \"<img \" +\n \"src='http://iconka.com/wp-content/uploads/edd/2015/1...
javascript
chosen
[ { "from": "system", "value": "FIX - IE11 does not support inside loops\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependenices\n */\n\nconst clone = require('shallow-clone');\nconst typeOf = require('kind-of');\n\nfunction cloneDeep(val, instanceClone) {\n switch (type...
javascript
chosen
[ { "from": "system", "value": "Use path.resolve to resolve path\n" }, { "from": "human", "value": "#!/usr/bin/env iojs\n\nvar program = require('commander'),\n fs = require('fs'),\n sequoria = require('sequoria'),\n createBot = require('./lib').createBot;\n\nfunction main() {\n program\n ....
javascript
chosen
[ { "from": "system", "value": "Put module.exports and function on same line\n" }, { "from": "human", "value": "module.exports = reviewersEditionCompare\n\nvar ordinal = require('number-to-words').toWordsOrdinal\nvar parse = require('reviewers-edition-parse')\nvar numbers = require('reviewers-edit...
javascript
chosen
[ { "from": "system", "value": "Adjust opt.splitter to compare against undefined for the default value.\n" }, { "from": "human", "value": "var es = require('event-stream'),\n clone = require('clone'),\n path = require('path');\n\nmodule.exports = function(opt){\n // clone options\n opt = opt ?...
javascript
chosen
[ { "from": "system", "value": "Add opportunity pass webpack root (context)\n" }, { "from": "human", "value": "var rimraf = require('rimraf')\nvar path = require('path');\nvar join = path.join;\n\nfunction Plugin(paths) {\n // determine webpack root\n this.context = path.dirname(module.parent.fi...
javascript
chosen
[ { "from": "system", "value": "Add loading/merging methods to Config utility\n" }, { "from": "human", "value": "import _ from 'lodash'\nimport defaultConfig from '../config/defaults'\n\nlet globalConfig = _.assign({}, _.cloneDeep(defaultConfig))\n\nexport default class Config {\n static load(cfg...
javascript
chosen
[ { "from": "system", "value": "Add a fix for Safari to the default config\n\nUglifying ES6 doesn't work currently with Safari due to a webkit bug.\nAdding this mangle option fixes that.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n name: 'ember-cli-uglify',\n\n includ...
javascript
chosen
[ { "from": "system", "value": "Read environment variables for data directory and tile downloader\n" }, { "from": "human", "value": "var addElevation = require('geojson-elevation').addElevation,\n TileSet = require('node-hgt').TileSet,\n express = require('express'),\n bodyParser = requir...
javascript
chosen
[ { "from": "system", "value": "Fix off by one bug\n" }, { "from": "human", "value": "function Alternate() {\n this.values = arguments;\n this.index = 0;\n}\n\nAlternate.prototype.next = function() {\n var returnValue = this.values[this.index];\n\n if (this.index < this.values.length) {\n t...
javascript
chosen
[ { "from": "system", "value": "Remove loop to keep scope small. Simplify some code, and pre calculate some things for perf\n" }, { "from": "human", "value": "/*!\n * tweensy - Copyright (c) 2017 Jacob Buck\n * https://github.com/jacobbuck/tweensy\n * Licensed under the terms of the MIT license.\n...
javascript
chosen
[ { "from": "system", "value": "Add patient code number sequence\n" }, { "from": "human", "value": "/* eslint-disable import/prefer-default-export */\n/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nconst HOURS_PER_DAY = 24;\nconst MINUTES_PER_HOUR = 60;\nconst SECONDS_PER_...
javascript
chosen
[ { "from": "system", "value": "Edit server route url to match client request\n" }, { "from": "human", "value": "var bodyParser = require('body-parser');\nvar express = require('express');\nvar app = express();\nvar router = express.Router();\nvar Sequelize = require('sequelize');\nvar sequelize =...
javascript
chosen
[ { "from": "system", "value": "Add documentation regarding MIME types.\n" }, { "from": "human", "value": "/**\n * render-mustache\n *\n * This module implements support for rendering [Mustache](http://mustache.github.com/)\n * templates using [mustache.js](https://github.com/janl/mustache.js).\n ...
javascript
chosen
[ { "from": "system", "value": "Change requested itag for YouTube music to a M4A+AAC stream, instead of a WebM+Opus stream in an attempt to fix issues\n" }, { "from": "human", "value": "/**\n * @file Music handler for YouTube videos. Does not support livestreams.\n * @author Ovyerus\n */\n\nconst ...
javascript
chosen
[ { "from": "system", "value": "Update store at Only import change\n" }, { "from": "human", "value": "// @flow\nimport type {Store, Dispatch, Action} from 'redux';\n\nexport const save = (store: Store) => (next: Dispatch) => (action: Action) => {\n\tsetImmediate(() => {\n\t\tlocalStorage.setItem('...
javascript
chosen
[ { "from": "system", "value": "spawn-1007006: Allow wider set of messages in exception tests\n\nIf Task.spawn catches an exception message then it adds \"Error: \" onto\nthe front, so allow a slightly wider set of error messages when testing.\n\nSigned-off-by: Joe Walker <7a17872fbb32c7d760c9a16ee3076daead11...
javascript
chosen
[ { "from": "system", "value": "Modify getPrice to report name of item actually queried\n" }, { "from": "human", "value": "import module from '../../module'\nimport command from '../../components/command'\nimport axios from 'axios'\nimport humanize from '../../utils/humanize'\n\nexport default mod...
javascript
chosen
[ { "from": "system", "value": "Clean up file versioning handler\n" }, { "from": "human", "value": "let chokidar = require('chokidar');\nlet glob = require('glob');\n\n/**\n * Create a new plugin instance.\n *\n * @param {Array} files\n */\nfunction FileVersioningPlugin(files = []) {\n this.fil...
javascript
chosen
[ { "from": "system", "value": "Allow double click zoom when map is not frozen\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport { Map, TileLayer, GeoJSON } from 'react-leaflet'\n\nclass CenteredMap extends React.PureComponent {\n static prop...
javascript
chosen
[ { "from": "system", "value": "Use event name for incident name\n" }, { "from": "human", "value": "var util = require('util');\nvar Duplex = require('stream').Duplex;\n\nvar LoadAverage = module.exports = function LoadAverage(options) {\n this.warn = options.warn;\n this.critical = options.crit...
javascript
chosen
[ { "from": "system", "value": "Change constant value for backward compatibility\n" }, { "from": "human", "value": "export default class Constants {\n static get USER_ACCOUNT_KEY() { return btoa('blipSdkUAccount'); }\n static get IFRAMEURL_LOCAL() { return 'http://localhost:3000/'; }\n st...
javascript
chosen
[ { "from": "system", "value": "Update test to reflect config file change\n" }, { "from": "human", "value": "'use strict';\n\n/*\nconfig\n->read from file, holds values and supplies as needed\n*/\nrequire('chai').should()\n\nvar config = require('../lib/config')()\n\ndescribe('Config', () => {\n\n...
javascript
chosen
[ { "from": "system", "value": "Change player sprite to show hero facing the zombies\n" }, { "from": "human", "value": "/* global Entity */\n(function() {\n 'use strict';\n\n function Player(x, y, speed) {\n this.base = Entity;\n this.base(\n x,\n y,\n Player.width,\n P...
javascript
chosen
[ { "from": "system", "value": "Add test: 'dad' is a palindrome\n" }, { "from": "human", "value": "var expect = require('chai').expect;\nvar isPalindrome = require('../src/palindrome');\n\ndescribe('palindrome-test', function() {\n\tit('should pass the canary test', function() {\n\t\texpect(true)....
javascript
chosen
[ { "from": "system", "value": "[CHORES] Move name config to development\n" }, { "from": "human", "value": "module.exports = {\n default: {\n available_providers: [\"ens\", \"ipns\"],\n provider: \"ens\",\n register: {\n rootDomain: \"embark.eth\",\n subdomains: {\n 'sta...
javascript
chosen
[ { "from": "system", "value": "Update bower @ Uninstall angular-material-data-table\n" }, { "from": "human", "value": "/**\n * Created by anonymous on 13/12/15 11:09.\n */\n\n(function() {\n 'use strict';\n\n angular\n .module('appFoundation', [\n /* Angularjs */\n ...
javascript
chosen
[ { "from": "system", "value": "Replace test.done with test.end (patch)\n" }, { "from": "human", "value": "'use strict'\n\nconst tap = require('tap')\nconst getDokumenter = require('../lib/journals/getDokumenter')\n\ntap.test('Requires options to be specified', function (test) {\n const options =...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary API call in unit test\n\nWe do not need to hit the API in this test. It's unnecessary and makes\nthe test harder to comprehend.\n\nInstead of testing this way, simulate a promise that resolves without\npages.\n\n(npm run test:unit should work without an inter...
javascript
chosen
[ { "from": "system", "value": "Revert \"Refactored macro to use ComputedProperty meta instead of object's meta\"\n" }, { "from": "human", "value": "import Em from 'ember';\n\nvar get = Em.get;\n\nvar defaultFilter = function(value) { return value; };\n\nexport default function(dependentKey, filte...
javascript
chosen
[ { "from": "system", "value": "Add \"vendor\" to list of printed properties\n" }, { "from": "human", "value": "const {TextView, device, ui} = require('tabris');\n\n// Display available device information\n\n['platform', 'version', 'model', 'language', 'orientation'].forEach((property) => {\n new...
javascript
chosen
[ { "from": "system", "value": "Check first censure words before analyze\n" }, { "from": "human", "value": "'use strict'\n\nvar extract = require('../../extract')\nvar lodash = require('lodash')\n\nvar CONST = {\n SOURCE_NAME: 'totalwind',\n IGNORE_LOG_PROPS: ['updatedAt', 'createdAt', 'link', '...
javascript
chosen
[ { "from": "system", "value": "Move update notifier to bin\n" }, { "from": "human", "value": "#! /usr/bin/env node\n'use strict';\n\nvar chalk = require('chalk'),\n pkg = require('../package.json');\n\nvar nodeVersion = process.version.replace('v',''),\n nodeVersionRequired = pkg.engines.no...
javascript
chosen
[ { "from": "system", "value": "Fix import errors flow found.\n" }, { "from": "human", "value": "// @flow\nimport { Record } from 'immutable';\n\nimport { Type } from './tm';\nimport EvaluationResult from './evaluation';\n\n\nconst EqualityShape = Record({\n of: null, // Tm\n type: Type.singleto...
javascript
chosen
[ { "from": "system", "value": "Disable lint for test assets\n" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\nconst gulp = require('gulp');\nconst eslint = require('gulp-eslint');\nconst spawn = require('cross-spawn');\nconst excludeGitignore = require('gulp-exclu...
javascript
chosen
[ { "from": "system", "value": "Update Counter test to no relying on initial values for event handlers\n" }, { "from": "human", "value": "/** @jsx createElement */\n\nconst {createElement, createEventHandler, render} = Yolk\n\nfunction Counter () {\n const handlePlus = createEventHandler(1, 0)\n ...
javascript
chosen