conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add Art descriptions to description boxes\n" }, { "from": "human", "value": "module.exports = {\n 'Filtering on search page': function (browser) {\n browser\n .url('http://localhost:8000/search?q=rocket')\n .waitForElementVisible('body', 1000)\n ....
javascript
chosen
[ { "from": "system", "value": "Update JS for poll routes topoint to container class\n" }, { "from": "human", "value": "$(document).ready(function() {\n \n $( \"#take_a_poll_link\" ).click(function( event ) {\n event.preventDefault();\n\n $.ajax({\n type: \"get\",\n url: \"/polls...
javascript
chosen
[ { "from": "system", "value": "Make sure we get Jackie Chan's name right\n" }, { "from": "human", "value": "// register the grid component\nVue.component('demo-grid', {\n template: '#grid-template',\n replace: true,\n props: {\n data: Array,\n columns: Array,\n filterKey: String\n },...
javascript
chosen
[ { "from": "system", "value": "Use Google symbol in the example.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar assert = require(\"assert\"),\n finance = require(\"../lib/finance\");\n\nvar params = {};\n\nparams.prods = [\"IBM\", \"YHOO\", \"MSFT\"];\nparams.referenceDate = \"Sat A...
javascript
chosen
[ { "from": "system", "value": "Replace /public with /posts in default tabs\n" }, { "from": "human", "value": "const nest = require('depnest')\nconst merge = require('lodash/merge')\nconst fs = require('fs')\nconst { join } = require('path')\n\nexports.gives = nest('app.sync.initialise')\n\nexport...
javascript
chosen
[ { "from": "system", "value": "Use JS Package.create from react-native-package to define the exported module\n" }, { "from": "human", "value": "// Libraries\nimport {NativeModules} from 'react-native';\n\n\nexport default NativeModules.RNLookback;\n" }, { "from": "gpt", "value": "// L...
javascript
chosen
[ { "from": "system", "value": "Fix path to setup file on windows\n" }, { "from": "human", "value": "/*\n * mocaccino.js\n *\n * Copyright (c) 2014 Maximilian Antoni <mail@maxantoni.de>\n *\n * @license MIT\n */\n'use strict';\n\nvar through = require('through');\nvar resolve = require('resolve');...
javascript
chosen
[ { "from": "system", "value": ":art: Make map usable in diffs\n" }, { "from": "human", "value": "'use babel'\n\nexport function getEditorsMap(editors) {\n const map = {}\n editors.forEach(function(ui) {\n const path = ui.editor.getPath()\n if (typeof map[path] === 'undefined') {\n ma...
javascript
chosen
[ { "from": "system", "value": "Set product API to new server move1t.herokuapp.com\n" }, { "from": "human", "value": "var settings = {\n test:{\n apiUrl: \"http://staging-move1t.herokuapp.com/\"\n },\n production:{\n apiUrl: \"http://192.168.2.240:3000/\"\n },\n\n getSetting: function(s...
javascript
chosen
[ { "from": "system", "value": "Use Script instead of eval for jQuery example" }, { "from": "human", "value": "var sys = require(\"sys\"), fs = require(\"fs\"); \n\nvar dom = require(\"../../lib/jsdom/level1/core\").dom.level1.core;\nvar window = require(\"../../lib/jsdom/browser\").windowAugmenta...
javascript
chosen
[ { "from": "system", "value": "Remove attempt to populate file input\n" }, { "from": "human", "value": "App.extend({\n Components: {}\n});\n\nApp.Components.Form = (function ($) {\n\n var pub = {\n name: 'app.Components.Form',\n events: ['change'],\n\n assignFormValue: ...
javascript
chosen
[ { "from": "system", "value": "Fix issue where serialization throws when the value is `undefined`\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = serialize;\n\nvar PLACE_HOLDER_REGEX = /\"@__(FUNCTION|REGEXP)_(\\d+)__@\"/g;\n\nfunction serialize(obj) {\n var functions = []...
javascript
chosen
[ { "from": "system", "value": "Add Redux DevTools Extension &\nHot reload reducers not working\n" }, { "from": "human", "value": "import { createStore, applyMiddleware } from 'redux';\nimport thunk from 'redux-thunk'\nimport createLogger from 'redux-logger';\nimport rootReducer from '../reducers'...
javascript
chosen
[ { "from": "system", "value": "Add unique ID to divs for each city\n" }, { "from": "human", "value": "const React = require('react')\n\nconst Questions = (props) => {\n return <div>\n {props.questions.map((question) => <div className='question'>What is the temperature in {question.city}...
javascript
chosen
[ { "from": "system", "value": "Revert \"Look for description in error caught\"\n\nThis reverts commit 18171100cc4cdf32d31dcf526254c708fd42812d.\n" }, { "from": "human", "value": "var context;\nwindow.addEventListener('load', init, false);\nfunction init() {\n\ttry {\n\t var dogBarkingUrl = 'http...
javascript
chosen
[ { "from": "system", "value": "Bring back bcrypt hashing and authentication\n" }, { "from": "human", "value": "'use strict';\n\nvar mongoose = require('mongoose');\n\nvar BCRYPT_COST = 12;\n\nvar Schema = mongoose.Schema;\n\nvar experimenterSchema = new Schema({\n username: {\n type: St...
javascript
chosen
[ { "from": "system", "value": "Check if count exists before adding it\n" }, { "from": "human", "value": "const { getFollowersForUser } = require('./medium/get-followers-for-user');\nconst uuid = require('uuid/v4');\nconst FollowerCount = require('./models');\nconst { user } = require('./models');...
javascript
chosen
[ { "from": "system", "value": "Add gutters object to _base theme\n" }, { "from": "human", "value": "export default {\n fontFamily: '\\'Helvetica\\', \\'Arial\\', sans-serif',\n colors: {\n },\n fontSizes: {\n }\n}\n" }, { "from": "gpt", "value": "export default {\n fontFamily: '...
javascript
chosen
[ { "from": "system", "value": "Fix doc-site example for custom input\n" }, { "from": "human", "value": "() => {\n const [startDate, setStartDate] = useState(new Date());\n const ExampleCustomInput = ({ value, onClick }) => (\n <button className=\"example-custom-input\" onClick={onClick}>\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the previous commit =)\n" }, { "from": "human", "value": "const DEFAULT_VALUES = {\n atomicNumber : 1,\n chemicalSymbol : 'H',\n name : 'Hydrogen'\n};\n\nconst ELEMENTS_VALUE = {\n 'hydrogen' : {\n name : 'Hydrogen',\n atomicNumber : 1,\n chemicalSy...
javascript
chosen
[ { "from": "system", "value": "Update documentation for specifying custom app name\n\nCloses bonfirejs/bf-header#2\n" }, { "from": "human", "value": "/**\n* @property appName is a computed property that first checks the consuming app config/environment.js\n* for APP.bonfire.title\n* APP: {\n* b...
javascript
chosen
[ { "from": "system", "value": "Integrate validations with address step 1 form\n" }, { "from": "human", "value": "module.exports = () => {\n return {\n buttonText: 'Continue',\n children: [\n {\n macroName: 'MultipleChoiceField',\n label: 'Address',\n name: 'uk_or_...
javascript
chosen
[ { "from": "system", "value": "Remove babel-polyfill from the lib\n" }, { "from": "human", "value": "// @flow\nimport 'babel-polyfill';\nexport {\n parametrized,\n parametrized1,\n parametrized2,\n parametrized3,\n parametrized4,\n parametrized5,\n parametrized6,\n paramet...
javascript
chosen
[ { "from": "system", "value": "Update to new way of registering store.\n" }, { "from": "human", "value": "/**\n * Entrypoint for the `core/ui` data store.\n *\n * Site Kit by Google, Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may no...
javascript
chosen
[ { "from": "system", "value": "Rollback al commit anterior porque no funciona\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('core').controller('HeaderController', ['$scope', 'Authentication', 'Menus','pascalprecht.translate','$rootScope','$locale',\n\tfunction($scope, Authent...
javascript
chosen
[ { "from": "system", "value": "Change test basic construct for ContentCtrlTest\n\nThe test tests only the ContentCtrl as a unit test, and therefore all\nother components will be injected with newly created objects or mock\nobjects.\n\nCurrently two tests exist testing the per default set scope variables\nwhi...
javascript
chosen
[ { "from": "system", "value": "Add listBycategory and alistByauthor sidebar selection." }, { "from": "human", "value": "$(document).ready(function()\n {\n $('li.top-menu').click(function() {\n\n $( this ).toggleClass( \"active\" );\n $(this).next().slideToggle('300...
javascript
chosen
[ { "from": "system", "value": "Add tabId to test-app serverInfo\n" }, { "from": "human", "value": "if (Meteor.isClient) {\n var Info = new Mongo.Collection(\"info\");\n var Counter = new Mongo.Collection(\"counter\");\n \n Template.hello.onCreated(function () {\n Meteor.subscribe(\"info\")...
javascript
chosen
[ { "from": "system", "value": "Fix stupid error in util lib\n" }, { "from": "human", "value": "var util = require('util');\n\nfunction doClick() {\n\talert(\"The sum of 1+2 is \" + util.sum(1, 1));\n}\n\n$.index.open();" }, { "from": "gpt", "value": "var util = require('util');\n\nfun...
javascript
chosen
[ { "from": "system", "value": "Use req.params[0] instead of req.param(0)\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar utils = require('./utils/firebase');\n\n\nrouter.get(/^\\/(.+)$/, (req, res, next) => {\n const sectionPath = req.p...
javascript
chosen
[ { "from": "system", "value": "Change sendReports time to 11am\n\nSigned-off-by: Felipe Milani <6def120dcec8fcb28aed4723fac713cfff66d853@gmail.com>\n" }, { "from": "human", "value": "import { SyncedCron } from 'meteor/percolate:synced-cron';\nimport { sendReports } from '../../api/email/server/re...
javascript
chosen
[ { "from": "system", "value": "Change test to minimal in order to use Travis to autodeploy on beta\n" }, { "from": "human", "value": "\"use strict\";\n\nprocess.env.NODE_ENV = \"test\";\nrequire(\"../server.js\");\nvar assert = require(\"chai\").assert;\nvar applicationStorage = process.require(\...
javascript
chosen
[ { "from": "system", "value": "[ReactNative] Replace all the call sites of mergeInto by Object.assign\n" }, { "from": "human", "value": "/**\n * Copyright 2004-present Facebook. All Rights Reserved.\n *\n * @providesModule Dimensions\n */\n'use strict';\n\nvar NativeModules = require('NativeModul...
javascript
chosen
[ { "from": "system", "value": "Remove reference to missing file\n\n- this file was recently removed in alphagov/govuk_publishing_components#2632 as it is no longer needed, so this reference to it is no longer needed\n" }, { "from": "human", "value": "// This file contains dependencies that are on...
javascript
chosen
[ { "from": "system", "value": "Fix typo in Babel Loader for Hot-Reload\n" }, { "from": "human", "value": "/**\n * COMMON WEBPACK CONFIGURATION\n */\n\nconst path = require('path');\nconst webpack = require('webpack');\n\nmodule.exports = (options) => {\n return {\n entry: options.entry,\n ...
javascript
chosen
[ { "from": "system", "value": "Sort indices/aliases and types alphabetically\n\nCloses #18\n" }, { "from": "human", "value": "\nfunction DropdownCtrl($scope, $http, Data) {\n $scope.data = Data;\n\n $scope.indices = [];\n $scope.types = [];\n\n\n var path = $scope.data.host + \"/_mapp...
javascript
chosen
[ { "from": "system", "value": "Check if it's number or not\n" }, { "from": "human", "value": "\n/*\n* Extends L.Marker to include two extra methods: clusterHide and clusterShow.\n* \n* They work as setOpacity(0) and setOpacity(1) respectively, but\n* they will remember the marker's opacity when h...
javascript
chosen
[ { "from": "system", "value": "Add spaces to session timeout countdown\n" }, { "from": "human", "value": "function remainingTime(timeElement, outputElement) {\n var now = new Date(),\n timeout = new Date(timeElement.dataset.time),\n timeRemaining = (timeout - now) / 1000,\n ...
javascript
chosen
[ { "from": "system", "value": ":wrench: Fix css styles by adding a tapp wrapper" }, { "from": "human", "value": "export const parameters = {\n actions: { argTypesRegex: '^on[A-Z].*' },\n};\n" }, { "from": "gpt", "value": "import React from 'react';\n\nexport const parameters = {\n ...
javascript
chosen
[ { "from": "system", "value": "Enable bignumber support by default\n\nConfigure mathjs so it uses bignums by default (with a somewhat excessive precision)." }, { "from": "human", "value": "'use strict';\nvar math = require('mathjs'),\n async = require('async');\nvar errors;\n\nexports.name = '...
javascript
chosen
[ { "from": "system", "value": "Fix menu badge on Firefox\n" }, { "from": "human", "value": "import React from \"react\";\nimport classNames from 'classnames';\nimport update from \"react-addons-update\";\n\nimport Badge from \"../Badge\";\nimport BaseButton from \"../Button\";\n\nconst COLOR = (F...
javascript
chosen
[ { "from": "system", "value": "Update map highlight circle with imls brand orange\n" }, { "from": "human", "value": "\n(function () {\n 'use strict';\n\n var circle = {\n color: '#f6ba46',\n weight: 5,\n fill: true,\n fillColor: '#000000',\n fillOpacity: 0...
javascript
chosen
[ { "from": "system", "value": "Update line by default, compute x1 and x2.\n" }, { "from": "human", "value": ";(function() {\n\n var isInited = false;\n var marker = null;\n SVG.extend(SVG.Element, {\n connectable: function(options, elmTarget) {\n\n if (elmTarget === und...
javascript
chosen
[ { "from": "system", "value": "blueprints/blueprint: Create .jshintrc only if \"ember-cli-jshint\" is a dep\n" }, { "from": "human", "value": "module.exports = {\n description: 'Generates a blueprint and definition.'\n};\n" }, { "from": "gpt", "value": "module.exports = {\n descript...
javascript
chosen
[ { "from": "system", "value": "Check ajaxOptions options argument presence\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Mixin.create({\n // Overwrite to change the request types on which Form Data is sent\n formDataTypes: ['POST', 'PUT', 'PATCH'],\n\n a...
javascript
chosen
[ { "from": "system", "value": "Refactor number cell to use `formatted` property\n" }, { "from": "human", "value": "import Em from 'ember';\nimport LlamaBodyCell from './llama-body-cell';\nvar get = Em.get;\n\nvar LlamaNumberCell = LlamaBodyCell.extend({\n\tclassNames: 'number',\n\tgetValue: funct...
javascript
chosen
[ { "from": "system", "value": "Fix log (pending msgclient fix)\n" }, { "from": "human", "value": "'use strict';\n\nconst express = require('express');\nconst MsgQueueClient = require('msgqueue-client');\n\nconst mqServerConfig = require('../common/config/mqserver.js');\nconst config = require('./...
javascript
chosen
[ { "from": "system", "value": "Add branch name at end of version\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar winston = require('winston'),\n program = require('commander'),\n\n exec = require('./lib/exec');\n\nprogram.version(require('./package.json').vers...
javascript
chosen
[ { "from": "system", "value": "Handle the delay setting change\n" }, { "from": "human", "value": "\nvar InputForm = React.createClass({\n render() {\n return (\n <div className=\"row\">\n <div className=\"input-field col s6\">\n <input placeholder=\"http://google.com\" id...
javascript
chosen
[ { "from": "system", "value": "Create new advanced watcher doc if id does not exists.\n" }, { "from": "human", "value": "import { uiModules } from 'ui/modules';\nimport { Notifier } from 'ui/notify/notifier';\nimport routes from 'ui/routes';\n\nimport template from './watcher_raw_edit.html';\nimp...
javascript
chosen
[ { "from": "system", "value": "Fix duplicated ? on query string\n" }, { "from": "human", "value": "const omit = require('lodash/omit')\nconst qs = require('qs')\n\nconst oauth = require('../lib/oauth')\n\nexports.mergeQueryWithURL = (url, ...queryObjs) => {\n const [, urlWithoutQuery, queryStrin...
javascript
chosen
[ { "from": "system", "value": "Remove explicit named export from rollup\n" }, { "from": "human", "value": "import babel from 'rollup-plugin-babel'\nimport babelrc from 'babelrc-rollup'\nimport replace from 'rollup-plugin-replace'\nimport commonjs from 'rollup-plugin-commonjs'\nimport resolve from...
javascript
chosen
[ { "from": "system", "value": "Fix issue with \"load more\" button status\n" }, { "from": "human", "value": "'use strict';\n\nangular\n .module('lwControllers')\n .controller('Posts',\n function($rootScope, $scope, $routeParams, $location, Article, Analytics, Admin) {\n $r...
javascript
chosen
[ { "from": "system", "value": "Remove a further unused line from the tests\n" }, { "from": "human", "value": "const EventEmitter = require('events');\nconst stripAnsi = require('strip-ansi');\nconst { takeRight } = require('lodash/fp');\n\nmodule.exports = class Stdout extends EventEmitter {\n ...
javascript
chosen
[ { "from": "system", "value": "feat: Enforce TEAM_TOKEN setting by defaulting to storing random number in memory\n" }, { "from": "human", "value": "const winston = require('winston');\nconst fs = require('fs');\nconst SecurityError = require('./errors/security-error');\n\nconst COMMAND_FILE = './...
javascript
chosen
[ { "from": "system", "value": "Add intent of function call\n" }, { "from": "human", "value": "const pushbullet = require('./pushbullet');\nconst client = new pushbullet.PushbulletClient();\n\nconsole.log(\"Starting the Pushbullet client!\");\n\n\nclient.getUser(() => console.dir(data));\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Add vertical autosize for lane title editing\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport InlineInput from 'rt/widgets/InlineInput'\nimport {Title, LaneHeader, RightContent } from 'rt/styles/Base'\nimport L...
javascript
chosen
[ { "from": "system", "value": "Add more stories for thumbnail\n" }, { "from": "human", "value": "import React from \"react\";\nimport { storiesOf } from \"@storybook/react\";\n\nimport Thumbnail from \"./Thumbnail\";\n\nstoriesOf(\"Thumbnail\", module).add(\"default\", () => (\n <div style={{ wi...
javascript
chosen
[ { "from": "system", "value": "Use second argument to test command as configuration filter\n" }, { "from": "human", "value": "const pickBy = require('ramda/src/pickBy');\nconst minimist = require('minimist');\nconst { warn } = require('../../console');\nconst getConfig = require('../../config');\...
javascript
chosen
[ { "from": "system", "value": ":new: Make terminate work for shared workers\n" }, { "from": "human", "value": "'use babel'\n\nimport {Disposable, CompositeDisposable} from 'sb-event-kit'\nimport Communication from 'sb-communication'\n\nclass Exchange {\n constructor(worker) {\n this.worker = ...
javascript
chosen
[ { "from": "system", "value": "Allow writing the expected AST using our own parser.\n" }, { "from": "human", "value": "#!/usr/bin/env babel-node\n\nimport { join, relative } from 'path';\nimport { parse as csrParse } from 'coffee-script-redux';\nimport print from './print-ast';\nimport { createWr...
javascript
chosen
[ { "from": "system", "value": "Use Promise polyfill if it is already available\n" }, { "from": "human", "value": "'use strict';\n\nif (require('node-version').major >= 4) {\n module.exports = require('./lib');\n} else {\n global.Promise = require('promise-polyfill');\n module.exports = r...
javascript
chosen
[ { "from": "system", "value": "Modify grunt writeln and fix grunt header to make grunt-newer quiet.\n" }, { "from": "human", "value": "function initTimeGrunt(grunt) {\n\tconst timeGrunt = require('time-grunt');\n\n\ttimeGrunt(grunt);\n}\n\nfunction initLoadGruntConfig(grunt) {\n\tconst loadGrunt...
javascript
chosen
[ { "from": "system", "value": "Fix TypeError when no changes could be found for a key\n" }, { "from": "human", "value": "import Changes from '/imports/api/changes/Changes';\n\nconst getUnreviewedChanges = (keyID) => {\n let { log, ...c } = Changes.findOne({ keyID });\n // Return only unreviewed...
javascript
chosen
[ { "from": "system", "value": "Add percentage to CLI output\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\nvar meow = require('meow');\nvar getRes = require('./');\n\nmeow({\n\thelp: [\n\t\t'Usage',\n\t\t' $ get-res'\n\t].join('\\n')\n});\n\ngetRes(function (err, res) {...
javascript
chosen
[ { "from": "system", "value": "Configure jest to deal with TS tests\n" }, { "from": "human", "value": "module.exports = {\n\tsetupFiles: ['./src/setupTests.js'],\n\tsetupTestFrameworkScriptFile: './src/setupTestFramework.js',\n\ttestPathIgnorePatterns: ['/node_modules/', '/dist/'],\n\ttransform: ...
javascript
chosen
[ { "from": "system", "value": "Make ellipses work with negative angles\n" }, { "from": "human", "value": "/**************************************************************\n *\tEllipse curve\n **************************************************************/\n\nTHREE.EllipseCurve = function ( aX, aY,...
javascript
chosen
[ { "from": "system", "value": "Add comments for clarity. [rev: trivial]\n" }, { "from": "human", "value": "define([\n 'jquery'\n], function() {\n return function selectElement(selector) {\n var el = $(selector);\n\n if (!el.length) {\n return false;\n }\n\n ...
javascript
chosen
[ { "from": "system", "value": "Save playedAt on collection object\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\n/* define song input schema */\nvar SongInput = new Schema({\n\tname: String,\n\tvalue: String\n});\n\nvar Song = new Schema({...
javascript
chosen
[ { "from": "system", "value": "Create the anonymous user server side instead\n" }, { "from": "human", "value": "App.Router.map(function () {\n this.resource('projects', {path: '/'}, function() {\n this.resource('user-welcome');\n this.resource('project', {path: '/:project_id'}, function() ...
javascript
chosen
[ { "from": "system", "value": "Remove unused import, make sure balance is reflected correctly\n" }, { "from": "human", "value": "import { roundBalance } from '../../common/tools';\nimport { info } from '../broadcast';\nimport { doUntilDone } from '../tools';\n\nlet balanceStr = '';\n\nexport defa...
javascript
chosen
[ { "from": "system", "value": "Add a comment to explain why the uid subtracts two\n" }, { "from": "human", "value": "import * as ACTION_TYPES from '../constants/action_types'\nimport { get } from 'lodash'\n\nfunction uploadAsset(type, file, editorId, uid) {\n return {\n type,\n meta: {},\n...
javascript
chosen
[ { "from": "system", "value": "Fix typo in addLocation action\n" }, { "from": "human", "value": "import { gotError } from './general';\nimport { createNewLocation, listLocations } from '../api/locations';\n\nexport function addLocation( params ) {\n return function( dispatch, getState ) {\n i...
javascript
chosen
[ { "from": "system", "value": "Fix display issue with versions in worker stats\n" }, { "from": "human", "value": "import React from 'react';\nimport moment from 'moment';\n\nimport Actions from '../actions';\n\nimport WorkerStatsStore from '../stores/worker-stats-store';\n\nexport default class W...
javascript
chosen
[ { "from": "system", "value": "Use required attribute instead of custom validity for description\n" }, { "from": "human", "value": "var select = document.getElementById('existing-type');\nvar input = document.getElementById(\"bottype\");\nfunction update() {\n if(parseInt(select.value, 10) == ...
javascript
chosen
[ { "from": "system", "value": "Remove unused handlers in Application store\n" }, { "from": "human", "value": "const createImmutableStore = require('../lib/createImmutableStore')\n// const Immutable = require('immutable')\n\nconst ApplicationStore = createImmutableStore({\n storeName: 'Applicatio...
javascript
chosen
[ { "from": "system", "value": "Simplify and remove unused events\n" }, { "from": "human", "value": "chrome.runtime.sendMessage({\n from: 'contentScript',\n type: 'loadEvent',\n loadState: 'load'\n});\n\nwindow.addEventListener('unload', () => {\n chrome.runtime.sendMessage({\n ...
javascript
chosen
[ { "from": "system", "value": "Add preferences to User object init\n" }, { "from": "human", "value": "const shortid = require('shortid');\n\n/**\n * The User class\n * @type {Object}\n */\nvar User = {};\n\n/**\n * Initialize a User object\n * Auto-generates a unique id\n * \n * Returns `this` re...
javascript
chosen
[ { "from": "system", "value": "Add missing `>` to top comment\n\n:smile:" }, { "from": "human", "value": "/**\n * amputee.js\n *\n * Copyright © 2015 | Johnie Hjelm <johnie@hjelm.im\n */\n\n// Get all amputee elements\nconst amputee = document.getElementsByTagName('amputee');\n\n/**\n * Ajax func...
javascript
chosen
[ { "from": "system", "value": "Remove destructuring to stay compatible with Node 4.x.\n" }, { "from": "human", "value": "const path = require('path');\nconst fs = require('fs');\nconst processor = require('../lib/processors/nativeFunction');\n\nfunction getFixturePath(file) {\n return path.join(...
javascript
chosen
[ { "from": "system", "value": "Move willTransition to action to fix\n" }, { "from": "human", "value": "/**\nUndo changes in the store made to an existing but not-saved\nmodel. This should be mixed into 'edit' routes like\n`CampaignEditRoute` and `BusinessEditRoute`. All non-persisted\nchanges to ...
javascript
chosen
[ { "from": "system", "value": "Update query body for V2 of figshare\n" }, { "from": "human", "value": "import { post, get } from 'request';\nimport { format as strFormat } from 'util';\n\nconst searchUrl = 'http://api.figshare.com/v2/articles/search';\nconst l2ArticleUrl = 'https://api.figshare.c...
javascript
chosen
[ { "from": "system", "value": "Use a cloned global expect so assertions can be registered.\n" }, { "from": "human", "value": "/* global expect:true */\nexpect = require('./lib/');\nexpect.output.preferredWidth = 80;\nrequire('./test/promisePolyfill');\n" }, { "from": "gpt", "value": "...
javascript
chosen
[ { "from": "system", "value": "Revert \"made access token private\"\n" }, { "from": "human", "value": "\nfunction makeMap(latitude, longitude){\n L.mapbox.ENV[\"access_token\"];\n var map = L.mapbox.map('map', 'mapbox.run-bike-hike')\n .setView([latitude, longitude], 16);\n L.mapbox.featureL...
javascript
chosen
[ { "from": "system", "value": "Fix for parseInt with radix\n" }, { "from": "human", "value": "angular.module( 'fullHeight', [] )\n\n.directive('fullHeight', function ($window) {\n return function (scope, element) {\n function applyResizing() {\n var offset = element.attr(\"full-height\")...
javascript
chosen
[ { "from": "system", "value": "Allow checking for 1D only too\n" }, { "from": "human", "value": "/**\n * Check if some 2D point is within a rectangle\n * @param {number} x The point's X coordinate.\n * @param {number} y The point's Y coordinate.\n * @param {number} minX The rectangle'...
javascript
chosen
[ { "from": "system", "value": "Change row size control to slider\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nclass RowSizeControls extends Component {\n render() {\n return (\n <div>\n <label>Images per row</label>\n <input type=\"number\...
javascript
chosen
[ { "from": "system", "value": "feat(utils): Move isElementInViewport fn from Thread\n" }, { "from": "human", "value": "/**\n * Traverses up the DOM until an element is found that contains the passed in \n * class\n * \n * @param {Object} el - The initial DOM element reference\n * @param {Stri...
javascript
chosen
[ { "from": "system", "value": "Use sinon.createSandbox instead of sinon.sandbox.create, if available\n\nAvoids a deprecation warning in Sinon 5+\n" }, { "from": "human", "value": "(function(){\n\nfunction mochaSinon(sinon){\n if (typeof beforeEach !== \"function\") {\n throw \"mocha-sinon rel...
javascript
chosen
[ { "from": "system", "value": "Truncate inputs after the passwd form is submitted.\n" }, { "from": "human", "value": "function change_password_submit ()\n{\n\tvar pgpsender = new PGPSender ();\n\n\tpgpsender.user_passwd ($(\"[name=username]\").val (), $(\"[name=passwd_password]\").val (), $(\"[na...
javascript
chosen
[ { "from": "system", "value": "Add some dummy memory func to favs " }, { "from": "human", "value": "var BVB = (function () {\n\n \"use strict\";\n\n function getFavSpanOnLoad(recipe_id){\n var fav_action = _.contains(favs, recipe_id) ? \"unfav\" : \"fav\";\n var fav_image = _....
javascript
chosen
[ { "from": "system", "value": "Fix error wrapper for DynamoDB\n\nGetting some DynamoDB errors in production. :-(\n" }, { "from": "human", "value": "import AWS from 'aws-sdk'\nimport WError from 'verror'\nimport { resources } from './cloudFormation'\n\nconst dynamoDbTable = resources.JobStreamDyna...
javascript
chosen
[ { "from": "system", "value": "Fix mapping of [allowed actions] vs. [VM state]\n" }, { "from": "human", "value": "\n// TODO: review - use VM status functions similar to the ovirt-engine\nexport function canStart (state) {\n return state && state === 'down'\n}\n\n// TODO: review\nexport function ...
javascript
chosen
[ { "from": "system", "value": "Add back to index link\n" }, { "from": "human", "value": "import React from 'react';\nimport connect from 'react-redux';\nimport { fetchPost } from '../actions';\n\nclass PostsShow extends React.Component {\n componentDidMount() {\n const { id } = this.props.mat...
javascript
chosen
[ { "from": "system", "value": "Convert validation rules to object before applying to form\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n element: 'form',\n classNames: ['ui form'],\n\n isSaving: null,\n validationRules: null,\n attr...
javascript
chosen
[ { "from": "system", "value": "Test (Tracker): Remove unsudes jsdom-global\n" }, { "from": "human", "value": "import 'jsdom-global/register';\nimport { expect } from 'chai';\nimport { Tracker } from '../src';\n\ndescribe('Tracker', () => {\n it('Should not be undefined', () => expect(Tracker).to...
javascript
chosen
[ { "from": "system", "value": "Add updateItem test for field Boolean.\n" }, { "from": "human", "value": "var demand = require('must');\n\nvar landmark = require('../').init(),\n\tTypes = landmark.Field.Types;\n\n/** Test List and Fields */\n\nvar Test = landmark.List('Test');\n\nTest.add({\n\tdat...
javascript
chosen
[ { "from": "system", "value": "Use utc() for date comparison\n" }, { "from": "human", "value": "import moment from 'moment';\n\nconst Utils = {\n\n valueToDate(s) {\n var date = moment(s, \"YYYY-MM-DD\", true);\n return date.isValid() ? date : null;\n },\n\n dateToValue(d) {\n return ...
javascript
chosen
[ { "from": "system", "value": "Add example of using include (which turns to embed) to dummy app.\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n model(params) {\n return this.store.findRecord('node', params.node_id);\n },\n se...
javascript
chosen
[ { "from": "system", "value": "Fix `register` for 1.13.13 - 2.1 apps\n\nAlso moved the register function above the call to `beforeEach` so you can register in a tests `beforeEach` if necessary.\n" }, { "from": "human", "value": "import { module } from 'qunit';\nimport startApp from '../helpers/st...
javascript
chosen