conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Correct AEP resource for person signup helper\n\nSigned-off-by: shaisachs <47bd79f9420edf5d0991d1e2710179d4e040d480@ngpvan.com>\n" }, { "from": "human", "value": "\nvar contentType = require('../middleware/contentType'),\n config = require('../config');\n\nfuncti...
javascript
chosen
[ { "from": "system", "value": "Add modify to keyed methods to enable patch with id\n" }, { "from": "human", "value": "var Router = require('express').Router;\n\nvar keyed = ['get', 'read', 'put', 'patch', 'update', 'del', 'delete'],\n\tmap = { index:'get', list:'get', read:'get', create:'post', u...
javascript
chosen
[ { "from": "system", "value": "Revert \"adding JSON to the list of extensions that should be compressed\"\n\nThis reverts commit c90513519febf8feeea78b06da6a467bb1085948.\n" }, { "from": "human", "value": "'use strict';\n\nvar es = require('event-stream'),\n\tpath = require('path'),\n\tzlib = req...
javascript
chosen
[ { "from": "system", "value": "Throw when encountering a SoakedMemberAccessOp.\n" }, { "from": "human", "value": "import NodePatcher from './../../../patchers/NodePatcher.js';\n\nexport default class SoakedMemberAccessOpPatcher extends NodePatcher {\n patchAsExpression() {\n\n }\n\n patchAsSta...
javascript
chosen
[ { "from": "system", "value": "Revert \"fixed possible bug & Mac OSX compatibility issue with rm\"\n\nThis reverts commit b4ed13e1cd70025d4b8bb4b29e98334b00bfdbed.\n" }, { "from": "human", "value": "module.exports.movePlugins = function (src, dest) {\n var exec = require('child_process').exec\n ...
javascript
chosen
[ { "from": "system", "value": "Remove failing request when user is not logged in\n" }, { "from": "human", "value": "'use strict';\n\ndefine(['ChoPidoTurnos'], function(ChoPidoTurnos) {\n function DoctorProfileCtrl(doctorsService) {\n return {\n '$onInit': function () {\n var _this...
javascript
chosen
[ { "from": "system", "value": "Solve 'invalid target element' error\n" }, { "from": "human", "value": "import React from 'react';\nimport ClipboardJS from 'clipboard';\n\nexport default class CopyButton extends React.PureComponent {\n constructor(props) {\n super(props);\n this.btnRef = Re...
javascript
chosen
[ { "from": "system", "value": "Send annotation tags as array.\n" }, { "from": "human", "value": "angular.module(\"Prometheus.services\").factory('AnnotationRefresher', [\"$http\", function($http) {\n return function(graph, scope) {\n var tags = graph.tags.map(function(e) {\n if (e.name) ...
javascript
chosen
[ { "from": "system", "value": "Allow for tags to be interpolated variables.\n" }, { "from": "human", "value": "angular.module(\"Prometheus.services\").factory('AnnotationRefresher', [\"$http\", function($http) {\n return function(graph, scope) {\n var tags = graph.tags.map(function(e) {\n ...
javascript
chosen
[ { "from": "system", "value": "Split the register function for the readability.\n" }, { "from": "human", "value": "'use strict';\n\nexports.register = function (callback) {\n var commands = [{\n name : 'hello',\n desc : 'print Hello, John',\n options : {\n wizard : false,\n ...
javascript
chosen
[ { "from": "system", "value": "[MARKENG-156] Add function to start at top of new page unless window.location has a hash\n" }, { "from": "human", "value": "exports.onClientEntry = () => {\n (() => {\n function OptanonWrapper() { } // eslint-disable-line no-unused-vars\n })();\n};\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Rewrite PropagatorMethods module with ES6 syntax\n" }, { "from": "human", "value": "'use strict';\n\nvar PropagatorMethods = {\n attach: function(component) {\n var target = component;\n for (var i = 0, len = this._.components.length; i < len; i++) {\n i...
javascript
chosen
[ { "from": "system", "value": "Add description to hook generator\n" }, { "from": "human", "value": "import { Base } from 'yeoman-generator';\nimport generatorArguments from './arguments';\nimport generatorOptions from './options';\nimport generatorSteps from './steps';\n\nexport default class Hoo...
javascript
chosen
[ { "from": "system", "value": "Add locales methods to i18n\n" }, { "from": "human", "value": "/**\n * You can customize the initial state of the module from the editor initialization\n * ```js\n * const editor = grapesjs.init({\n * i18n: {\n * locale: 'en',\n * messages: {\n * en: {\n...
javascript
chosen
[ { "from": "system", "value": "Use `imply` instead of `use` and `export` together\n\nThis commit uses the `api.imply` shorthand to use a package and export its exports." }, { "from": "human", "value": "var path = Npm.require(\"path\");\n\nPackage.describe({\n summary: \"JavaScript.next-to-JavaSc...
javascript
chosen
[ { "from": "system", "value": "Use image onload and onerror\n" }, { "from": "human", "value": "/* eslint-env node */\n\nconst Canvas = require('canvas');\nconst fs = require('fs');\n\nconst { Image } = Canvas;\n\n/**\n * Create a new canvas object with height and width\n * set to the given values...
javascript
chosen
[ { "from": "system", "value": "Update the idProperty and labelProperty of the store properly based on what the picklist is using.\n" }, { "from": "human", "value": "/*\n * Copyright (c) 1997-2013, SalesLogix, NA., LLC. All rights reserved.\n */\n\n/**\n * @class Mobile.SalesLogix.Views.PickList\n...
javascript
chosen
[ { "from": "system", "value": "Switch markdown loading to fetch/async/await\n" }, { "from": "human", "value": "import h from 'hyperscript';\nimport fetch from 'unfetch';\nimport audio from './audio';\nimport aboutSrc from './content/about.md';\n\nlet visible = false;\nlet fetched = false;\n\ncons...
javascript
chosen
[ { "from": "system", "value": "Add file rule for test template file\n" }, { "from": "human", "value": "module.exports = (config) => {\n config.set({\n frameworks: ['mocha', 'karma-typescript'],\n browsers: ['ChromeHeadless'],\n singleRun: true,\n concurrency: Infinity,\n reporters...
javascript
chosen
[ { "from": "system", "value": "Refactor coursera tool. Add getAdjacencylist function.\n\nlzhoucs|G580|Win8|WebStorm9\n" }, { "from": "human", "value": "var http = require('http');\n\n/*\n* Convert from coursera sample format to javascript array.\n* e.g :\n*\n* a.txt :\n*\n* 111\n* 222\n* 333\n* 4...
javascript
chosen
[ { "from": "system", "value": "Make symbol linking more lenient.\n\nSummary:\nSometimes a symbol has a nested <span> in it. Clicks on that\nshould count as clicks on the symbol. So keep looking for symbols among\nthe ancestors of the click target.\n\nThis is a silly method because I don't know if there's a m...
javascript
chosen
[ { "from": "system", "value": "Send redis library to queue via opts\n" }, { "from": "human", "value": "var Queue = require('./queue');\nvar Job = require('./job');\nvar Worker = require('./worker');\nvar redis = require('./redis');\n\nexports.redis = redis;\n\nexports.createQueue = function(name)...
javascript
chosen
[ { "from": "system", "value": "Fix unexpected error when there is no context in an error\n" }, { "from": "human", "value": "var JSLINT = require(\"../lib/nodelint\");\n\nfunction addDefaults(options) {\n 'use strict';\n ['node', 'es5'].forEach(function (opt) {\n if (!options.hasOwnPr...
javascript
chosen
[ { "from": "system", "value": "Fix id formatting in artificialTokenList\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.artificialToken').directive('artificialTokenList', [\n 'artificialToken',\n 'idHandler',\n function(artificialToken, idHandler) {\n return {...
javascript
chosen
[ { "from": "system", "value": "Add the previously removed updateAnswer function\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('confRegistrationWebApp')\n .directive('radioQuestion', function () {\n return {\n templateUrl: 'views/radioQuestion.html',\n restrict: ...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect require() path in Marked renderer\n" }, { "from": "human", "value": "var escape = require('./util/escape')\nvar format = require('string-template');\nvar hljs = require('highlight.js');\nvar heading = require('./util/writeHeading');\nvar m...
javascript
chosen
[ { "from": "system", "value": "Make helpers a little more robust by searching specifically for Select or Select.Async components\n" }, { "from": "human", "value": "export function search(select, queryString, callback) {\n select.find('input').simulate('change', { target: { value: queryString } }...
javascript
chosen
[ { "from": "system", "value": "Include the PDF and LaTeX Transformers\n" }, { "from": "human", "value": "import {StreamTransformer} from './stream.transformer';\nimport {TracebackTransformer} from './traceback.transformer';\nimport {LaTeXTransformer} from './latex.transformer';\nimport {MarkdownT...
javascript
chosen
[ { "from": "system", "value": "Change votes route to /\n" }, { "from": "human", "value": "Router.configure({\n layoutTemplate: 'layout'\n});\nRouter.route('/votes', {name: 'votesList'});\nRouter.route('/iframe', {name: 'iFrame'});\nRouter.route('/submitvote', {name: 'submitVote'});\nRouter.route...
javascript
chosen
[ { "from": "system", "value": "Add route to limit posts\n" }, { "from": "human", "value": "Router.configure({\n layoutTemplate: 'layout',\n loadingTemplate: 'loading',\n notFoundTemplate: 'notFound',\n waitOn: function() {\n return [Meteor.subscribe('posts'), Meteor.subscribe('notification...
javascript
chosen
[ { "from": "system", "value": "Replace lost classes in components list\n" }, { "from": "human", "value": "import BarChart from './BarChart';\nimport BoxPlot from './BoxPlot';\nimport BulletChart from './BulletChart';\nimport GanttChart from './GanttChart';\nimport Geo from './Geo';\nimport Heatma...
javascript
chosen
[ { "from": "system", "value": "Add confirmation dialog to close trade." }, { "from": "human", "value": "\"use strict\";\n\n(function () {\n angular\n .module(\"argo\")\n .controller(\"Trades\", Trades);\n\n Trades.$inject = [\"toastService\", \"tradesService\"];\n function ...
javascript
chosen
[ { "from": "system", "value": "Use the new EventEmitter input by passing its events to socket.io\n" }, { "from": "human", "value": "var Transmitter = function (config) {\n\n var router = require('./router.js');\n router(config);\n\n var io = require('socket.io')(router.server);\n // Socket.io...
javascript
chosen
[ { "from": "system", "value": "feat(bot): Implement switching to webhooks in production\n" }, { "from": "human", "value": "\"use strict\";\n\nconst http = require('http');\nconst mongoose = require('mongoose');\nconst requireAll = require('require-all');\nconst TelegramBot = require('node-telegra...
javascript
chosen
[ { "from": "system", "value": "Remove foundation-sites require as foundation is not used anymore.\n\nSigned-off-by: Snorre Magnus Davøen <b6ec5a60a98746258b9d59fdb44419d796d6053e@gmail.com>\n" }, { "from": "human", "value": "'use strict';\n\nrequire('foundation-sites/scss/foundation.scss')\nrequi...
javascript
chosen
[ { "from": "system", "value": "Tweak sample for react-redux in order to use local storage\n" }, { "from": "human", "value": "export default function enhancer() {\n return (next) => (reducer, preloadedState) => {\n const initialState = Object.assign({}, preloadedState, loadState(restoreS...
javascript
chosen
[ { "from": "system", "value": "Replace :: with : in IE8 for backward compatibility with element pseudo selectors\n" }, { "from": "human", "value": "/* global legacyConvert, module, project */\n\nmodule.exports = function(grunt) {\n\tgrunt.registerTask('convertLegacy', function(task) {\n\t\tvar de...
javascript
chosen
[ { "from": "system", "value": "Add renaming of nextTab -> switchTab\n" }, { "from": "human", "value": "/* eslint-disable import/no-named-as-default */\n/* eslint-disable react/forbid-prop-types */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-red...
javascript
chosen
[ { "from": "system", "value": "Add polish dict to base code\n" }, { "from": "human", "value": "module.exports = {\n 'ar': require('../../i18n/ar.json'),\n 'da': require('../../i18n/da.json'),\n 'de': require('../../i18n/de.json'),\n 'en': require('../../i18n/en.json'),\n 'es': require('../.....
javascript
chosen
[ { "from": "system", "value": "Add keys to table loop\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\n\nimport './index.css';\n\nconst Pit = React.createClass({\n propTypes: {\n pit: PropTypes.object.isRequired,\n },\n\n render() {\n const { pit } = this.pro...
javascript
chosen
[ { "from": "system", "value": "Add message to SEND_MESSAGE action for debugging.\n" }, { "from": "human", "value": "import {\n SOCKET_SET_OPENING, SOCKET_SET_CLOSING, SOCKET_SEND_MESSAGE\n} from \"../constants/ActionTypes\";\n\nexport default (socketClient) => ({\n open: url => {\n c...
javascript
chosen
[ { "from": "system", "value": "Add UTC manipulation of dates for to and froms\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2020\n */\nimport moment from 'moment';\n\nimport { UIDatabase } from '../database';\nimport { FRIDGE_ACTIONS } from '../acti...
javascript
chosen
[ { "from": "system", "value": "Add link to report from hell\n" }, { "from": "human", "value": "'use strict';\n\nconst moment = require('moment')\nconst _ = require('lodash')\nconst lastBusinessDay = require('../../businessDays').last\n\nmodule.exports = ({ getChatUsers, getWorkEntries }) => {\n ...
javascript
chosen
[ { "from": "system", "value": "Update alert to allow for setting an id.\n" }, { "from": "human", "value": "'use strict';\n\nif (!waitlist) {\n\tvar waitlist = {};\n}\n\nwaitlist.base = (function(){\n\tfunction getMetaData (name) {\n\t\treturn $('meta[name=\"'+name+'\"]').attr('content');\n\t}\n\t...
javascript
chosen
[ { "from": "system", "value": "Fix checking of exec output\n" }, { "from": "human", "value": "var shell = require('shelljs');\n\nif (exec('git status --porcelain').output != '') {\n console.error('Git working directory not clean.');\n process.exit(2);\n}\n\nvar versionIncrement = process.argv[p...
javascript
chosen
[ { "from": "system", "value": "Use index to scroll to desired target\n" }, { "from": "human", "value": "import { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport { scrollIt } from 'utils/scroll';\n\nclass ScrollToHighlightIndex extends PureComponent {\n // eslint-disabl...
javascript
chosen
[ { "from": "system", "value": "Change to using textContent instead of innerHTML\n" }, { "from": "human", "value": "function localizeHtmlPage() {\n\t//Localize by replacing __MSG_***__ meta tags\n\tvar objects = document.querySelectorAll('.message');\n\tfor (var j = 0; j < objects.length; j++) {\n...
javascript
chosen
[ { "from": "system", "value": "Hide dialog when leaving route\n" }, { "from": "human", "value": "import Ember from \"ember\";\n\nexport default Ember.Component.extend({\n didInsertElement: function() {\n // show the dialog\n this.$('.modal').modal('show');\n\n // send the according acti...
javascript
chosen
[ { "from": "system", "value": "Change mocha tests discord channel name to test\n" }, { "from": "human", "value": "//\n// Copyright (c) 2016-2017 DrSmugleaf\n//\n\n\"use strict\"\nrequire(\"dotenv\").config({ path: __dirname + \"/../.env\" })\nconst constants = require(\"../libs/util/constants\")\...
javascript
chosen
[ { "from": "system", "value": "Check localhost domain to set env notification\n" }, { "from": "human", "value": "function isDevOrSandpit () {\n var hostname = window.location.hostname;\n var env = {};\n\n if(hostname.indexOf('develop') > -1) {\n env.name = 'develop'\n }\n\n ...
javascript
chosen
[ { "from": "system", "value": "Increase garbage collection throttling delay.\n\nMay help with this problem, which seems to stem from too much GC:\nhttps://github.com/meteor/meteor/pull/8728#issuecomment-337636773\n\nIf this isn't enough, we could include this commit in 1.6.1:\nhttps://github.com/meteor/meteo...
javascript
chosen
[ { "from": "system", "value": "Update reshapeNewsData to use allNewsSelector and pass state to it\n" }, { "from": "human", "value": "/* NewsFeedContainer.js\n * Container for our NewsFeed as a view \n * Dependencies: ActionTypes\n * Modules: NewsActions, and NewsFeed\n * Author: Tiffany Tse\n * C...
javascript
chosen
[ { "from": "system", "value": "Expand timestamp json for db indicies\n" }, { "from": "human", "value": "/*jshint node:true */\n\"use strict\";\n\nvar request = require('request');\n\nvar reddit = {\n top: function (subreddit, callback) {\n var url = \"http://www.reddit.com/r/\" + subreddit + ...
javascript
chosen
[ { "from": "system", "value": "Initialize Foundation after every route transition\n" }, { "from": "human", "value": "App = Ember.Application.create();\n\n// Add routes here\nApp.Router.map(function() {\n \n // Atoms (Components)\n this.resource('atoms', function() {\n\n // Sub-routes here\n...
javascript
chosen
[ { "from": "system", "value": "Add comments for ctrlPanelService and its role\n" }, { "from": "human", "value": "angular.module('myApp')\n.factory('ctrlPanelService', ['$rootScope', 'userService', 'locationService','transactionService',\nfunction($rootScope, $userService, locationService, transac...
javascript
chosen
[ { "from": "system", "value": "Add metalsmith config to gulp config\n" }, { "from": "human", "value": "module.exports = {\n // Autoprefixer\n autoprefixer: {\n // https://github.com/postcss/autoprefixer#browsers\n browsers: [\n 'Explorer >= 10',\n 'ExplorerMobile >= 10',\n ...
javascript
chosen
[ { "from": "system", "value": "Mark as answered to disable all matrix input types\n" }, { "from": "human", "value": "$(document).ready(function() {\n $(document).on('change', '.question-answered-box', function(){\n the_id = $(this).data('the-id')\n text_answer_field = $(this).closest('.tex...
javascript
chosen
[ { "from": "system", "value": "Fix no hash case in history handler\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2010 Kevin Decker (http://www.incaseofstairs.com/)\n * See LICENSE for license information\n */\nvar HistoryHandler = (function() {\n\tvar currentHash, callbackFn;\n\n\tfunct...
javascript
chosen
[ { "from": "system", "value": "Add scroll area to test application\n" }, { "from": "human", "value": "/* ************************************************************************\n\n widgets\n\n Copyright:\n 2009 Deutsche Telekom AG, Germany, http://telekom.com\n\n ***************************...
javascript
chosen
[ { "from": "system", "value": "Update factory blueprint to pass JSHint\n\nJSHint complains about unused {faker} import in default factory." }, { "from": "human", "value": "import Mirage, {faker} from 'ember-cli-mirage';\n\nexport default Mirage.Factory.extend({\n});\n" }, { "from": "gpt",...
javascript
chosen
[ { "from": "system", "value": "Remove default message from webpack\n" }, { "from": "human", "value": "/* eslint no-console:0 */\n// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in...
javascript
chosen
[ { "from": "system", "value": "Refactor HttpCacheView to be defined inside an anonymous namespace. \n\nBUG=90857\nReview URL: http://codereview.chromium.org/7544008\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@94868 0039d316-1c4b-4281-b951-d872f2087c98\n" }, { "from": "human", "value":...
javascript
chosen
[ { "from": "system", "value": "Improve generate method for uniq locations\n" }, { "from": "human", "value": "'use strict';\n\nconst common = require('./../server/common');\n\nexport class DungeonBluePrints {\n constructor (number, worldSize, locationSize) {\n this.number = number;\n this.w...
javascript
chosen
[ { "from": "system", "value": ":hammer: Fix for a source-map warning\n" }, { "from": "human", "value": "const path = require('path');\n\nmodule.exports = {\n entry: \"./src/index.tsx\",\n\n output: {\n filename: \"bundle.js\",\n path: path.resolve(__dirname, \"public/\")\n ...
javascript
chosen
[ { "from": "system", "value": "Add handler for Judging button\n" }, { "from": "human", "value": "window.onload = function() {\n\n var tabs = function() {\n var args = models.application.arguments;\n var current = $(\"#\"+args[0]);\n var sections = $(\".section\");\n ...
javascript
chosen
[ { "from": "system", "value": "refactor(make-dir): Update test to move test double replacement to before block\n" }, { "from": "human", "value": "'use strict';\n\nconst td = require('testdouble');\n\nconst MakeDir = require('../../../src/utils/make-dir');\n\nconst fs =...
javascript
chosen
[ { "from": "system", "value": "Fix inline-view-configs test on Windows.\n\nSummary:\n*facepalm* The file path is platform specific.\n\nChangelog: [Internal]\n\nReviewed By: GijsWeterings\n\nDifferential Revision: D20793023\n\nfbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04\n" }, { "from"...
javascript
chosen
[ { "from": "system", "value": "Resolve directories in the app folder\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar path = require('path');\n\nmodule.exports = {\n context: __dirname + '/app',\n entry: './index.js',\n\n output: {\n path: __dirname + '/bin',\n p...
javascript
chosen
[ { "from": "system", "value": "Use PORT env for dev server\n" }, { "from": "human", "value": "const path = require('path');\n\nmodule.exports = {\n devtool: 'inline-source-map',\n entry: './src/index.js',\n module: {\n rules: [\n {\n test: /\\.(js|vue)$/,\n loader: 'eslin...
javascript
chosen
[ { "from": "system", "value": "Add hashing in build HMTL\n" }, { "from": "human", "value": "const path = require('path');\nconst webpack = require('webpack');\nconst CleanWebpackPlugin = require('clean-webpack-plugin');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\n\nconst project =...
javascript
chosen
[ { "from": "system", "value": "Fix prod'n webpack conf for linked deps\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar BundleTracker = require('webpack-bundle-tracker');\nvar path = require(\"path\");\n\nmodule.exports = {\n context: __dirname,\n \n entry: [\n ...
javascript
chosen
[ { "from": "system", "value": "Use quotes for scope properties\n" }, { "from": "human", "value": "goog.provide('app_scaleline_directive');\n\ngoog.require('app');\ngoog.require('ngeo_control_directive');\ngoog.require('ol.control.ScaleLine');\n\n(function() {\n var module = angular.module('app')...
javascript
chosen
[ { "from": "system", "value": "Add a \"Try Blue Ocean UI\" button in classic Jenkins - fix lint errors\n" }, { "from": "human", "value": "var $ = require('jquery-detached').getJQuery();\nvar jsModules = require('@jenkins-cd/js-modules');\n\n$(document).ready(function () {\n var tryBlueOcean = ...
javascript
chosen
[ { "from": "system", "value": "Delete Loki database and persistent storage on logout.\n" }, { "from": "human", "value": "/**\n * Copyright 2015, Government of Canada.\n * All rights reserved.\n *\n * This source code is licensed under the MIT license.\n *\n * @providesModule User\n */\n\nvar Cook...
javascript
chosen
[ { "from": "system", "value": "Index.js: Move blogController to run only if blog section is loaded\n" }, { "from": "human", "value": "window.onload = function() {\n sectionShow();\n blogController();\n};\n\nfunction sectionShow() {\n var sectionControls = {'home_btn': 'home', 'about_btn': 'abo...
javascript
chosen
[ { "from": "system", "value": "Fix formating in the device-code sample\n" }, { "from": "human", "value": "/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nvar msal = require('@azure/msal-node');\n\nconst msalConfig = {\n auth: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add ability to specify a function instead of a string for dynamic configs\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-cli-docker-config',\n\n contentFor: function(type, config) {\n if (type === ...
javascript
chosen
[ { "from": "system", "value": "Add dirname RegExps to REPL context\n" }, { "from": "human", "value": "'use strict';\n\nvar NS = {};\n\n\n// MODULES //\n\nvar getKeys = require( 'object-keys' ).shim();\nNS.RE_EOL = require( '@stdlib/regexp/eol' );\nNS.RE_EXTNAME = require( '@stdlib/regexp/extname'...
javascript
chosen
[ { "from": "system", "value": "Disable getAllUsers from the client\n\nWe can lazy-load members instead.\n" }, { "from": "human", "value": "const Eris = require(\"eris\");\nconst config = require(\"./cfg\");\n\nconst bot = new Eris.Client(config.token, {\n getAllUsers: true,\n restMode: true,\n}...
javascript
chosen
[ { "from": "system", "value": "Set the background colour based on exit status.\n" }, { "from": "human", "value": "(function($) {\n $(document).ready(function() {\n\n $('#template-entry-hidden').load(\"entry.template.html\");\n\n $('#btn-load-project').click(function(){\n var project =...
javascript
chosen
[ { "from": "system", "value": "Add zero class to new AmountEntry cell\n" }, { "from": "human", "value": "/**\n * Cell used for showing an AmountEntry\n *\n * Copyright 2015 Ethan Smith\n */\n\nvar Marionette = require('backbone.marionette');\n\nvar AmountEntryCell = Marionette.ItemView.extend({\n...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Make ripple_address address column not required. Add timestamps.\n" }, { "from": "human", "value": "var dbm = require('db-migrate');\nvar type = dbm.dataType;\n\nexports.up = function(db, callback) {\n db.createTable('ripple_addresses', {\n id: { type:...
javascript
chosen
[ { "from": "system", "value": "Rename prediction label to future\n" }, { "from": "human", "value": "const renderWay = require('./renderWay');\nconst predict = require('./predict');\n\nmodule.exports = (model, dispatch) => {\n const prediction = predict(model);\n return renderWay(prediction, {\n...
javascript
chosen
[ { "from": "system", "value": "Update chrome plugin for concourse 2.1.0\n\nIt was mostly working, but just left a dark bar across the top with the\nenv name in it. This updates it to remove that bar as well to maintain\nconsistency with the existing appearence.\n" }, { "from": "human", "value": "...
javascript
chosen
[ { "from": "system", "value": "Update currentUser module test cases\n" }, { "from": "human", "value": "describe('current-user module', function() {\n\n var currentUser;\n beforeEach(module('current-user'));\n\n beforeEach(inject(function(_currentUser_) {\n currentUser = _currentUser_;\n })...
javascript
chosen
[ { "from": "system", "value": "Update Spinner to use es6 class.\n" }, { "from": "human", "value": "/*\nThis file is part of the Juju GUI, which lets users view and manage Juju\nenvironments within a graphical interface (https://launchpad.net/juju-gui).\nCopyright (C) 2015 Canonical Ltd.\n\nThis p...
javascript
chosen
[ { "from": "system", "value": "Change add to return the vector itself, for method chaining\n" }, { "from": "human", "value": "/**\n * Creates a new 2 dimensional Vector.\n * \n * @constructor\n * @this {Circle}\n * @param {number} x The x value of the new vector.\n * @param {number} y The y value...
javascript
chosen
[ { "from": "system", "value": "Hide twitter field if value is empty\n" }, { "from": "human", "value": "\n$(\"#hive-intro-menu .hive-list li\").click(function(event) {\n var placeName = $(this).find(\".the-place\").text();\n var twitterHandle = $(this).find(\".the-details .twitter-handle\").text...
javascript
chosen
[ { "from": "system", "value": "Add style to Electron Interface\n" }, { "from": "human", "value": "class ElectronInterface extends SiteInterface {\n constructor() {\n super();\n }\n}" }, { "from": "gpt", "value": "class ElectronInterface extends SiteInterface {\n constr...
javascript
chosen
[ { "from": "system", "value": "Fix using the Grunt files format\n" }, { "from": "human", "value": "'use strict';\n\nvar mocha = require('../lib/mocha');\n\n\nmodule.exports = function (grunt) {\n grunt.registerMultiTask('mochacli', 'Run Mocha server-side tests.', function () {\n var opt...
javascript
chosen
[ { "from": "system", "value": "Fix invalid test and disable it due to V8 bug\n" }, { "from": "human", "value": "class ElementHolder {\n element;\n\n getElement() { return this.element; }\n\n makeFilterCapturedThis() {\n var capturedThis = this;\n return function (x) {\n return x == ...
javascript
chosen
[ { "from": "system", "value": "internal-test-helpers: Convert `RunLoopAssert` to ES6 class\n" }, { "from": "human", "value": "import { cancelTimers, end, getCurrentRunLoop, hasScheduledTimers } from '@ember/runloop';\n\nfunction RunLoopAssertion(env) {\n this.env = env;\n}\n\nRunLoopAssertion.pr...
javascript
chosen
[ { "from": "system", "value": "Create Tests Dynamically When Needed\n" }, { "from": "human", "value": "// TODO docs, see data/breakpoint.js\ndefine(function(require, exports, module) {\n \n var Data = require(\"./data\");\n \n function File(options) {\n this.data = options || {...
javascript
chosen
[ { "from": "system", "value": "Add sizeClassNames Given Props & Offset Tests\n" }, { "from": "human", "value": "/* global describe, it, beforeEach */\n\nimport React from 'react'\nimport { expect } from 'chai'\nimport { sizeClassNames } from '../src/js/util'\n\ndescribe('Util', () => {\n describ...
javascript
chosen
[ { "from": "system", "value": "Use object attributes; adjust appearance\n" }, { "from": "human", "value": "Template.homeResidentActivityLevelTrend.rendered = function () {\n // Get reference to template instance\n var instance = this;\n\n instance.autorun(function () {\n // Get reference to...
javascript
chosen
[ { "from": "system", "value": "Use single hot observable as timed event stream." }, { "from": "human", "value": "(function(){\n // todo: remove depsu to elementBottomIsAlmostVisible\n var nextPage = function(elem) {\n var e = ($.isFunction(elem)) ? elem() : elem\n return Rx.Observable.int...
javascript
chosen
[ { "from": "system", "value": "Disable viewport calculation in case of server side render\n" }, { "from": "human", "value": "import React from 'react';\nimport Helmet from 'react-helmet';\nimport styles from './styles';\n\nfunction calculateViewportFromWindow() {\n if (window.innerWidth >= 544) ...
javascript
chosen
[ { "from": "system", "value": "Add conditions to remove duplicates.\n" }, { "from": "human", "value": "const SET_PHOTOS = 'SET_PHOTOS'\n\nconst initialState = {\n photos: [],\n photosDetail: []\n}\n\nconst photos = (state = initialState, action = {}) => {\n \n switch (action.type) {\n case...
javascript
chosen
[ { "from": "system", "value": "Use console.error and console.log instead of alert\n" }, { "from": "human", "value": "if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register('./service-worker.js', {scope: './'})\n .catch(function(error) {\n alert('Error registering service ...
javascript
chosen
[ { "from": "system", "value": "[SocketServer.js] Add createTask on and emit event with mock data\n" }, { "from": "human", "value": "const socketio = require('socket.io')\nconst data = require('../data/tasks')\nlet counter = 0\nexports.listen = function (server) {\n io = socketio.listen(server)\n...
javascript
chosen