conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update user POST and GET routes\n" }, { "from": "human", "value": "import {Router} from 'express'\nimport models from '../models';\nimport tasks from './tasks'\n\nexport default () => {\n\tlet app = Router({mergeParams: true})\n\n\tapp.use('/:userId/tasks', tasks())...
javascript
chosen
[ { "from": "system", "value": "Fix race condition in purge test.\n" }, { "from": "human", "value": "require('./harness').run();\n\nvar recvCount = 0;\nvar body = \"hello world\";\n\nconnection.addListener('ready', function () {\n puts(\"connected to \" + connection.serverProperties.product);\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix nav issue when using mean menu\n\nWhen the link only had a dropdown and didnt have a link itself, it wouldnt trigger the dropdown on mobile\n" }, { "from": "human", "value": "/* From w3schools */\n\n/* When the user clicks on the button,\ntoggle between hiding a...
javascript
chosen
[ { "from": "system", "value": "Improve source maps for JS\n" }, { "from": "human", "value": "import path from 'path';\nimport webpack from 'webpack';\nimport CommonsChunkPlugin from 'webpack/lib/optimize/CommonsChunkPlugin';\n\nconst PROD = process.env.NODE_ENV || 0;\n\nmodule.exports = {\n devt...
javascript
chosen
[ { "from": "system", "value": "Change property to be access\n" }, { "from": "human", "value": "import req from 'superagent';\n\nimport {dispatch} from '../dispatcher';\n\nimport {Action} from '../actions';\n\nimport meta from '../meta';\n\nconst DIR_CONFIG='/resource/config/app/moe/somesim',\n\t ...
javascript
chosen
[ { "from": "system", "value": "Use one query per source instead of a single query\n\nThis makes the code much much simpler.\n" }, { "from": "human", "value": "'use strict';\n\nconst format = require('util').format;\nconst log = require('util').log;\n\nconst Promise = require('bluebird');\nconst d...
javascript
chosen
[ { "from": "system", "value": "Add record details after upload\n" }, { "from": "human", "value": "import Ember from 'ember'\nimport Authenticated from 'ember-simple-auth/mixins/authenticated-route-mixin'\n\nconst { get, set } = Ember\n\nexport default Ember.Route.extend(Authenticated, {\n pageTi...
javascript
chosen
[ { "from": "system", "value": "Add Creative Commons Attribution 3.0 license\n\nThis license is used for many presentation recordings. It would be great\nto have the license supported by the application directly and avoid\nconstantly looking for the license link.\n" }, { "from": "human", "value": ...
javascript
chosen
[ { "from": "system", "value": "Fix white blue colors for color picker\n" }, { "from": "human", "value": "export default {\n black_pink: ['#36516e', '#f93b58', 0],\n pink_black: ['#f93b58', '#36516e', 1],\n white_blue: ['#45c0e9', '#efefef', 0],\n blue_white: ['#45c0e9', '#efefef', 1],\n beig...
javascript
chosen
[ { "from": "system", "value": "Add reset rating stars color when reload video.\n" }, { "from": "human", "value": "function getMusic(element) {\n element = $(element);\n var info_send = {\n //method: 'info', // TODO possible method to get the song data: song 'info' or song 'id'\n ...
javascript
chosen
[ { "from": "system", "value": "Use correct listener in CodeMirror callbacks\n" }, { "from": "human", "value": "import { component } from \"d3-component\";\nimport { select, local } from \"d3-selection\";\n\nconst codeMirrorLocal = local();\n\n// User interface component for the code editor.\nexpo...
javascript
chosen
[ { "from": "system", "value": "Debug should output everything pls\n" }, { "from": "human", "value": "\"use strict\";\n\nconst hasDebug = process.argv.indexOf(\"--debug\") > -1;\n\nconst debug = (!hasDebug) ? \n function() {} : \n (message) => console.log(mess...
javascript
chosen
[ { "from": "system", "value": "Debug and add test cases\n" }, { "from": "human", "value": "// Method that performs basic string compression using the counts of repeated characters\n\nfunction compressStr(str) {\n\tvar output = \"\", // will return this variable as final compressed string\n\t\tcur...
javascript
chosen
[ { "from": "system", "value": "Reorder vars according to length\n" }, { "from": "human", "value": "'use strict';\n\nvar pdf = require( './../lib' );\n\nvar x;\nvar mu;\nvar sigma;\nvar v;\nvar i;\n\nfor ( i = 0; i < 10; i++ ) {\n\tx = Math.random() * 10;\n\tmu = Math.random() * 10 - 5;\n\tsigma =...
javascript
chosen
[ { "from": "system", "value": "Refactor carousel image references for better readability\n" }, { "from": "human", "value": "app.controller('HomeController', ['$http', 'AuthFactory', function($http, AuthFactory) {\n console.log('HomeController running');\n var self = this;\n self.userStatus = A...
javascript
chosen
[ { "from": "system", "value": ":new: Add a message key helper; also cleanup unused\n" }, { "from": "human", "value": "'use babel'\n\nimport minimatch from 'minimatch'\n\nexport function showError(e) {\n atom.notifications.addError(`[Linter] ${e.message}`, {\n detail: e.stack,\n dismissable...
javascript
chosen
[ { "from": "system", "value": "Set JS grammar to newly created pane texteditor\n" }, { "from": "human", "value": "'use babel'\n\nimport Html2JsView from './html2js-view'\nimport html2js from './html-2-js'\nimport { CompositeDisposable } from 'atom'\n\nexport default {\n\n html2JsView: null,\n m...
javascript
chosen
[ { "from": "system", "value": "Update post css task to add rem fallbacks properly for IE8\n" }, { "from": "human", "value": "module.exports = {\n\toptions: {\n\t\tmap: true,\n\t\tprocessors: [\n\t\t\trequire(\"pixrem\")(), // add fallbacks for rem units for IE8+\n\t\t\trequire(\"autoprefixer\")({...
javascript
chosen
[ { "from": "system", "value": "Add --tsconfig CLI option to specify a TypeScript config file\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nconst dependencyTree = require('../');\nconst program = require('commander');\n\nprogram\n .version(require('../package.json').v...
javascript
chosen
[ { "from": "system", "value": "Check new peripheral names against regex\n" }, { "from": "human", "value": "import React from 'react';\nimport InlineEdit from 'react-edit-inline';\nimport Ansible from '../../utils/Ansible';\n\nvar NameEdit = React.createClass({\n propTypes: {\n name: React.Pro...
javascript
chosen
[ { "from": "system", "value": "Set Main container to be stateful\n" }, { "from": "human", "value": "import React from 'react';\nimport Map, {GoogleApiWrapper} from 'google-maps-react';\n\nimport { searchNearby } from 'utils/googleApiHelpers';\n\nexport class Container extends React.Component {\n\...
javascript
chosen
[ { "from": "system", "value": "[LIB-386] Add methods to api key's detail endpoint\n" }, { "from": "human", "value": "import stampit from 'stampit';\nimport {Meta, Model} from './base';\n\nconst ApiKeyMeta = Meta({\n name: 'apiKey',\n pluralName: 'apiKeys',\n endpoints: {\n 'detail': {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix an issue with grid post rendering." }, { "from": "human", "value": "import React from 'react'\nimport { parsePost } from '../parsers/PostParser'\n\nclass PostsAsGrid extends React.Component {\n static propTypes = {\n posts: React.PropTypes.object,\n json:...
javascript
chosen
[ { "from": "system", "value": "Reset fellow server js file\n" }, { "from": "human", "value": "'use strict';\nvar users = require('../../app/controllers/users');\n var fellows = require('../../app/controllers/fellows');\n\n\nmodule.exports = function(app) {\n\t// Setting up the bootcamp api\n\tapp...
javascript
chosen
[ { "from": "system", "value": "Tweak comment about field ID\n\nCo-Authored-By: jryans <91e4c98f79b38ce04c052c188926e2d9ae2a3b28@gmail.com>" }, { "from": "human", "value": "/*\nCopyright 2019 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this ...
javascript
chosen
[ { "from": "system", "value": "Improve node socket connection to ping as per what a primus server expects\n" }, { "from": "human", "value": "var WebSocket = require('ws');\nvar reHttpSignalhost = /^http(.*)$/;\nvar reTrailingSlash = /\\/$/;\n\nfunction connect(signalhost) {\n // if we have a htt...
javascript
chosen
[ { "from": "system", "value": "Fix renamer, lcov check was not accessing the proper object\n" }, { "from": "human", "value": "var Reporter = require('../reporter');\n\nvar lcovRecord = function(data) {\n var str = \"\",\n lineHandled = 0,\n lineFound = 0,\n fileName = data.fileNam...
javascript
chosen
[ { "from": "system", "value": "Add shared function for range sensitive rounding\n" }, { "from": "human", "value": "var schema = require('signalk-schema');\n\nfunction BaseWidget(id, options, streamBundle, instrumentPanel) {\n this.instrumentPanel = instrumentPanel;\n}\n\nBaseWidget.prototype.set...
javascript
chosen
[ { "from": "system", "value": "Fix test case to not fail due to varying timing (again)\n" }, { "from": "human", "value": "/*global describe, it*/\n/*\n * mochify.js\n *\n * Copyright (c) 2014 Maximilian Antoni <mail@maxantoni.de>\n *\n * @license MIT\n */\n'use strict';\n\nvar assert = require('a...
javascript
chosen
[ { "from": "system", "value": "Improve search if settings plugin\nNow available by settings and preferences words\n" }, { "from": "human", "value": "import React from 'react';\nimport Settings from './Settings';\n\n/**\n * Plugin to show app settings in results list\n * @param {String} term\n */...
javascript
chosen
[ { "from": "system", "value": "Swap back to webpack 4, adjust next-offline\n" }, { "from": "human", "value": "const withOffline = require(\"next-offline\");\n\nconst nextConfig = {\n target: \"serverless\",\n future: {\n webpack5: true,\n },\n workboxOpts: {\n swDest: \"static/service-w...
javascript
chosen
[ { "from": "system", "value": "Update on tab activate as well as update\n" }, { "from": "human", "value": "/* Retrieve any previously set cookie and send to content script */\n\nbrowser.tabs.onUpdated.addListener(cookieUpdate);\n\nfunction getActiveTab() {\n return browser.tabs.query({active: tr...
javascript
chosen
[ { "from": "system", "value": "Use cookies to persist formatting options\n" }, { "from": "human", "value": "var ready = function() {\n\t$('#FontSize a').click(function() {\n\t\t$('.content').css(\"font-size\", this.dataset.size);\n\t});\n\n\t$('#FontFamily a').click(function(){\n\t\t$('.content')...
javascript
chosen
[ { "from": "system", "value": "Improve scrolling to error feature\n" }, { "from": "human", "value": "$(function() {\n if ($('small.error').length > 0) {\n $('html, body').animate({\n scrollTop: ($('small.error').first().offset().top)\n },500);\n }\n});" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Fix bug by restoring calls to socket.io service\n" }, { "from": "human", "value": "var config = require('../../config/config.js');\nvar express = require('express');\nvar router = express.Router();\nvar mongoose = require('mongoose');\nvar Observation = mongoose.mod...
javascript
chosen
[ { "from": "system", "value": "Update xmlBlob function to write to temp directory\n" }, { "from": "human", "value": "var fs = require('fs');\n\nmodule.exports = function (context, xmlZipBlob) {\n context.log('Node.js blob trigger function processed blob:', xmlZipBlob);\n context.log(`typeof...
javascript
chosen
[ { "from": "system", "value": "Use buzz.toTimer() method for time filter\n" }, { "from": "human", "value": " (function() {\n function timecode() {\n return function(seconds) {\n var seconds = Number.parseFloat(seconds);\n \n if (Number.isNaN(seconds...
javascript
chosen
[ { "from": "system", "value": "Fix support check that skips tests on ALL browsers\n\nMistake and poor checking on my part.\n" }, { "from": "human", "value": "const html = require('choo/html');\nconst callcount = require('./callcount.js');\nconst chai = require('chai');\nconst expect = chai.expect...
javascript
chosen
[ { "from": "system", "value": "Fix bug in background color\n" }, { "from": "human", "value": "function startTime() {\n var today=new Date();\n var h=checkTime(today.getHours());\n var m=checkTime(today.getMinutes());\n var s=checkTime(today.getSeconds());\n var timeString = s%2===0...
javascript
chosen
[ { "from": "system", "value": "Handle mapbox geocoder response data\n" }, { "from": "human", "value": "DDG.require('maps',function(){\n ddg_spice_maps_maps = function(response) {\n \n if (!response || !response.length) { return Spice.failed('maps'); }\n\n // OSM sends back...
javascript
chosen
[ { "from": "system", "value": "Enforce compatibility of the `undefined` and `default` setting for navbar color scheme. This makes the demo work for the default, but the inverse still doesn't work because of different scheme names.\n" }, { "from": "human", "value": "import { computed } from '@embe...
javascript
chosen
[ { "from": "system", "value": "Use const instead of var as according to best practices\n" }, { "from": "human", "value": "var list = document.createElement('ul');\nvar info = document.createElement('p');\nvar html = document.querySelector('html');\n\ninfo.textContent = 'Below is a dynamic list. C...
javascript
chosen
[ { "from": "system", "value": "Revert \"feat(locale): add Arabic locale support\"\n\nThis reverts commit a13e32a8f0426a0890c813cefbe3987750b12802.\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL wa...
javascript
chosen
[ { "from": "system", "value": "Implement cacheKeyFn and fix lint\n" }, { "from": "human", "value": "import DataLoader from 'dataloader';\nimport client from 'util/client';\n\nexport default () =>\n new DataLoader(async categoryQueries => {\n const body = [];\n\n categoryQueries.forEach(({ ...
javascript
chosen
[ { "from": "system", "value": "Make sure inventory item is completely loaded\n" }, { "from": "human", "value": "import Ember from \"ember\";\nexport default Ember.Mixin.create({\n /**\n * For use with the inventory-type ahead. When an inventory item is selected, resolve the selected\n ...
javascript
chosen
[ { "from": "system", "value": "Allow Multiple Arguments to Events\n" }, { "from": "human", "value": "var listeners = {};\n\nexports.addEventListener = function(name, func) {\n\tif (!listeners[name]) {\n\t\tlisteners[name] = [];\n\t}\n\tlisteners[name].push(func);\n\treturn exports;\n};\n\nexports...
javascript
chosen
[ { "from": "system", "value": "Configure prettier to format mdx\n" }, { "from": "human", "value": "module.exports = {\n semi: false,\n tabWidth: 2,\n singleQuote: true,\n proseWrap: 'always',\n}\n" }, { "from": "gpt", "value": "module.exports = {\n semi: false,\n tabWidth: 2,\n ...
javascript
chosen
[ { "from": "system", "value": "Fix wrong usage of update\n" }, { "from": "human", "value": "import update from 'immutability-helper'\n\nimport ActionTypes from '../actionTypes'\n\nconst initialState = {\n isLoading: false,\n lastRequestAt: undefined,\n latestActivities: [],\n unreadMessagesCo...
javascript
chosen
[ { "from": "system", "value": "Use normal button for select workspace button (SAAS-1389)\n" }, { "from": "human", "value": "'use strict';\n\n(function() {\n\n angular.module('ncsaas')\n .directive('sidebar', ['$state', sidebar]);\n\n function sidebar($state, $uibModal) {\n return {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix a bug where the user wouldn't be able to log in\n" }, { "from": "human", "value": "import { connect } from 'react-redux';\nimport { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { setConfig } from 'widget-editor';\n\nimport { browserHist...
javascript
chosen
[ { "from": "system", "value": "Bring in code commented out for tests\n" }, { "from": "human", "value": "var queue = require('queue-async');\nvar _ = require('underscore');\n\nfunction MapConfigNamedLayersAdapter(overviewsApi) {\n this.overviewsApi = overviewsApi;\n}\n\nmodule.exports = MapConf...
javascript
chosen
[ { "from": "system", "value": "Update check to look for presence, not equality (order unnecessary)\n" }, { "from": "human", "value": "import chai from 'chai';\nimport irc from 'irc';\nimport discord from 'discord.js';\nimport Bot from '../lib/bot';\nimport config from './fixtures/single-test-conf...
javascript
chosen
[ { "from": "system", "value": "Make tooltips work when tabbing\n\nFixed the tooltips on IE, and changed the background colour to be\nnicer on Firefox.\n\nPatch by: Haoyu Bai <baihaoyu@gmail.com>\n\n--HG--\nextra : convert_revision : svn%3A32761e7d-7263-4528-b7be-7235b26367ec/trunk%401624\n" }, { "fro...
javascript
chosen
[ { "from": "system", "value": "Change video ID (see extended log)\n\n- Demonstrate that HTTP referrer overriding is not necessary. This is\nmostly for my own research and for eventual changes I will make to Toby\nmy YouTube player so that I no longer require a patch to\nlibchromiumcontent allowing the overri...
javascript
chosen
[ { "from": "system", "value": "Refresh data on app going foreground\n" }, { "from": "human", "value": "/* application entry point */\n\n// require mithril globally for convenience\nwindow.m = require('mithril');\n\n// cordova plugins polyfills for browser\nif (!window.cordova) require('./cordovaP...
javascript
chosen
[ { "from": "system", "value": "Modify question type to allow the following type: string, text or range\n" }, { "from": "human", "value": "/**\n* Questions.js\n*\n* @description :: TODO: You might write a short summary of how this model works and what it represents here.\n* @docs :: http://...
javascript
chosen
[ { "from": "system", "value": "[ViewSource] Make jshydra output match dehydra's.\n" }, { "from": "human", "value": "// This just dumps out an ast for your viewing pleasure.\n\ninclude(\"dumpast.js\");\n\nfunction process_js(ast) {\n dump_ast(ast);\n}\n" }, { "from": "gpt", "value": "...
javascript
chosen
[ { "from": "system", "value": "Add classes to quote component\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\n\nconst Quote = ({quote}) => (\n <div>\n <p>{quote.value}</p>\n <p>{quote.author}</p>\n </div>\n)\n\nQuote.propTypes = {\n quote: PropTypes.obje...
javascript
chosen
[ { "from": "system", "value": "Fix ordering on command line\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/*eslint-disable no-var */\nvar path = require('path');\nvar spawner = require('child_process');\n\nexports.getFullPath = function(script){\n return path.join(__dirname, script...
javascript
chosen
[ { "from": "system", "value": "Use relative paths for bower/package.json\n" }, { "from": "human", "value": "angular\n .module('app')\n .factory('apiService', [\n '$http',\n function($http) {\n return {\n client: $http.get('/api/bower'),\n server: $http.get('/api/package...
javascript
chosen
[ { "from": "system", "value": "Fix bug in validation method\n" }, { "from": "human", "value": "const validate = (values) => {\n const errors = {};\n if (!values.title || values.title.trim() === '') {\n errors.title = 'Book title is required';\n }\n if (!values.author || values.author.trim(...
javascript
chosen
[ { "from": "system", "value": "Remove word \"should\" from test descriptions\n" }, { "from": "human", "value": "var test = require('ava');\nvar unescapeCss = require('../lib/unescape-css');\n\ntest('should unescape plain chars', function (t) {\n t.is(unescapeCss('Romeo \\\\+ Juliette'), 'Romeo +...
javascript
chosen
[ { "from": "system", "value": "Fix drop event with preventDefault\n\nIf preventDefault is not triggered, we can't use drop event. I fix it\nand added an over function to disable it by default.\n" }, { "from": "human", "value": "(function ($) {\n\n $.fn.dragster = function (options) {\n ...
javascript
chosen
[ { "from": "system", "value": "Validate the only 1 field we have right now\n" }, { "from": "human", "value": "var args = arguments[0] || {};\n\nif (args.hasOwnProperty('itemIndex')) {\n // Edit mode\n var myModel = Alloy.Collections.tasks.at(args.itemIndex);\n $.text.value = myModel.get('text'...
javascript
chosen
[ { "from": "system", "value": "Add animation for kudo-side when kudo-bottom is showed\n" }, { "from": "human", "value": "$(document).ready(function() {\n \n $('.side-nav-container').hover(function() {\n $(this).addClass('is-showed');\n $('.kudo').addClass('hide');\n }, function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add date tooltip to timestamps\n" }, { "from": "human", "value": "/*\nCopyright 2015, 2016 OpenMarket Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of...
javascript
chosen
[ { "from": "system", "value": "Add new rule for spacing around infix operators\n" }, { "from": "human", "value": "// The rules ultimately override any rules defined in legacy/rules/style.js\nmodule.exports = {\n rules: {\n // Enforce function expressions\n // http://eslint.org/do...
javascript
chosen
[ { "from": "system", "value": "Fix updating of balance after a logout followed by a quick login\n" }, { "from": "human", "value": "import { ActionConstants as actions } from '../actions'\nimport { NETWORK_MAIN, NETWORK_TEST } from '../actions/network'\n\nexport default function network(state = {}...
javascript
chosen
[ { "from": "system", "value": "Add mocks to movies controller tests\n" }, { "from": "human", "value": "'use strict';\n\ndescribe('controllers', function() {\n var httpBackend, scope, createController;\n beforeEach(module('polyflix'));\n\n beforeEach(inject(function($rootScope, $httpBackend, $c...
javascript
chosen
[ { "from": "system", "value": "Fix typo on console message\n" }, { "from": "human", "value": "/*\n * Run in: http://adventofcode.com/day/10\n */\n\n;(function () {\n let input = document.querySelector('.puzzle-input').textContent\n\n console.log(\n 'Day09/first:',\n first(input)\n )\n\n ...
javascript
chosen
[ { "from": "system", "value": "Remove obsolete object from scope\n" }, { "from": "human", "value": "'use strict';\nangular.module('com.module.sandbox')\n .controller('SandboxFormsCtrl', function ($scope, CoreService) {\n\n var now = new Date();\n\n $scope.formOptions = {};\n\n $scope.fo...
javascript
chosen
[ { "from": "system", "value": "Fix module name in require after rename\n" }, { "from": "human", "value": "'use strict';\r\n\r\nconst Game = require('./game');\r\n\r\n// todo: this class got refactored away to almost nothing. does it still have value?\r\n// hmm, yes, since we are decorating it\r\n...
javascript
chosen
[ { "from": "system", "value": "Add css file as 'web.cordova' is more accurate.\n\nIf application is browser and cordova in the same time, it will have impact on browser." }, { "from": "human", "value": "Package.describe({\n name: '255kb:cordova-disable-select',\n version: '1.0.2',\n summ...
javascript
chosen
[ { "from": "system", "value": "Fix logout button prop type warning\n" }, { "from": "human", "value": "import React from 'react';\n\n\nexport default function LogoutButton(props) {\n return (\n <div className=\"sign-out-wrapper\">\n <span>{props.email}</span>\n <span className=\"butt...
javascript
chosen
[ { "from": "system", "value": "Fix single player imports on IE11\n\nFixes https://github.com/CookPete/react-player/issues/954\n" }, { "from": "human", "value": "const { join } = require('path')\nconst { writeFile } = require('fs').promises\nconst { default: players } = require('../lib/players')\n...
javascript
chosen
[ { "from": "system", "value": "Undo skip test after fix\n" }, { "from": "human", "value": "import { moduleForComponent, skip } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\nimport notificationsStub from 'wherehows-web/tests/stubs/services/notifications';\nimport userStub fro...
javascript
chosen
[ { "from": "system", "value": "Use Ember.K instead of noOp\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport redux from 'npm:redux';\nimport reducers from '../reducers/index';\nimport enhancers from '../enhancers/index';\nimport optional from '../reducers/optional';\nimport mi...
javascript
chosen
[ { "from": "system", "value": ":wrench: Put songs as new for 2 months\n" }, { "from": "human", "value": "import _ from 'lodash'\n\nconst grouping = [\n { title: 'Custom Song', criteria: song => song.custom },\n { title: 'Tutorial', criteria: song => song.tutorial },\n { title: 'Unreleased', cr...
javascript
chosen
[ { "from": "system", "value": "DELETE correct options object + protocol handling\n" }, { "from": "human", "value": "const is = require('is');\nconst url = require('url');\n/**\n * Returns an object containing the required properties to make an\n * http request.\n * @module DELETE/sanitizeArgument...
javascript
chosen
[ { "from": "system", "value": "Add a shortcut to toggle debug mode.\n" }, { "from": "human", "value": "import React from 'react';\nimport Invocation from './invocation';\nimport StatusLine from './status_line';\n\nexport default React.createClass({\n getInitialState() {\n return {vcsDat...
javascript
chosen
[ { "from": "system", "value": "Load addons into resolver AFField instead of global AFField\n" }, { "from": "human", "value": "import Ember from 'ember'\n\nimport AFField, { DEFAULT_CONFIG as FIELD_DEFAULT_CONFIG } from '../components/af-field'\n\nimport i18n from '../mixins/i18n'\nimport loc from...
javascript
chosen
[ { "from": "system", "value": "Add test for two variables being multiplied who lack a space in between.\n" }, { "from": "human", "value": "a * b;\n10*5;\n10 * 5;\n10e5*5;\n\n10 * (5 + 10);\n10*(5 + 10);\n" }, { "from": "gpt", "value": "a * b;\na*b;\n10*5;\n10 * 5;\n10e5*5;\n\n10 * (5 ...
javascript
chosen
[ { "from": "system", "value": "Set focus on the first advanced search field\n" }, { "from": "human", "value": "$(document).ready(function(){\n $(\"#advanced_search_toggler\").click(function(e){\n $('body').append('<div class=\"as-form-overlay\">')\n $(\"#advanced_search_toggler\").toggleCl...
javascript
chosen
[ { "from": "system", "value": "Disable direct connect for sauce labs\n" }, { "from": "human", "value": "var pr = process.env.TRAVIS_PULL_REQUEST;\nvar souceUser = process.env.SAUCE_USERNAME || \"liqd\";\nvar sauceKey = process.env.SAUCE_ACCESS_KEY;\nvar name = ((pr === \"false\") ? \"\" : \"#\" +...
javascript
chosen
[ { "from": "system", "value": "Fix bug with moving up and down\n" }, { "from": "human", "value": "import React, {Component, PropTypes} from 'react';\nimport t from 'tcomb-form';\n\nfunction renderInput(locals) {\n\n const onChange = function (event) {\n locals.onChange(event.target.value);\n ...
javascript
chosen
[ { "from": "system", "value": "Make it more obvious that TRANSLATIONS is global\n" }, { "from": "human", "value": "(function(global) {\n \"use strict\";\n\n var default_i18n = new Jed({\n locale_data: TRANSLATIONS,\n domain: \"indico\"\n });\n\n global.i18n = default_i18...
javascript
chosen
[ { "from": "system", "value": "Update default behavior of Watch button\n" }, { "from": "human", "value": "'use strict';\n\ndescribe('Sign up page', function () {\n\n\tvar watchButton;\n\n\tbeforeEach(function () {\n\t\twatchButton = element('.btn-primary');\n\t});\n\n\tit('should have Watch/Unwat...
javascript
chosen
[ { "from": "system", "value": "Use correct file name for db stub\n" }, { "from": "human", "value": "var users = require('./user-dump'),\n\tPromise = require('bluebird')\n\nmodule.exports = {\n\tget : Get,\n\tadd : Add\n};\n\n\nfunction Get(request,reply) {\n\t\n\tsetTimeout(function() {\n\t\trepl...
javascript
chosen
[ { "from": "system", "value": "Update FancyScrollBar to use arrow properties\n" }, { "from": "human", "value": "import React, {Component, PropTypes} from 'react'\nimport classnames from 'classnames'\nimport {Scrollbars} from 'react-custom-scrollbars'\n\nclass FancyScrollbar extends Component {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove jQuery from the assets\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into including all the files listed below.\n// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically\n// be include...
javascript
chosen
[ { "from": "system", "value": "Add timeout to mri tests\n" }, { "from": "human", "value": "\"use strict\"\n\nconst mocha = require('mocha');\nconst expect = require('chai').expect;\nconst fs = require('fs');\nconst mri = require('../src/mri');\n\ndescribe(\"Detect CSharp functions\", function(){\...
javascript
chosen
[ { "from": "system", "value": "Test: Add output returned by the fixer\n" }, { "from": "human", "value": "'use strict';\n\n//------------------------------------------------------------------------------\n// Requirements\n//--------------------------------------------------------------------------...
javascript
chosen
[ { "from": "system", "value": "Fix import path of Spinning usage" }, { "from": "human", "value": "// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP\n\nimport React, { Component } from 'react';\nimport Spinning from 'grommet/components/icons/Spinning';\nimport DocsArticle from '...
javascript
chosen
[ { "from": "system", "value": "Remove duplicate declaration of CONFIG.\n" }, { "from": "human", "value": "/**\n * This is the default (fallback) configuration file for the web application.\n */\n\n// Create empty CONFIG object as fallback if it does not exist.\nvar CONFIG = CONFIG || {};\n\n// De...
javascript
chosen
[ { "from": "system", "value": "Truncate during app start causing error, disable it for now.\n" }, { "from": "human", "value": "module.exports = function (Como) {\n var models = {},\n // include underscore utility-belt\n _ = require('/lib/Underscore/underscore.min');\n\n _.each...
javascript
chosen
[ { "from": "system", "value": "Fix a deprecation warning about `initialize` arguments\n\nThis shows up in the browser console. Fixed as suggested at:\nhttp://emberjs.com/deprecations/v2.x/#toc_initializer-arity\n" }, { "from": "human", "value": "export default {\n name: 'app.session',\n\n i...
javascript
chosen
[ { "from": "system", "value": "Update debug globals code to allow modifications from the Chrome console\n\nPreviously, refreshes wouldn't happen until the next call from native code. Now,\nwe run a setInterval that runs all the time to force any Chrome-triggered events\nto get flushed.\n" }, { "from"...
javascript
chosen
[ { "from": "system", "value": "Add routing for EUFN and Lancastrians projects\n" }, { "from": "human", "value": "function routerConfig ($stateProvider, $urlRouterProvider) {\n 'ngInject';\n $stateProvider\n // Holding page\n .state('holding-page', {\n url: '/',\n views: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add a more useful comment\n" }, { "from": "human", "value": "var persist = require('./lib/persist');\n\nmodule.exports = persist;\n" }, { "from": "gpt", "value": "var persist = require('./lib/persist');\n\n/**\n * @param String db MongoDB connection stri...
javascript
chosen
[ { "from": "system", "value": "Fix to allow non boolean options\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(prompts) {\n // This method will only show prompts that haven't been supplied as options. This makes the generator more composable.\n const filteredPromp...
javascript
chosen