conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Clean up Test Code in Popup JS\n" }, { "from": "human", "value": "$(document).ready(function(){\n var pairing_duration_ms;\n console.log(\"Loading...\")\n $('button.duration-button').on('click', function(event){\n event.preventDefault();\n console.log($('in...
javascript
chosen
[ { "from": "system", "value": "Use new PROJECTIONCHANGE event properties\n" }, { "from": "human", "value": "TC.control = TC.control || {};\n\nif (!TC.Control) {\n TC.syncLoadJS(TC.apiLocation + 'TC/Control');\n}\n\nTC.control.NavBarHome = function () {\n TC.Control.apply(this, arguments);\...
javascript
chosen
[ { "from": "system", "value": "Allow at least 5 descriptors if detection goes wrong\n" }, { "from": "human", "value": "'use strict';\n\nvar toUint = require('es5-ext/lib/Number/to-uint')\n\n , count = 0, limit = Infinity, callbacks = [];\n\nexports.open = function () {\n\t++count;\n};\nexports.c...
javascript
chosen
[ { "from": "system", "value": "Fix version check for extension version.\n" }, { "from": "human", "value": "/**\n * Migrates the database from one version to another.\n */\nfunction migrateStorage() {\n\tvar extensionVersion = getExtensionVersion().major;\n\n\tgetStorageVersion(function(storageVer...
javascript
chosen
[ { "from": "system", "value": "Improve test coverage of interpolateProperties\n\nRemove the branch that is never used, and is never exposed to public API\n" }, { "from": "human", "value": "\"use strict\";\n\nvar interpolate = require(\"./interpolate\");\nvar format = require(\"./format\");\nvar r...
javascript
chosen
[ { "from": "system", "value": "Stop AJAX updates queuing requests\n\nThe `updateContent` module updates a section of the page based on an\nAJAX request.\n\nThe current implementation will poll every `x` seconds. If the server\ntakes a long time to respond, this results in a the browser queuing up\nrequests. ...
javascript
chosen
[ { "from": "system", "value": "Change for L.Class and add zombie function\n" }, { "from": "human", "value": "var TC = require('tangram.cartodb');\nvar LeafletLayerView = require('./leaflet-layer-view');\nvar L = require('leaflet');\n\nvar LeafletCartoDBVectorLayerGroupView = L.Layer.extend({\n i...
javascript
chosen
[ { "from": "system", "value": "Load post id from route params, and create editor with it.\n" }, { "from": "human", "value": "'use strict';\n\n/* global CartUtility */\nmodule.exports = function($scope, $location, $anchorScroll, $dataService, $editorService) {\n CartUtility.log('CartBlogNewCtrl...
javascript
chosen
[ { "from": "system", "value": "Handle avatar if image is missing.\n" }, { "from": "human", "value": "var imgs = document.querySelectorAll('img.avatar');\n\nif (imgs) {\n imgs.forEach(function(e) {\n e.addEventListener('error', defaultAvatar(e));\n });\n}\n\nfunction defaultAvatar(e) {\n e.o...
javascript
chosen
[ { "from": "system", "value": "Add default grid system prompt" }, { "from": "human", "value": "'use strict';\n\nfunction notEmpty(src) {\n return !!src;\n}\n\nmodule.exports = [{\n type: 'input',\n name: 'name',\n message: 'Project Name',\n validate: notEmpty\n}, {\n type:...
javascript
chosen
[ { "from": "system", "value": "Fix group by style issue\n\nhttps://github.com/rancher/rancher/issues/13018\n" }, { "from": "human", "value": "import Component from '@ember/component';\nimport { inject as service } from '@ember/service';\nimport { computed, get, set } from '@ember/object';\nimport...
javascript
chosen
[ { "from": "system", "value": "Add jymCount and yafCount helpers; cleanup\n" }, { "from": "human", "value": "Template.dashboardCounts.created = function () {\n this.subscribe(\"linensCount\");\n};\n\nTemplate.dashboardCounts.helpers({\n 'linensCount': function () {\n // Return the li...
javascript
chosen
[ { "from": "system", "value": "Fix code style and change repo_id as unique field.\n" }, { "from": "human", "value": "'use strict';\nmodule.exports = {\n up: function(queryInterface, Sequelize) {\n return queryInterface.createTable('bookmarks', {\n id: {\n allowNull: false,\n ...
javascript
chosen
[ { "from": "system", "value": "Fix interrupt on OS X\n\n - system id 'darwin' contains the phrase 'win' too\n - check for 'win32' instead\n" }, { "from": "human", "value": "module.exports = function (message, callback) {\n var interrupted = false;\n var signal = process.platform.indexOf('win') ...
javascript
chosen
[ { "from": "system", "value": "Update server.js in hapi generator for the hapi-util\n" }, { "from": "human", "value": "'use strict';\n\nvar Hapi = require('hapi'),\n\t\tconfig = require('./config'),\n\t\tindexRoutes = require('./src/api/index/indexRoutes');\n\nvar options = {\n\tcors: true,\n\tca...
javascript
chosen
[ { "from": "system", "value": "Add @override annotation to Object.toString.\n\nPiperOrigin-RevId: 122313006\n" }, { "from": "human", "value": "\n/**\n * @return {string}\n * @public\n */\nObject.prototype.toString = function() {\n return window.String(this.$javaToString());\n};\n" }, { "...
javascript
chosen
[ { "from": "human", "value": "Set up board and pseudocode logic\n" }, { "from": "gpt", "value": "var board = [\n [],\n [],\n [],\n [],\n [],\n [],\n []\n]\n\n// Click on column\n//jquery will know that you clicked on a specific column\n//CSS will provide links for the specific columns\n//(...
javascript
chosen
[ { "from": "system", "value": "[Fix] Fix syntax error in AJAX interface detection.\n" }, { "from": "human", "value": "define(function () {\n\t'use strict';\n\t\n\tfunction getRequest(data) {\n\t\tvar xhr = new ('onload' in new XMLHttpRequest()) XMLHttpRequest : XDomainRequest,\n\t\t\tbaseUrl = '...
javascript
chosen
[ { "from": "system", "value": "Add note about block validation.\n" }, { "from": "human", "value": "var JPAudioPlayerBlock = {\n\tvalidate:function(){\n\t\tvar failed=0;\n\t\tif ($(\"#audioBlock-singleAudio input[name=fID]\").val() <= 0) {\n\t\t\talert(ccm_t('choose-file'));\n\t\t\tfailed = 1;\n\t...
javascript
chosen
[ { "from": "system", "value": "Fix feathersErrors.errors === undefined error\n\nThe errors reside on the feathersErrors object itself. No need to address the property errors here." }, { "from": "human", "value": "\nconst feathersErrors = require('@feathersjs/errors');\n\nconst errors = feathersEr...
javascript
chosen
[ { "from": "system", "value": "Change StoreWatchMixin to watch in componentDidMount\n\nSee #88\n" }, { "from": "human", "value": "var _each = require(\"lodash-node/modern/collections/forEach\");\n\nvar StoreWatchMixin = function() {\n var storeNames = Array.prototype.slice.call(arguments);\n re...
javascript
chosen
[ { "from": "system", "value": "Enable listing task to modules\n" }, { "from": "human", "value": "var inherits = require('util').inherits,\n Task = require('./Task'),\n gulp = require('gulp'),\n _ = require('lodash');\n\nvar ListingTask = function (buildHelper) {\n Task.call(this, buil...
javascript
chosen
[ { "from": "system", "value": "Make sure we require meteor/underscore as well\n" }, { "from": "human", "value": "Package.describe({\n\tname:\"lepozepo:cloudinary\",\n\tsummary: \"Upload files to Cloudinary\",\n\tversion:\"4.2.0\",\n\tgit:\"https://github.com/Lepozepo/cloudinary\"\n});\n\nNpm.depe...
javascript
chosen
[ { "from": "system", "value": "Add support for Meteor 1.2\n" }, { "from": "human", "value": "// package metadata file for Meteor.js\n\n/* jshint strict:false */\n/* global Package:true */\n\nPackage.describe({\n name: 'twbs:bootstrap', // http://atmospherejs.com/twbs/bootstrap\n summary: 'The ...
javascript
chosen
[ { "from": "system", "value": "Add example documentation (not yet working)\n" }, { "from": "human", "value": "'use strict';\nangular.module('arethusa.core').directive('keyCapture', [\n 'keyCapture',\n function (keyCapture) {\n return {\n restrict: 'A',\n link: function (scope, elem...
javascript
chosen
[ { "from": "system", "value": "Correct search onclick event delegation by using currentTarget\n" }, { "from": "human", "value": "const searchEntitySelector = '.js-search-entity'\n\nconst SearchAnalytics = {\n init() {\n this.pageNumber =\n new URLSearchParams(window.location.search).get(...
javascript
chosen
[ { "from": "system", "value": "Edit flash message for logout\n" }, { "from": "human", "value": "angular.module('private.logout', [\n])\n.config(function ($stateProvider) {\n $stateProvider\n .state('wegas.private.logout', {\n url: 'logout',\n \tviews: {\n \t\t \t'wo...
javascript
chosen
[ { "from": "system", "value": "Update example for revised <ListRow>\n" }, { "from": "human", "value": "import React from 'react';\n\nimport List from 'src/List';\nimport ListRow from 'src/ListRow';\n\nimport Button from 'src/Button';\nimport TextLabel from 'src/TextLabel';\n\nimport DebugBox from...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary check for loading file\n" }, { "from": "human", "value": "(function(app) {\n 'use strict';\n\n var dom = app.dom || require('../dom.js');\n var Button = app.Button || require('./button.js');\n\n var LoadButton = Button.inherits(function(props)...
javascript
chosen
[ { "from": "system", "value": "Fix onChange propType in Switch component\n" }, { "from": "human", "value": "import React from 'react';\n\nimport { Strings } from '../../constants';\n\n\nexport default React.createClass({\n\n propTypes: {\n field : React.PropTypes.string,\n onClick ...
javascript
chosen
[ { "from": "system", "value": "Fix crash in data reading\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar datafiles = require('./datafiles');\n\nmodule.exports = {\n dataFileVariables: function (config, path) {\n let dataVars = {};\n let scopes = _.filter(config.data_file...
javascript
chosen
[ { "from": "system", "value": "Use a config file for the FlightAware keys.\n" }, { "from": "human", "value": "var express = require('express');\nvar path = require('path');\nvar FlightAware = require('flightaware.js');\n\n// Get access to the FlightAware 2.0 client API ...\n// See http://flightaw...
javascript
chosen
[ { "from": "system", "value": "Add strftime library for date formatting\n" }, { "from": "human", "value": "var express = require('express');\n\nvar app = express();\n\nvar port = process.env.PORT || 8080\n\napp.get('/', function (req, res) {\n \n \n \n \n res.send('Hello World!');\n});\n\nap...
javascript
chosen
[ { "from": "system", "value": "Remove dead code and polyfill for containsElement.\n" }, { "from": "human", "value": "/* global Node */\n\nimport _default from \"ember-views/views/states/default\";\nimport { create } from \"ember-metal/platform\";\nimport merge from \"ember-metal/merge\";\nimport ...
javascript
chosen
[ { "from": "system", "value": "Read query prarms for lat, long and date.\n" }, { "from": "human", "value": "var express = require('express');\nvar xml = require('xml');\nvar app = express();\nvar suncalc = require('suncalc');\nvar mongoose = require('mongoose');\n\nmongoose.connect('mongodb://loc...
javascript
chosen
[ { "from": "system", "value": "Support multiple tags in embed code.\n\nCloses #21\n" }, { "from": "human", "value": "export default function createEagerSchema({embedCode, properties}) {\n embedCode = JSON.stringify(embedCode)\n\n const initializeApp = function initializeApp(embedCodeInjection) ...
javascript
chosen
[ { "from": "system", "value": "Use just `false` instead of `function() { return false; }` if the test already failed." }, { "from": "human", "value": "// code.google.com/speed/webp/\n// by rich bradshaw, ryan seddon, and paul irish\n\n\n// This test is ascynchronous. Watch out.\n\n(function(){\n\...
javascript
chosen
[ { "from": "system", "value": "Change basic example to show querystring and hash\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport { connect } from 'react-redux'\n\nconst HelloChild = ({ path }) => (\n <div>\n Hello-Child at path {path}\n </div>\n)\n\nHelloC...
javascript
chosen
[ { "from": "system", "value": "Break out of callback hell.\n" }, { "from": "human", "value": "var session = require(\"zed/session\");\nvar config = require(\"zed/config\");\n\nmodule.exports = function(options, callback) {\n config.getPreference(\"trimEmptyLines\", function getPrefs(err, trimE...
javascript
chosen
[ { "from": "system", "value": "Add options support to credentials.\n" }, { "from": "human", "value": "function PluggableCredentialStore() {\n this._stores = [];\n}\n\nPluggableCredentialStore.prototype.use = function(store) {\n this._stores.push(store);\n}\n\nPluggableCredentialStore.prototype....
javascript
chosen
[ { "from": "system", "value": "Use name 'default color' for \"global\" color setting\n" }, { "from": "human", "value": "import VisualizationComponent from '../core/VisualizationComponent';\nimport vcharts from '../external/vcharts/src';\n\nexport default class Scatter extends VisualizationCompone...
javascript
chosen
[ { "from": "system", "value": "Fix asset require for default module\n" }, { "from": "human", "value": "//= require /angular/angular\n//= require /angular/angular-resource\n//= require /app.config\n//= require_self\n//= require_tree services\n//= require_tree controllers\n//= require_tree directiv...
javascript
chosen
[ { "from": "system", "value": "Allow core jquery-git to be used for unit tests.\n" }, { "from": "human", "value": "(function() {\n\t// Insert a script tag pointing at the desired version of jQuery\n\n\t// Get the version from the url\n\tvar jqueryRE = /[\\\\?&]jquery=([^&#]*)/,\n\t\tresults = jqu...
javascript
chosen
[ { "from": "system", "value": "Revert \"default to unversioned vendored jquery.js for ci\"\n\nThis reverts commit 4b5a84880f8317549140b5cfba96d61c14eba5d2.\n" }, { "from": "human", "value": "(function() {\n\t// Insert a script tag pointing at the desired version of jQuery\n\n\t// Get the version ...
javascript
chosen
[ { "from": "system", "value": "Add chapter 5, exercise 3\n" }, { "from": "human", "value": "function every1(array, test) {\n for (let elem of array) {\n if (!test(elem)) return false;\n }\n return true;\n}\n\nfunction every2(array, test) {\n return !array.some(elem => !test(ele...
javascript
chosen
[ { "from": "system", "value": "Add `-rc.n` suffix to `email` before republishing.\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Send email messages\",\n version: \"1.2.0\"\n});\n\nNpm.depends({\n mailcomposer: \"4.0.1\",\n // Using smtp-connection@2 (instead of latest) be...
javascript
chosen
[ { "from": "system", "value": "fix: Change default Layman cookie name so the auth doesn't interfere with other apps\n" }, { "from": "human", "value": "require('dotenv').config();\n\nconst session = require('express-session');\nconst connectSQLite3 = require('connect-sqlite3');\n\nexports.createEx...
javascript
chosen
[ { "from": "system", "value": "Add matched callback command example\n" }, { "from": "human", "value": "import React, { useState } from 'react'\nimport Dictaphone from './Dictaphone'\n\nconst DictaphoneWidgetA = () => {\n const [message, setMessage] = useState('')\n const commands = [\n {\n ...
javascript
chosen
[ { "from": "system", "value": "Add optional importUrl to Shapefile signature" }, { "from": "human", "value": "L.Shapefile =L.GeoJSON.extend({\n initialize: function (file, options) {\n if(typeof cw !== 'undefined'){\n this.worker = cw(function(data,cb){\n impor...
javascript
chosen
[ { "from": "system", "value": "Support generating random values in web worker without window\n" }, { "from": "human", "value": "const getRandomValues = (buf) => {\n if (typeof process !== 'undefined') {\n const nodeCrypto = require('crypto');\n const bytes = nodeCrypto.randomBytes(buf.leng...
javascript
chosen
[ { "from": "system", "value": "Build js file for v1.0.0-rc\n" }, { "from": "human", "value": "// Generated by CoffeeScript 1.3.3\n\n/*\n jquery.turbolinks.js ~ v0.2.1 ~ https://github.com/kossnocorp/jquery.turbolinks\n\n jQuery plugin for drop-in fix binded events problem caused by Turbolinks\n...
javascript
chosen
[ { "from": "system", "value": "Remove hash & path on dev webpack css module names\n\nThis will make bok-choy testing easier.\n" }, { "from": "human", "value": "/* eslint-env node */\n\n'use strict';\n\nvar Merge = require('webpack-merge');\nvar path = require('path');\nvar webpack = require('webp...
javascript
chosen
[ { "from": "system", "value": "Fix JS error chrome is undefined\n" }, { "from": "human", "value": "if (document.cookie.indexOf(\"_ptt=\") < 0 ) {\n\n chrome.tabs.getCurrent(function(tab) {\n if (tab) {\n return;\n }\n // Move authorization process to new tab!\n chrome.tabs.creat...
javascript
chosen
[ { "from": "system", "value": "Add email field to User model\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\nvar bcrypt = require('bcrypt');\n\nvar SALT_WORK_FACTOR = 10;\n\nvar UserSchema = new Schema({\n \"username\": { type: String, uniqu...
javascript
chosen
[ { "from": "system", "value": "Remove p surrounding form to avoid error\n" }, { "from": "human", "value": "import React from 'react';\nimport './QuickStart.scss';\n\nconst QuickStart = () => (\n <div className=\"quick-start\">\n <h1>Documentation</h1>\n <p className=\"quick-start-hint\">Ne...
javascript
chosen
[ { "from": "system", "value": "Add fallback to no-icon so icons will show issues\n\n" }, { "from": "human", "value": "import Ractive from \"ractive\";\nimport \"../../static/fontawesome/js/fontawesome.js\";\nimport \"../../static/fontawesome/js/packs/brands.js\";\nimport \"../../static/fontawesom...
javascript
chosen
[ { "from": "system", "value": "Remove weird bug where clicking certain parts of pages wouldn't cause them to flip\n" }, { "from": "human", "value": "$(function() {\n var $pages = $('.page'),\n currPage = 0;\n\n function setZIndex(currPage) {\n $pages.each(function(index) {\n ...
javascript
chosen
[ { "from": "system", "value": "Change of the mongo db name.\n" }, { "from": "human", "value": "// The main application script\n \nvar express = require('express');\nvar mongoose = require('mongoose');\nvar app = express();\n \n// connect to Mongo when the app initializes\nmongoose.connect('mongod...
javascript
chosen
[ { "from": "system", "value": "Change environnement variable (MONGO -> MONGO_MIXIT\n" }, { "from": "human", "value": "var express = require('express');\nvar http = require('http');\nvar methodOverride = require('method-override');\nvar bodyParser = require('body-parser');\nvar staticFavicon = req...
javascript
chosen
[ { "from": "system", "value": "Fix route change tracking; route not rendered yet" }, { "from": "human", "value": "\nexports.loadContext = function(callback) {\n var context = require.context('./pages', true);\n if (module.hot) {\n module.hot.accept(context.id, function() {\n context = r...
javascript
chosen
[ { "from": "system", "value": "Fix call to hodor library\n" }, { "from": "human", "value": "const app = require('express')();\n\nconst hodor = require('hodor');\nconst argv = require('yargs').argv;\n\nconst port = argv.p || 8080;\n\n// Hodor all the things\napp.all('*', (req, res) => res.json({ h...
javascript
chosen
[ { "from": "system", "value": "Remove dev mode, that should really be configured by the configuration\n" }, { "from": "human", "value": "'use strict';\nlet irc = require( 'irc' );\nlet plugins = require( './plugins' );\n\nconst config = {\n channels: [ '#kokarn' ],\n plugins: [ 'Telegram', ...
javascript
chosen
[ { "from": "system", "value": "Fix error when output closes before end (e.g., head -n 1)\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar fs = require('fs')\nvar path = require('path')\nvar minimist = require('minimist')\nvar fasta = require('./')\n\nvar argv = minimist(process.argv.sl...
javascript
chosen
[ { "from": "system", "value": "Add return unique elements array function\n" }, { "from": "human", "value": "// Program to remove duplicates of array and return array of only unique elements\n\nfunction uniqueElements(arr) {\n\tvar hashmap = {};\n\tvar unique = [];\n\n}" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Update look and view of direction triangle\n" }, { "from": "human", "value": "import {Graphics, Point} from 'pixi.js';\nimport {toCanvasCoordinates} from './CoordinatesMapper';\nimport {LEFT, RIGHT, UP, DOWN} from './Direction';\n\n\n/**\n * Draws the direction an E...
javascript
chosen
[ { "from": "system", "value": "Test locally in multiple browsers\n" }, { "from": "human", "value": "module.exports = {\n test_page: 'tests/index.html?hidepassed',\n disable_watching: true,\n launch_in_ci: [\n 'Chrome'\n ],\n launch_in_dev: [\n 'Chrome'\n ],\n browser_args: {\n Chr...
javascript
chosen
[ { "from": "system", "value": "Add a basic initial git setup on the new project\n" }, { "from": "human", "value": "'use strict';\nvar yeoman = require('yeoman-generator');\nvar prompts = require('./prompts');\nvar _ = require('lodash');\n\nmodule.exports = yeoman.Base.extend({\n initializing: fu...
javascript
chosen
[ { "from": "system", "value": "Return 'Bad Request' on plain HTTP/RPC when encryption is required.\n" }, { "from": "human", "value": "// Redirect between plain HTTP and encrypted HTTPS by following rules:\n// - If user is logged in - force HTTPS.\n// - If user is visiting \"users.auth.*\" page - ...
javascript
chosen
[ { "from": "system", "value": "Fix for sprite cycles not triggering\n\nTurns out settings/events.js was passing then with \"Sprite\" instead of\n\"Class\" (this was changed a while ago elsewhere).\n\nFixes #33. Just in time for Halloween.\n" }, { "from": "human", "value": "FullScreenPokemon.FullS...
javascript
chosen
[ { "from": "system", "value": "Update http status code when creating a new message\n" }, { "from": "human", "value": "import presenter from '../../presenter/message';\nimport messageRepository from '../../repository/message';\nimport * as message from '../../services/message';\n\n\nexport async f...
javascript
chosen
[ { "from": "system", "value": "Fix an issue where .focus() is scrolling the page, same as in UrlUI\n" }, { "from": "human", "value": "const LoaderView = require('./Loader')\nconst { h, Component } = require('preact')\n\nclass AuthBlock extends Component {\n componentDidMount () {\n this.conne...
javascript
chosen
[ { "from": "system", "value": "Remove placeholder from initial state\n" }, { "from": "human", "value": "export default {\n creatorIsOpen: false,\n title: '',\n description: '',\n placeholder: '',\n creationStatus: {\n failed: false,\n fields: []\n },\n datasets: {\n name: 'dataset...
javascript
chosen
[ { "from": "system", "value": "Fix thunker and logger priority\n" }, { "from": "human", "value": "//jshint -W067\n\n'use strict';\n\nimport * as todosreducers from 'todosreducers';\nimport {default as DevTools} from 'devtools';\n\nvar {\n Immutable,\n Redux\n } = window,\n {\n...
javascript
chosen
[ { "from": "system", "value": "Move logout to the last position\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n angular.module('app.states')\n .run(appRun);\n\n /** @ngInject */\n function appRun(routerHelper, navigationHelper) {\n routerHelper.configureStates(getSt...
javascript
chosen
[ { "from": "system", "value": "Fix exception on api login\n" }, { "from": "human", "value": "\"use strict\";\nconst passport = require('passport');\nconst LocalStrategy = require('passport-local').Strategy;\nconst usr = require('../models/user');\n\n// Passport session set-up\npassport.serializeU...
javascript
chosen
[ { "from": "system", "value": "Handle label if plural or singular\n" }, { "from": "human", "value": "import inflect from 'i';\nimport numeral from 'numeral';\nimport FormattedNumber from '../types/formatted_number';\nimport { GraphQLString } from 'graphql';\n\nconst { pluralize } = inflect();\n\n...
javascript
chosen
[ { "from": "system", "value": "Use login and signup in auth service\n" }, { "from": "human", "value": "import fetch from 'api';\n\nexport default {\n async signIn(email, password) {\n try {\n const body = { email, password };\n const response = await fetch('/login', { method: 'POST'...
javascript
chosen
[ { "from": "system", "value": "Replace default transport for logging, remove file logging\n" }, { "from": "human", "value": "const winston = require('winston');\n\nmodule.exports = ({\n filename,\n level,\n transports: transports = [{ type: 'Console', options: { level: 'debug' } }],\n}) => {\n...
javascript
chosen
[ { "from": "system", "value": "Switch x axis to minute\n" }, { "from": "human", "value": "import React from 'react';\nimport { Line } from 'react-chartjs-2';\n\nexport default function Day({ days }) {\n const items = days.day || [];\n\n if (days.loading) {\n return (\n <p>Loading...</p>...
javascript
chosen
[ { "from": "system", "value": "Fix bug with levels being equal on same tile\n" }, { "from": "human", "value": "import CreaturesJSON from \"../db/Creatures.json\";\n\nconst creatures = new Map(Object.entries(CreaturesJSON));\n\nclass Creature {\n constructor(level, creature) {\n this.name = cr...
javascript
chosen
[ { "from": "system", "value": "Use different arity in benchmark to avoid deopt\n" }, { "from": "human", "value": "/**\n * Fork Performance Benchmark\n * Measures the cost of forking a repo. This is a good indicator of\n * start up time for complicated trees.\n */\n\n'use strict'\n\nconst { Microc...
javascript
chosen
[ { "from": "system", "value": "Send user email if logged in\n" }, { "from": "human", "value": "module.exports = {\n\n index: function(req, res, next){\n res.render('index');\n }\n\n};\n" }, { "from": "gpt", "value": "module.exports = {\n\n index: function(req, res, next){\n r...
javascript
chosen
[ { "from": "system", "value": "Use jQuery oembed all to render OEmbed content\n" }, { "from": "human", "value": "import Oembed from 'oembed-all';\n\nTemplate.postItem.onRendered(function () {\n // Get reference to template instance\n const instance = this;\n\n // Get Post ID from template inst...
javascript
chosen
[ { "from": "system", "value": "Update electron sample to make it work on electron v5.\n\nnodeIntegration is turned off by default since electron v5.\n" }, { "from": "human", "value": "const electron = require('electron')\n// Module to control application life.\nconst app = electron.app\n// Module...
javascript
chosen
[ { "from": "system", "value": "Comment test on vuejsdialog with vue3\n" }, { "from": "human", "value": "import { createApp, defineAsyncComponent } from 'vue';\n\nimport '@fontsource/kreon';\n\nconst app = createApp({\n mounted: function() {\n document.body.classList.add('cssLoading');\n...
javascript
chosen
[ { "from": "system", "value": "Trim whitespace and remove \\n from item name.\n\nNewlines in item name complicate formatting. Replace them with spaces.\n" }, { "from": "human", "value": "import _request from 'request-promise'\nimport cheerio from 'cheerio'\n\nconst jar = _request.jar()\nconst req...
javascript
chosen
[ { "from": "system", "value": "Fix Feedback modal on Enter\n" }, { "from": "human", "value": "var CoreView = require('backbone/core-view');\nvar ViewFactory = require('builder/components/view-factory');\nvar template = require('./feedback-button.tpl');\nvar TipsyTooltipView = require('builder/com...
javascript
chosen
[ { "from": "system", "value": "Sort the maps country selector items\n\n. #109\n" }, { "from": "human", "value": "/*jshint browser:true, jquery:true */\n/*global Ember, FLOW */\n\n\nFLOW.placemarkControl = Ember.ArrayController.create({\n content: null,\n\n populate: function () {\n this.set(...
javascript
chosen
[ { "from": "system", "value": "feat(formats): Add deprecation warning about moved import\n" }, { "from": "human", "value": "// @flow\nimport React from 'react'\n\ntype FormatProps<V, FormatOptions> = {\n value: V,\n format?: FormatOptions,\n i18n: {\n language: string\n }\n}\n\nfunction\nc...
javascript
chosen
[ { "from": "system", "value": "Reorder the flag checks so version can be shown\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar oust = require('../index');\nvar pkg = require('../package.json');\nvar fs = require('fs');\n\nvar argv = require('minimist')(process.argv.slice(2));\n\nvar...
javascript
chosen
[ { "from": "system", "value": "Secure by proper design! Ha! And IPs!\n" }, { "from": "human", "value": "var mongo = require('mongodb'),\n\tnconf = require('nconf'),\n\tassert = require('assert');\n\nvar Server = mongo.Server,\n\tDb = mongo.Db,\n\tClient = mongo.MongoClient,\n\tObjectId = mongo.Ob...
javascript
chosen
[ { "from": "system", "value": "Allow images to load from myemma.com\n" }, { "from": "human", "value": "BrowserPolicy.content.allowOriginForAll(\"*.googleapis.com\");\nBrowserPolicy.content.allowOriginForAll(\"*.gstatic.com\");\nBrowserPolicy.content.allowOriginForAll(\"*.bootstrapcdn.com\");\n\nB...
javascript
chosen
[ { "from": "system", "value": "Fix cache headers on CSS file.\n" }, { "from": "human", "value": "var prepare = require('prepare-response')\n , autoprefixer = require('autoprefixer-core')()\n , fs = require('fs')\n\nvar cache = new Map()\n , isProd = process.env.NODE_ENV == 'production'\n\nmodu...
javascript
chosen
[ { "from": "system", "value": "Set cross origin tag for html5 embeds\n" }, { "from": "human", "value": "/* global videojs */\nimport React from 'react'\nimport { webcastPropType } from '../../utils/webcastUtils'\n\nexport default class EmbedHtml5 extends React.Component {\n static propTypes = {\...
javascript
chosen
[ { "from": "system", "value": "Delete the databases between tests rather than nuking all entries since that doesn't remove indexes\n" }, { "from": "human", "value": "/*\n * Helper class for cleaning nedb state\n */\n\"use strict\";\nvar Promise = require(\"bluebird\");\nvar promiseutil = require(...
javascript
chosen
[ { "from": "system", "value": "Use a factory function for simple arg-passing actions\n" }, { "from": "human", "value": "var {\n ADD_LESSON,\n ADD_STEP,\n DELETE_LESSON,\n DELETE_STEP,\n IMPORT_LESSONS,\n SELECT_LESSON,\n SELECT_STEP,\n TOGGLE_EDITING,\n UPDATE_LESSON,\n UPDATE_STEP\n} =...
javascript
chosen
[ { "from": "system", "value": "Apply the 'change' handler if provided\n\nAlong with changing the icons, apply any custom handler if proivided\n" }, { "from": "human", "value": "/*\n * Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute\n *\n * Lice...
javascript
chosen
[ { "from": "system", "value": "Modify payload format for kafka message\n" }, { "from": "human", "value": "'use strict'\n\nconst config = require('config')\n\nconst logAPI = module.exports = {}\n\nlogAPI.get = function *() {\n var token\n\n // TODO: Add support for session cookie authentication....
javascript
chosen
[ { "from": "system", "value": "Allow fetchData in development mode\n" }, { "from": "human", "value": "import 'babel/polyfill';\nimport './client/lib/index';\n\nimport $ from 'jquery';\nimport React from 'react';\nimport Router from 'react-router';\nimport app from 'app/client/components/main/app'...
javascript
chosen
[ { "from": "system", "value": "[DDW-596] Improve electron process webpack plugin\n" }, { "from": "human", "value": "const { exec } = require('child_process');\n\nclass ManageElectronProcessPlugin {\n\n apply(compiler) {\n if (compiler.options.watch) {\n let electron = null;\n compil...
javascript
chosen