conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Make SVG dimensions normalized and remove width and height attrs.\n" }, { "from": "human", "value": "// @flow\nimport { NARROW_SPACE, WIDE_SPACE, NARROW_BAR, WIDE_BAR } from \"../Core/Characters\"\n\nexport function rect(x: number, height: number, width: number, fil...
javascript
chosen
[ { "from": "system", "value": "Initialize tooltips when showing message\n" }, { "from": "human", "value": "import $ from 'jquery';\nimport { onMessage, addMessage } from '../messageQueue.js';\nimport { getCurrentScene } from '../currentScene.js';\n\nexport default class {\n constructor() {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix issue with cache-control screwing up reviewed stats.\n" }, { "from": "human", "value": "import { UPDATE_SEARCH_PARAMS } from \"../actions\";\n\nconst searchParamsReducer = ( state = {\n reviewed: false,\n quality_grade: \"needs_id\",\n verifiable: true\n}, ac...
javascript
chosen
[ { "from": "system", "value": "Clear the optimized route after changing scenario\n" }, { "from": "human", "value": "var BaseView = require('views/map-view');\n\nmodule.exports = BaseView.extend({\n gRouteOptions: {\n polylineOptions: {\n strokeColor: '#e6a640'\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Add more sites to blacklist\n" }, { "from": "human", "value": "// Add your blacklisted sites to this array. Subdomain and TLD are optional and flexible.\nvar BLACKLIST = [\n\t'agolo.com',\n\t'youtube',\n\t'twitter.com',\n\t'mail.google'\n];\n\n\n/** Convert the arra...
javascript
chosen
[ { "from": "system", "value": "Set base URL for production in demo\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'dummy',\n environment: environment,\n baseURL: '/',\n locationType: 'auto',\n Em...
javascript
chosen
[ { "from": "system", "value": "Refactor using the array spread operator.\n" }, { "from": "human", "value": "import Terrain from 'react-icons/lib/md/terrain'\nimport SnowFlake from 'react-icons/lib/ti/weather-snow'\nimport Calendar from 'react-icons/lib/fa/calendar'\nimport { SkiDayRow } from './S...
javascript
chosen
[ { "from": "system", "value": "Add keys to query list\n" }, { "from": "human", "value": "var React = require('react');\nvar actions = require('../actions');\nvar { Navigation } = require('react-router');\nvar QueryStore = require('../stores/query_store.js');\n\nvar QueryList = React.createClass({...
javascript
chosen
[ { "from": "system", "value": "Fix get showDevMenu on worker\n" }, { "from": "human", "value": "/* eslint-disable no-underscore-dangle */\n\nimport { avoidWarnForRequire } from './utils';\nimport { toggleNetworkInspect } from './networkInspect';\n\nlet availableDevMenuMethods = {};\n\nexport cons...
javascript
chosen
[ { "from": "system", "value": "Replace bad chars with a space when cleaning up queries\n\nThis makes searches which contain these characters still work. We\ncould probably just remove this cleanQuery entirely, but that requires\nmore investigation\n" }, { "from": "human", "value": "import Ember ...
javascript
chosen
[ { "from": "system", "value": "Fix test for project euler 47\n" }, { "from": "human", "value": "'use strict';\nconst problem47 = require('./problem-0047');\n\ndescribe('consecutiveDistinctPrimeFactors', () => {\n xit('finds first consecutive numbers with distinct prime factors for known input', ...
javascript
chosen
[ { "from": "system", "value": "Allow null in comments.user_id in DB migration\n\n" }, { "from": "human", "value": "export function up(knex) {\n return knex.schema.table('comments', (table) => {\n table.integer('hide_type').defaultTo(0).notNullable();\n table.index('hide_type', 'comments_hi...
javascript
chosen
[ { "from": "system", "value": "Fix paper stylesheet name in docs\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport { createStyleSheet } from 'stylishly';\nimport Paper from 'material-ui/Paper';\n\nconst styleSheet = createStyleSheet('FlatButtons', (theme) => {\n...
javascript
chosen
[ { "from": "system", "value": "Remove add follower button in user list\n" }, { "from": "human", "value": "import React from 'react';\nimport { Link } from 'react-router';\n\nimport Icon from '../widgets/Icon';\nimport Avatar from '../widgets/Avatar';\n\nimport './UserList.scss';\n\nexport default...
javascript
chosen
[ { "from": "system", "value": "Make property uploading and default = false\n\nMake property uploading and default = false to enable uploading indicator." }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.ArrayController.extend({\n persistedCats: function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Reset image, even after error\n" }, { "from": "human", "value": "$('#tiny_inner_image').bind('change', function (event) {\n formElement = document.getElementById(\"tinymce_file_uploader\");\n data = new FormData(formElement);\n ed = tinymce.get('news_type_t...
javascript
chosen
[ { "from": "system", "value": "Refresh button state (disabled) is updated based on active tasks." }, { "from": "human", "value": "require (['dojo/domReady!'], function () {\r\n\t\r\n});" }, { "from": "gpt", "value": "require ([\r\n 'dojo/query',\r\n 'dojo/dom-class',\r\n 'doj...
javascript
chosen
[ { "from": "system", "value": "Fix Bandzone playing state recognition\n\nResolves #819.\n" }, { "from": "human", "value": "'use strict';\n\n/* global Connector */\n\nif (location.href === 'http://bandzone.cz/' || location.href === 'https://bandzone.cz/') {\n\tConnector.playerSelector = '#stats';\...
javascript
chosen
[ { "from": "system", "value": "Fix cordova example error caused by badge plugin update\n\nAs of version 0.6.2 of the plugin the promptForPermission function has\nbeen deprecated. The replacement is registerPermission, which requires a\ncallback. The old method delegates to the new one, and without the\ncallb...
javascript
chosen
[ { "from": "system", "value": "Add top level error handler.\n" }, { "from": "human", "value": "var http = require('http');\nhttp.createServer(require('./lrdata').urls).listen(8080);\nconsole.log(\"Server running\");\n" }, { "from": "gpt", "value": "var http = require('http');\nhttp.cr...
javascript
chosen
[ { "from": "system", "value": "Use /graphql instead of graphql" }, { "from": "human", "value": "import express from 'express';\nimport { apolloServer } from 'graphql-tools';\nimport Schema from './data/schema';\nimport Mocks from './data/mocks';\n\nconst GRAPHQL_PORT = 8080;\n\nconst graphQLServe...
javascript
chosen
[ { "from": "system", "value": "Add interval for checking flow meter\n" }, { "from": "human", "value": "var twilio = require('twilio'),\n express = require('express'),\n orderPizza = require('orderpizza'),\n sendText = require('sendText');\n\nvar app = express();\n\nvar textResponse = fun...
javascript
chosen
[ { "from": "system", "value": "Change background color to transparent\n" }, { "from": "human", "value": "var React = require('react-native');\nvar deviceScreen = require('Dimensions').get('window');\n\nvar {\n StyleSheet,\n} = React;\n\nmodule.exports = StyleSheet.create({\n container: {\n f...
javascript
chosen
[ { "from": "system", "value": "Fix regression (do not render inline-formulas as <a> tag)\n" }, { "from": "human", "value": "\"use strict\";\n\nvar ResourceReferenceView = require('../resource_reference').View;\n\nvar InlineFormulaView = function(node, viewFactory) {\n ResourceReferenceView.call(...
javascript
chosen
[ { "from": "system", "value": "Fix typo in error handling, preventing an error to be thrown while catching a top level error\n" }, { "from": "human", "value": "import { initOptions, keycloak } from \"keycloak\"\n;(async() => {\n keycloak.onTokenExpired = () =>\n keycloak\n .updateToken()...
javascript
chosen
[ { "from": "system", "value": "Change to use Chrome for CI testing\n" }, { "from": "human", "value": "/*jshint node:true*/\nmodule.exports = {\n \"framework\": \"qunit\",\n \"test_page\": \"tests/index.html?hidepassed\",\n \"disable_watching\": true,\n \"launch_in_ci\": [\n \"PhantomJS\"\n...
javascript
chosen
[ { "from": "system", "value": "Order the records by creation date\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar mongoose = require('mongoose'),\n City = mongoose.model('City');\n\n\n/**\n * Find city by id\n */\nexports.city = function(req, res, nex...
javascript
chosen
[ { "from": "system", "value": "feat: Add base install argument to commander new command\n" }, { "from": "human", "value": "\"use strict\";\n\nvar program = require('commander');\nvar path = require('path');\nvar os = require('os');\n\nvar newCommand = require('./commands/new');\nvar pkg ...
javascript
chosen
[ { "from": "system", "value": "Update up to changes in eregistrations\n" }, { "from": "human", "value": "'use strict';\n\nvar db = require('../../../db')\n , assign = require('es5-ext/object/assign')\n , getCostsPrintController = require('eregistrations/ser...
javascript
chosen
[ { "from": "system", "value": "Use angular $window instead of window global\n" }, { "from": "human", "value": "angular.module( 'app' )\n.controller( 'ApplicationCtrl', function( $scope, UserSvc, jwtHelper ) {\n $scope.$on( 'login', function( _, user ) {\n $scope.currentUser = user\n ...
javascript
chosen
[ { "from": "system", "value": "Update rxjs in GTN to latest version\n" }, { "from": "human", "value": "System.config({\n map : {\n 'app': 'app',\n 'rxjs': 'https://unpkg.com/rxjs@5.0.0-beta.6',\n '@angular/common': 'https://unpkg.com/@angular/common@2.0.0',\n '@angu...
javascript
chosen
[ { "from": "system", "value": "Issue-5: Fix issue where customfield prefix could contain variable letters\n\nCloses #5\nbug\nSemVer:Patch\n" }, { "from": "human", "value": "\"use strict\";\n\n// Third Party\nconst curry = require(\"lodash/fp/curry\");\nconst find = require(\"lodash/fp/find\");\nc...
javascript
chosen
[ { "from": "system", "value": "Add requiresUserLogin to registerWizard route\n" }, { "from": "human", "value": "Router.route('/', {\n name: 'home'\n});\n\nRouter.route('/dashboard', {\n\n});\n\nRouter.route('/register');\n\nRouter.route('/wizard/:step?', {\n name: 'registerWizard'\n});\n\nRou...
javascript
chosen
[ { "from": "system", "value": "Make utils to be watched\n" }, { "from": "human", "value": "/*global module:false*/\nmodule.exports = function(grunt) {\n grunt.initConfig({\n watch: {\n reload: {\n files: ['src/*', 'src/js/*.js', 'src/css/*.css', 'grunt.js'],\n ...
javascript
chosen
[ { "from": "system", "value": "Fix apps icon missing issue\n\nhttps://github.com/rancher/rancher/issues/22152\n" }, { "from": "human", "value": "import { inject as service } from '@ember/service';\nimport Component from '@ember/component';\nimport layout from './template';\nimport LazyIcon from '...
javascript
chosen
[ { "from": "system", "value": "Insert new files, AngularJS para Zumbis, Aula 14\n" }, { "from": "human", "value": "angular.module('app').directive('ngCepValidator', function() {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function($scope, $element, $attrs, ngModel) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add herald namespace to OSGi shell in the configuration file.\n\nActivated commands are:\n* `herald:fire`\n* `herald:local`\n* `herald:peers`\n" }, { "from": "human", "value": "/**\n * Configuration for Herald\n */\n{\n\t/*\n\t * Herald core bundles\n\t */\n\t\"bund...
javascript
chosen
[ { "from": "system", "value": "Remove debug output from socket.io server\n" }, { "from": "human", "value": "var http = require('http');\nvar server = http.createServer().listen(8005);\nvar io = require('socket.io')(server);\nvar cookie = require('cookie');\nvar querystring = require('querystring'...
javascript
chosen
[ { "from": "system", "value": "Use `open` of props. and close hander call onHidePromoteModal action.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport Dialog from 'material-ui/lib/dialog';\nimport FlatButton from 'material-ui/lib/flat-button';\nimport RaisedButt...
javascript
chosen
[ { "from": "system", "value": "Change license from GPL3 to MPL2\n" }, { "from": "human", "value": "/**\r\n *\r\n * @source: error.js\r\n *\r\n * @licstart The following is the entire license notice for the\r\n * JavaScript code in this page.\r\n *\r\n * Copyright (C) 2014 Richard Louie Orilla\...
javascript
chosen
[ { "from": "system", "value": "Set GCM key for Heroku\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 version control so...
javascript
chosen
[ { "from": "system", "value": "Disable stdout max listener limit\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nprocess.logging = function() {\n return console.log;\n};\n\nprocess.logStream = process.stdout;\n\nvar dictator = require('..');\nvar fs = require('fs');\n\...
javascript
chosen
[ { "from": "system", "value": "Update Japanese Message on My_First_Io" }, { "from": "human", "value": "var fs = require('fs')\n\nvar contents = fs.readFileSync(process.argv[2])\nvar lines = contents.toString().split('\\n').length - 1\nconsole.log(lines)\n\n// メモ:'utf8'を'readFileSync'に二つ目の関数として渡すと...
javascript
chosen
[ { "from": "system", "value": "Add cumulative flow values for graph\n" }, { "from": "human", "value": "'use strict';\n\nvar utils = require('../utils');\n\n\nfunction createColumnsObj(lists) {\n var columns = {};\n\n for(var list in lists) {\n lists[list].forEach(function(column) {\n co...
javascript
chosen
[ { "from": "system", "value": "Use search class to get data and create an item collection\n" }, { "from": "human", "value": "import * as Backbone from 'backbone';\nimport SearchBoxView from '../views/searchBox-view';\nimport SearchResultsView from '../views/searchResults-view';\nimport dispatcher...
javascript
chosen
[ { "from": "system", "value": "Fix event behaviour when typing\n" }, { "from": "human", "value": "import {\n Component,\n h\n} from 'skatejs';\nimport styles from './styles';\n\nconst deleteCode = 8;\n\ncustomElements.define('sk-tags', class extends Component {\n static get props() {\n retu...
javascript
chosen
[ { "from": "system", "value": "Add a test to configure GA event tracking" }, { "from": "human", "value": "// Function to load and initiate the Analytics tracker\nfunction gaTracker(id){\n $.getScript('//www.google-analytics.com/analytics.js'); // jQuery shortcut\n window.ga=window.ga||function(...
javascript
chosen
[ { "from": "system", "value": "Set textAlign of delete button as right\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport QuizInput from './QuizInput'\nimport styled from 'styled-components'\nimport IconButton from 'material-ui/...
javascript
chosen
[ { "from": "system", "value": "Handle spans in large contenteditable divs.\n" }, { "from": "human", "value": "(function() {\n\t\"use strict\";\n\t\n\tvar ContentEditableUtils = function() {\n\t};\n\n\tContentEditableUtils.prototype.getTextFromContentEditable = function(contentEditable) {\n\t\tvar...
javascript
chosen
[ { "from": "system", "value": "Reset filter query params on \"Members\" click in sidebar\n\ncloses https://github.com/TryGhost/Team/issues/967\n\nMember filters is reset when clicked on \"Members\" in the left sidebar.\n" }, { "from": "human", "value": "import {helper} from '@ember/component/help...
javascript
chosen
[ { "from": "system", "value": "Improve wallet check in state transitions\n" }, { "from": "human", "value": "function AppRun(AppConstants, $rootScope, $timeout, Wallet, Alert, $transitions) {\n 'ngInject';\n\n // Change page title based on state\n $transitions.onSuccess({ to: true }, (tr...
javascript
chosen
[ { "from": "system", "value": "AQCU-1196: Fix for arrows collapse panel arrows not updating once the TSS report has been saved.\n" }, { "from": "human", "value": "$(document).ready(function() {\n Sortable.init();\n \n //Initialize Tables\n for(var i = 0; i < $('table').length; i++){\n $($(...
javascript
chosen
[ { "from": "system", "value": "Check for fb on click and not on load\n" }, { "from": "human", "value": "'use strict';\nvar $ = require('jquery'),\n React = require('react');\n\nif (typeof window !== 'undefined') {\n var _gaq = window._gaq || undefined;\n var FB = window.FB || undefined;\n}\n...
javascript
chosen
[ { "from": "system", "value": "Use spawnSync instead of execSync: more consistent\n" }, { "from": "human", "value": "/*!\n * to-clipboard <https://github.com/jonschlinkert/to-clipboard>\n *\n * Copyright (c) 2015, Jon Schlinkert.\n * Licensed under the MIT License.\n */\n\n'use strict';\n\nvar cp...
javascript
chosen
[ { "from": "system", "value": "Transform todo items to todo objects\n" }, { "from": "human", "value": "var todoList = {\n todos: ['item 1', 'item 2', 'item 3'],\n displayTodos: function() {\n console.log('My Todos', this.todos);\n },\n addTodo: function(todo) {\n this.todos.push(todo);\...
javascript
chosen
[ { "from": "system", "value": "Use new user data API\n" }, { "from": "human", "value": "var ipc = require('ipc')\nvar fs = require('fs')\n\nvar userData\n\ndocument.addEventListener('DOMContentLoaded', function (event) {\n ipc.send('getUserDataPath')\n\n ipc.on('haveUserDataPath', function (pat...
javascript
chosen
[ { "from": "system", "value": "Fix tests not correctly dropping plpgsql functions.\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http...
javascript
chosen
[ { "from": "system", "value": "Improve optimization by separating the try/catch, and bailing out early when not typeof \"object\"." }, { "from": "human", "value": "'use strict';\n\nvar regexExec = RegExp.prototype.exec;\n\nmodule.exports = function isRegex(value) {\n\ttry {\n\t\tregexExec.call(va...
javascript
chosen
[ { "from": "system", "value": "Use a beautiful shorthand for mapping state to props\n" }, { "from": "human", "value": "import React from 'react';\nimport {connect} from 'react-redux';\nimport NewPaula from './new-paula';\n\nclass MainComponent extends React.Component {\n\trender() {\n\t\treturn <...
javascript
chosen
[ { "from": "system", "value": "Add customization for conseil departemental nord" }, { "from": "human", "value": "'use strict';\n\nangular.module('ddsCommon').factory('CustomizationService', function(lyonMetropoleInseeCodes) {\n\n function determineCustomizationId(testCase, currentPeriod) {\n ...
javascript
chosen
[ { "from": "system", "value": "Make main fn a noop in node\n" }, { "from": "human", "value": "'use strict'\n\nvar window = require('global/window')\nvar Struct = require('observ-struct')\nvar Observ = require('observ')\nvar minimumViewport = require('minimum-viewport')\nvar orientation = require(...
javascript
chosen
[ { "from": "system", "value": "Add min/max window width. Add custom menubar icon\n" }, { "from": "human", "value": "'use strict';\n\nvar app = require('app');\nvar dribbbleapi = require('./dribbbleapi');\n\nvar mainWindow = null;\nvar dribbbleData = null;\n\nvar menubar = require('menubar')\n\nv...
javascript
chosen
[ { "from": "system", "value": "Clear scope product name value\n" }, { "from": "human", "value": "'use strict';\n\nvar app = angular.module('ProductsApp');\n\napp.controller('editmodeController', ['$scope', function($scope) {\n var ctrl = this;\n \n ctrl.enterEvent = function(event) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add update function for products\n" }, { "from": "human", "value": "'use strict';\n\nvar app = angular.module('ProductsApp');\n\napp.controller('editmodeController', ['$scope', function($scope) {\n var ctrl = this;\n \n ctrl.save = function () {\n $s...
javascript
chosen
[ { "from": "system", "value": "Make json files language specific\n" }, { "from": "human", "value": "Plugin.registerSourceHandler('i18n.json', function (compileStep) {\n compileStep.addJavaScript({\n path: compileStep.inputPath + '.js',\n sourcePath: compileStep.inputPath,\n data: ['if(M...
javascript
chosen
[ { "from": "system", "value": "Add webpack HTML hot loading\n" }, { "from": "human", "value": "const path = require('path');\nconst config = require('config');\nconst webpack = require('webpack');\n\nmodule.exports = {\n name : 'client',\n target : 'web',\n devtool: config.compiler.devtool,\...
javascript
chosen
[ { "from": "system", "value": "Implement adding urls to history\n" }, { "from": "human", "value": "var gImageForward = {\n\n onLoad: function() {\n if ('undefined' == typeof gBrowser) {\n return;\n }\n window.removeEventListener('load', gImageForward.onLoad, fal...
javascript
chosen
[ { "from": "system", "value": "Increase HTTP request limit to allow for larger imports\n" }, { "from": "human", "value": "/*\n * Biodiversity Heritage Library\n * A backend for collecting OCR corrections from BHL games.\n * Copyright 2015 Tiltfactor\n */\n\n(function() {\n global.requireLocal = ...
javascript
chosen
[ { "from": "system", "value": "Fix the loop on the home slider\n" }, { "from": "human", "value": "var LightSliderHomeInit = function() {\n\n //\n // Init\n //\n this.init();\n\n};\n\nLightSliderHomeInit.prototype.init = function() {\n\n var that = this;\n\n $('[data-slider-home]...
javascript
chosen
[ { "from": "system", "value": "Increase pause time of home slider\n" }, { "from": "human", "value": "var LightSliderHomeInit = function() {\n\n //\n // Init\n //\n this.init();\n\n};\n\nLightSliderHomeInit.prototype.init = function() {\n\n var that = this;\n\n $('[data-slider-ho...
javascript
chosen
[ { "from": "system", "value": "Check for windows root directory\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\n\nmodule.exports = function isEmberCliProject() {\n var originalCwd = process.cwd();\n var inside = false;\n\n while(process.cwd() !== '/') { // is it wi...
javascript
chosen
[ { "from": "system", "value": "Create uploads directory if doesnt exist\n" }, { "from": "human", "value": "const express = require('express');\nconst path = require('path');\nconst fs = require('fs');\nconst formidable = require('formidable');\nconst createTorrent = require('create-torrent');\n\n...
javascript
chosen
[ { "from": "system", "value": "Add functions to add/remove data\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('underscore');\n\nmodule.exports = (function() {\n\n\tvar attic = function(prefix) {\n\t\tthis.prefix = prefix;\n\t};\n\n\tattic.prototype = {\n supported: fu...
javascript
chosen
[ { "from": "system", "value": "Update version string to 2.6.0-pre.14.1\n" }, { "from": "human", "value": "'use strict';\n\nvar\n\tplatform = require('enyo/platform'),\n\tdispatcher = require('enyo/dispatcher'),\n\tgesture = require('enyo/gesture');\n\nexports = module.exports = require('./lib/opt...
javascript
chosen
[ { "from": "system", "value": "Add track number and album artist to info\n" }, { "from": "human", "value": "var osa = require('osa2')\n\nfunction play(uri) {\n if (uri)\n return playTrack(uri)\n return osa(() => Application('Spotify').play())()\n}\n\nfunction playTrack(uri) {\n re...
javascript
chosen
[ { "from": "system", "value": "Add speaker model to application serializer\n" }, { "from": "human", "value": "import { moduleForModel, test } from 'ember-qunit';\n\nmoduleForModel('event', 'Unit | Serializer | application', {\n needs: [\n 'serializer:application',\n 'model:event',\n 'mo...
javascript
chosen
[ { "from": "system", "value": "RB: Patch set and map with iterator\n" }, { "from": "human", "value": "function isObject(whoAmI) {\n return (!!whoAmI) && (whoAmI.constructor === Object);\n}\n\nfunction isArray(whoAmI) {\n return (!!whoAmI) && (whoAmI.constructor === Array);\n}\n\nfunction is...
javascript
chosen
[ { "from": "system", "value": "Add support of nested directories" }, { "from": "human", "value": "\n'use strict';\n\nvar through = require('through2');\nvar glob = require('glob');\n\nmodule.exports = function() {\n\n var transform = function(file, env, cb) {\n\n // find all instances m...
javascript
chosen
[ { "from": "system", "value": "Update implementation as per spec\n" }, { "from": "human", "value": "// Crockford's Base32\n// https://en.wikipedia.org/wiki/Base32\nconst ENCODING = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"\nif (ENCODING.length !== 32) throw new Error('ENCODING')\n\n// Current Version ...
javascript
chosen
[ { "from": "system", "value": "Fix scope issue, fix project dir.\n" }, { "from": "human", "value": "/* globals require */\n\nfunction initEnv(projectConfig) {\n let defaults = _.get(projectConfig, 'env.default', {});\n\n _.forIn(projectConfig.env, function (vars, env) {\n let envVars = _.def...
javascript
chosen
[ { "from": "system", "value": "Remove mocked-up tasks, add reducer, add input box\n\nNow this accepts new tasks from the users. It starts to get dynamic.\nStill no persistence: tasks get on re-start.\n" }, { "from": "human", "value": "'use strict';\n\nconst choo = require('choo');\nconst html = r...
javascript
chosen
[ { "from": "system", "value": "Replace placeholder BASE_PATH in header to fix relative links\n" }, { "from": "human", "value": "module.exports = {\n website: {\n assets: \".\",\n html: {\n \"body:start\": function(current, output) {\n var fs = require(\"fs\");\n var path...
javascript
chosen
[ { "from": "system", "value": "Make admin-lookup opt-in via pelias-config.\n\nindex.js\n\t-Make the admin-lookup an opt-in feature since it's technically\n\tadvanced usage; fixes #49.\n" }, { "from": "human", "value": "\n/**\n The openstreetmap importer provides a way of parsing, mapping and\n ...
javascript
chosen
[ { "from": "system", "value": "Change minimum clicks to 10\n" }, { "from": "human", "value": "function KeyboardShortcutAlert(alertHandler) {\n var self = {\n 'clickCount': {}\n };\n var MINIMUM_CLICKS_BEFORE_ALERT = 5;\n\n function modeSwitchButtonClicked(labelType) {\n ...
javascript
chosen
[ { "from": "system", "value": "Simplify mapValues body into a single return" }, { "from": "human", "value": "var Promise = require('bluebird');\nvar mapValues = require('lodash.mapvalues');\nvar assign = require('lodash.assign');\nvar curry = require('lodash.curry');\n\nfunction FileWebpackPlugin...
javascript
chosen
[ { "from": "system", "value": "Use /.dockerenv as a fallback mechanism\n\nOn my machine, /.dockerinit was not present. Since I'm using a fresh install from\n[brew](http://brew.sh/), I suspect I'm not the only one with this problem. This patch\nupdates is-docker to check for a /.dockerenv file if /.dockerinit...
javascript
chosen
[ { "from": "system", "value": "Set alternate propery with otherOS symbol set.\n" }, { "from": "human", "value": "'use strict';\nvar chalk = require('chalk');\n\nvar main = {\n\tinfo: chalk.blue('ℹ'),\n\tsuccess: chalk.green('✔'),\n\twarning: chalk.yellow('⚠'),\n\terror: chalk.red('✖')\n};\n\nvar ...
javascript
chosen
[ { "from": "system", "value": "Fix module with incorrect case\n" }, { "from": "human", "value": "'use strict';\r\n\r\nmodule.exports.DropdownMenu = require('./dist/dropdownMenu');\r\nmodule.exports.MenuList = require('./dist/menuList');\r\nmodule.exports.MenuItem = require('./dist/MenuItem');\r\n...
javascript
chosen
[ { "from": "system", "value": "Make logged file path relative" }, { "from": "human", "value": "var fs = require('fs')\n\nmodule.exports = function (path, opts) {\n if (!path) throw new Error('Path must be provided')\n\n return function (err, src) {\n if (!opts) opts = {}\n if (err) throw ...
javascript
chosen
[ { "from": "system", "value": "Fix iframeJail option when serving an app in ember@2.16.0+\n\nThe treeForPublic hook runs before the app is initialized, so the iframeJail\noption was not being read at all. This commit removes the reliance on the app\nand simply reads the config, making it available in the cur...
javascript
chosen
[ { "from": "system", "value": "Use async.parallel() to call GitHub API endpoints in parallel\n" }, { "from": "human", "value": "var _ = require('underscore');\nvar async = require('async');\nvar request = require('request');\nvar linters = require('./linters');\n\nvar repoURL = 'https://api.githu...
javascript
chosen
[ { "from": "system", "value": "Add test change for release 5\n" }, { "from": "human", "value": "#!/usr/bin/env node\nconst inquirer = require('inquirer')\nconst Listr = require('listr')\n\nconst steps = [{\n type: 'input',\n name: 'userName',\n message: 'Whats your name?'\n}]\n\n\nconst tasks ...
javascript
chosen
[ { "from": "system", "value": "Replace wrong use of path.normalize\n" }, { "from": "human", "value": "'use strict';\n\n// Module dependencies\nvar path = require('path');\n\n// Set module root directory\nprocess.rootTest = __dirname;\nprocess.requireTest = function(filePath) {\n return require(p...
javascript
chosen
[ { "from": "system", "value": "Replace wrong use of path.normalize\n" }, { "from": "human", "value": "'use strict';\n\n// Module dependencies\nvar path = require('path');\n\n// Set module root directory\nprocess.rootAPI = __dirname;\nprocess.requireAPI = function(filePath) {\n return require(pat...
javascript
chosen
[ { "from": "system", "value": "Call the callback if the credential isn't found.\n" }, { "from": "human", "value": "const fs = require('fs');\nconst passport = require('passport');\nconst JWTStrategy = require('passport-jwt').Strategy;\nconst extractors = require('./extractors');\nconst services =...
javascript
chosen
[ { "from": "system", "value": "Check isEmbedded and isDuplicate only when needed\n" }, { "from": "human", "value": "var embeddedRegexp = /data:(.*?);base64,/;\nvar commentRegexp = /\\/\\*([\\s\\S]*?)\\*\\//g;\nvar urlsRegexp = /((?:@import\\s+)?url\\s*\\(['\"]?)(\\S*?)(['\"]?\\s*\\))|(@import\\s+...
javascript
chosen
[ { "from": "system", "value": "Fix sample path for ssh key.\n" }, { "from": "human", "value": "var nodegit = require('nodegit'),\n cred = nodegit.Cred;\n\nmodule.exports = function(url, userName) {\n // return cred.sshKeyFromAgent(userName);\n return cred.sshKeyNew(userName, '/home/build/...
javascript
chosen
[ { "from": "system", "value": "Fix deprecation warning of router\n\nember-router.router renamed to ember-router._routerMicrolib in ember 2.13\nhttps://emberjs.com/deprecations/v2.x/#toc_ember-router-router-renamed-to-ember-router-_routermicrolib\n" }, { "from": "human", "value": "import Ember fro...
javascript
chosen
[ { "from": "system", "value": "Add a filter for dropped energy\n" }, { "from": "human", "value": "'use strict';\n\nvar all;\nvar cache = {};\n\nfunction getCache(room) {\n if (room === undefined) {\n if (all === undefined) {\n all = [];\n for (var i in Game.rooms) ...
javascript
chosen
[ { "from": "system", "value": "Add setTitle call to update profile\n\nAdd setTitle call to update profile so that the HTML head title\nattribute is set when visiting this route.\n" }, { "from": "human", "value": "publicAccessible = FlowRouter.group({});\n\nsignInRequired = FlowRouter.group({\n t...
javascript
chosen