conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove Article date (until it became true)\n" }, { "from": "human", "value": "import React from 'react'\n\nfunction getColorFromId(id) {\n const hue = (id * 97) % 360\n return `hsl(${hue}, 32%, 68%)`\n}\n\nconst Article = ({ link, title, id }) => (\n <div classNa...
javascript
chosen
[ { "from": "system", "value": "Define all API endpoint before integration db\n" }, { "from": "human", "value": "import HandleRecipeRequest from '../controllers/recipe';\nimport Validator from '../controllers/helpers/validator';\n\nmodule.exports = (app) => {\n\n app.get('/api', (request, respo...
javascript
chosen
[ { "from": "system", "value": "test: Check for dropped players list\n" }, { "from": "human", "value": "\n'use strict'\n\nconst expect = require('chai').expect\nconst makeTournament = require('..').makeTournament\n\ndescribe('makeTournament', () => {\n\n it('should allow players with the same nam...
javascript
chosen
[ { "from": "system", "value": "Add header and footer components to routes\n" }, { "from": "human", "value": "import React from 'react';\nimport { BrowserRouter as Router, Route, Switch } from 'react-router-dom';\n\n// Components\nimport App from '../components/app';\nimport NotFound from '../comp...
javascript
chosen
[ { "from": "system", "value": "Move property notification to common location\n\nI prefer this to be next to where the change is made that causes the\nall property to change." }, { "from": "human", "value": "import Ember from 'ember';\nimport { wrap } from 'bus-detective/utils/deserializer';\n\nex...
javascript
chosen
[ { "from": "system", "value": "Fix `data-style` warning in examples\n" }, { "from": "human", "value": "import React from 'react';\nimport {findDOMNode} from 'react-dom';\n\nconst AUTHOR_REPO = 'ericgio/react-bootstrap-typeahead';\n\nclass GitHubStarsButton extends React.Component {\n componentDi...
javascript
chosen
[ { "from": "system", "value": "Fix 401 langauge auth error\n" }, { "from": "human", "value": "/**\n * @ngdoc service\n * @name just.service.service:datastoreService\n * @description\n * # datastoreService\n * Service to handle data...\n */\nangular.module('just.service')\n .service('datastoreSer...
javascript
chosen
[ { "from": "system", "value": "Add root as default tab\n" }, { "from": "human", "value": "define([\n \"underscore\",\n \"jQuery\",\n \"hr/hr\",\n \"core/box\",\n \"core/commands\",\n \"views/components/tabs\"\n], function(_, $, hr, box, commands, TabsView) {\n\n var BodyView ...
javascript
chosen
[ { "from": "system", "value": "Update the benchmark to use the document.readyState to measure page-completedness\nrather than the onload event. Extensions were moved from the pre-onload state\nto running at document idle some time ago.\n\nBUG=none\nTEST=none\n\nReview URL: http://codereview.chromium.org/397...
javascript
chosen
[ { "from": "system", "value": "refactor: Rename mock as instance and not classe name\n" }, { "from": "human", "value": "/*\n* This file is part of the easy framework.\n*\n* (c) Julien Sergent <sergent.julien@icloud.com>\n*\n* For the full copyright and license information, please view the LICENSE...
javascript
chosen
[ { "from": "system", "value": "Fix array handling, pass indentStr to xmlWrite\n" }, { "from": "human", "value": "'use strict';\n\nvar xmlWrite = require('./xmlWrite');\n\nvar attributePrefix = '@';\n\nfunction traverse(obj,parent) {\n\t\nvar result = [];\n\t\n\tfor (var key in obj){\n\t\t// skip ...
javascript
chosen
[ { "from": "system", "value": "Remove proxy configs for UxApplications\n" }, { "from": "human", "value": "Ext.define('OppUI.view.uxDashboard.uxapplications.UxApplicationsModel', {\n extend: 'Ext.app.ViewModel',\n alias: 'viewmodel.uxapplications',\n data: {\n total: 10,\n t...
javascript
chosen
[ { "from": "system", "value": "Increase resiliance of getMegas functions\n" }, { "from": "human", "value": "export default {\n\n // Return the color in which an item should be drawn\n getColor: (state, getters, rootState) => {\n // Check if there is a default color for the step\n if (\n ...
javascript
chosen
[ { "from": "system", "value": "Fix duplicate call of 't.end()' in tests\n" }, { "from": "human", "value": "var test = require('tap').test,\n wolfram = require('../')\n\ntest('valid response', function(t) {\n var client = wolfram.createClient(process.env.WOLFRAM_APPID)\n \n client.query(\"in...
javascript
chosen
[ { "from": "system", "value": "Remove extraneous div from Previewer component\n" }, { "from": "human", "value": "/* @flow */\n\nvar React = require('react')\nvar PreviewerBlockList = require('./previewer_block_list')\n\nvar Previewer = React.createClass({\n\n render(): any {\n return(\n ...
javascript
chosen
[ { "from": "system", "value": "Fix active menu state on settings navigation\n\ncloses #4622\n- unfocus ActivatingListItem link when clicked\n" }, { "from": "human", "value": "var ActivatingListItem = Ember.Component.extend({\n tagName: 'li',\n classNameBindings: ['active'],\n active: fal...
javascript
chosen
[ { "from": "system", "value": "Add note about require statement" }, { "from": "human", "value": "var util = require('util');\nvar ParentBot = require('../parentBot.js').ParentBot;\n\nvar MySQL = require('mysql'); //require your own modules\n\nvar ChildBot = function () {\n ChildBot.super_.app...
javascript
chosen
[ { "from": "system", "value": "Fix not opens scelects on android chrome 50+\n" }, { "from": "human", "value": "'use strict';\n\nsvg4everybody();\n\nFastClick.attach(document.body);\n\n$('.table').basictable({ baseClass: 'table' });\n\n// Modules\n//= require source/modules/**/!(_)*.js\n" }, {...
javascript
chosen
[ { "from": "system", "value": "Fix build when using newer V8 versions\n" }, { "from": "human", "value": "// Copyright 2014 Simon Lydell\n// X11 (“MIT”) Licensed. (See LICENSE.)\n\nvar fs = require(\"fs\")\n\nrequire(\"coffee-script/register\")\nvar regex = require(\"./regex.coffee\")\n\nvar code ...
javascript
chosen
[ { "from": "system", "value": "Change API for name to be string\n" }, { "from": "human", "value": "'use strict';\n\n/* rule.js\n * Expresses CSS rules.\n */\n\nconst create = require('./create');\n\nlet Rule = create(function(names, list1, list2){\n this.names = names;\n if (typeof names === 's...
javascript
chosen
[ { "from": "system", "value": "Clean up method names, variable names, and refine methods.\n" }, { "from": "human", "value": "module.exports = (function(){\n\t\n\tfunction collectParams(url) {\n\t\tvar helper = require(\"../../helpers\");\n\t\tvar params = helper.paramsForUrl(url);\n\t\treturn par...
javascript
chosen
[ { "from": "system", "value": "Fix command to show parse logs and tail output\n" }, { "from": "human", "value": "// Requires\nvar _ = require('underscore');\n\nfunction setup(options, imports, register) {\n var deploy = imports.deploy;\n var shells = imports.shells;\n\n /*\n Documenta...
javascript
chosen
[ { "from": "system", "value": "Mark @roadscape as an employee\n" }, { "from": "human", "value": "const list = `\nned\nsneak\nvandeberg\nandrarchy\nroelandp\ngoldibex\nsteem\nsteemit\nsteemitblog\nsteemitdev\nadmin\nsteemit1\nsteemit2\nsteemit3\n`\n .trim()\n .split('\\n');\n\nexport default...
javascript
chosen
[ { "from": "system", "value": "Add ActionTypes and API Base URL\n" }, { "from": "human", "value": "var keyMirror = require('keymirror');\n\nmodule.exports = {\n\n PayloadSources: keyMirror({\n SERVER_ACTION: null,\n VIEW_ACTION: null\n }),\n\n MenuItems: {\n JOBS: {\n id: 'jobs',...
javascript
chosen
[ { "from": "system", "value": "Add --debug arg to nodemon to be able to run a debugging session\n\nCan be used with either node-inspector or WebStorm\n" }, { "from": "human", "value": "/* eslint-disable strict */\n\n'use strict';\n\nconst nodemon = require('gulp-nodemon');\n\n// Start a developme...
javascript
chosen
[ { "from": "system", "value": "Modify main loop code of FilterChain.parse()\n" }, { "from": "human", "value": "const AstNode = require('./ast-node');\n\nclass FilterChain extends AstNode {\n type() {\n return 'filter_chain';\n }\n\n /**\n * @param {ParseContext} context\n * @return {boo...
javascript
chosen
[ { "from": "system", "value": "Set up the call to fetch\n" }, { "from": "human", "value": "/**\n RemoteCall\n @description function that makes the remote call using the fetch polyfill,\n running a series of provided lifecycle hooks\n @exports @default {function} callRemoteResource\n**/\n\n/...
javascript
chosen
[ { "from": "system", "value": "Remove obsolete -h shorthand check\n" }, { "from": "human", "value": "#!/usr/bin/env node\n/*\n * Copyright (c) Maximilian Antoni <max@javascript.studio>\n *\n * @license MIT\n */\n'use strict';\n\nconst editor = require('editor');\nconst changes = require('..');\n\...
javascript
chosen
[ { "from": "system", "value": "Save action runs ember concurrency task\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport { task } from 'ember-concurrency';\n\nvar noteController = Ember.Controller.extend({\n\trefreshEditorFlag: false,\n\tisTyping: false,\n\tisSaving: false,\n ...
javascript
chosen
[ { "from": "system", "value": "Exclude <Route>, <Switch>, etc. from UMD build\n\nThere has to be a better way...\n" }, { "from": "human", "value": "import babel from \"rollup-plugin-babel\";\nimport uglify from \"rollup-plugin-uglify\";\nimport replace from \"rollup-plugin-replace\";\nimport comm...
javascript
chosen
[ { "from": "system", "value": "Add the -f option to run from a specific migration.\n" }, { "from": "human", "value": "var OS = require(\"os\");\nvar Config = require(\"truffle-config\");\nvar Contracts = require(\"../contracts\");\nvar Resolver = require(\"truffle-resolver\");\nvar Artifactor = r...
javascript
chosen
[ { "from": "system", "value": "Add ice rinks to used services\n" }, { "from": "human", "value": "import {Schema} from 'normalizr';\nimport {normalizeActionName} from '../common/helpers';\n\nexport const UnitServices = {\n MECHANICALLY_FROZEN_ICE: 33417,\n ICE_SKATING_FIELD: 33418,\n SPEED_SKAT...
javascript
chosen
[ { "from": "system", "value": "Add lazy property to nspec\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2017 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfoam.CLASS({\n package: 'foam.nanos.boot',\n name: 'NSpec',\n\n ids: [ ...
javascript
chosen
[ { "from": "system", "value": "Enable placeholder to be docked\n\n" }, { "from": "human", "value": "Ext.define('Slate.ui.mixin.PlaceholderItem', {\n extend: 'Ext.Mixin',\n requires: [\n 'Slate.ui.Placeholder'\n ],\n\n\n mixinConfig: {\n after: {\n initItems: '...
javascript
chosen
[ { "from": "system", "value": "Fix lazy loading in editor for Safari\n\nPassing the document `root`, which fixes positive root margin handling\nin iframes for Chrome, causes `IntersectionObserver` not to trigger\ncallback at all in Safari. Without `root` option, Safari still ignores\npositive root margins in...
javascript
chosen
[ { "from": "system", "value": "Fix _ in octokat cache handler.\n" }, { "from": "human", "value": "/**\n * https://github.com/philschatz/gh-board/blob/master/src/github-client.js#L7-L66\n */\nclass OctokatCacheHandler {\n constructor() {\n // Pull data from `sessionStorage`\n // this.storag...
javascript
chosen
[ { "from": "system", "value": "Add root URL to Book model\n\nSince model is used independently of collection in some cases\n" }, { "from": "human", "value": "define([\n 'app',\n 'backbone'\n], function(App, Backbone) {\n\n var Entities = App.module('Entities');\n\n //=========================...
javascript
chosen
[ { "from": "system", "value": "Update ORB to latest version\n" }, { "from": "human", "value": "orb = {\n init: function () {\n let language = localStorage.getItem(\"orb-language\");\n\n if (language) {\n this.translateTo(window[language]);\n }\n else {\n let browser_lan...
javascript
chosen
[ { "from": "system", "value": "Use build() result for test\n" }, { "from": "human", "value": "!function (assert, path) {\n 'use strict';\n\n require('vows').describe('Integration test').addBatch({\n 'When minifying a CSS file': {\n topic: function () {\n var...
javascript
chosen
[ { "from": "system", "value": "Add functions for displaying pie chart and map\n" }, { "from": "human", "value": "function drawHistogram(){\n var cvterm_id = $(\"#cvterm_id\").val();\n $.ajax({\n url: WebRoot.concat(\"/ajax/details/Traits\"),\n data: {type_cvterm_id: cvterm_id}...
javascript
chosen
[ { "from": "system", "value": "Change was necessary to allow modifyAccount calls in storeAccounts to\nreturn. We don't really use the webOS stored credentials anyway... no\nidea how to read them." }, { "from": "human", "value": "var onCredentialsChangedAssistant = function (future) {};\r\n\r\nonC...
javascript
chosen
[ { "from": "system", "value": "Add theme var & watch on homecontroller\n" }, { "from": "human", "value": "//CONTROLLERS\nprimed.controller('homeController', ['$scope', '$location', 'cityService', function($scope, $location, cityService) {\n \n $scope.city = cityService.city;\n \n $sco...
javascript
chosen
[ { "from": "system", "value": "TeikeiNext: Enable debug output in development.\n" }, { "from": "human", "value": "import pino from 'pino'\nimport pinoExpress from 'express-pino-logger'\nimport logger from 'feathers-logger'\n\nexport default app => {\n app.configure(logger(pino()))\n app.use(pin...
javascript
chosen
[ { "from": "system", "value": "KiwiLibrary: Update built-in JavaScript for sprite node\n" }, { "from": "human", "value": "/*\n * Graphics.js\n */\n\nclass SpriteNodeAction {\n\tconstructor(active, speed, angle){\n\t\tthis.mActive\t= active ;\t// Bool\n\t\tthis.mSpeed\t= speed ;\t// Double [m/sec]...
javascript
chosen
[ { "from": "system", "value": "Update test to keep connections\n" }, { "from": "human", "value": "var common = require('../../common');\nvar assert = require('assert');\n\nvar rows;\nvar fields;\nvar err;\nvar server;\n\nfunction test() {\n var connection = common.createConnection({port:...
javascript
chosen
[ { "from": "system", "value": "Update build script to use package.json from the project root.\n" }, { "from": "human", "value": "/*\n * Copyright 2011 Twitter, Inc.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the...
javascript
chosen
[ { "from": "system", "value": "Use console.info instead of console.log for output.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar path = require('path')\nvar linklocal = require('../')\nvar program = require('commander')\nvar pkg = require('../package.json')\n\nprogram\n .version(...
javascript
chosen
[ { "from": "system", "value": "Enable cubemap texture lod in Plask" }, { "from": "human", "value": "var glu = require('pex-glu');\nvar color = require('pex-color');\nvar sys = require('pex-sys');\nvar Context = glu.Context;\nvar Material = glu.Material;\nvar Program = glu.Program;\nvar Color = co...
javascript
chosen
[ { "from": "system", "value": "Fix deprecated usage of Ember.observer.\n\n[Fixes #81]\n" }, { "from": "human", "value": "import RecordArray from \"./record-array\";\n\n/**\n @module ember-orbit\n */\n\nvar get = Ember.get;\n\n/**\n @class FilteredRecordArray\n @namespace EO\n @extends EO.RecordAr...
javascript
chosen
[ { "from": "system", "value": "Add an answers function for state token strategy\n\n[rev: alex.scown]\n" }, { "from": "human", "value": "/*\n * Copyright 2016 Hewlett-Packard Development Company, L.P.\n * Licensed under the MIT License (the \"License\"); you may not use this file except in complia...
javascript
chosen
[ { "from": "system", "value": "Edit user stories to conform to common conventions\n" }, { "from": "human", "value": "// As a user I want to use a function \"sum\" to take all the numbers in a list and add them together.\r\n// As a user I want to use a function \"mean\" to get the mathematical ave...
javascript
chosen
[ { "from": "system", "value": "Tidy that commit up a bit...\n" }, { "from": "human", "value": "(function($){\n\n\t$.fn.savetheorphans = function(options) {\n\n\t\tvar defaults = {\n\t\t\torphansToSave: 1\n\t\t};\n\n\t\tvar options = $.extend(defaults, options);\n\n\t\treturn this.each(function() ...
javascript
chosen
[ { "from": "system", "value": "Comment about SkyWay's API key\n" }, { "from": "human", "value": "var VIEWER_ID = 'viewer' + location.hash.replace(/^#/, '');\n\n// SkyWay (jt.skyway.io)\nvar LICENSE_KEY = 'bf09a433-41d9-4e2b-9229-cb711a8a7306';\n\n// URLs\nvar URL_SCHEME = 'http://';\nvar URL_HOST...
javascript
chosen
[ { "from": "system", "value": "Reset password link and route.\n" }, { "from": "human", "value": "AccountsTemplates.configureRoute('signIn', {layoutTemplate: 'appLayout'});\nAccountsTemplates.configureRoute('signUp', {layoutTemplate: 'appLayout'});\nAccountsTemplates.configureRoute('ensureSignedIn...
javascript
chosen
[ { "from": "system", "value": "Implement function for getting marker location\n" }, { "from": "human", "value": "var Place = {};\n\n$(document).on('pageshow', '#select-place', function() {\n $('#select-place-map-canvas').css('height', 500);\n\n utils.getCurrentLocation().done(function(locat...
javascript
chosen
[ { "from": "system", "value": "Fix unnamed SQL parameters not being escaped (api)\n" }, { "from": "human", "value": "const util = require('util');\nconst mysql = require('mysql');\n\n// Open the database connection.\nconst db = mysql.createConnection({\n\thost: process.env['DB_HOST'],\n\tport: pr...
javascript
chosen
[ { "from": "system", "value": "Send JSON errors when \"Accept:\"able\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('underscore');\nvar http = require('http');\n\nmodule.exports = function (er, req, res, next) {\n res.set('Cache-Control', 'no-cache');\n\n // Log interesting...
javascript
chosen
[ { "from": "system", "value": "Remove array from state status.\n" }, { "from": "human", "value": "import React, {Component} from 'react';\nimport $ from 'jquery';\nimport CurrentWeatherCard from './CurrentWeatherCard';\n\nexport default class App extends Component {\n constructor(){\n super()...
javascript
chosen
[ { "from": "system", "value": "Send network data on start\n" }, { "from": "human", "value": "var\n util = require('util')\n , stream = require('stream')\n , os = require('os')\n;\n\nfunction network(opts, app) {\n\n var\n self = this\n , initialize = function(cloud) {\n\...
javascript
chosen
[ { "from": "system", "value": "Integrate webpack into gulp task\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst eslint = require('gulp-eslint');\nconst sourcemaps = require('gulp-sourcemaps');\nconst babel = require('gulp-babel');\nconst concat = require('gulp-concat');\n\...
javascript
chosen
[ { "from": "system", "value": "Allow parent to add middleware\n" }, { "from": "human", "value": "const router = require('koa-router')()\nconst handlebars = require('koa-handlebars')\n\n// Use a separate handlebars instance with different options\nrouter.use(handlebars({\n cache: false,\n root: ...
javascript
chosen
[ { "from": "system", "value": "Add class md-dialog-content to create padding within dialogs.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport PaperDialogInner from './paper-dialog-inner';\n\nexport default Ember.Component.extend({\n tagName: 'md-dialog-content',\n\n\n dialo...
javascript
chosen
[ { "from": "system", "value": ":new: Add onDidUpdateMessages to indie registry\n" }, { "from": "human", "value": "'use babel'\n\nimport {Emitter, CompositeDisposable} from 'atom'\nimport Validate from './validate'\nimport Indie from './indie'\n\nexport default class IndieRegistry {\n constructor...
javascript
chosen
[ { "from": "system", "value": "Use newer object destructuring syntax.\n" }, { "from": "human", "value": "const trimHeadersLower = require('./trimHeadersLower');\n\nmodule.exports = function checkTimeline(result) {\n const timeline = result.timeline;\n const fulfilmentValue = result.fulfilmentVa...
javascript
chosen
[ { "from": "system", "value": "Add 'Get' and 'Approve Draft' methods for LandingPage\n" }, { "from": "human", "value": "var _ = require('lodash'),\n Promise = require('bluebird'),\n util = require('../util'),\n qs = require('querystring'),\n log = util.logger();\n\nfunction LandingPag...
javascript
chosen
[ { "from": "system", "value": "Save the scroll position while serfing site\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport App from './App'\nimport Router from 'vue-router'\n\nimport MainPage from './components/summary/List'\nimport Discipline from './components/discipline/Page'\...
javascript
chosen
[ { "from": "system", "value": "Change copy button's text on success/failure\n" }, { "from": "human", "value": "import Clipboard from 'clipboard';\n\n// Each code block in Github will be rendered in a div with class=\"highlight\"\nconst CODE_BLOCK_SELECTOR = 'div.highlight';\n\n// Get all code blo...
javascript
chosen
[ { "from": "system", "value": "Set timeout default value to 30sec.\n" }, { "from": "human", "value": "var os = require('os');\nvar path = require('path');\nvar paths = require('./paths');\n\n// Guess proxy defined in the env\n/*jshint camelcase: false*/\nvar proxy = process.env.HTTP_PROXY\n ||...
javascript
chosen
[ { "from": "system", "value": "Fix parent confusion in \"forfeit already present\" test\n" }, { "from": "human", "value": "var forfeitRegExp = require('./lib/forfeit/forfeitRegExp.js');\n\nmodule.exports = function forfeitAlreadyPresent(combo, forfeit) {\n var regex = forfeitRegExp(forfeit);\n ...
javascript
chosen
[ { "from": "system", "value": "Throw a error instead of just logging it\n" }, { "from": "human", "value": "resetDatabase = function (options) {\n if (process.env.NODE_ENV !== 'development' ||\n !(process.env.IS_MIRROR || process.env.VELOCITY_TEST_PACKAGES)\n ) {\n console.error(\n '...
javascript
chosen
[ { "from": "system", "value": "UPdate to tags sort order\n" }, { "from": "human", "value": "Meteor.publish('categories', function() {\n if(Users.can.viewById(this.userId)){\n return Categories.find();\n }\n return [];\n});\n" }, { "from": "gpt", "value": "Meteor.publish('categor...
javascript
chosen
[ { "from": "system", "value": "Use the sync version of unlink to try to resolve spurious Travis failures\n\nTravis can fail random tests with:\n\n Error: ENOENT: no such file or directory, rename 'spec-db/users.db~' -> 'spec-db/users.db'\n at Error (native)\n\nThis isn't due to double `unlink()` calls (e...
javascript
chosen
[ { "from": "system", "value": "Install now drops and recreates the database\n" }, { "from": "human", "value": "process.env.NODE_CONFIG_DIR=\"../config/\";\nvar mysql = require(\"promise-mysql\");\nvar config = require(\"config\");\nvar fs = require(\"fs\");\n\nvar connection;\n\nmysql.createConne...
javascript
chosen
[ { "from": "system", "value": "Handle patterns as String or RegExp.\n" }, { "from": "human", "value": "'use strict';\n\nvar EventEmitter = require('events').EventEmitter;\nvar mixin = require('merge-descriptors');\n\nfunction Command() {\n this.actions = [];\n this.token;\n\n mixin(this, Event...
javascript
chosen
[ { "from": "system", "value": "Fix lat/long on autocomplete search\n" }, { "from": "human", "value": "/**\n * Created by dough on 2017-02-09.\n */\n$(function () {\n\n var latitudeInput = $('#siteLatitude');\n var longitudeInput = $('#siteLongitude');\n\n function initMap() {\n\n ...
javascript
chosen
[ { "from": "system", "value": "Telemetry: Fix calculation of bounding rects for elements in iframes.\n\nWe currently use getBoundingClientRect() to compute the bounds of an element in\nthe page. That method returns the coordinates wrt to its viewport (which could\nbe an iframe). For synthetic gestures howeve...
javascript
chosen
[ { "from": "system", "value": "Refactor and fix prevToken directive\n" }, { "from": "human", "value": "'use strict';\nangular.module('arethusa.core').directive('prevToken', function () {\n return {\n restrict: 'E',\n link: function (scope, element, attrs) {\n element.bind('click', fun...
javascript
chosen
[ { "from": "system", "value": "Add TODO for public config route\n" }, { "from": "human", "value": "const { Configuration } = require('@hpi-schul-cloud/commons');\n\nconst publicAppConfigServiceHooks = {\n\tbefore: {\n\t\tall: [],\n\t\tfind: [],\n\t},\n\tafter: {\n\t\tall: [],\n\t\tfind: [],\n\t},...
javascript
chosen
[ { "from": "system", "value": "Load visualization dependencies into build.\n" }, { "from": "human", "value": "/*jshint node:true*/\n/* global require, module */\nvar EmberApp = require('ember-cli/lib/broccoli/ember-app');\n\nmodule.exports = function(defaults) {\n var app = new EmberApp(defaults...
javascript
chosen
[ { "from": "system", "value": "Fix bug in component smoke tests\n\nThe context of the variants wasn't being passed to the template, but\nthe variant object containing `context`.\n" }, { "from": "human", "value": "const expect = require('chai').expect\nconst nunjucks = require('nunjucks')\nconst c...
javascript
chosen
[ { "from": "system", "value": "Convert adsConversionID setting for GA4 to placeholder.\n" }, { "from": "human", "value": "/**\n * `modules/analytics-4` base 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...
javascript
chosen
[ { "from": "system", "value": "Official-storybook: Test case for args breaking on non-primary story\n" }, { "from": "human", "value": "import React from 'react';\nimport { DocgenButton } from '../../components/DocgenButton';\nimport { ButtonGroup } from '../../components/ButtonGroup';\n\nexport d...
javascript
chosen
[ { "from": "system", "value": "Add login & logout link\n" }, { "from": "human", "value": "/*\n * HomePage\n * This is the first thing users see of our App\n */\n\nimport { asyncChangeProjectName, asyncChangeOwnerName } from '../../actions/AppActions';\nimport React, { Component } from 'react';\ni...
javascript
chosen
[ { "from": "system", "value": "Remove gutter from the more menu\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/more-menu';\n\nexport default Ember.Component.extend({\n layout,\n classNames: ['dropdown-button'],\n\n didRender() {\n ...
javascript
chosen
[ { "from": "system", "value": "Test Binary Search: 100% coverage\n" }, { "from": "human", "value": "/* eslint-env mocha */\nconst binarysearch = require('../../../src').Algorithms.Searching.binarysearch;\nconst assert = require('assert');\n\ndescribe('Binary Search', () => {\n it('should return ...
javascript
chosen
[ { "from": "system", "value": "Rename type `JSON` to `JSONValue` since `JSON` is already defined\n" }, { "from": "human", "value": "declare type JSON = string | number | boolean | null | JSONObject | JSONArray;\ndeclare type JSONObject = { [key:string]: JSON };\ndeclare type JSONArray = Array<JSO...
javascript
chosen
[ { "from": "system", "value": "Use element.localName and check namespaceURI\n" }, { "from": "human", "value": "import { Localization } from './base';\nimport { overlayElement } from './overlay';\n\nexport { contexts } from './base';\n\nconst allowed = {\n attributes: {\n global: ['aria-label'...
javascript
chosen
[ { "from": "system", "value": "Add BASE URL var and dummy code for joinEvent.\n" }, { "from": "human", "value": ";(function(){\n\n angular.module('flockTogether')\n\n .controller('detailCtrl', function($scope, $http, $location) {\n var id = $location.path().split('/')[2]-1;//pulls event_...
javascript
chosen
[ { "from": "system", "value": "Fix music not changing in main page\n" }, { "from": "human", "value": "class MainController {\n constructor($log, $state, $localStorage, baseMusic, audioOn, AudioService) {\n 'ngInject';\n\n this.$state = $state;\n this.$storage = $localStorage.$default({\...
javascript
chosen
[ { "from": "system", "value": "Remove link from button and change text\n" }, { "from": "human", "value": "import React from 'react';\n\nconst Offseason = () => (\n <div className=\"offseason\">\n <div className=\"lead\">\n <div className=\"neonlogo\"></div>\n <h1 className=\"title w...
javascript
chosen
[ { "from": "system", "value": "Add code for release 3\n" }, { "from": "human", "value": "// Release 2\n// Pseudocode\n\n// Sum Function:\n// define a sum function that takes in an array of integers.\n// create a result variable equal to 0.\n// iterate through the array and add each array value to...
javascript
chosen
[ { "from": "system", "value": "Change the name of a button directive that was missed to match the updated terminology\n" }, { "from": "human", "value": "var keijibanApp = angular.module('keijiban', ['ngMaterial', 'ngRoute']);\n\nkeijibanApp.directive('infoMenu', function() {\n return {\n ...
javascript
chosen
[ { "from": "system", "value": "Add in error messages if trying to push/replace and no history provided\n" }, { "from": "human", "value": "// function to create the singleton options object that can be shared\n// throughout an application\nfunction createUrlQueryOptions() {\n // default options\n...
javascript
chosen
[ { "from": "system", "value": "Cover case, where prefix goes on seconds position in string\n" }, { "from": "human", "value": "import prefix from '../prefix'\nimport pascalize from '../utils/pascalize'\n\n// Test if property is supported with vendor prefix.\nexport default {\n supportedProperty: ...
javascript
chosen
[ { "from": "system", "value": "Use ejs templates to serve random video" }, { "from": "human", "value": "var MongoClient = require('mongodb').MongoClient;\nvar assert = require('assert');\nvar ObjectId = require('mongodb').ObjectID;\nvar url = 'mongodb://localhost:27017/test';\n\nvar express = req...
javascript
chosen
[ { "from": "system", "value": "Update webpack config to use nodeExternals\n" }, { "from": "human", "value": "import path from 'path'\n\nexport default {\n module: {\n loaders: [{\n test: /\\.jsx?$/,\n loaders: ['babel-loader'],\n exclude: /node_modules/,\n }, {\n test: ...
javascript
chosen
[ { "from": "system", "value": "Copy indent rule to TS as well\n" }, { "from": "human", "value": "module.exports = {\n extends: [\"matrix-org\", \"matrix-org/react-legacy\"],\n parser: \"babel-eslint\",\n\n env: {\n browser: true,\n node: true,\n },\n globals: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add modal options to sidebar\n" }, { "from": "human", "value": "module.exports = {\n api: [\n {\n type: 'category',\n label: 'Navigation',\n items: [\n 'component',\n 'root',\n 'stack',\n 'modal',\n 'overlay'\n ...
javascript
chosen
[ { "from": "system", "value": "Support `head` as an HTTP_METHOD" }, { "from": "human", "value": "HTTP_METHODS = [\n 'get',\n 'post',\n 'put',\n 'delete',\n 'patch'\n];\n" }, { "from": "gpt", "value": "HTTP_METHODS = [\n 'get',\n 'post',\n 'put',\n 'delete',\n 'patch',\n 'he...
javascript
chosen
[ { "from": "system", "value": "Update to work with new API\n" }, { "from": "human", "value": "'use strict';\n\nvar consolidate = require('consolidate');\nvar path = require('path');\nvar _ = require('lodash');\n\nmodule.exports = {\n\n partials: {},\n\n defaults: {\n ...
javascript
chosen