conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change eslint formatter to HTML instead of checkstyle\n" }, { "from": "human", "value": "'use strict';\nconst path = require('path');\nconst nodeExternals = require('webpack-node-externals');\n\nmodule.exports = {\n entry: {\n authorizer: './lambda_functions/aut...
javascript
chosen
[ { "from": "system", "value": "Add support for source maps\n\nThis allows you to add break points in the JavaScript console and debug code.\n" }, { "from": "human", "value": "module.exports = {\n entry: './src/app.js',\n output: {\n path: './dist',\n filename: 'build.js'\n }\n}\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Remove defunct NEX aliasing from OEX shim (see: DNA-2416)\n" }, { "from": "human", "value": "!(function( global ) {\n \n // NEX<->CRX support set up\n var nexAPIStubs = ['app', 'extension', 'windows', 'tabs', 'browserAction', 'contextMenus', 'i18n', 'webRequest']...
javascript
chosen
[ { "from": "system", "value": "Add snake_case param for validating generate input" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = input => {\n const regex = /^[A-Za-z-]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Ple...
javascript
chosen
[ { "from": "system", "value": "Modify indicator list query.\nFormat indicator queries.\nCorrected missing { for getIndicatorToUpdate\n" }, { "from": "human", "value": "import gql from \"graphql-tag\";\n\nclass IndicatorRepository {\n static getListPage(pageNumber, pageSize) {\n return gql`{\n...
javascript
chosen
[ { "from": "system", "value": "Add flag indicating method comes from chain execution\n" }, { "from": "human", "value": "'use strict'\n\nexport default class LodashWrapper {\n constructor (_) {\n this.steps = []\n let step = 1\n\n const record = (name, args, result) => {\n if (name ...
javascript
chosen
[ { "from": "system", "value": "Use IP instead of hostname in connection settings\n" }, { "from": "human", "value": "/*\nCopyright (C) 2010, Oleg Efimov <efimovov@gmail.com>\n\nSee license text in LICENSE file\n*/\n\n/*\n> mysql -u root\nCREATE DATABASE test DEFAULT CHARACTER SET utf8 COLLATE utf8...
javascript
chosen
[ { "from": "system", "value": "Check for content in form fields when they load\n" }, { "from": "human", "value": "$(function(){\n $('input').on(\"focus\", function(){\n $(this).siblings('label').addClass(\"is-focused\");\n });\n $('input').on(\"blur\", function(){\n $(this).siblings('la...
javascript
chosen
[ { "from": "system", "value": "Add externals to stop rollup unresolved dependency warnings\n" }, { "from": "human", "value": "import resolve from 'rollup-plugin-node-resolve';\nimport common from 'rollup-plugin-commonjs';\nimport json from 'rollup-plugin-json';\nimport replace from 'rollup-plugin...
javascript
chosen
[ { "from": "system", "value": "Make a partially random tower\n" }, { "from": "human", "value": "var SandwichTime = (function () {\n\n var level;\n\n function Slab(width, height, upperLeft, paint) {\n var width, height, upperLeft, paint;\n this.width = width;\n this.height = height;\n ...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect dotenv path fallback\n" }, { "from": "human", "value": "/* eslint-disable import/no-dynamic-require,global-require */\n\nimport fs from 'fs';\nimport path from 'path';\nimport log from 'fancy-log';\nimport dotenv from 'dotenv';\nimport config from './l...
javascript
chosen
[ { "from": "system", "value": "Fix derived map to use .constructor.of\n" }, { "from": "human", "value": "var utils = require('./utils');\nvar applicative = require('./applicative');\nvar ownPropFrom = utils.ownPropFrom;\nvar isOwnFunction = utils.isOwnFunction;\n\nvar derivables = {\n map: funct...
javascript
chosen
[ { "from": "system", "value": "Change confirm dialog so that it doesn't show cancel button if not callback\n" }, { "from": "human", "value": "define([\n], function() {\n \"use strict\";\n \n return {\n props: {\n title: {\n type: String,\n default: \"Confirm\"\n },\n...
javascript
chosen
[ { "from": "system", "value": "Fix production domain name again\n" }, { "from": "human", "value": "'use strict'\n\nvar env = process.env.NODE_ENV || 'development'\n\nif (env === 'development') require('dotenv').config()\n\nvar conf = module.exports = {\n env: env,\n server: {\n port: process...
javascript
chosen
[ { "from": "system", "value": "Revert changes for adding \"static\" to route\n\nbecause accessing static is using /api/static instead of /static\n" }, { "from": "human", "value": "/**\n * Main application routes\n */\n\n'use strict';\n\nvar express = require('express');\nvar config = require('./c...
javascript
chosen
[ { "from": "system", "value": "Adjust auth line to keep specs passing\n" }, { "from": "human", "value": "// Load environment variables\nif (process.env.NODE_ENV === 'development') {\n require('dotenv').config({ path: './env/development.env' });\n}\n\nvar express = require('express');\nvar passpo...
javascript
chosen
[ { "from": "system", "value": "Remove commented out old database hooks\n" }, { "from": "human", "value": "var\n express = require( 'express' ),\n mongoose = require( 'mongoose' ),\n reqExtend = require( 'request-extend' ),\n config = require( './config' ),\n app = express();\n\n//var\n// db...
javascript
chosen
[ { "from": "system", "value": "Fix get of cover for multilingual books\n" }, { "from": "human", "value": "var path = require('path');\nvar fs = require('../../utils/fs');\n\n/**\n Resolve path to cover file to use\n\n @param {Output}\n @return {String}\n*/\nfunction getCoverPath(output) ...
javascript
chosen
[ { "from": "system", "value": "Add top positioning to chevron and reformat with Prettify\n\n" }, { "from": "human", "value": "//@flow\n\nimport styled from \"styled-components\";\n\nexport const Svg = styled.svg.attrs({\n viewBox: \"0 0 24 24\"\n})`\n ${({ theme, isActive, stateful }: { theme: ...
javascript
chosen
[ { "from": "system", "value": "Test push post repo transfer to git-phaser org\n" }, { "from": "human", "value": "var nc_debug;\n\nangular.module('gitphaser') \n .controller('NearbyCtrl', NearbyCtrl); \n\n// @controller NearbyCtrl\n// @params: $scope, $reactive\n// @route: /tab/nearby\n//\n// Ex...
javascript
chosen
[ { "from": "system", "value": "Change selectors according to @Paszt comments" }, { "from": "human", "value": "'use strict';\n\n/* global Connector */\n\nConnector.playerSelector = '#player-controls';\n\nConnector.artistSelector = '.track.playing .info .artist-name';\n\nConnector.trackSelector = '...
javascript
chosen
[ { "from": "system", "value": "Add `--no-sandbox` to Chrome args in CI.\n" }, { "from": "human", "value": "/* jshint node:true */\n\nvar options = {\n \"framework\": \"qunit\",\n \"test_page\": \"tests/index.html?hidepassed\",\n \"disable_watching\": true,\n \"launch_in_ci\": [\n \"Chrome\...
javascript
chosen
[ { "from": "system", "value": "Remove itemControllers as they are deprecated\n" }, { "from": "human", "value": "import Em from 'ember';\nimport Row from 'llama-table/controllers/row';\nimport { makeArray } from 'llama-table/computed';\nvar computed = Em.computed;\nvar map = computed.map;\nvar sor...
javascript
chosen
[ { "from": "system", "value": "Fix detection on Windows 10 Anniversary\n" }, { "from": "human", "value": "const DRAW_SIZE = 32;\n\nfunction newContext() {\n const canvas = document.createElement('canvas');\n canvas.width = canvas.height = DRAW_SIZE * 2;\n return canvas.getContext('2d');\n}\n\n...
javascript
chosen
[ { "from": "system", "value": "Clean up this looong constant." }, { "from": "human", "value": "const itemsPerPage = 100;\nexport const GITHUB_URL = `https://api.github.com/search/code?per_page=${itemsPerPage}&q=repo%3Atddbin%2Fkatas+language%3AJavaScript+path%3Akatas%2Fes6%2Flanguage`;
\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Save timer instances to internal cache obj\n" }, { "from": "human", "value": "var Events = {\n\n scrollTimer: null,\n stopTimer: null,\n\n scroll: function (ev, me) {\n var cache = me.cache,\n now = getTime();\n \n if(me.disableScrollEv) { return;...
javascript
chosen
[ { "from": "system", "value": "Add mention of TI Website to source code\n" }, { "from": "human", "value": "import * as PIXI from 'pixi.js';\nimport * as store from './store';\nimport * as view from './view';\n\nexport const app = new PIXI.Application({antialias: true, transparent: true});\ndocume...
javascript
chosen
[ { "from": "system", "value": "Reduce variable lifespan of port\n" }, { "from": "human", "value": "import express from 'express';\nimport LEX from 'letsencrypt-express';\n\nimport configureHelmet from './security/configure-helmet';\nimport database from './database';\nimport log from './log';\nim...
javascript
chosen
[ { "from": "system", "value": "Fix bug holding onto deleted item, just use name\n" }, { "from": "human", "value": "function App(viewDiv, twitterScreenName)\n{\n var app = this;\n\n this.view = new View(viewDiv);\n this.view.itemRemoveClicked = function(item) { app.onViewItemRemoveClicked...
javascript
chosen
[ { "from": "system", "value": "Make sure the tumblr url fixer is location implementation agnostic\n" }, { "from": "human", "value": "App.RawTransform = DS.Transform.extend({\n deserialize: function(serialized) {\n return serialized;\n },\n serialize: function(deserialized) {\n return des...
javascript
chosen
[ { "from": "system", "value": "Add v prefix to version.\n" }, { "from": "human", "value": "/**\n * exported PageHeader\n *\n * A page header component.\n *\n **/\n\nvar React = require('react');\nvar PropTypes = require('prop-types'); // ES5 with npm\nvar createReactClass = require('create-react-...
javascript
chosen
[ { "from": "system", "value": "Stop featuring floaty for now\n\nfbshipit-source-id: 8331684\n" }, { "from": "human", "value": "/**\n * Copyright 2015-present 650 Industries. All rights reserved.\n *\n * @providesModule FeaturedExperiences\n */\n'use strict';\n\nfunction setReferrer(newReferrer) {...
javascript
chosen
[ { "from": "system", "value": "Disable import/export of cell output.\n" }, { "from": "human", "value": "export default {\n\n type: 'cell',\n tagName: 'div',\n\n matchElement: function (el) {\n return el.is('div[data-cell]')\n },\n\n import: function (el, node) {\n const language = el.a...
javascript
chosen
[ { "from": "system", "value": "Fix active and focus styles\n" }, { "from": "human", "value": "import styled from 'styled-components';\nimport { Link } from 'react-router';\nimport { primaryDarker } from 'utils/colors';\n\nconst Logo = styled(Link)`\n color: ${primaryDarker};\n margin: 0;\n fon...
javascript
chosen
[ { "from": "system", "value": "Update ngconstant version after releasing\n" }, { "from": "human", "value": "\"use strict\";\n// DO NOT EDIT THIS FILE, EDIT THE GRUNT TASK NGCONSTANT SETTINGS INSTEAD WHICH GENERATES THIS FILE\nangular.module('publisherApp')\n\n.constant('ENV', 'dev')\n\n.constant(...
javascript
chosen
[ { "from": "system", "value": "Fix disabling menu without text tracks\n" }, { "from": "human", "value": "import buttonMixin from '../../mixins/videojsButtonMixin';\nimport CaptionsMenu from './captionsMenu';\nimport SubtitlesMenuItem from './subtitlesMenuItem';\nimport TranscriptMenuItem from './...
javascript
chosen
[ { "from": "system", "value": "Use the correct module path.\n\nThe name is `ember-cli-chosen` as specified in:\n\nhttps://github.com/green-arrow/ember-cli-chosen/blob/master/index.js#L8\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport EmberChosen from 'ember-chosen/components...
javascript
chosen
[ { "from": "system", "value": "Use Google Charts as like before\n\nWe don't have to do this upgrade right now.\n" }, { "from": "human", "value": "/*global google*/\nimport Component from '@ember/component';\n\nfunction createEvent(name) {\n let event = document.createEvent('Event');\n event...
javascript
chosen
[ { "from": "system", "value": "Change text on OK cookie button\n" }, { "from": "human", "value": "// Source: http://youmightnotneedjquery.com/#ready\nfunction ready(fn) {\n 'use strict';\n if (document.addEventListener) {\n document.addEventListener('DOMContentLoaded', fn);\n } else {\n ...
javascript
chosen
[ { "from": "system", "value": "Improve debugging, fix an error on /usage\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport Helmet from 'react-helmet';\nimport { IndexLink } from 'react-router';\nimport { usage, todo } from...
javascript
chosen
[ { "from": "system", "value": "Use HQ grid for retina map layer\n" }, { "from": "human", "value": "import {normalizeActionName} from '../common/helpers.js';\n\nexport const MAP_URL = 'https://geoserver.hel.fi/mapproxy/wmts/osm-lite/etrs_tm35fin/{z}/{x}/{y}.png';\nexport const MAP_RETINA_URL = 'ht...
javascript
chosen
[ { "from": "system", "value": "Add default meta for empty tiles\n" }, { "from": "human", "value": "(() => {\n const tools = [];\n\n DTile.Tool = class DTileTool {\n static register() {\n tools.push(new this());\n }\n\n static get allTools() { return tools; }\...
javascript
chosen
[ { "from": "system", "value": "Change to panel based look\n" }, { "from": "human", "value": "/*\n *\n * About\n *\n */\n\nimport React, { PropTypes } from 'react';\nimport { connect } from 'react-redux';\nimport { FormattedMessage } from 'react-intl';\nimport { createStructuredSelector } from 're...
javascript
chosen
[ { "from": "system", "value": "feat: Add service that returns monthly limit \n\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Service.extend({\n store: Ember.inject.service(),\n currencies: ['AUD', 'CAD', 'CHF', 'EUR', 'GBP', 'JPY', 'NZD', 'RUB', 'USD'],\n...
javascript
chosen
[ { "from": "system", "value": "Terminate exec on shell errors\n" }, { "from": "human", "value": "// CLI setup\n\nimport program from 'commander';\nimport jsonfile from 'jsonfile';\nimport shell from 'shelljs';\nimport updateNotifier from 'update-notifier';\nimport winston from 'winston';\nimport ...
javascript
chosen
[ { "from": "system", "value": "Set options for babel register\n" }, { "from": "human", "value": "const fs = require('fs-extra')\nconst path = require('path')\nconst escape = require('escape-string-regexp')\nconst utils = require('./utils')\n\nconst escapedPath = escape(process.cwd())\n\nrequire('...
javascript
chosen
[ { "from": "system", "value": "Add fn to read package.json\n" }, { "from": "human", "value": "'use strict';\n\nvar JspmNuget = function (options, ui) {\n \n};\n\n// static configuration function\nJspmNuget.configure = function(config, ui) {\n \n};\n\n// regular expression to verify package name...
javascript
chosen
[ { "from": "system", "value": "Add random string generator tests\n" }, { "from": "human", "value": "var rfr = require('rfr');\nvar Lab = require('lab');\nvar lab = exports.lab = Lab.script();\nvar Code = require('code');\n\nvar Utility = rfr('app/util/Utility');\n\nlab.experiment('Utility#getModu...
javascript
chosen
[ { "from": "system", "value": "Fix exception caused by bound function\n" }, { "from": "human", "value": "'use babel';\n\n/* eslint-disable no-multi-str, prefer-const*/\nlet linkPaths;\nconst regex = new RegExp('\\\n((?:\\\\w:)?/?\\\n(?:[-\\\\w.]+/)*[-\\\\w.]+)\\\n:(\\\\d+)\\\n(?::(\\\\d+))?\\\n',...
javascript
chosen
[ { "from": "system", "value": "Improve default params handling on Middleware.response.\n\n" }, { "from": "human", "value": "\nclass Middleware {\n constructor() {\n this._req = [];\n this._res = [];\n }\n\n request(fn) {\n this._req.push(fn);\n return this._req.length - 1;\n }\n\n...
javascript
chosen
[ { "from": "system", "value": "BUG: Fix redirect link to work on IE\n\nIE doesn't correctly understand the url. Affixing the base reference stops it from getting confused." }, { "from": "human", "value": "(function($){\n\t\"use strict\";\n\n\t$.entwine('ss', function($) {\n\n\t\t$('a.newsletter-p...
javascript
chosen
[ { "from": "system", "value": "Initialize search view on form submission\n\n* search view is a parent view to all other search components\n* handle everything else once page transition is complete\n" }, { "from": "human", "value": "import * as Backbone from 'backbone';\nimport DocumentSet from '....
javascript
chosen
[ { "from": "system", "value": "Add step function and central game loop.\n" }, { "from": "human", "value": "var canvas = document.getElementById('screen').getContext('2d');\n\nvar entities = [];\n\nfor (var i = 0; i < 10; i++) {\n entities.push(new organism())\n}\n\nfor (e in entities) {\n e...
javascript
chosen
[ { "from": "system", "value": "Add site footer to each documentation generator\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar cssstats = require('cssstats')\n\nvar module = require('tac...
javascript
chosen
[ { "from": "system", "value": "Add a separator in the Game menu\n" }, { "from": "human", "value": "var gui = require ('nw.gui');\n\nfunction Application() {\n var menubar = new gui.Menu({ type: 'menubar' });\n\n // See https://github.com/rogerwang/node-webkit/issues/743 to get an idea of\n // ...
javascript
chosen
[ { "from": "system", "value": "Add support to navigate from go back and go foward history on browser\n" }, { "from": "human", "value": "var hash = window.location.hash;\n\nswitch (hash) {\n case '#contact': openModalContactWindow(); break;\n case '#about': openModalAboutWindow(); break;\n case...
javascript
chosen
[ { "from": "system", "value": "Add static function of Obeservable creation\n" }, { "from": "human", "value": "import { Subscription } from './Subscription';\nimport { noop } from './utilities';\n\nexport class Observable {\n constructor (observerCallback) {\n this.observerCallback = observerC...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary variable in importantRule\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\n\nmodule.exports = function (options) {\n var filename = path.basename(options.path);\n var config = options.config;\n var node = o...
javascript
chosen
[ { "from": "system", "value": "Make sure the script is executed everywhere on github\n" }, { "from": "human", "value": "// ==UserScript==\n// @name github add youtube\n// @namespace damien@pobel.fr\n// @include https://github.com/\n// @version 1\n// @grant none\n// ==/UserS...
javascript
chosen
[ { "from": "system", "value": "Add route to own profile\n" }, { "from": "human", "value": "var winston = require('winston');\nvar path = require('path');\n\nglobal.APP_NAME = \"proxtop\";\nglobal.PROXER_BASE_URL = \"https://proxer.me\";\nglobal.INDEX_LOCATION = __dirname + \"../../index.html\";\n...
javascript
chosen
[ { "from": "system", "value": "Update tests to log the error when it fails\n" }, { "from": "human", "value": "const Box = require(\"@truffle/box\");\nconst MemoryLogger = require(\"../memorylogger\");\nconst CommandRunner = require(\"../commandrunner\");\nconst assert = require(\"assert\");\ncons...
javascript
chosen
[ { "from": "system", "value": "Add source map to webpack for better debugging\n" }, { "from": "human", "value": "var HtmlWebpackPlugin = require('html-webpack-plugin');\nvar HtmlWebpackPluginConfig = new HtmlWebpackPlugin({\n template: __dirname + '/app/index.html',\n filename: 'index.html',\n ...
javascript
chosen
[ { "from": "system", "value": "Change to the funtion-exporting model\n\nThis is the preparation to use the browserify in the future.\n" }, { "from": "human", "value": "function jquery_plugin_class(class_name) {\n jQuery.fn[class_name] = function(method_name) {\n var args = Array.prototy...
javascript
chosen
[ { "from": "system", "value": "Fix extracting a video extra data\n" }, { "from": "human", "value": "'use strict';\n\nconst Atom = require('../atom');\nconst Utils = require('../utils');\n\nclass AtomAVC1 extends Atom {\n\n constructor() {\n super();\n\n this.width = null;\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the onboarding communities picker." }, { "from": "human", "value": "import React from 'react'\nimport classNames from 'classnames'\nimport { loadCommunities } from '../../actions/onboarding'\nimport StreamComponent from '../streams/StreamComponent'\nimport Picke...
javascript
chosen
[ { "from": "system", "value": "Fix export of force resize method\n" }, { "from": "human", "value": "import { state } from './../store/index.js';\nimport external from './../externalModules.js';\n\nconst enable = function () {\n disable(); // Clean up any lingering listeners\n window.addEventLis...
javascript
chosen
[ { "from": "system", "value": "Fix For Testing from Dev Console\n" }, { "from": "human", "value": "'use strict';\n\nvar Alexa = require('alexa-sdk');\nvar constants = require('./constants');\nvar audioEventHandlers = require('./handlers/audioEventHandlers');\nvar startModeHandlers = require('./ha...
javascript
chosen
[ { "from": "system", "value": "Make tests runnable in WebStorm.\n" }, { "from": "human", "value": "(function() {\n /*global __karma__,require*/\n \"use strict\";\n\n var included = __karma__.config.args[0];\n var excluded = __karma__.config.args[1];\n var webglValidation = __karma_...
javascript
chosen
[ { "from": "system", "value": "Add necessary bootstrap asset to fix alerts\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets...
javascript
chosen
[ { "from": "system", "value": "Add autotap on document ready\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, ...
javascript
chosen
[ { "from": "system", "value": "Use user home dir via os module\n" }, { "from": "human", "value": "module.exports = {\n path: process.env.POD_CONF || (process.env.HOME + '/.podrc'),\n webId: 'pod-web-service'\n}" }, { "from": "gpt", "value": "const os = require('os');\nmodule.exp...
javascript
chosen
[ { "from": "system", "value": "Convert tabs to spaces in package.js template\n" }, { "from": "human", "value": "Package.describe({\n\tname: '{{#meteorUser}}{{.}}:{{/meteorUser}}{{destPkgPrefix}}{{pkg.name}}',\n summary: 'Bootstrap: {{pkg.name}}',\n version: '{{bootstrap.version}}'\n});\n\nPacka...
javascript
chosen
[ { "from": "system", "value": "Simplify logic now that 2.6 is deprecated.\n" }, { "from": "human", "value": "var conf = rs.conf();\nvar ret = 0;\n\nfor (var i = 0; i < conf[\"members\"].length; i++) {\n member = conf[\"members\"][i];\n // In Mongo 2.6, priority and votes aren't returned when\n ...
javascript
chosen
[ { "from": "system", "value": "Revert \"updated: remove esm from the cli bundle\"\n\nThis reverts commit e75f8fa6ac98969c8d65ede6c7d9a614d7f54b5d.\n" }, { "from": "human", "value": "// allow modules import syntax\nimport run, * as cli from './src/index'\n\n// Run from CLI or as Node module\nif (m...
javascript
chosen
[ { "from": "system", "value": "Make cookies readable from frontend\n" }, { "from": "human", "value": "import Cookies from 'cookies'\n\nexport function checkSession (req, res, next) {\n const cookies = new Cookies(req, res)\n const userId = cookies.get('user_id')\n\n if (!userId) {\n return ...
javascript
chosen
[ { "from": "system", "value": "Include the Mixpanel snippet using content-for\n" }, { "from": "human", "value": "module.exports = {\n name: 'ember-mixpanel'\n};\n" }, { "from": "gpt", "value": "module.exports = {\n name: 'ember-mixpanel',\n\n contentFor: function(type, config) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use const instead of var\n" }, { "from": "human", "value": "var { app, BrowserWindow } = require(\"electron\");\nvar mainWindow = null;\n\napp.on(\"window-all-closed\", function() {\n app.quit();\n});\n\nrequire(\"electron-reload\")(__dirname);\n\napp.on(\"ready\",...
javascript
chosen
[ { "from": "system", "value": "Attach file path to page props\n" }, { "from": "human", "value": "const React = require('react')\nconst { renderToString, renderToStaticMarkup } = require('react-dom/server')\nconst App = require('./components/app')\nconst Page = require('./components/page')\n\nmodu...
javascript
chosen
[ { "from": "system", "value": "Use tabs instead of spaces.\n" }, { "from": "human", "value": "var robotjs = require('./build/Release/robotjs.node');\n\nmodule.exports = robotjs;\n\nmodule.exports.screen = {};\n\nfunction bitmap (width, height, byteWidth, bitsPerPixel, bytesPerPixel, image) \n{\n ...
javascript
chosen
[ { "from": "system", "value": "Update to pull out `body`\n" }, { "from": "human", "value": "import gravity from '../lib/apis/gravity'; // Uncached\nimport {\n GraphQLObjectType,\n GraphQLString,\n} from 'graphql';\n\nconst PingType = new GraphQLObjectType({\n name: 'Ping',\n description: 'Sys...
javascript
chosen
[ { "from": "system", "value": "Use appropriate alias for excluded keys\n" }, { "from": "human", "value": "export const normalize = ({ data, recursionKey = 'children' }) => {\n let normalizedData = {}\n let counter = -1\n\n const transform = ({ node, parentId }) => {\n counter += 1\n cons...
javascript
chosen
[ { "from": "system", "value": "Set default API endpoint in config" }, { "from": "human", "value": "/*\nName: planetos - index.js\nSource & docs: https://github.com/fvdm/nodejs-planetos\nFeedback: https://github.com/fvdm/nodejs-planetos/issues\nLicense: Unlicense (public do...
javascript
chosen
[ { "from": "system", "value": "Allow for root-level domains like localhost\n" }, { "from": "human", "value": "/**\n * Expose `sni`.\n * @type Function\n */\nmodule.exports = sni;\n\n/**\n * RegEx for finding a domain name.\n * @type {RegExp}\n */\nvar regex = /^(?:[a-z0-9-]+\\.)+[a-z]+$/i;\n\n/**...
javascript
chosen
[ { "from": "system", "value": "Move static to the front\n" }, { "from": "human", "value": "require('./env');\nvar mount = require('koa-mount');\nvar koa = require('koa');\nvar app = koa();\napp.use(require('koa-logger')());\n\napp.use(require('koa-bodyparser')());\napp.use(function *(next) {\n i...
javascript
chosen
[ { "from": "system", "value": "Change API for Hyper with Electron v1.6.3\n" }, { "from": "human", "value": "const { TouchBar } = require('electron');\nconst { TouchBarButton } = TouchBar;\n\nif (TouchBar) {\n\tconst buttons = [new TouchBarButton({\n\t\tlabel: `Click me`.toUpperCase(),\n\t\tclick:...
javascript
chosen
[ { "from": "system", "value": "Fix jpeg and svg mime types" }, { "from": "human", "value": "'use strict';\r\n\r\nfunction getFileExtension(path) {\r\n return path.split('.').pop();\r\n}\r\n\r\nmodule.exports = function base64ImageLoader(content) {\r\n this.cacheable && this.cacheable();\r\n re...
javascript
chosen
[ { "from": "system", "value": "Optimize with micromatch.matcher when possible\n" }, { "from": "human", "value": "'use strict';\n\nvar micromatch = require('micromatch');\n\nvar anymatch = function(criteria, value, returnIndex, startIndex, endIndex) {\n if (!Array.isArray(criteria)) { criteria = ...
javascript
chosen
[ { "from": "system", "value": "Clone underscore implementation for now.\n" }, { "from": "human", "value": "/**\n * Returns a function, that, when invoked, will only be triggered at most once during a given window of time.\n *\n * @param {Number} wait milliseconds to wait before allowing another i...
javascript
chosen
[ { "from": "system", "value": "Proposal: Allow underscores in enum values\n\nLodash's `upperCase` method will convert all underscores to spaces. So, an enum value of \"NOT_CERTIFIED\" will get changed to \"NOT CERTIFIED\" which will not match and cause the lint check to fail. Alternatively, if we use the `to...
javascript
chosen
[ { "from": "system", "value": "Add build check to ensure all faces are included in lib\n" }, { "from": "human", "value": "'use strict';\n\n/* Dependencies. */\nvar fs = require('fs');\nvar path = require('path');\nvar gemoji = require('gemoji').name;\nvar toJSON = require('plain-text-data-to-json...
javascript
chosen
[ { "from": "system", "value": "Remove extra Underscore flow declaration" }, { "from": "human", "value": "type Key = string | number;\ntype Value = any;\n\ndeclare module icepick {\n declare function getIn<O:Object, K:Key, V:Value>(object: ?O, path: Array<K>): ?V;\n declare function setIn<O:...
javascript
chosen
[ { "from": "system", "value": "Replace direct use of props.builders with indirect variable for type security\n" }, { "from": "human", "value": "import * as React from \"react\";\n\n/**\n * Component used as an indicator for build status.\n * Statuses are differentiated by alternative\n * styling ...
javascript
chosen
[ { "from": "system", "value": "Update gdbase client main script\n" }, { "from": "human", "value": "//GDBase client tool\n//Usage: node gdbase-client.js command --specie <SPECIE> --assembly <ASSEMBLY> --dataset <DATASET>\n\n//Import dependencies\nvar getArgs = require('get-args');\n\n//Source data...
javascript
chosen
[ { "from": "system", "value": "[core] Use flow over flow weak\n" }, { "from": "human", "value": "// @flow weak\nconst es2015 = require('babel-preset-es2015').buildPreset;\n\nconst ENV = process.env.BABEL_ENV;\n\nmodule.exports = {\n presets: [\n [\n es2015,\n {\n modules: ENV...
javascript
chosen
[ { "from": "system", "value": "Fix a lint error in start-a-project\n" }, { "from": "human", "value": "var shop = require('../../')\nvar reg = require('../../lib/registry.js')\nvar fs = require('fs')\nvar path = require('path')\n\nexports.init = function (workshopper) {\n this.__ = workshopper.i1...
javascript
chosen
[ { "from": "system", "value": "Remove decimal from form currency\n" }, { "from": "human", "value": "/**\n * \n */\n\nUI.Currency = new Class({\n\n\tExtends: UI.Field,\n\n\toptions: {\n\t\tname: 'currency',\n\t\tbase: 'control'\n\t},\n\n\t/**\n\t * [_initElement description]\n\t * @return {[type]}...
javascript
chosen
[ { "from": "system", "value": "Create routes file to contain all routes\n" }, { "from": "human", "value": "var express = require(\"express\");\nvar app = express();\napp.use(express.static(__dirname + '/views'));\n//Store all HTML files in view folder.\napp.use(express.static(__dirname + '/sc...
javascript
chosen
[ { "from": "system", "value": "chore(webpack): Remove comments from minified version.\n" }, { "from": "human", "value": "var Clean = require('clean-webpack-plugin'),\n webpack = require('webpack'),\n webpackConfig = require('webpack-config');\n\nvar config = webpac...
javascript
chosen
[ { "from": "system", "value": "Enable source maps in production\n" }, { "from": "human", "value": "const config = require('./webpack.config.js');\nconst webpack = require('webpack');\nconst ExtractTextPlugin = require('extract-text-webpack-plugin');\n\nconfig.devtool = 'cheap-module-source-map';\...
javascript
chosen
[ { "from": "system", "value": "Change default port to 5000 for Heroku compatibility\n" }, { "from": "human", "value": "var express = require('express'),\n routes = require('./routes'),\n path = require('path'),\n weather = require('./routes/weather'),\n npr = require('./routes/npr');\...
javascript
chosen