conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use a router to navigate gui's\n" }, { "from": "human", "value": "histomicstk.App = girder.App.extend({\n\n initialize: function () {\n girder.fetchCurrentUser()\n .done(_.bind(function (user) {\n girder.eventStream = new girder.E...
javascript
chosen
[ { "from": "system", "value": "Fix typo causing unnecessary requests\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar Watchlist = require('../models/watchlist');\n\n\n// POST watchlist\nrouter.post('/', function (req, res, next) {\n var us...
javascript
chosen
[ { "from": "system", "value": "[ARRCONN-237] Order by string prop option added\n" }, { "from": "human", "value": "var Arrow = require('arrow'),\n\tCollection = Arrow.Collection;\n\nexports.query = function query(Model, options, next) {\n\tvar self = this,\n\t\tcollection = this.getCollection(Mode...
javascript
chosen
[ { "from": "system", "value": "Chore: Remove unused function from the form deletion feature\n" }, { "from": "human", "value": "$(function(){\n let elements = $('.vich-image, .cropper');\n if(!elements.length) return;\n\n $.get('/wearejust/sonata_theme/delete_dialog', (html) => {\n ...
javascript
chosen
[ { "from": "system", "value": "Use 4 spaces to be consistent with other files\n" }, { "from": "human", "value": "const vscode = require('vscode');\n\nfunction showRelatedFiles() {\n const { fileName } = vscode.window.activeTextEditor.document;\n const fileNameParts = fileName.split('/');\n con...
javascript
chosen
[ { "from": "system", "value": "Set tokenpro back to true on logout\n" }, { "from": "human", "value": "var app = angular.module('controller.accounts', ['ionic']);\n\napp.controller('AccountsCtrl', function($scope, $state, $window, RequestService, AccountsService, LoadingService) {\n\n LoadingSe...
javascript
chosen
[ { "from": "system", "value": "Add min to snapshot limit\n" }, { "from": "human", "value": "define([\n 'jquery',\n 'underscore',\n 'backbone',\n 'bootstrap',\n 'views/backup/volumeSlider',\n 'text!templates/backup/volumeSlider.html'\n], function($, _, Backbone, Bootstrap, VolumeSliderView) ...
javascript
chosen
[ { "from": "system", "value": "Return 0 / 1 instead of \"true\" / \"false\"\n" }, { "from": "human", "value": "#!/usr/bin/env node\nconst programm = require('commander');\nconst caniuseYarn = require('../lib');\nconst pkg = require('../package.json');\n\nprogramm\n .version(pkg.version)\n .pars...
javascript
chosen
[ { "from": "system", "value": "Store Alchemy emotion on MongoDB\n" }, { "from": "human", "value": "import http from 'http';\nimport express from 'express';\nimport io from 'socket.io';\nimport bodyparser from 'body-parser';\nimport chatbot from './chatterbot/chatbotController.js';\nimport analyze...
javascript
chosen
[ { "from": "system", "value": "Add comment for future work\n" }, { "from": "human", "value": "import selftest from '../selftest';\nimport { parse, markBottom } from '../parse-stack';\nimport _ from 'underscore';\nimport Fiber from 'fibers';\nimport Future from 'fibers/future';\n\nselftest.define(...
javascript
chosen
[ { "from": "system", "value": "Change schemas to new format.\n\n" }, { "from": "human", "value": "import { Schema, arrayOf } from 'normalizr';\n\nexport const packages = new Schema('packages', { idAttribute: 'name' });\nexport const arrayOfPackages = arrayOf(packages);\n" }, { "from": "gp...
javascript
chosen
[ { "from": "system", "value": "Watch changes over json files\n" }, { "from": "human", "value": "// Modules required for this task\nvar gulp = require('gulp'),\n environments = require('gulp-environments');\n\n// Define main directories\nvar assets = 'assets/',\n development = environments.d...
javascript
chosen
[ { "from": "system", "value": "Fix new version of openpgp\n" }, { "from": "human", "value": "import { init, createWorker } from 'pmcrypto';\nimport { loadScript } from './dom';\n\nexport const initMain = async (openpgpContents) => {\n const mainUrl = URL.createObjectURL(new Blob([openpgpConten...
javascript
chosen
[ { "from": "system", "value": "Rename /hello_world route to /\n" }, { "from": "human", "value": "angular.module('app', ['ngRoute']).\n config(function($routeProvider, $locationProvider) {\n $locationProvider.html5Mode(false).hashPrefix(\"!\");\n $routeProvider.\n when(\"/hello_world\"...
javascript
chosen
[ { "from": "system", "value": "Update Vue example to use form\n\n* Mimics same submit behavior with React example\n* where pressing enter submits form, as well as\n* clicking submit button\n" }, { "from": "human", "value": "import Vue from 'vue';\n\nimport api from './api';\n\nnew Vue({\n el: '#...
javascript
chosen
[ { "from": "system", "value": "Remove extension from grunt file\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\n // Project configuration.\n grunt.initConfig({\n ts: {\n default: {\n src: [\"*.ts\", \"node_modules/dimensions/**/*.ts...
javascript
chosen
[ { "from": "system", "value": "Add some more tests for AppView\n" }, { "from": "human", "value": "/* global app, chai, describe, it, beforeEach, afterEach, sinon */\nvar expect = chai.expect;\n\ndescribe(\"AppView\", function() {\n var sandbox;\n\n describe(\"#initialize\", function() {\n be...
javascript
chosen
[ { "from": "system", "value": "Add optional properties for Post and Author type\n" }, { "from": "human", "value": "'use babel';\n/* @flow */\n\nexport type Post = {\n title: string,\n content: string,\n postCreated : any,\n postPublished: string,\n lastUpdated: string,\n status:...
javascript
chosen
[ { "from": "system", "value": "Implement progress simulation for control button on example page\n" }, { "from": "human", "value": "angular.module('progressButtonDemo', ['progressButton'])\n\t.controller('ProgressButtonsCtrl', function($scope, $interval) {\n\t\t$scope.buttons = [\n\t\t\t{ value: 0...
javascript
chosen
[ { "from": "system", "value": "Fix new window components name\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n Route,\n Router,\n hashHistory\n} from 'react-router';\nimport ComponentPage from './components/ComponentPage';\nimport App...
javascript
chosen
[ { "from": "system", "value": "Return dest to fix bug with whitelist\n" }, { "from": "human", "value": "module.exports = function(dest, key, source) {\n var keys = key.split('.');\n var last = keys.length - 1;\n var container = {\n dest: dest,\n src: source\n };\n keys.reduce(function(...
javascript
chosen
[ { "from": "system", "value": "Refactor to override variable value.\n" }, { "from": "human", "value": "var cookie = require('cookie');\n\nexports = module.exports = {\n set: function (key, value, options) {\n return document.cookie = cookie.serialize(key, value, options);\n },\n\n get: func...
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 bit of perflogger back\n" }, { "from": "human", "value": "import createLogger from 'redux-logger';\nimport { enableBatching } from 'redux-batched-actions';\nimport promiseMiddleware from 'redux-promise-middleware';\nimport { createStore, compose, applyMiddleware...
javascript
chosen
[ { "from": "system", "value": "Call addControl instead of passing map to control\n" }, { "from": "human", "value": "goog.require('ol.Map');\ngoog.require('ol.View2D');\ngoog.require('ol.control.ZoomSlider');\ngoog.require('ol.layer.TileLayer');\ngoog.require('ol.source.MapQuestOpenAerial');\n\n\n...
javascript
chosen
[ { "from": "system", "value": "Revert \"removed stuff Ember.setupForTesting does automatically\"\n\nThis reverts commit 5d039b1be8e7f27cbf0e4ceed8e539b41f009636.\n\nConflicts:\n\tblueprint/tests/test-helper.js\n" }, { "from": "human", "value": "/* global require */\n\nvar Application = require('<...
javascript
chosen
[ { "from": "system", "value": "Add repeated ticks for animation\n" }, { "from": "human", "value": "/* global Thing */\n\n(function (document, window) {\n 'use strict';\n\n var Main = function () {\n // console.log('Main()');\n\n this.field = document.getElementById('field');\n...
javascript
chosen
[ { "from": "system", "value": "Update for new rpc and scheduler.\n" }, { "from": "human", "value": "var axon = require('axon')\nvar debug = require('debug')('micromono:rpc')\n\n\nmodule.exports = {\n client: {\n send: function(data) {\n var self = this\n this.scheduleProvider(functi...
javascript
chosen
[ { "from": "system", "value": "Update to only grab the gist ID, not the revision sha\n" }, { "from": "human", "value": "// ==UserScript==\n// @name gitFiddle\n// @namespace http://jason.karns.name\n// @include https://gist.github.com/*\n// @require https://ajax.google...
javascript
chosen
[ { "from": "system", "value": "Remove 'react-intl/locale-data/en' because it's default.\n" }, { "from": "human", "value": "import { IntlProvider, addLocaleData } from 'react-intl';\nimport { connect } from 'react-redux';\nimport en from 'react-intl/locale-data/en';\nimport ko from 'react-intl/loc...
javascript
chosen
[ { "from": "system", "value": "Correct the url for sessiontoken requests in fetchSessionToken()\n" }, { "from": "human", "value": "'use strict';\n\nvar $ = require('jQuery');\n\nfunction fetchSessionToken(cb, scope) {\n var dfd = $.Deferred();\n\n if (window.Kwf && window.Kwf.sessionToken) ...
javascript
chosen
[ { "from": "system", "value": "Fix infinite scrolling after second page\n" }, { "from": "human", "value": "\npagination = {\n enabled: false,\n loading: false,\n\n showMore: function(newPagination, appendFunction) {\n if (newPagination) {\n jQuery('.pagination').replaceWith(newPaginati...
javascript
chosen
[ { "from": "system", "value": "Fix typo on styles watch\n" }, { "from": "human", "value": "/*\n * Universal JS Boilerplate\n * Copyright (c) Carlos Azaustre, carlosazaustre.es\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this so...
javascript
chosen
[ { "from": "system", "value": "Fix window and global object\n" }, { "from": "human", "value": "(function(window) {\n\n var modules = {};\n var _modules = {};\n var stack = {};\n\n // define(id, function(require, module, exports))\n function define(id, callback) {\n if (typeof id !== 'stri...
javascript
chosen
[ { "from": "system", "value": "Add platform check when making menu\n" }, { "from": "human", "value": "'use strict';\n\nvar app = require('app');\nvar shortcut = require('./shortcut.js');\n\nrequire('crash-reporter').start();\n\n// Keep a global reference to prevent being GCed.\nvar mainWindow = n...
javascript
chosen
[ { "from": "system", "value": "Remove imports and exports for es5 cjs modules\n\nFixes #219\n" }, { "from": "human", "value": "module.exports = {\n plugins: [\n ['@babel/plugin-transform-runtime', { useESModules: true, corejs: 2 }]\n ],\n presets: [\n [\n '@babel/preset-env',\n ...
javascript
chosen
[ { "from": "system", "value": "Correct comma spacing for Giuliano\n" }, { "from": "human", "value": "var cheerio = require('cheerio');\nrequire('./parserUtil');\n\nmodule.exports.parse = function (html, callback) {\n\n var $ = cheerio.load(html);\n\n var menu = [];\n var todayStr = globa...
javascript
chosen
[ { "from": "system", "value": "Change the markup in the Character component\n\nIt uses now the initial design for the character component, they seem\nnow more like cards\n" }, { "from": "human", "value": "var React = require('react');\n\nvar Character = React.createClass({\n getThumbnail: functi...
javascript
chosen
[ { "from": "system", "value": "Change back to no bind, changed to arrow function.\n" }, { "from": "human", "value": "'use strict';\n\nconst Server = require('net').Server,\n handler = require('./handler');\n\n/* lib/index.js\n * Server object.\n * * */\n\n// Export server.\nmodule.exports = ...
javascript
chosen
[ { "from": "system", "value": "Add explicit value field (for documentation later)\n" }, { "from": "human", "value": "// ==========================================================================\n// Project: Ember Handlebar Views\n// Copyright: ©2011 Strobe Inc. and contributors.\n// License: ...
javascript
chosen
[ { "from": "system", "value": "Fix playbackrate on media change\n" }, { "from": "human", "value": "import app from './app';\n\n\nclass Player {\n\n constructor(options) {\n\n this.audio = new Audio();\n\n this.audio.playbackRate = options.playbackRate || 1;\n this.audio.vo...
javascript
chosen
[ { "from": "system", "value": "Introduce listWidth, listHeight and slideHeight state attributes.\n" }, { "from": "human", "value": "var initialState = {\n animating: false,\n dragging: false,\n autoPlayTimer: null,\n currentDirection: 0,\n currentLeft: null,\n currentSlide: 0,\n...
javascript
chosen
[ { "from": "system", "value": "Modify import and code style.\n" }, { "from": "human", "value": "const dir = require('node-dir')\nconst Deferred = require('promised-io/promise').Deferred\nconst path = require('path')\nconst _ = require('lodash')\n\nfunction files(dirPath, fileExtension) {\n if (_...
javascript
chosen
[ { "from": "system", "value": "Add logger kafkajs to log lines\n" }, { "from": "human", "value": "const LEVELS = {\n NOTHING: 0,\n ERROR: 1,\n WARN: 2,\n INFO: 4,\n DEBUG: 5,\n}\n\nconst createLevel = (label, level, currentLevel, namespace, loggerFunction) => (\n message,\n extra = {}\n) =...
javascript
chosen
[ { "from": "system", "value": "Enable long term caching (don't change hash when no files changed)\n" }, { "from": "human", "value": "import path from \"path\"\n\n// ! client side loader only \\\\\nexport default ({ config }) => {\n const { webpackConfig } = config\n return {\n ...webpackConf...
javascript
chosen
[ { "from": "system", "value": "Change browser on chrome (for tests)\n" }, { "from": "human", "value": "exports.config = {\n\n specs: ['e2e/*/*_spec.js'],\n baseUrl: 'http://localhost:5000',\n capabilities: {\n 'browserName': 'firefox',\n 'count': 1,\n },\n\n suites: {...
javascript
chosen
[ { "from": "system", "value": "Add exports:named for compatibility with typescript\n" }, { "from": "human", "value": "import babel from \"rollup-plugin-babel\";\nimport buble from \"rollup-plugin-buble\";\nimport { uglify } from \"rollup-plugin-uglify\";\n\nconst config = {\n input: \"src/index....
javascript
chosen
[ { "from": "system", "value": "Adjust and output bundle to dev dir\n" }, { "from": "human", "value": "import babel from 'rollup-plugin-babel';\n\n/**\n * glsl transform from three.js rollup.config.js\n *\n * @see https://github.com/mrdoob/three.js/blob/r82/rollup.config.js\n */\n\nfunction glsl (...
javascript
chosen
[ { "from": "system", "value": "Rename scrobble to track router\n" }, { "from": "human", "value": "'use strict';\n\nconst router = require('express').Router();\nconst authRouter = require('./auth/authRouter');\n\nrouter.get('/', function(req, res) {\n res.send('Scrawble dat track jo!');\n});\n\nr...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded code to disable audio muting.\n" }, { "from": "human", "value": "import Phaser from 'phaser'\nimport { centerGameObjects } from '../utils'\n\nexport default class extends Phaser.State {\n init () {\n\t\tthis.game.sound.mute = false\n\t}\n\n pre...
javascript
chosen
[ { "from": "system", "value": "Refactor index loop to for-of loop\n" }, { "from": "human", "value": "module.exports = digits => {\n const first = digits[0];\n\n for (let i = 1; i < digits.length; ++i) {\n if (digits[i] !== first) {\n return true;\n }\n }\n\n return false;\n};\n" ...
javascript
chosen
[ { "from": "system", "value": "Add two quick tests for users endpoint\n" }, { "from": "human", "value": "const apiUnderTest = require('../src');\nconst supertest = require('supertest');\n\nconst request = supertest.agent(apiUnderTest.listen());\n\ndescribe('Hello World', () => {\n it('should say...
javascript
chosen
[ { "from": "system", "value": "Fix regex for html links parsing.\n" }, { "from": "human", "value": "export class HtmlTools {\n static escapeHtml (text) {\n return text.replace(/[\\\"&<>]/g, a => HtmlTools._escapeCharMap[a]);\n }\n\n static anchorLinksEscapeHtml (text) {\n v...
javascript
chosen
[ { "from": "system", "value": "Fix model not being passed in snippet recursion\n" }, { "from": "human", "value": "function dieRoll (min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}\n\nfunction processDirective (directive, model, cb) {\n if (directive[0] === ':') {\n ret...
javascript
chosen
[ { "from": "system", "value": "Add test for review comments\n" }, { "from": "human", "value": "import assert from 'assert'\nimport {ugf} from '../src/modules/fileformats/index.js'\n\ndescribe('ugf', () => {\n describe('parse', () => {\n it('should parse simple files', () => {\n let tree ...
javascript
chosen
[ { "from": "system", "value": "Fix a router path in AdminLogon\n" }, { "from": "human", "value": "/**\n * AdminLogonController: Creates a endpoint where a user can log\n * into the system. It renders the login template only if user is\n * not already logged in.\n */\nAdminLogonController = RouteC...
javascript
chosen
[ { "from": "system", "value": "Add rendering of game to DOM\n" }, { "from": "human", "value": "var Game = require('./models/game'),\n bowlingGame,\n bowlingBtn,\n onFinish,\n onBowl,\n onLoad;\n\n// Create instance of bowling game\nbowlingGame = new Game();\n\n/**\n * Set up bowlin...
javascript
chosen
[ { "from": "system", "value": "Replace uneccessary .replace syntax in aria-labelledby attribute\n" }, { "from": "human", "value": "// @flow\n\nimport React from 'react';\nimport type { Node } from 'react';\nimport classNames from 'classnames';\nimport { inject, observer } from 'mobx-react';\nimpo...
javascript
chosen
[ { "from": "system", "value": "Set window width and dot symbol for node as well\n" }, { "from": "human", "value": "/*\n * mocaccino.js\n *\n * Copyright (c) 2014 Maximilian Antoni <mail@maxantoni.de>\n *\n * @license MIT\n */\n'use strict';\n\nvar Mocha = require('mocha');\nvar _mocha = new Mocha...
javascript
chosen
[ { "from": "system", "value": "Include polyfills and shims required for testing.\n" }, { "from": "human", "value": "// require all modules ending in \".tests.ts\" from source and all subdirectories\n\nvar testsContext = require.context('./source', true, /\\.tests\\.js$/);\ntestsContext.keys().for...
javascript
chosen
[ { "from": "system", "value": "Fix expected value for youtube api.\n" }, { "from": "human", "value": "var lt = require('loopback-testing');\nvar chai = require('chai');\nvar assert = chai.assert;\n\n//path to app.js or server.js\nvar app = require('../../server/server.js');\n\ndescribe('/api/yout...
javascript
chosen
[ { "from": "system", "value": "Add route to download files\n" }, { "from": "human", "value": "var controller = require('./controllers/base_controller');\n\nmodule.exports.init = function (app) {\n\n\tapp.get('/entries', handle(controller.listEntries));\n\tapp.get('/entries/:id', handle(controller...
javascript
chosen
[ { "from": "system", "value": "Fix weird issue with craft price calculation in some cases\n" }, { "from": "human", "value": "// Update the tree prices\nfunction treePrices (tree, itemPrices) {\n tree = {...tree}\n\n // Either use the \"used quantity\" which gets set when the user uses\n // own...
javascript
chosen
[ { "from": "system", "value": "Make cookie a little more robust\n" }, { "from": "human", "value": "'use strict';\n\nconst uuidv4 = require('uuid/v4');\n\n// TODO init that sets cookie name?\n\nconst sessionIdent = 'tiny-ident';\n\nconst get = (req, res) => {\n let uuid;\n\n if ((req.cookies || ...
javascript
chosen
[ { "from": "system", "value": "Move log message to else block, incorrectly report null when not null\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2019 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfoam.CLASS({\n package: 'foam....
javascript
chosen
[ { "from": "system", "value": "Use passed object in objChanged rather than table held version, to pass along the change set\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/techno-table';\nimport ColumnSpec from '../lib/column-spec';\n\nex...
javascript
chosen
[ { "from": "system", "value": "Use compression on server side\n" }, { "from": "human", "value": "const express = require('express');\nconst compression = require('compression');\nconst path = require('path');\n\nconst app = express();\nconst PORT = process.env.PORT || 5000;\n\nconst Metascraper =...
javascript
chosen
[ { "from": "system", "value": "Add variable for chrome options\n" }, { "from": "human", "value": "var path = require('path');\n\nexports.config = {\n //directConnect: true,\n\n seleniumAddress: 'http://localhost:4444/wd/hub',\n\n // Spec patterns are relative to the location of this config.\n ...
javascript
chosen
[ { "from": "system", "value": "Add human friendly date in component\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport ReactCSSTransitionGroup from 'react-addons-css-transition-group';\nimport styles from './Incident.css';\nimport Map from './Map';\nimport GridTi...
javascript
chosen
[ { "from": "system", "value": "Add deferVisibleCompile option (default: false)\n\nThis defers compilation of visible elements too. Will be useful for incrementally showing long lists." }, { "from": "human", "value": "(function () {\n 'use strict';\n\n angular.module('ngDeferredShow', [])\n ...
javascript
chosen
[ { "from": "system", "value": "Adjust ember try config to make travis pass\n" }, { "from": "human", "value": "module.exports = {\n scenarios: [\n {\n name: 'default',\n dependencies: { }\n },\n {\n name: 'ember-release',\n dependencies: {\n 'ember': 'component...
javascript
chosen
[ { "from": "system", "value": "Fix a missing part of code in unit test\n\n- Setup code is *misteriously* missing...\n" }, { "from": "human", "value": "'use strict';\n\nvar grunt = require('grunt');\n\nexports.bump = {\n default_options: function(test) {\n test.expect(1);\n\n var actual = g...
javascript
chosen
[ { "from": "system", "value": "Use var rather than let for pre-ES6 cross-compatibility\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\n\n/**\n * Check the existence of the file\n */\nfunction checkFileExistsSync(filepath){\n let flag = true;\n\n try {\n fs.access...
javascript
chosen
[ { "from": "system", "value": "Fix trade-type-picker click event leak to asset-picker\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport { Label, DownArrow } from 'binary-components';\nimport DropDown from '../containers/DropDown';\nimport { actions } from '....
javascript
chosen
[ { "from": "system", "value": "Fix IE8 complaining when trying to set type attribute" }, { "from": "human", "value": "(function (window, $) {\n $.fn.progressiveDatePicker = function (value, options) {\n return this.each(function () {\n var el = $(this);\n if (!Mode...
javascript
chosen
[ { "from": "system", "value": "Use new for constructing the array\n" }, { "from": "human", "value": "\"use strict\";\n\nexports.arrayApply = function (fs) {\n return function (xs) {\n var l = fs.length;\n var k = xs.length;\n var result = Array(l*k);\n var n = 0;\n for (var i = 0;...
javascript
chosen
[ { "from": "system", "value": "Add graphql to extrenal-libs list for webpack, fixing duplication causing Apollo internal errors\n" }, { "from": "human", "value": "const esbuild = require(\"esbuild\");\n\nesbuild.buildSync({\n entryPoints: ['./src/platform/current/server/serverStartup.ts'],\n bu...
javascript
chosen
[ { "from": "system", "value": "Check if `this.providerParams` is defined\n" }, { "from": "human", "value": "// Load modules\n\nvar Crypto = require('crypto');\n\n// Declare internals\n\nvar internals = {};\n\n\nexports = module.exports = function (options) {\n\n return {\n protocol: 'oa...
javascript
chosen
[ { "from": "system", "value": "Update stacktrace info with new model path structure\n" }, { "from": "human", "value": "function $init$native$Exception$before(exc) {\n var _caller=arguments.callee.caller.caller;\n exc.stack_trace=[];\n while(_caller) {\n exc.stack_trace.push(_caller);\n _...
javascript
chosen
[ { "from": "system", "value": "Allow empty router to pass to next middleware\n\nWhen no router is defined for a feature app the default needs to\njust call next to allow the app to pass through.\n" }, { "from": "human", "value": "const router = require('express').Router()\nconst fs = require('fs'...
javascript
chosen
[ { "from": "system", "value": "Drop function only style for being more angular\n" }, { "from": "human", "value": "!function() {\n 'use strict';\n\n angular.module('crumble', ['ngRoute'])\n .factory('crumble', function ($location, $route, $interpolate) {\n var context;\n\n var crumb...
javascript
chosen
[ { "from": "system", "value": "Fix external link file selection handler referer\n\nREDMINE-17703\n" }, { "from": "human", "value": "import {editor} from 'pageflow-scrolled/editor';\n\nimport {SidebarRouter} from './SidebarRouter';\nimport {SidebarController} from './SidebarController';\nimport {S...
javascript
chosen
[ { "from": "system", "value": "Use path for fix webpack build\n" }, { "from": "human", "value": "const path = require('path')\nconst webpack = require('webpack')\n\nmodule.exports = {\n debug: true,\n cache: false,\n process: true,\n stats: {\n colors: true\n },\n entry: {\n 'scrollto...
javascript
chosen
[ { "from": "system", "value": "Remove outdated dependency in postintall\n\nWe no longer use dotenv.\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar runCommand = require('run-command'),\n dotenv = require('dotenv');\n\nrunCommand(\"gulp\");\n" }, { "from": "gpt", "va...
javascript
chosen
[ { "from": "system", "value": "Make the registration process not to proceed after validation fails\n" }, { "from": "human", "value": "const userModel = require('../../models/users')\nconst validator = require('./registerValidation')\nconst { buildResponse } = require('../../utils/responseService'...
javascript
chosen
[ { "from": "system", "value": "Use `devtool: 'source-map'` because 'eval' isn't suited for production\n\n(https://webpack.js.org/configuration/devtool/#devtool)\n" }, { "from": "human", "value": "/* eslint-env node */\n\nconst webpack = require('webpack');\nconst packageJson = require('./package....
javascript
chosen
[ { "from": "system", "value": "Revert \"Fix webpack to load jsx files and fix hot loading by separating out redux-rest\"\n\nThis reverts commit f618d07e66c27fdbc9b599ccdca0016cb3c2dcc8.\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar BundleTracker = require('webpack-bund...
javascript
chosen
[ { "from": "system", "value": "Add new colors to the palette\n" }, { "from": "human", "value": "const colors = {\n main: '#023365',\n background: '#EEF1F4',\n clear: 'rgba(0,0,0,0)',\n facebook: '#3b5998',\n transparent: 'rgba(0,0,0,0)',\n silver: '#F7F7F7',\n steel: '#CCCCCC',\n error: '...
javascript
chosen
[ { "from": "system", "value": "Allow GrabPay to have payment in THB\n" }, { "from": "human", "value": "define(\n [\n 'ko',\n 'Omise_Payment/js/view/payment/omise-offsite-method-renderer',\n 'Magento_Checkout/js/view/payment/default',\n 'Magento_Checkout/js/model/quo...
javascript
chosen
[ { "from": "system", "value": "Remove \"port\" setting for Socket.IO config\nIt was messing up the websocket url in Firefox\n" }, { "from": "human", "value": "function IO(){\n\tvar secure = window.location.protocol.match(/https/);\n\tvar socket = this.socket = new io.Socket(window.location.hostna...
javascript
chosen
[ { "from": "system", "value": "Make back button work when switching from basic to full via dropdown\n" }, { "from": "human", "value": "Template.registerHelper(\"layoutHidden\", function (type) {\n return (!!Session.get('fullApi')) ^ (type === 'full') ? 'hidden' : '';\n});\n\nTemplate.basicOrFull...
javascript
chosen
[ { "from": "system", "value": "Put everything in the precache?\n" }, { "from": "human", "value": "const path = require('path');\n\nconst BUILD_DIR = 'dist';\n\nmodule.exports = {\n globDirectory: BUILD_DIR,\n globPatterns: ['/', '**/*.{js,css,woff2,webmanifest}'],\n swSrc: path.join(BUILD_DIR,...
javascript
chosen
[ { "from": "system", "value": "Remove source from custom compare provider\n" }, { "from": "human", "value": "import { createAction } from 'redux-actions';\nimport { createThunkAction } from 'utils/redux';\n\nconst fetchCustomCompareAccordionInit = createAction(\n 'fetchCustomCompareAccordionInit...
javascript
chosen
[ { "from": "system", "value": "Fix show-more links not working after rebuild\n" }, { "from": "human", "value": "I.grade_list_table = (function () {\n\n function showMore(grade) {\n var table = $(\".grade-table-\"+grade);\n table.find(\"tr.show_more\").hide();\n table.find(\"tr.hidden_ob...
javascript
chosen
[ { "from": "system", "value": "Add e2e test for author user role\n" }, { "from": "human", "value": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a ...
javascript
chosen
[ { "from": "system", "value": "Add diff browser support for autoprefixer\n" }, { "from": "human", "value": "module.exports = {\n plugins: {\n 'autoprefixer': {},\n }\n}\n" }, { "from": "gpt", "value": "module.exports = {\n plugins: {\n autoprefixer: {\n browsers: [\n ...
javascript
chosen
[ { "from": "system", "value": "Use join instead of reduce\n" }, { "from": "human", "value": "class Randomcase {\n\t/**\n\t * A function that transforms a normal string into Randomcase\n\t *\n\t * @static\n\t * @param {String} input\n\t * @memberof Randomcase\n\t */\n\tstatic transform(input) {\n\...
javascript
chosen
[ { "from": "system", "value": "Update JS style: use 2 spaces, not 4\n" }, { "from": "human", "value": "// Initialize an OpenTok Session object\nvar session = OT.initSession(apiKey, sessionId);\n\n// Initialize a Publisher, and place it into the element with id=\"publisher\"\nvar publisher = OT.in...
javascript
chosen
[ { "from": "system", "value": "Use dummy email for config sample file\n" }, { "from": "human", "value": "module.exports = {\n 'notifications' : {\n enabled: false, //if disabled, no notifications will be sent\n to: ['ivan@iloire.com'], //default notification list if no alert_to is specifie...
javascript
chosen
[ { "from": "system", "value": "Remove deprecated from method default config\n" }, { "from": "human", "value": "'use strict';\n\nvar config = {\n\tname: '<%= name %>',\n\tslug: '<%= slug %>',\n\ttype: '<%= type %>',\n\tkind: '<%= kind %>',\n\tdeprecated: false,\n\tscripts:{ <% if(scripts.indexOf('...
javascript
chosen