conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix throwing when no source maps on calling `forEach` of null\n\nWe need here to show frames even if all came from node_modules\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT l...
javascript
chosen
[ { "from": "system", "value": "Add color to asset.name in console output\n" }, { "from": "human", "value": "const chalk = require('chalk');\n\nfunction composeWebpackOutput(stats) {\n if (!stats.hasErrors() && !stats.hasWarnings()) {\n composeSuccessOutput(stats);\n return;\n }\n\n compo...
javascript
chosen
[ { "from": "system", "value": "Reduce compressed tarball size by ~1%\n" }, { "from": "human", "value": "var fs = require('fs')\nvar path = require('path')\nvar mkdirp = require('mkdirp')\nvar tar = require('tar-stream')\nvar zlib = require('zlib')\n\nfunction mode (octal) {\n return parseInt(oct...
javascript
chosen
[ { "from": "system", "value": "Add space before typeof operator\n" }, { "from": "human", "value": "import {curry} from 'lodash'\n\nlet isCurrentSemester = curry((year, semester, schedule) => {\n\tif (typeof year === 'string')\n\t\tyear = parseInt(year, 10)\n\tif (typeof semester === 'string')\n\t...
javascript
chosen
[ { "from": "system", "value": "Put the Era module system unit tests under a command-line option rather than always running them.\n" }, { "from": "human", "value": "#!/bin/env node\n// build-era.js\n// Copyright 2013, 2014 Ross Angle. Released under the MIT License.\n\"use strict\";\n\nprocess.chd...
javascript
chosen
[ { "from": "system", "value": "Use group 1 for analog value\n" }, { "from": "human", "value": "module.exports = function(RED) {\n function TaCmiCoeOutNode(config) {\n RED.nodes.createNode(this,config);\n\tthis.topic_prefix = config.topic_prefix\n var node = this;\n this.on...
javascript
chosen
[ { "from": "system", "value": "[feat] Refresh paused tests less frequently\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n _scheduleRefresh: Ember.on('init', function() {\n Ember.run.later(()=> {\n this.refresh();\n if (this.get...
javascript
chosen
[ { "from": "system", "value": "Swap from letters int to packages object\n" }, { "from": "human", "value": "class Player extends Phaser.Sprite {\n constructor (game, city, saved) {\n super(game, city.x, city.y, 'city')\n this.game.add.existing(this)\n this.tint = 0x006600\n...
javascript
chosen
[ { "from": "system", "value": "Add all JavaScript dependencies from govuk_publishing_components\n" }, { "from": "human", "value": "//= require_tree ./modules\n//= require govuk_publishing_components/components/feedback\n// from govuk_frontend_toolkit and not delivered by static as part of\n// hea...
javascript
chosen
[ { "from": "system", "value": "Add extra momentjs locales for 'de' and 'es'\n\nrefs #1909\n" }, { "from": "human", "value": "//= require jquery\n//= require jquery_ujs\n//= require twitter/bootstrap\n//= require lodash\n//= require handlebars.runtime\n//= require diacritics\n\n// To use placehold...
javascript
chosen
[ { "from": "system", "value": "Adjust configuration of coverage target paths\nAdjust configuration to exclude `assets` and `__generated__`\ndirectories from coverage statistics.\n" }, { "from": "human", "value": "const path = require('path');\n\nmodule.exports = {\n rootDir: process.cwd(),\n mo...
javascript
chosen
[ { "from": "human", "value": "Add unit test for service Subscription\n" }, { "from": "gpt", "value": "'use strict';\n\ndescribe('Service: Subscription', function () {\n\n\tvar MainSrvc, $httpBackend;\n\n\t// load the controller's module\n\tbeforeEach(module('npmalerts'));\n\n\t// Initialize the c...
javascript
chosen
[ { "from": "system", "value": "Fix for dynamic route list not checking existing routes correctly\n" }, { "from": "human", "value": "var fs = require('fs');\n//moment to record time\nvar moment = require('moment');\n\n//saves json to disk to be analyzed later\nexports.file = function (filename, da...
javascript
chosen
[ { "from": "system", "value": "Remove Sequelize logging from test environment\n" }, { "from": "human", "value": "import dotenv from 'dotenv';\n\ndotenv.config();\n\nexport default {\n development: {\n dialect: 'mysql',\n host: 'localhost',\n database: 'gamelibrary',\n username: 'root...
javascript
chosen
[ { "from": "system", "value": "Clarify browser is closed even with getBrowser option\n\nAvoid extra burden of having to close browser, but also document how it can be kept alive.\r\nPossible that should switch in future to shift responsibility of closing custom browser to user." }, { "from": "human",...
javascript
chosen
[ { "from": "system", "value": "Replace hyphens by underscores in ownership annotations in JS files\n\nSummary: Replace hyphens by underscores in ownership annotations in JS files.\n\nDifferential Revision: D36702735\n\nfbshipit-source-id: 868616619e3ea30219ac7ed2431f4a53551b6a34\n" }, { "from": "huma...
javascript
chosen
[ { "from": "system", "value": "Add setpasses command and writeConfig fn; the latter may be removed soon\n" }, { "from": "human", "value": "\nconst fs = require('fs');\n\nmodule.exports = {\n fn: command => (\n (message, config, ...other) => {\n if (message.author.id === confi...
javascript
chosen
[ { "from": "system", "value": "Make wiki much faster for blocks of highlighted code on quick render\n" }, { "from": "human", "value": "'use strict';\n\nvar hljs = require('highlight.js');\nrequire('highlight-css');\nvar MarkdownIt = require('markdown-it');\n\nvar highlighter = function (str, lang...
javascript
chosen
[ { "from": "system", "value": "Use string substitution in console.log().\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar colors = require('colors'),\n\texec = require('child_process').exec,\n\tpkg = require('../package.json'),\n\tyear = new Date().getFullYear(),\n\tpreamble = '/*!\\...
javascript
chosen
[ { "from": "system", "value": "Switch all CRUD endpoints to /api namespace\n\nThis will clearly define what are the API paths and normal paths.\n" }, { "from": "human", "value": "const express = require('express');\nconst bodyParser = require('body-parser'); \nconst User = require('../database/mo...
javascript
chosen
[ { "from": "system", "value": "Add a sortyBy comparator to spine collection\n" }, { "from": "human", "value": "\"use strict\";\n/**\n * Collection of spines.\n **/\n define([\n \"underscore\",\n \"backbone\"\n], function(_, Backbone) {\n\n var SpineCollection = Backbone.Collection.exten...
javascript
chosen
[ { "from": "system", "value": "Add idea reducer to root reducer\n" }, { "from": "human", "value": "import { combineReducers } from \"redux\"\n\nimport user from \"./user\"\n\nconst rootReducer = combineReducers({\n user,\n})\n\nexport default rootReducer\n" }, { "from": "gpt", "value...
javascript
chosen
[ { "from": "system", "value": "Write to child for exercise\n" }, { "from": "human", "value": "\nwindow.firebaseRef = null;\n$(function() {\n var key = \"firebase-codecademy\";\n if (!localStorage.getItem(key)) {\n var hash = Math.random().toString(36).slice(2);\n localStorage.setItem(\"fi...
javascript
chosen
[ { "from": "system", "value": "Remove option of pasting from Word - force plain text\n" }, { "from": "human", "value": "/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or http://ckeditor.com/license\n */\n\nCKEDITOR.ed...
javascript
chosen
[ { "from": "system", "value": "Add remove personal data to cached actions\n" }, { "from": "human", "value": "import * as ActionTypes from '../_constants/ActionTypes';\n\nexport default [\n ActionTypes.UPDATE_TOKEN,\n ActionTypes.SERVER_DATA_ASSET_INDEX,\n ActionTypes.SERVER_DATA_BALANCE,...
javascript
chosen
[ { "from": "system", "value": "Fix syntax error in spec.\n" }, { "from": "human", "value": "describe( \"TodoTxtItem\", function () {\n\n\tvar target = {\n\t\traw: \"This is a task. +Project\",\n\t\trender: \"This is a task. +Project\",\n\t\ttext: \"This is a task.\",\n\t\tpriority: null,\n\t\tcom...
javascript
chosen
[ { "from": "system", "value": "Add html to watch list since its compiled inline via browserify\n" }, { "from": "human", "value": "var browserifyTransforms = ['brfs'];\n\nmodule.exports = function(grunt) {\n\n\tgrunt.registerTask( 'default', [ 'clean', 'browserify', 'sass', 'autoprefixer' ] );\n\t...
javascript
chosen
[ { "from": "system", "value": "Use the local Provider ref rather than the one under Provider\n" }, { "from": "human", "value": "/**\n *\n * @param {any} defaultValue\n */\nexport function createContext(defaultValue = {}) {\n\tfunction Consumer(props) {\n\t\treturn props.children(props.value);\n\t...
javascript
chosen
[ { "from": "system", "value": "Add test task to grunt.\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\t// Project configuration\n\tgrunt.initConfig({\n\t\tpkg: grunt.file.readJSON('package.json'),\n\t\tjshint: {\n\t\t\tall: 'src/<%= pkg.name %>.js'\n\t\t},\n\t\tuglify: {\...
javascript
chosen
[ { "from": "system", "value": "Fix mochaRunner:custom task's script and style paths\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.loadNpmTasks('grunt-mocha-test');\n grunt.loadNpmTasks('grunt-contrib-jshint');\n\n // Load the plugin's tasks\n grunt.loadTasks('t...
javascript
chosen
[ { "from": "system", "value": "Add \"bail\" options to abort grunt if errors\n" }, { "from": "human", "value": "/*global module*/\nmodule.exports = function (grunt) {\n 'use strict';\n\n grunt.loadNpmTasks('grunt-contrib-jshint');\n grunt.loadNpmTasks('grunt-mocha');\n\n var gruntConf...
javascript
chosen
[ { "from": "system", "value": "Enable pretty printing in the git_log_json task\n" }, { "from": "human", "value": "/*\n * grunt-git-log-json\n * https://github.com/nlaplante/grunt-git-log-json\n *\n * Copyright (c) 2014 Nicolas Laplante\n * Licensed under the MIT license.\n */\n\n'use strict';\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix query for chat messages\n" }, { "from": "human", "value": "/* @flow */\n\nimport React, { Component, PropTypes } from 'react';\nimport Connect from '../../../modules/store/Connect';\nimport ChatMessages from '../views/ChatMessages';\nimport type { SubscriptionRa...
javascript
chosen
[ { "from": "system", "value": "Change integration of oauth2 server\n" }, { "from": "human", "value": "var idmcore = require(\"./idm_core\");\nvar idmweb = require(\"./idm_web\");\n\nfunction init(settings) {\n // TODO: Ask DP whether no asynchronous action\n // are in idm init\n idmcore....
javascript
chosen
[ { "from": "system", "value": "Add country to admin layers filtering\n\nThis was missing, which would cause countries to get all admin layers.\n" }, { "from": "human", "value": "/* Look up which admin fields should be populated for a record in a given layer.\n *\n * The logic is: look up eveythin...
javascript
chosen
[ { "from": "system", "value": "Consistency: Remove extraneous space in jshint inline comment\n" }, { "from": "human", "value": "\n\n// The AMDJS logic branch is evaluated first to avoid potential confusion over\n// the CommonJS syntactical sugar offered by AMD.\nif (typeof define === \"function\"...
javascript
chosen
[ { "from": "system", "value": "Improve error feedback on server add screen" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport { connect } from 'react-redux';\nimport { addServer } from '../actions/servers';\nimport { setStatus, clearStatus } from '../act...
javascript
chosen
[ { "from": "system", "value": "Update support data for CSS Font Loading API.\n" }, { "from": "human", "value": "define([], function () {\n return {\n name: 'CSS Font Loading',\n description: 'The [CSS3 font loading module](http://dev.w3.org/csswg/css-font-loading/) defines a new interface ...
javascript
chosen
[ { "from": "system", "value": "Fix colour preview not loading on page load\n\nThe event was changed from `change` to `input`. The trigger was not updated accordingly." }, { "from": "human", "value": "(function(Modules) {\n \"use strict\";\n\n let isSixDigitHex = value => value.match(/^#[0-9A-F]...
javascript
chosen
[ { "from": "system", "value": "Include the new track-click module\n\nThis will make sure we expose the `TrackClick` module to the GOVUK namespace.\n" }, { "from": "human", "value": "//= require govuk/modules\n//= require modules/sticky-element-container\n//= require modules/toggle\n\n$(document)....
javascript
chosen
[ { "from": "system", "value": "Widgets: Use 'load' over 'DOMContentLoaded' to wait for stylesheets.\n" }, { "from": "human", "value": "(function () {\n if (!window.postMessage || window.self === window.top) {\n return;\n }\n function reportWidgetSize() {\n var D, height, sizeMessage;\n\n...
javascript
chosen
[ { "from": "system", "value": "Allow plugins to manage multiple properties\n" }, { "from": "human", "value": "'use strict';\n\nvar module = angular.module('kheoApp');\n\nmodule.controller('ServerDetailCtrl', ['$scope', '$resource', '$routeParams', 'configuration', '_', function ($scope, $resource...
javascript
chosen
[ { "from": "system", "value": "Remove unused callback (causing weird error)\n" }, { "from": "human", "value": "'use strict';\n\nlet gulp = require('gulp');\nlet karma = require('karma');\n\n/**\n * Run test once and exit\n */\ngulp.task('test', function (done) {\n new karma.Server({\n c...
javascript
chosen
[ { "from": "system", "value": "Add missing params argument to api.team methods\n" }, { "from": "human", "value": "const { authConf } = require('src/auth-utils');\nconst authApi = require('src/core/auth');\n\n\nfunction list(organizationId, {auth}) {\n return authApi.organizations.listTeams(organ...
javascript
chosen
[ { "from": "system", "value": "Fix update checks never returning anything.\n" }, { "from": "human", "value": "var Promise = require('bluebird');\nvar fs = Promise.promisifyAll(require('fs'));\nvar _ = require('lodash');\n\nmodule.exports = {\n createIfNotExists: function(inPath) {\n ret...
javascript
chosen
[ { "from": "system", "value": "Make sure menu code doesn't error out on 404\n" }, { "from": "human", "value": "// Highlight active navigation menu item\n(function() {\n var fullPath = window.location.pathname.substring(1);\n var parentPath = fullPath.split('/')[0];\n var path = fullPath.replac...
javascript
chosen
[ { "from": "system", "value": "Use service discovery to get password client.\n" }, { "from": "human", "value": "exports = module.exports = function(ds) {\n \n return function(username, password, realm, cb) {\n if (typeof realm == 'function') {\n cb = realm;\n realm = undefined;\n ...
javascript
chosen
[ { "from": "system", "value": "Use `NavigatorIOS` to contain `WeatherView` in main view\n" }, { "from": "human", "value": "/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n */\n'use strict';\nimport React, {\n AppRegistry,\n Component,\n StyleSheet,\n Text,\n Vie...
javascript
chosen
[ { "from": "system", "value": "Add some console logs for testing elastic.io integration.\n" }, { "from": "human", "value": "StockXmlImport = require('./main').StockXmlImport\n\nexports.process = function(msg, cfg, cb, snapshot) {\n config = {\n client_id: cfg.sphereClientId,\n client_secre...
javascript
chosen
[ { "from": "system", "value": "Implement case for arrays too short to be sequences\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = {\n\taritGeo: function(numlist) {\n\t\tif (!Array.isArray(numlist)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (numlist.length === 0) {\n\t\t\treturn ...
javascript
chosen
[ { "from": "system", "value": "Destroy Vue component when Backbone view is destroyed\n" }, { "from": "human", "value": "import Vue from 'vue';\n\nimport View from './view';\n\nimport store from './vue/store';\n\n// Backbone view that wraps a Vue component\nconst VueComponentView = View.extend({\n...
javascript
chosen
[ { "from": "system", "value": "Fix galleria URL by prepending slash /\n" }, { "from": "human", "value": "$(document).ready(function(){\n\n // Initialize any dialogs present\n $( \".dialog\" ).dialog({\n autoOpen: false,\n modal: true,\n width: 450\n });\n\n /* Fire up the slideshow -...
javascript
chosen
[ { "from": "system", "value": "Write \"Doesn't break Mithril\" tests\n" }, { "from": "human", "value": "import \"6to5/polyfill\";\n\nimport test from \"tape-catch\";\n\nimport n from \"../source/n\";\n\n\ntest(\"Doesn't break Mithril:\", function (is) {\n is.pass(\"Does the same as mithril wit...
javascript
chosen
[ { "from": "system", "value": "Fix typo in bin message\n" }, { "from": "human", "value": "#! /usr/bin/env node\n\nvar color = require('bash-color');\n\nconsole.log(color.red(\"You need to install 'gitbook-cli' to have access to the gitbook command anywhere on your system.\"));\nconsole.log(color....
javascript
chosen
[ { "from": "system", "value": "Revert \"Create a sandbox before each test and clean it up afterwards\"\n\nThis reverts commit c9ef14a1d3346ac6d4db00cbab09df0d6a5a97c4.\n\nSince the helpers are using a sandbox of their own, we don't need to create\nanother one.\n" }, { "from": "human", "value": "v...
javascript
chosen
[ { "from": "system", "value": "Add chapter 6, exercise 2\n" }, { "from": "human", "value": "class Group {\n constructor() {\n this.members = [];\n }\n\n add(elem) {\n // Could use Group.has() here instead\n if (!this.members.includes(elem)) {\n this.member...
javascript
chosen
[ { "from": "system", "value": "Add logging to see who we can't get the info for\n" }, { "from": "human", "value": "var moment = require('moment');\nvar userCache = {};\nvar cacheTimeInMilliseconds = 1000 * 60 * 15;\n\n/**\n * Every time a user posts a message, we update their slack profile so we ...
javascript
chosen
[ { "from": "system", "value": "Change .filter -> .find. So it can be used on parent element\n" }, { "from": "human", "value": "// $('img.photo',this).imagesLoaded(myFunction)\n// execute a callback when all images have loaded.\n// needed because .load() doesn't work on cached images\n\n// mit li...
javascript
chosen
[ { "from": "system", "value": "Set new state when model gets new restaurant name\n" }, { "from": "human", "value": "import React, { PropTypes, Component } from 'react';\nimport { Modal, Button } from 'react-bootstrap';\n\nclass DeleteRestaurantModal extends Component {\n state = {};\n\n compone...
javascript
chosen
[ { "from": "system", "value": "Fix scroll Component when the page is updated but the feature didn't change\n" }, { "from": "human", "value": "import React from 'react'\nimport Card from '../util/View/Card'\nimport {PageTitle} from '../util/View/Title'\nimport {Meta} from '../util/View/Meta'\nimpo...
javascript
chosen
[ { "from": "system", "value": "Fix for FF being stupid\n\nFF apparently doesn't know what a checked checkbox is until it's been checked/unchecked once, so even though it's checked by default in the HTML we have to also trigger some JavaScript to check it for us. This will become a nasty problem if we later m...
javascript
chosen
[ { "from": "system", "value": "Add Display / Hide Of Timepicker Popup\n" }, { "from": "human", "value": "let React = require(\"react\")\nlet cx = require(\"classnames\")\nlet popup = React.createFactory(require(\"./timepicker_popup\"))\nlet {errorList, sizeClassNames, formGroupCx, label} = requir...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary call to setEncoding.\n" }, { "from": "human", "value": "/*globals require, module, Promise */\n\n'use strict';\n\nvar streamify;\n\nstreamify = require('./streamify');\n\nmodule.exports = stringify;\n\n/**\n * Public function `stringify`.\n *\n * ...
javascript
chosen
[ { "from": "system", "value": "Add creation of a file to write to\n" }, { "from": "human", "value": "var fs = require('fs');\nvar clicolour = require('cli-color');\nvar mkdirp = require('mkdirp');\nvar error = require('../../error/bsod.js');\nvar xml = require('xml');\n\n\nexports.buildLang = fun...
javascript
chosen
[ { "from": "system", "value": "Change units to CSS standard\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n 'tags': {\n 'body': {\n 'padding': '1 2'\n },\n 'p': {\n 'margin': '1 0'\n }\n },\n 'ids': {\n 'logo': {\n 'color': 0x00aa00,\n ...
javascript
chosen
[ { "from": "system", "value": "Copy URL to clipboard (CMD + L)\n\nCloses #40.\n" }, { "from": "human", "value": "// Get webview element\nvar webview = document.getElementById('webview');\n\n// Initial page zoom factor\nvar zoomFactor = 1.0;\n\n// Listen to keydown event\ndocument.addEventListener...
javascript
chosen
[ { "from": "system", "value": "Fix a bug that caused side effects between list() and run().\n" }, { "from": "human", "value": "if (!('requireModule' in global)) {\n const join = require('path').join;\n const appRoot = join('..', __dirname);\n global.requireModule = (module) => require(join(app...
javascript
chosen
[ { "from": "system", "value": "Add bot loading by config\n" }, { "from": "human", "value": "'use strict';\n\nvar sequoria = require('sequoria'),\n fs = require('fs');\n\nvar Bot = require('./bot');\n\nvar exports = module.exports = {};\n\nvar createBot = exports.createBot = function createBot(op...
javascript
chosen
[ { "from": "system", "value": "Allow preRequest as option passed in\n" }, { "from": "human", "value": "var Controller = require('./controller');\n\nvar bodyParser = require('body-parser');\nvar methodOverride = require('method-override');\n\nvar errors = require('./errors');\nexports.errors = req...
javascript
chosen
[ { "from": "system", "value": "Stop creating the regex everytime\n" }, { "from": "human", "value": "/*\n * JS-Watson\n *\n * Copyright 2012, Shyam Habarakada\n * Licensed under MIT.\n *\n */\n(function(global) {\n\n var _i = this;\n \n // Try to initialize with the default google analytics asy...
javascript
chosen
[ { "from": "system", "value": "Correct api has wrong precedence\n" }, { "from": "human", "value": "'use strict'\n\nconst combine = require( 'depject' )\nconst common = require( './common' )\n\nconst Api = ( adapter, ...plugins ) => {\n const sockets = combine( [ adapter, common, ...plugins ] )\n...
javascript
chosen
[ { "from": "system", "value": "Make the default box visibility 'listed'\n" }, { "from": "human", "value": "/**\n * Controller for handling the dialog to add a new box\n * @return {function} A controller that contains 2 test elements\n */\nmodule.exports = function ($mdDialog) {\n\n this.name = '...
javascript
chosen
[ { "from": "system", "value": "Handle case where location cannot be found\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict'\n\nvar geopkg = require('./lib/geopkg')\n\nvar open = process.argv[2]\n\nvar error = function (err) {\n if (!err) return\n console.log('ERROR:', err.mes...
javascript
chosen
[ { "from": "system", "value": "Remove Ember 2.12 from Ember Try config\n" }, { "from": "human", "value": "'use strict';\n\nconst getChannelURL = require('ember-source-channel-url');\n\nmodule.exports = function() {\n return Promise.all([\n getChannelURL('release'),\n getChannelURL('beta'),...
javascript
chosen
[ { "from": "system", "value": "Remove API key from source per new Google policy.\n" }, { "from": "human", "value": "boomerang.factory('Config', function () {\n return {\n //modify these\n 'name' : 'GDG Space Coast',\n 'id' : '103959793061819610212',\n ...
javascript
chosen
[ { "from": "system", "value": "Add SCSS file per Webpack entry point\n\n#450\r\n\r\nThe `scss` path can be added to the entry point configuration in the app's .yo-rc.json, e.g.:\r\n\r\n```json\r\n\"entries\": {\r\n \"app\": {\r\n \"scss\": \"../workspace_custom.scss\",\r\n \"js\": \"dist/initialize.js...
javascript
chosen
[ { "from": "system", "value": "Add 3rd argument to addEventListener\n" }, { "from": "human", "value": "'use strict';\n\nfunction FormNapper(formId) {\n this.htmlForm = document.getElementById(formId);\n}\n\nFormNapper.prototype.hijack = function (onsubmit) {\n function handler(event) {\n if ...
javascript
chosen
[ { "from": "system", "value": "Add exports annotation for isPromise\n" }, { "from": "human", "value": "/**\n Utility Functions\n @description a collection of utility functions, aka junk drawer\n @exports {function} isCacheableRequest\n**/\n\n/**\n @name isCacheableRequest\n @desc determines ...
javascript
chosen
[ { "from": "system", "value": "Fix server side. Build to lib\n" }, { "from": "human", "value": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getInterfaceLanguage = getInterfaceLanguage;\nexports.validateTranslationKeys = validateTranslationKeys;\n...
javascript
chosen
[ { "from": "system", "value": "Improve the chord matching regex\n" }, { "from": "human", "value": "// Load the markdown-it regex plugin\nconst mdRegex = require('markdown-it-regexp')\n\n// Set our chord's identifier regex pattern and replacement string\nconst chordPattern = mdRegex(\n // regexp ...
javascript
chosen
[ { "from": "human", "value": "Add basic Wenku library; map, forEach, typeOf\n" }, { "from": "gpt", "value": "(function (d, w) {\n 'use strict';\n\n // Constructor for the Wenku library.\n function Wenku(e) {\n var i;\n for (i = 0; i < e.length; i += 1) {\n this[i] = e[i];\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Comment out buggy declation emitter\n" }, { "from": "human", "value": "module.exports = {\n entry: './src/confirm.ts',\n output: {\n path: './dist',\n filename: 'angular2-bootstrap-confirm.js',\n libraryTarget: 'umd',\n library: 'ng2BootstrapConfirm'\n...
javascript
chosen
[ { "from": "system", "value": "Update valid Socket origins for Native\n" }, { "from": "human", "value": "/**\n * Production environment settings\n *\n * This file can include shared settings for a production environment,\n * such as API keys or remote database passwords. If you're using\n * a ve...
javascript
chosen
[ { "from": "system", "value": "Fix the file extension typo.\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n\n name: 'ember-cli-summernote',\n\n\n included: function(app) {\n this._super.included(app);\n\n // <!-- include libraries(jQuery, ...
javascript
chosen
[ { "from": "system", "value": "Use Object.create to make it safe to mutate options hash\n" }, { "from": "human", "value": "'use strict';\nvar postcssCached = require('postcss-cached');\nvar through = require('through2');\nvar applySourceMap = require('vinyl-sourcemaps-apply');\nvar gulpUtil = req...
javascript
chosen
[ { "from": "system", "value": "Improve initial check for `data-models` dir\n" }, { "from": "human", "value": "'use strict';\nconst path = require('path');\nconst assert = require('assert');\nconst fs = require('fs');\n\nmodule.exports = {\n name: require('./package').name,\n included() {\n c...
javascript
chosen
[ { "from": "system", "value": "Implement the calibration loop entirely in JavaScript.\n" }, { "from": "human", "value": "var lights = require(\"offgrid-lights\");\nvar camera = require(\"offgrid-camera\");\n" }, { "from": "gpt", "value": "var assert = require(\"assert\");\nvar fs = re...
javascript
chosen
[ { "from": "system", "value": "Put a newline at the end of the compiled CSS for great POSIX justice.\n" }, { "from": "human", "value": "var fs = require(\"fs\");\nvar spawn = require(\"child_process\").spawn;\nvar tmp = require(\"tmp\");\nvar path = require(\"path\");\nvar templatesDir = path.joi...
javascript
chosen
[ { "from": "system", "value": "Use the el reference instead of the vm reference\n" }, { "from": "human", "value": "import { util } from 'vue';\n\nexport var directive = {\n\n acceptStatement: true,\n priority: 700,\n\n update: function(handler) {\n if (typeof handler !== 'function') {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix missing config in verify_config call\n" }, { "from": "human", "value": "var api = require('digio-api')\n, cmd = require('./cli')\n, fs = require('fs')\n, _package = require('../package.json')\n, path = require('path')\n, tools = require('./tools')\n\nvar digio =...
javascript
chosen
[ { "from": "system", "value": "Add Fira Code to the font stack and enable ligatures\n" }, { "from": "human", "value": "const Color = require('color');\n\nmodule.exports.onWindow = browserWindow => browserWindow.setVibrancy('ultra-dark');\n\nmodule.exports.decorateConfig = config => {\n config.ba...
javascript
chosen
[ { "from": "system", "value": "Add webpack config for auto import\n" }, { "from": "human", "value": "/* eslint-env node */\n'use strict';\n\nconst react = require('broccoli-react');\n\nmodule.exports = {\n name: 'ember-cli-react',\n\n preprocessTree: function(type, tree) {\n if (type === 'js...
javascript
chosen
[ { "from": "system", "value": "Indent with tabs in generated xml\n" }, { "from": "human", "value": "'use strict';\nconst neatCsv = require('neat-csv');\nconst pify = require('pify');\nconst Promise = require('pinkie-promise');\nconst redent = require('redent');\nconst trimNewlines = require('trim...
javascript
chosen
[ { "from": "system", "value": "Remove assignment to a constant variable\n" }, { "from": "human", "value": "const emojis = require(\"emoji-unicode-map\");\n\nmodule.exports = Object.keys(emojis.emoji);\nemojis = null;\n" }, { "from": "gpt", "value": "const emojis = require(\"emoji-unic...
javascript
chosen
[ { "from": "system", "value": "Make breadcrumbs dynamic, i.e. now they may be functions.\n\nIn doing so it's possible to e.g. update the breadcrumbs when changing the language.\n" }, { "from": "human", "value": "export default {\n\tinstall(Vue) {\n\t\tObject.defineProperties(Vue.prototype, {\n\t\...
javascript
chosen
[ { "from": "system", "value": "Add filter for search input.\n" }, { "from": "human", "value": "import React from 'react'\nimport preload from '../public/data.json'\nimport ShowCard from './ShowCard'\n\nconst Search = React.createClass({\n getInitialState () {\n return {\n searchTerm: ''\...
javascript
chosen
[ { "from": "system", "value": "Make ball fall through bottom wall again\n" }, { "from": "human", "value": "/*\n * This class handles collisions.\n */\n\n'use strict';\nimport Vector from 'Vector.js';\n\nexport default class {\n constructor(actorsInstance) {\n this._actorsInstance = actorsInst...
javascript
chosen
[ { "from": "system", "value": "Fix mailto href in profile.\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport Avatar from 'material-ui/Avatar';\nimport Divider from 'material-ui/Divider';\nimport { grey500 } from 'material-ui/styles/colors';\n\nconst style = { \n...
javascript
chosen
[ { "from": "system", "value": "Make toClasses(...) more flexible regarding input\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 * ...
javascript
chosen
[ { "from": "system", "value": "Use an example component without transparent background.\n" }, { "from": "human", "value": "import React from 'react';\nimport { Button } from '@storybook/components';\n\nexport default {\n title: 'Core/Layout',\n parameters: {\n layout: 'padded',\n },\n};\n\n...
javascript
chosen