conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Document the FirstPassCache helper class\n" }, { "from": "human", "value": "\r\n\r\nexport default class FirstPassCache {\r\n constructor() {\r\n this._passedFiles = [];\r\n this._firstPassHandled = false;\r\n }\r\n\r\n pass(filePath) {\r\n ...
javascript
chosen
[ { "from": "system", "value": "Make sure we don't try to load a null path.\n" }, { "from": "human", "value": "var React = require('react');\n\nvar meetingRelationPropType = require('types/meetingRelationPropType');\nvar {attachMediaStream} = require('helpers/WebRTCAdapter');\n\nvar Broadcast = Re...
javascript
chosen
[ { "from": "system", "value": "Add toolbar and dummy content\n" }, { "from": "human", "value": "'use strict';\n\nvar React = require('react-native');\nvar {\n AppRegistry,\n View,\n} = React;\n\nvar iTunesBrowser = React.createClass({\n render: function() {\n return (\n <View>\n <...
javascript
chosen
[ { "from": "system", "value": "Fix pluralization on program years route\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nvar Router = Ember.Router.extend({\n location: IliosENV.locationType\n});\nRouter.map(function() {\n this.resource('dashboard', function() {\n this.route('...
javascript
chosen
[ { "from": "system", "value": "Add `success` and `error` functions to each response object.\n" }, { "from": "human", "value": "class Base {\n\n constructor() {\n this.__beforeFilters = []\n this.__skipBeforeFilters = []\n this.__afterFilters = []\n this.__skipAfterFilters = []\n }\n...
javascript
chosen
[ { "from": "system", "value": "Fix use of not available Array.contains in some cases in detection\n" }, { "from": "human", "value": "/*\n===============================================================================================\n\n\t\tUnify Project\n\n\t\tHomepage: unify-project.org\n\t\tLic...
javascript
chosen
[ { "from": "system", "value": "Fix printing tweets if theres no moderators at all\n" }, { "from": "human", "value": "const fs = require(\"fs\");\nconst path = require(\"path\");\nconst glob = require(\"glob\");\nconst DIR = \"_data/events_gdcr2019\";\n\nconst toWelcomeTweetModerators = moderators...
javascript
chosen
[ { "from": "system", "value": "Add bikeracks and Imgur API params to config\n" }, { "from": "human", "value": "\nvar Config = {\n\n // API\n nearbyRacksURL: 'static/data/austin_racks_v1.json',\n\n rackIconOptions: {\n iconUrl: 'static/images/parking_bicycle_0.png',\n shadow...
javascript
chosen
[ { "from": "system", "value": "remove: Use native base64 instead of angular module\n" }, { "from": "human", "value": "/**\n * Copyright (c) Ajay Sreedhar. All rights reserved.\n *\n * Licensed under the MIT License.\n * Please see LICENSE file located in the project root for more information.\n *...
javascript
chosen
[ { "from": "system", "value": "Add initial data with some roles and users\n" }, { "from": "human", "value": "// Add initial data here...\n\nexport default function () {}\n" }, { "from": "gpt", "value": "// Add initial data here...\nimport { Meteor } from 'meteor/meteor';\nimport { Rol...
javascript
chosen
[ { "from": "system", "value": "Fix requirements on play speed\n" }, { "from": "human", "value": "var HyperdeckCore = require(\"./hyperdeck-core.js\");\nvar Promise = require('promise');\n\n\nvar Hyperdeck = function(ip) {\n //Start by connecting to Hyperdeck via HypderdeckCore\n var Core = new ...
javascript
chosen
[ { "from": "system", "value": "Create global TMW namespace & add jshint & jslint directives\n" }, { "from": "human", "value": "/*\tAuthor:\n\t\tTMW - (Author Name Here)\n*/\n\n\n$(function() {\n\t// Any globals go here in CAPS (but avoid if possible)\n\n\t// follow a singleton pattern\n\t// (http...
javascript
chosen
[ { "from": "system", "value": "Use new landingPage attribute locations\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n\n downloadLatency: Ember.computed(function() {\n var rawLatency = this.get('model').get(\"landingPage\").result['do...
javascript
chosen
[ { "from": "system", "value": "Fix babel transpile for electron runner" }, { "from": "human", "value": "/* eslint-disable object-shorthand */\nmodule.exports = {\n // We need to make sure that the transpiler hit the linoleum source since we are\n // not building to npm or simliar.\n ignore: fu...
javascript
chosen
[ { "from": "system", "value": "Add QClient function and object prototype.\n" }, { "from": "human", "value": "/**\n * QClient.js\n * ==========\n * Main module exported from this library.\n */\n\n/**\n * QClient\n * -------\n * The main function exposed to your code.\n * QClient will take your cli...
javascript
chosen
[ { "from": "system", "value": "Add ability to pass autoNumeric config object to the decorator function\n" }, { "from": "human", "value": "Ractive.decorators.autoNumeric = function (node, relativeKeypath, boundValue) {\n var self = this,\n $el = $(node),\n context = self.getContex...
javascript
chosen
[ { "from": "system", "value": "Use glob pattern for excluding files\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// Native\nconst path = require('path')\n\n// Packages\nconst asyncToGen = require('async-to-gen/register')\nconst updateNotifier = require('update-notifier')\nconst {red}...
javascript
chosen
[ { "from": "system", "value": "Test played changes including firefox report\n" }, { "from": "human", "value": "({\n name: 'prop-played',\n description: 'Property \"played\"',\n spec: 'http://dev.w3.org/html5/spec/Overview.html#dom-mediacontroller-played',\n assert: function(finish) {\n var...
javascript
chosen
[ { "from": "system", "value": "tests/initializer-addon: Use alternative blueprint test helpers\n" }, { "from": "human", "value": "'use strict';\n\nvar setupTestHooks = require('ember-cli-blueprint-test-helpers/lib/helpers/setup');\nvar BlueprintHelpers = require('ember-cli-blueprint-test-he...
javascript
chosen
[ { "from": "system", "value": "Add on finish for remap istanbul\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar config = require('../gulp.config')();\nvar Server = require('karma').Server;\nvar remapIstanbul = require('remap-istanbul/lib/gulpRemapIstanbul');\n\n/**\n * Run tes...
javascript
chosen
[ { "from": "system", "value": "Revert \"target to API in preview\"\n\nThis reverts commit c1fe5d796af9b677faa5197e7ea830d5df026183.\n" }, { "from": "human", "value": "module.exports = {\n apiUrl: 'https://manifold-api-pre.azurewebsites.net',\n analytics: 'UA-98003629-1',\n apiUrl2: 'http...
javascript
chosen
[ { "from": "system", "value": "Fix CSS Modules ident name for production build (from Sai Kishore Komanduri)\n" }, { "from": "human", "value": "var cssnext = require('postcss-cssnext');\nvar postcssFocus = require('postcss-focus');\nvar postcssReporter = require('postcss-reporter');\n\nmodule.expo...
javascript
chosen
[ { "from": "system", "value": "chore(Collective): Add more keywords to blacklisted slugs" }, { "from": "human", "value": "/**\n * Check if given `slug` could conflict with existing routes or\n * if it's a reserved keyword.\n *\n * The list is mostly based on frontend `src/server/pages.js` file an...
javascript
chosen
[ { "from": "system", "value": "Revert \"Send changes in react-counter-messaging\"\n\nThis reverts commit ff9167ce9607408eaadc188435dca89192933915.\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\n\nclass Counter extends Component {\n constructor() {\n s...
javascript
chosen
[ { "from": "system", "value": "Analytics: Add search string to page view\n\nAs we want to see which advertising channels\nare most effective, we want to record the query\nparameters.\n" }, { "from": "human", "value": "// analytics.js\r\nCircleBlvd.Services.analytics = function ($window, $location...
javascript
chosen
[ { "from": "system", "value": "Remove console logs from auth\n" }, { "from": "human", "value": "import {parse} from 'cookie';\nmodule.exports = (router) => {\n // router is props.history from a component served by react router\n let cookies = parse(document.cookie);\n console.log(cookies);\n ...
javascript
chosen
[ { "from": "system", "value": "Fix test: redundant done argument\n" }, { "from": "human", "value": "/* eslint-env mocha */\n\nvar chai = require('chai')\nchai.use(require('chai-as-promised'))\nchai.should()\n\nvar schema = {\n type: 'object',\n additionalProperties: false,\n patternProperties:...
javascript
chosen
[ { "from": "system", "value": "Add tests for asynchronous method inference\n" }, { "from": "human", "value": "var promisify = require(\"../\");\nvar assert = require(\"assert\");\n\ndescribe(\"Promisify\", function() {\n it(\"can convert a basic async function\", function() {\n function test(...
javascript
chosen
[ { "from": "system", "value": "Add disableHostCheck for dev server\n" }, { "from": "human", "value": "import webpack from 'webpack';\nimport baseConfig from './base.babel';\n\nconst host = 'localhost';\nconst port = 3000;\n\nconst baseDevConfig = {\n ...baseConfig,\n mode: 'development',\n dev...
javascript
chosen
[ { "from": "system", "value": "Set default user name on persistent URLs\n" }, { "from": "human", "value": "/*\n * Copyright (C) 2015 SUSE Linux\n *\n * This software may be modified and distributed under the terms\n * of the MIT license. See the LICENSE.txt file for details.\n */\n\n(function ()...
javascript
chosen
[ { "from": "system", "value": "Update server to use connect serve-static\n" }, { "from": "human", "value": "var util = require('util'),\n connect = require('connect'),\n port = 9000;\n\nconnect.createServer(connect.static(__dirname)).listen(process.env.PORT || port);\nutil.puts('Listening o...
javascript
chosen
[ { "from": "system", "value": "Test sending an unparsable message.\n" }, { "from": "human", "value": "'use strict';\n\nconst http = require('http');\nconst W3CWebSocket = require('websocket').w3cwebsocket;\nconst WebSocketAsPromised = require('websocket-as-promised');\nconst createWsServer = requ...
javascript
chosen
[ { "from": "system", "value": "Load captcha library only when used\n" }, { "from": "human", "value": "var libraryLoaded = false;\nvar callbacks = [];\n\nmodule.exports = function(callback) {\n if (!libraryLoaded) {\n callbacks.push(callback);\n } else {\n callback.call();\n ...
javascript
chosen
[ { "from": "system", "value": "Clean imput box with shortcut keys\n" }, { "from": "human", "value": "//open command bar\nMousetrap.bindGlobal(['shift+up'], function(e) {\n document.getElementById('light').style.display='block';\n return false;\n});\n\n//close command bar\nMousetrap.bindGlobal([...
javascript
chosen
[ { "from": "system", "value": "Fix bug in Jenkins configuration page\n\nThe Jenkins configuration page (http://tests.dom/jenkins/configure) was\nbasically unusable, because there is an gray overlay box that is blocking the\nform fields and thus these fields are unusable. This overlay should be displayed\nonl...
javascript
chosen
[ { "from": "system", "value": "ApiHelper: Make HTTP status available on failure as well\n" }, { "from": "human", "value": "/*\n * Copyright 2018 ThoughtWorks, Inc.\n *\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": "Fix support of custom background on icons\n" }, { "from": "human", "value": "import React from 'react';\nimport IconSVG from './IconSVG';\n\nimport { iconClass } from './util';\nimport { prefixable } from '../../decorators';\n\nexport const Icon = (props) => {\n co...
javascript
chosen
[ { "from": "system", "value": "Add some options for prototype handler.\n" }, { "from": "human", "value": "(function ($) {\n var methods = {\n init: function(options) {\n return this.each(function() {\n show($(this), false);\n $(this).change(funct...
javascript
chosen
[ { "from": "system", "value": "Fix missing text in services page\n" }, { "from": "human", "value": "/* eslint-disable react/no-danger */\n/* eslint-disable camelcase */\nimport React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport DOMPurify from 'dompurify';\n\...
javascript
chosen
[ { "from": "system", "value": "Use doc _id field to construct url\n\nDocs don't always have an id property, so we use _id directly instead.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar filter = require('../filter');\n\nmodule.exports = jsonTransformPlugin;\n\nfunction jsonTransformPl...
javascript
chosen
[ { "from": "system", "value": "Fix: Validate url input for feedback\n" }, { "from": "human", "value": "import * as validation from 'utils/validation';\nimport memoize from 'lru-memoize';\n\nconst nameInput = [\n validation.valueRequired,\n];\n\n\nconst feedbackInput = [\n validation.valueRequir...
javascript
chosen
[ { "from": "system", "value": "Add new record to list\n" }, { "from": "human", "value": "import { reduceApi, getBaseType } from '../../common/api'\n\nimport {\n LIST_TODOS,\n VIEW_TODO,\n CREATE_TODO,\n UPDATE_TODO,\n DELETE_TODO,\n MOVE_TODO\n} from './actions';\n\nexport default function ...
javascript
chosen
[ { "from": "system", "value": "Simplify syntax and use ES6 features\n" }, { "from": "human", "value": "import config from '../../../data/__config.json';\nvar selectedThemeModule = './themes/'+config.currentTheme+'/boot.js';\nconst Theme = require(selectedThemeModule);\nexport default Theme.defaul...
javascript
chosen
[ { "from": "system", "value": "Fix join on room with currently playing song bug\n" }, { "from": "human", "value": "const initialState = {\n time: 0,\n songIndex: 0,\n isPlaying: false\n}\n\nexport default function player(state = initialState, action) {\n switch (action.type) {\n case 'UPDATE...
javascript
chosen
[ { "from": "system", "value": "Add keyup to event list to fix IE so it updates height properly when deleting text.\n" }, { "from": "human", "value": "(function($){\n $.fn.textareaAutoExpand = function(){\n return this.each(function(){\n var textarea = $(this);\n var height = textare...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"attempt to add input option field\"\"\n\nThis reverts commit 5910ed3e285808fb9961644b27cb108e28027e9a.\n" }, { "from": "human", "value": "/**\n * Created by AMOS on 10/7/16.\n */\n\n\n//TODO: Add various imports for challenge(s)\nimport * as mcq fr...
javascript
chosen
[ { "from": "system", "value": "test: Copy over fixtures to temp dir\n" }, { "from": "human", "value": "var chai = require('chai');\nvar os = require('os');\nvar fs = require('fs-extra');\nvar path = require('path');\n\nvar fileTemplater = require('../../bin/fileTemplater')();\n\nchai.use(require...
javascript
chosen
[ { "from": "system", "value": "fix(bookmarks): Remove Highlights from Bookmarks page\n" }, { "from": "human", "value": "const React = require(\"react\");\nconst {connect} = require(\"react-redux\");\nconst {selectSpotlight} = require(\"selectors/selectors\");\nconst GroupedActivityFeed = require(...
javascript
chosen
[ { "from": "system", "value": "Add account filtering to modal\n" }, { "from": "human", "value": "/* global angular, console */\n\nimport 'ionic-sdk/release/js/ionic.bundle';\n\nangular.module('app.modals.select-account', [])\n.controller('SelectAccountCtrl', function ($scope, Wallet) {\n\t'use st...
javascript
chosen
[ { "from": "system", "value": "Handle error for the purchase history\n" }, { "from": "human", "value": "'use strict';\n\n\n(function() {\n angular\n .module('bitcoincom.controllers')\n .controller('buyBitcoinPurchaseHistoryController', purchaseHistoryController);\n\n function purchase...
javascript
chosen
[ { "from": "system", "value": "Fix: Move line-height property to correct location\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\nimport { regular } from './icon-definitions';\n\nconst StyledIcon = styl...
javascript
chosen
[ { "from": "system", "value": "test(inherit-select-classes): Make sure false don't add the class\n" }, { "from": "human", "value": "describe('Chosen options: inherit-select-classes', function () {\n beforeEach(function () {\n chosenSelectHelper.compileWithAttributes({\n inheritSelectClas...
javascript
chosen
[ { "from": "system", "value": "Add more tests for CodeCell\n" }, { "from": "human", "value": "import React from 'react';\n\nimport { shallow, mount } from 'enzyme';\nimport Immutable from 'immutable';\nimport {expect} from 'chai';\n\nimport CodeCell from '../../../../src/notebook/components/cell/...
javascript
chosen
[ { "from": "system", "value": "feat: Add initial arrow function test\n" }, { "from": "human", "value": "describe(\"About Functions\", function () {\n\n describe(\"Default Parameters\", function () {\n\n it(\"should understand default parameters basic usage\", function () {\n\n function g...
javascript
chosen
[ { "from": "system", "value": "Add function to populate storage\n" }, { "from": "human", "value": "'use strict'\n\n// Code thanks to MDN\nexport function storageAvailable (type) {\n try {\n let storage = window[type]\n let x = '__storage_test__'\n storage.setItem(x, x)\n storage.remo...
javascript
chosen
[ { "from": "system", "value": "Add MarkerGroup in Map by device geo info\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { Box, Tabs, Tab } from 'grommet';\nimport { Map } fro...
javascript
chosen
[ { "from": "system", "value": "Put LPD status as first in pre-campaign dashboard\n" }, { "from": "human", "value": "export default {\n 'id': -9,\n 'title': 'EOC Pre Campaign',\n 'dashboardType': 'EocCampaign',\n 'builtin': true,\n 'charts': [\n {\n 'title': 'tableData',\n 'type'...
javascript
chosen
[ { "from": "system", "value": "Use Em.A rather than [] to allow for unextended prototypes\n" }, { "from": "human", "value": "import Em from 'ember';\n\nexport default Em.Component.extend({\n classNames: ['button-select'],\n buttons: null,\n selected: null,\n\n setup: Em.on('init', function() ...
javascript
chosen
[ { "from": "system", "value": "Create virtual path for static resources\n" }, { "from": "human", "value": "var express = require('express');\n\nvar app = express();\n\napp.use(express.static('resources'));\n\napp.get('/', function (request, response) {\n response.send('Hello, world.');\n})\n\n...
javascript
chosen
[ { "from": "system", "value": "Allow legend behavior to be called without arguments.\n" }, { "from": "human", "value": "var OpenLayersPlusLegend = function(opts) {\n var self = this;\n this.map = $(opts[0]).data('map');\n\n this.setLegend = function(layer) {\n // The layer param m...
javascript
chosen
[ { "from": "system", "value": "Add high contrast to storybook\n\ncloses OUT-4252\n\nflag=none\n\nTest-plan: - Click user icon in global toolbar\n - Switch between 'canvas' and 'canvas-high-contrast'\n - Verify that components display in expected contrast\n - Verify that all stories are rendering as expected ...
javascript
chosen
[ { "from": "system", "value": "Convert a module's call to BEST.helpers.timeline -> BEST.helpers.piecewise\n" }, { "from": "human", "value": "BEST.module('arkady.pevzner:timeline-example', {\n behaviors: {\n '#ui-el' : {\n size: [100, 100],\n style: function(myStyl...
javascript
chosen
[ { "from": "system", "value": "Add babel-polyfill to aquifers SPA\n" }, { "from": "human", "value": "/*\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n ...
javascript
chosen
[ { "from": "system", "value": ":book: Add method for describing intent\n" }, { "from": "human", "value": "function getOpeningHoursMessage(status) {\n if (status.isOpen) {\n const closedNext = status.until;\n const closedTime = closedNext.format('h:mm a');\n const closedDay = closedNext....
javascript
chosen
[ { "from": "system", "value": "Connect to the testing signaling server\n" }, { "from": "human", "value": "var isTestling = typeof __testlingConsole != 'undefined';\nvar remoteSignaller = '//switchboard.rtc.io';\n// var remoteSignaller = 'http://localhost:3000';\n\nmodule.exports = {\n signalling...
javascript
chosen
[ { "from": "system", "value": "Replace object spread operator with Object.assign\n" }, { "from": "human", "value": "const knex = require('knex')\nconst config = require('server/services/config')\n\nvar defaults = {\n pool: {\n min: 2,\n max: 10\n },\n migrations: {\n tableName: 'schem...
javascript
chosen
[ { "from": "system", "value": "Make destroyOAuthToken action destroy & recreate Octokat instance\n\nFix Bug #32\n" }, { "from": "human", "value": "import * as types from './actionTypes';\nimport GithubAPI from '../api/githubAPI';\n\nexport function oauthTempCodeReceived(tempCode) {\n return {t...
javascript
chosen
[ { "from": "system", "value": "Trim whitespace from banner text before checking\n" }, { "from": "human", "value": "(function (GOVUK) {\n \"use strict\";\n\n var sendVirtualPageView = function() {\n var $element = $(this);\n var url = $element.data('url');\n if (GOVUK.analytics && url)...
javascript
chosen
[ { "from": "system", "value": "Remove scrolling to left 0 on half page up or down\n" }, { "from": "human", "value": "import { behavior, scroll, scrollStep } from './utils'\n\nexport function scrollDown (event) {\n scroll(event.repeat, scrollStep, 'scrollTop')\n}\n\nexport function scrollUp (even...
javascript
chosen
[ { "from": "system", "value": "Add prop-types as a peer dependency\n\nThis further reduces the bundle size to 8k\n" }, { "from": "human", "value": "import path from 'path';\nimport UglifyJSPlugin from 'uglifyjs-webpack-plugin';\nimport ExtractTextPlugin from 'extract-text-webpack-plugin';\n\ncons...
javascript
chosen
[ { "from": "system", "value": "Update notes migration to use examiner and startDate\n" }, { "from": "human", "value": "var config = require('../config.js');\nvar nano = require('nano')(config.couchAuthDbURL);\nvar maindb = nano.use('main');\nvar uuid = require('node-uuid');\nvar recordsToUpdate ...
javascript
chosen
[ { "from": "system", "value": "Add new span for displaying search query\n" }, { "from": "human", "value": "import PropTypes from 'prop-types';\nimport React, { Fragment } from 'react';\nimport AUtextInput from '@gov.au/text-inputs';\n\n\n/**\n * The Search Results component\n *\n * @disable-docs\...
javascript
chosen
[ { "from": "system", "value": "Improve UI flow for adding cross references.\n" }, { "from": "human", "value": "import { InsertInlineNodeCommand as SubstanceInsertInlineNodeCommand } from 'substance'\n\n/**\n Reusable command implementation for inserting inline nodes.\n\n @class InsertInlineNode...
javascript
chosen
[ { "from": "system", "value": "Fix displaying the sub query name if not available" }, { "from": "human", "value": "\nimport { isString, isEmpty } from 'lodash'\nimport Expression from './base'\n\n/**\n * @class SubQueryExpression\n */\nexport default class SubQuery extends Expression {\n \n /**...
javascript
chosen
[ { "from": "system", "value": "Use local WOF PIP service\n" }, { "from": "human", "value": "var through = require( 'through2' );\nvar logger = require( 'pelias-logger' ).get( 'openaddresses' );\nvar peliasAdminLookup = require( 'pelias-wof-admin-lookup' );\n\nfunction createAdminLookupStream(enab...
javascript
chosen
[ { "from": "system", "value": "Add canvas width height vars\n" }, { "from": "human", "value": "/**\n * @fileoverview WebGL.js - Set up WebGL context\n * @author Ben Brooks (beb12@aber.ac.uk)\n * @version 1.0\n */\n\n/**\n * Initialise the WebGL context and return it\n * @params canvas - HTML5 Can...
javascript
chosen
[ { "from": "system", "value": "Enforce indentation of switch/case statements\n" }, { "from": "human", "value": "module.exports = {\n rules: {\n // Disallow dangling commas\n 'comma-dangle': [2, 'never'],\n\n // Allow anonymous functions\n 'func-names': [0],\n\n // Allow short iden...
javascript
chosen
[ { "from": "system", "value": "Add second solution for subsets\n" }, { "from": "human", "value": "// https://leetcode.com/problems/subsets/description/\n\n/**\n * @param {number[]} nums\n * @return {number[][]}\n */\nvar subsets = function (nums) {\n let result = [[]];\n for (let num of nums) {...
javascript
chosen
[ { "from": "system", "value": "Fix for .bowerrc not being copied\n" }, { "from": "human", "value": "var gulp = require('gulp');\n\ngulp.task('default', function(done){\n gulp.src(__dirname + '/template/**')\n .pipe(gulp.dest('./'))\n .on('end', function () {\n done();\...
javascript
chosen
[ { "from": "human", "value": "Add real behavior of the library\n" }, { "from": "gpt", "value": "window.onerror = function () {\n var words = 'aie ouille hurt ouch oops boo cry rah huh oh ahen wow poop'.split(' ');\n var rand = Math.floor((Math.random() * words.length));\n\n console.log(words[r...
javascript
chosen
[ { "from": "system", "value": "Add local base URL for iOS\n" }, { "from": "human", "value": "import secrets from './secrets' // See README\n\nexport default {\n apiKey: secrets.apiKey,\n baseUrl: 'http://10.0.2.2:5000/api/v1/', // AVD,\n // baseUrl: 'http://192.168.56.1:5000/api/v1/' // Genymo...
javascript
chosen
[ { "from": "system", "value": "Add PUT and DELETE to Access-Control-Allow-Methods.\n" }, { "from": "human", "value": "var http = require('http');\nhttp.createServer(function (req, res) {\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.writeHead(200, {'Content-Type': 'application/...
javascript
chosen
[ { "from": "system", "value": "Fix samples comparison after upgrading to MSON Zoo 3.0.\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDomServer from 'react-dom/server';\nimport msonZoo from 'mson-zoo';\nimport jsBeautify from 'js-beautify';\nimport fs from 'fs';\nimpor...
javascript
chosen
[ { "from": "system", "value": "Set scope attrs to optional\n" }, { "from": "human", "value": "angular.module('mwUI.UiComponents')\n//TODO rename\n .directive('mwTabsPane', function () {\n return {\n scope: {\n title: '@mwTabsPane',\n id: '@',\n icon: '@',\n to...
javascript
chosen
[ { "from": "system", "value": "Add task to transpile all general es6 scripts\n" }, { "from": "human", "value": "var\n gulp = require('gulp'),\n babel = require('gulp-babel'),\n watch = require('gulp-watch'),\n uglify = require('gulp-uglify'),\n strip = require('gulp-stri...
javascript
chosen
[ { "from": "system", "value": "Make sure the default adapter is cleared before every test run.\n" }, { "from": "human", "value": "beforeEach(function () {\n});\n" }, { "from": "gpt", "value": "(function(once) { if(once) return function() {};\n global.itBehavesLikeAnAdapter = require(...
javascript
chosen
[ { "from": "system", "value": "Fix port cli integration test\n" }, { "from": "human", "value": "import {expect} from 'chai'\nimport {ENV_NAME, TEST_SERVICE_NAME} from '../../environment'\nimport Automator from '../../util/cli-automator'\n\nexport default function () {\n\n this.When(/I get the in...
javascript
chosen
[ { "from": "system", "value": "Check for reference handlers only when resetting to default state.\n" }, { "from": "human", "value": "var $$ = React.createElement;\n\nvar stateHandlers = {\n\n handleSelectionChange: function(writerCtrl, sel) {\n var surface = writerCtrl.getSurface();\n if (...
javascript
chosen
[ { "from": "system", "value": "Add standard, standard_level, theme to ga's\n\nGo back to the list state after successful creation\n\nSee #81\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports =\n\n/*@ngInject*/\nfunction GrammarActivitiesCreateCmsCtrl (\n $scope, _, GrammarActivi...
javascript
chosen
[ { "from": "system", "value": "Break back into three parts.\n\nsvn path=/trunk/; revision=569\n" }, { "from": "human", "value": "#!/usr/bin/env seed\n\nSeed.import_namespace(\"Gtk\");\nGtk.init(null, null);\n\nBrowserToolbar = new GType({\n parent: Gtk.HBox.type,\n name: \"BrowserToolbar\",...
javascript
chosen
[ { "from": "system", "value": "Mark injected resources with attribute 'data-spark-injected' for further processing on the server. This is required for the resource caching feature of spark.\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar inject = require('gulp-inject');\nvar p...
javascript
chosen
[ { "from": "system", "value": "Implement simple throttling for preview iframe refreshes.\n" }, { "from": "human", "value": "(function(window, $) {\n var document = window.document;\n var preview_iframe;\n\n var iframe_name = 'live_preview'; // Name (and id) to give to the preview ifram...
javascript
chosen
[ { "from": "system", "value": "Add method to get single user group IDs\n" }, { "from": "human", "value": "Meteor.methods({\n addSingleUserPermissions(userId, groupIds) {\n // Remove existing user permissions\n Permissions.remove({ userId });\n\n // add new permissions, if any group IDs ...
javascript
chosen
[ { "from": "system", "value": "Remove version constraint from `ecmascript` in `shell-server`.\n\nWe only need version constraints on core packages in some cases. For\nexample, when referring to \"core\" package wrappers (like `npm-mongo`)\nwhich uses an API outside the Meteor build system.\n" }, { "...
javascript
chosen
[ { "from": "system", "value": "Make the weather page use a named controller.\n\nWe have to use named controllers rather than inline controllers because\nwe want to be able to indicate to the client which controller to use to\nrender the page. We can send the client a string to look up, but we can't\nreliably...
javascript
chosen
[ { "from": "system", "value": "Add hint to check phone\n" }, { "from": "human", "value": "import $ from 'jquery';\n\nimport Scene from 'Scene';\nimport bedroom from 'scenes/bedroom';\nimport homeHallway from 'scenes/homeHallway';\n\nimport Door from 'entities/Door';\nimport cellPhone from 'entiti...
javascript
chosen
[ { "from": "system", "value": "Fix electron file to der-reader dist\n" }, { "from": "human", "value": "'use strict';\n\nvar webspeechapi, vibrateWebApi, DerReader;\n\nconst env = require('./env/env.json').env;\n\nif (env === 'dev') {\n webspeechapi = require('./../modules/tts.webapi/tts.webapi.j...
javascript
chosen
[ { "from": "system", "value": "Add search middleware and GA to site search integration example\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport { createStore, combineReducers, applyMiddleware } from 'redux'\nimport { Provider } from 'react-r...
javascript
chosen
[ { "from": "system", "value": "[client] Allow specifying a request body for dataset creation requests\n" }, { "from": "human", "value": "const assign = require('object-assign')\nconst validate = require('../validators')\n\nfunction DatasetsClient(client) {\n this.request = client.request.bind(cl...
javascript
chosen
[ { "from": "system", "value": "Return catcher value, give catcher the callback.\n" }, { "from": "human", "value": "var slice = [].slice\nvar eject = require('eject')\n\n// todo: create strings parser.\nfunction Interrupt () {\n this._types = {}\n}\n\nInterrupt.prototype._populate = function (e...
javascript
chosen