conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix tests for pulse-settings component\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\n\nmoduleForComponent('pulse-settings', 'Integration | Component | pulse settings', {\n ...
javascript
chosen
[ { "from": "system", "value": "Add Bootstrap CSS file reference in grunt task\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.loadNpmTasks('grunt-bower-concat');\n var taskConfig = {\n pkg: grunt.file.readJSON('package.json'),\n bower_concat: {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix loading bug with last merge\n" }, { "from": "human", "value": "var baseHref = `http://localhost: ${process.env.npm_package_config_port}`\nvar appEntry = `${baseHref} /gen/app.entry.js`\n\nvar baseNode = document.createElement('base')\nbaseNode.href = baseHref\nd...
javascript
chosen
[ { "from": "system", "value": "Remove color switcher fade effect" }, { "from": "human", "value": "$(document).ready(function () {\n\n $('#primaryPostForm').validate()\n\n // Image preview in upload input\n $('.form__input--upload').on('change', function () {\n\n var label = $(this...
javascript
chosen
[ { "from": "system", "value": "Revert \"Fix for possible deref of cleaned up source component\"\n\nThis reverts commit 2b35e47816edb0f655fca21d108d651a6a218b2c.\n" }, { "from": "human", "value": "/*\n * Copyright (C) 2012 salesforce.com, inc.\n *\n * Licensed under the Apache License, Version 2.0...
javascript
chosen
[ { "from": "human", "value": "[bar] Add summary inside the bar.\n" }, { "from": "gpt", "value": "var builder = require('focus').component.builder;\nvar React = require('react');\nvar applicationStore = require('focus').application.builtInStore();\n\nvar barMixin = {\n getDefaultProps: function g...
javascript
chosen
[ { "from": "system", "value": "Fix \"Axis Tick Styling\" example.\n" }, { "from": "human", "value": "var options = {\n container: document.getElementById('myChart'),\n data: generateSpiralData(),\n series: [{\n type: 'line',\n xKey: 'x',\n yKey: 'y',\n marker:...
javascript
chosen
[ { "from": "system", "value": "Fix remove last element from select box\n" }, { "from": "human", "value": "$.fn.productAutocomplete = function (options) {\n 'use strict'\n\n // Default options\n options = options || {}\n var multiple = typeof (options.multiple) !== 'undefined' ? options.multip...
javascript
chosen
[ { "from": "system", "value": "Add shortcut keys for the main navigation" }, { "from": "human", "value": "import React from 'react'\nimport { Link } from 'react-router'\nimport { ElloMark } from '../iconography/ElloIcons'\n\nclass Navbar extends React.Component {\n render() {\n return (\n ...
javascript
chosen
[ { "from": "system", "value": "Use port from variable instead of hard coding\n\n### Changes\r\n1. Edited error description to add port's value from variable instead of hard coding. Also removed redundant `//` between localhost and port." }, { "from": "human", "value": "import express from 'expres...
javascript
chosen
[ { "from": "system", "value": "Allow image_uri to be part of the public API\n" }, { "from": "human", "value": "import BlogPost from '../database/models/blog-post';\nimport log from '../log';\n\nconst PUBLIC_API_ATTRIBUTES = [\n 'id',\n 'title',\n 'link',\n 'description',\n 'date_updated',\n ...
javascript
chosen
[ { "from": "system", "value": "Make the graph labels nicer\n" }, { "from": "human", "value": "import _ from 'lodash'\n\nclass GraphController {\n constructor() {\n this.prepareData();\n }\n\n prepareData() {\n // I am assuming the reference object is always sent\n // at position 0 so ...
javascript
chosen
[ { "from": "system", "value": "Reset search on page change\n" }, { "from": "human", "value": "/* By default the search is hidden. When you add a component on the page that wants to use the search,\n * then add this as a mixin. It will use CSS to activate the search while the component is shown.\n...
javascript
chosen
[ { "from": "system", "value": "Exit fragment-ready event handler when it's from a non-applicable fragment\n" }, { "from": "human", "value": "(function ($) {\n\nvar FIELDS = {\n 'centerpage': 'referenced_cp',\n 'channel': 'query',\n 'query': 'raw_query'\n};\n\n\nvar show_matching_field = ...
javascript
chosen
[ { "from": "system", "value": "Add matrix calcs to direction shadow class\n" }, { "from": "human", "value": "import { LightShadow } from './LightShadow.js';\nimport { OrthographicCamera } from '../cameras/OrthographicCamera.js';\n\n/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nfunction Dire...
javascript
chosen
[ { "from": "system", "value": "Handle GitHub's updated Content Security Policy\n\nIt looks like GitHub changed their CSP recently. This extension didn't work for me until I added this code.\n" }, { "from": "human", "value": "// this idea borrowed from\n// https://www.planbox.com/blog/development/...
javascript
chosen
[ { "from": "system", "value": "Add stopwatch as auth protected route\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport {\n BrowserRouter as Router,\n Route,\n Switch\n} from 'react-router-dom';\n\nimport MonthDetail from './components/pages/History/Mont...
javascript
chosen
[ { "from": "system", "value": "Move cursor after image when inserting\n" }, { "from": "human", "value": "import {\n EditorState,\n AtomicBlockUtils,\n} from 'draft-js';\n\nexport default (editorState, url, extraData) => {\n const urlType = 'image';\n const contentState = editorState.getCurren...
javascript
chosen
[ { "from": "system", "value": "Disable debug output, add missing var\n" }, { "from": "human", "value": "include('helma/webapp/response');\ninclude('helma/engine');\ninclude('helma/jsdoc');\nrequire('core/array');\n\nexports.index = function index(req, module) {\n var repo = new ScriptRepositor...
javascript
chosen
[ { "from": "system", "value": "Add better fix for handling invalid markdown inputs\n" }, { "from": "human", "value": "import { node, object, oneOfType, string } from 'prop-types'\nimport Bit from './Bit'\nimport Code from './Code'\nimport HTML from 'html-parse-stringify'\nimport React from 'react...
javascript
chosen
[ { "from": "system", "value": "Remove protractor:dist from the ci task (gulp).\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\n\ngulp.task(\n 'ci',\n ['coding-standards', 'test', 'protractor', 'protractor:dist']\n);\n" }, { "from": "gpt", "value": ...
javascript
chosen
[ { "from": "system", "value": "Set codemirror size when opening modal.\n" }, { "from": "human", "value": "\"use strict\";\n\njsns.run([\n \"htmlrest.domquery\",\n \"htmlrest.storage\",\n \"htmlrest.rest\",\n \"htmlrest.controller\",\n \"htmlrest.widgets.navmenu\",\n \"edity.pag...
javascript
chosen
[ { "from": "system", "value": "Add success notifcation for project creation\n" }, { "from": "human", "value": "define(['react', 'collections/projects', 'models/project', 'rsvp'], function(React, Collection, Model, RSVP) {\n\n var projects = new Collection();\n\n var getProjects = function()...
javascript
chosen
[ { "from": "system", "value": "Handle user signing and redirect\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport Modal from 'shared/components/modal/modal';\nimport Form from 'shared/components/form/form';\nimport FormEmail from 'shared/components/form/formEmai...
javascript
chosen
[ { "from": "system", "value": "Allow 'vim' command to accept an array of arguments.\n" }, { "from": "human", "value": "// Copyright (c) 2014 The Chromium OS Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\ni...
javascript
chosen
[ { "from": "system", "value": "Allow repr to show java.lang.Iterables.\n" }, { "from": "human", "value": "function quote(s) {\n\treturn \"\\\"\" + s.replace(/([\\\\\\\"])/, \"\\\\$1\") + \"\\\"\";\n}\n\nfunction maybe_quote(s) {\n\tif (/[\\\\\\\"]/.test(s))\n\t\treturn quote(s);\n\telse\n\t\tretu...
javascript
chosen
[ { "from": "system", "value": "Change default health to 1.\n" }, { "from": "human", "value": "function Actor(other) {\n\tother = other || {};\n\tthis.name = other.name || \"\";\n\tthis.init = other.init || 0;\n\tthis.hp = other.hp || 0;\n};\nvar sort = function(left, right) {\n\treturn left.init=...
javascript
chosen
[ { "from": "system", "value": "Fix new Worker() compatibility check in unit tests for older node versions\n" }, { "from": "human", "value": "module.exports = function supportsWorker() {\n\ttry {\n\t\t// eslint-disable-next-line node/no-unsupported-features/node-builtins\n\t\treturn require(\"work...
javascript
chosen
[ { "from": "system", "value": "Fix issue where team page is not found\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport Helmet from 'react-helmet'\n\nimport { NavBar } from '../../components'\n\nconst styles = {\n iframe: {\n width: '100%',\n }\n}\n\nclass T...
javascript
chosen
[ { "from": "system", "value": "[turbofan] Fix test of %_MathClz32 intrinsic.\n\nThis test will fail once we optimize top-level code, because the\naforementioned intrinsic doesn't perform a NumberToUint32 conversion.\n\nR=titzer@chromium.org\nTEST=mjsunit/asm/math-clz32\n\nReview URL: https://codereview.chrom...
javascript
chosen
[ { "from": "system", "value": "Make it clearer when the r.js optimizer starts\n" }, { "from": "human", "value": "//Create a runner that will run a separate build for each item\n//in the configs array. Thanks to @jwhitley for this cleverness\nfor (var i = 0; i < __Screwdriver.rjs.moduleConfigs.len...
javascript
chosen
[ { "from": "system", "value": "Add skill rating and make win rate more precise\n\nFixes #1\n" }, { "from": "human", "value": "import fetch from 'node-fetch';\nimport { API_URL, HTTP_HEADERS } from '../constants';\n\nconst headers = HTTP_HEADERS;\n\nconst formatStats = (data, battletag, competitiv...
javascript
chosen
[ { "from": "system", "value": "Add key to iterated objects\n" }, { "from": "human", "value": "var React = require('react');\nvar classNames = require('classnames');\n\nvar ListItem = require('./ListItem');\nvar ListItemGroup = require('./ListItemGroup');\n\nvar List = React.createClass({\n displ...
javascript
chosen
[ { "from": "system", "value": "Remove unused endpoints on session route\n" }, { "from": "human", "value": "import routes from '../routes'\nimport request from '../request'\n\nconst create = (opts, email, password) =>\n request.post(opts, routes.session, { email, password })\n\nconst verify = Pro...
javascript
chosen
[ { "from": "system", "value": "Add localMin and globalMin to API\n" }, { "from": "human", "value": "var eng = require('./node/engine');\n\nmodule.exports = {\n minimize: function(func, options, callback) {\n eng.runPython('minimize', func, options, callback);\n },\n nonNegLeastSquares: func...
javascript
chosen
[ { "from": "system", "value": "Use arrow functions instead of vm variable (WAL-400)\n" }, { "from": "human", "value": "const volumeSnapshots = {\n templateUrl: 'views/partials/filtered-list.html',\n controller: VolumeSnapshotsListController,\n controllerAs: 'ListController',\n bindings: {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove \"cast\" from Promise test\n\nPromise.resolve now behaves as Promise.cast\n" }, { "from": "human", "value": "/*!\n{\n \"name\": \"ES6 Promises\",\n \"property\": \"promises\",\n \"caniuse\": \"promises\",\n \"polyfills\": [\"es6promises\"],\n \"authors\"...
javascript
chosen
[ { "from": "system", "value": "chore: Add component name for LoadingBar plugin\n" }, { "from": "human", "value": "import Vue from 'vue'\n\nimport { isSSR } from './platform.js'\nimport QAjaxBar from '../components/ajax-bar/QAjaxBar.js'\n\nexport default {\n start () {},\n stop () {},\n increme...
javascript
chosen
[ { "from": "system", "value": "Remove the timer for monitoring the icegatheringstate\n" }, { "from": "human", "value": "module.exports = function(pc, candidates, callback) {\n var timer;\n\n pc.onicecandidate = function(evt) {\n if (evt.candidate) {\n console.log(evt);\n candidates...
javascript
chosen
[ { "from": "system", "value": "Correct comment on parsing route parameters instead of query\n" }, { "from": "human", "value": "'use strict'\r\n\r\n\r\nmodule.exports = (function(){\r\n /**\r\n * Import modules\r\n */\r\n const footballDb = require('./../db/footballDb')\r\n /**\r\...
javascript
chosen
[ { "from": "system", "value": "Remove global binding that is now not needed anymore\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n function fetchPonyfill(options) {\n var Promise = options && options.Promise || self.Promise;\n var XMLHttpRequest = options && options...
javascript
chosen
[ { "from": "system", "value": "Update JSDOM usage due to API change\n" }, { "from": "human", "value": "// Remove the PUBLIC_URL, if defined\nprocess.env.PUBLIC_URL = ''\n\nprocess.env.INSPIRE_API_URL = 'inspire-api-url'\n\nrequire('babel-register')()\n\nconst { jsdom } = require('jsdom')\nconst m...
javascript
chosen
[ { "from": "system", "value": "firefox: Disable a few unused features\n" }, { "from": "human", "value": "user_pref(\"accessibility.typeaheadfind.flashBar\", 0);\nuser_pref(\"accessibility.typeaheadfind.prefillwithselection\", true);\nuser_pref(\"browser.backspace_action\", 2);\nuser_pref(\"browse...
javascript
chosen
[ { "from": "system", "value": "Replace api key with env vars\n" }, { "from": "human", "value": "module.exports = {\n siteMetadata: {\n siteUrl: 'https://chocolate-free.com/',\n title: 'Chocolate Free',\n },\n plugins: [\n {\n resolve: 'gatsby-source-contentful',\n options: {...
javascript
chosen
[ { "from": "system", "value": "Add mentors route to router\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('mission-control').config(['$stateProvider', '$urlRouterProvider',\n function ($stateProvider, $urlRouterProvider) {\n // For unmatched routes\n $urlRouterProvider....
javascript
chosen
[ { "from": "system", "value": "Add simple test case for browser `.get`\n" }, { "from": "human", "value": "var expect = require('chai').expect;\nvar request = require('supertest');\nvar http = require('http');\nvar cookie = require('../lib/browser');\n\ndescribe('server-side cookie', function() {\...
javascript
chosen
[ { "from": "system", "value": "Set referer header to prevent CSRF\n" }, { "from": "human", "value": "// Copyright (C) 2007-2014, GoodData(R) Corporation.\nvar httpProxy = require('http-proxy');\n\nmodule.exports = function(host) {\n var currentHost, currentPort;\n\n var proxy = new httpProx...
javascript
chosen
[ { "from": "system", "value": "Update each series results to be embedded in the reduce\n" }, { "from": "human", "value": "import when from 'when';\n\nlet\n openFiles = ['a.js', 'b.js', 'c.js'],\n saveFile = (file) => {\n console.log('saveFile', file);\n return new Promise((res...
javascript
chosen
[ { "from": "system", "value": "Convert two .set() calls into one .update()\n" }, { "from": "human", "value": "\"use strict\";\n\nvar db = require(\"./firebase\");\n\n// Ensure the updated timestamp is always accurate-ish\nmodule.exports = function(ref) {\n ref.on(\"child_changed\", function(sn...
javascript
chosen
[ { "from": "system", "value": "Use username if nickname is null\n" }, { "from": "human", "value": "const eris = justcord.eris;\nconst config = justcord.config;\nconst chat = justcord.chat;\n\neris.on(\"ready\", () => {\n console.log(\"Justcord ready!\"); // TODO: Add logging utility functions\...
javascript
chosen
[ { "from": "system", "value": "Update up to changes in event-emitter package\n" }, { "from": "human", "value": "'use strict';\n\nvar noop = require('es5-ext/function/noop')\n , assign = require('es5-ext/object/assign')\n , memoize = require('memoizee')\n , ee = require('event-emit...
javascript
chosen
[ { "from": "system", "value": "Fix typo in error message\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// Must symlink the generator from xtc's modules up to the project's modules.\n// Else Yeoman won't find it.\n\nvar path = require('path')\n\tfs = require('fs')\n;\n\n// process.cwd(...
javascript
chosen
[ { "from": "system", "value": "Fix setting GroupId on ItemsController when its model is empty\n" }, { "from": "human", "value": "var ItemsRoute = Em.Route.extend({\n model: function (params) {\n return this.api.fetchAll('items', 'groups', params.group_id);\n },\n\n setupController: function...
javascript
chosen
[ { "from": "system", "value": "Use `Localization.getCurrentDeviceCountryAsync` if its version of expo is over 26 since it's deprecated.\n\nref:https://github.com/expo/expo-docs/tree/master/versions/v26.0.0/sdk\n" }, { "from": "human", "value": "let RNVersionCheck;\nif (process.env.RNVC_ENV === 't...
javascript
chosen
[ { "from": "system", "value": "Allow viewport to be initialized with a pre-existing camera model\n" }, { "from": "human", "value": "cinema.views.ViewportView = Backbone.View.extend({\n\n initialize: function () {\n this.$el.html(cinema.app.templates.viewport());\n\n this.camera =...
javascript
chosen
[ { "from": "system", "value": "Rewrite documentation urls to forward on the embedded flag\n" }, { "from": "human", "value": "/*global CodeMirror*/\n$(function() {\n $('pre').each(function() {\n var preElement = $(this);\n var code = dedent(preElement.text()).trim();\n preElement.empty()...
javascript
chosen
[ { "from": "system", "value": "Add ids to the markup\n" }, { "from": "human", "value": "(function(global) {\n 'use strict';\n\n (function(id) {\n var i, j;\n var tab = document.getElementById(id);\n var thead = tab.querySelector('thead');\n var tbody = tab.queryS...
javascript
chosen
[ { "from": "system", "value": "Remove support for MONGOHQ_URL env variable\n" }, { "from": "human", "value": "module.exports = {\n db: process.env.MONGODB || process.env.MONGOHQ_URL || 'mongodb://localhost:27017/gamekeller',\n sessionSecret: process.env.SESSION_SECRET || 'gkdevel'\n}" }, { ...
javascript
chosen
[ { "from": "system", "value": "Drop support for older browsers\n\nBy only targeting modern evergreen browsers in our build we can\nsignificantly reduce the amount of extra code we generate to be\ncompatible with older browsers. This will make our application smaller\nto download and faster to parse.\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Fix async reads from the choppa." }, { "from": "human", "value": "var through = require('through2');\n\nvar choppa = function(chunkSize) {\n chunkSize = chunkSize === undefined ? 1 : chunkSize;\n var prev = new Buffer(0);\n\n var transform = function(chunk, enc, ...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix error when files are not found\n\nUsing include syntax with a wrong path resulted in a crash without emitting an error message." }, { "from": "human", "value": "var aglio = require('aglio');\nvar through2 = require('through2');\nvar gutil = require('gulp-u...
javascript
chosen
[ { "from": "system", "value": "Use templates to cleanup query\n" }, { "from": "human", "value": "const getJSON = require('get-json');\n\nconst overpass = 'http://overpass-api.de/api/interpreter?data=';\nconst query = '[out:json];way[%22highway%22](around:50,51.424037,-0.148666);out;';\n\ngetJSON(...
javascript
chosen
[ { "from": "system", "value": "Add google+ as alias for googleplus\n" }, { "from": "human", "value": "var qs = require('querystring')\n\nmodule.exports = function (network, url, opts) {\n\n opts = opts || {}\n\n if (!linkfor[network]) throw new Error('Unsupported network ' + network)\n return ...
javascript
chosen
[ { "from": "system", "value": "feat: Update plugin to use PostCSS 8\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar postcss = require('postcss');\nvar SEProperties = require('swedish-css-properties');\nvar SEValues = require('swedish-css-values');\n\nmodule.exports = postcss.pl...
javascript
chosen
[ { "from": "system", "value": "Switch to double quotes inside the exec\n\nThis allows the exec call to work properly with Windows.\n" }, { "from": "human", "value": "var exec = require('child_process').exec;\nmodule.exports = function sysPrefix() {\n return new Promise(function(resolve, reject) ...
javascript
chosen
[ { "from": "system", "value": "Fix dotenv to work locally instead of just on heroku\n" }, { "from": "human", "value": "const express = require('express');\nconst shortUrlController = require('./lib/short-url-controller.js');\nconst stubController = require('./lib/stub-controller.js');\nconst logg...
javascript
chosen
[ { "from": "system", "value": "Return a single value when n=1\n\n* Worked previously: last([1], 1) === 1\n* Broken previously: last([1, 2], 1) === 2\n" }, { "from": "human", "value": "/*!\n * array-last <https://github.com/jonschlinkert/array-last>\n *\n * Copyright (c) 2014 Jon Schlinkert, contr...
javascript
chosen
[ { "from": "system", "value": "Make sure we always load the schema, even within a test\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar fs = require('fs');\n\nmodule.exports = {\n name: 'uncharted-describe-models',\n\n config: function(env, config) {\n if (env...
javascript
chosen
[ { "from": "system", "value": "Send HTTP responses for all messages\n" }, { "from": "human", "value": "var restify = require('restify');\n\nvar messenger = require('./lib/messenger');\nvar session = require('./lib/session');\n\nvar server = restify.createServer();\n\nserver.use(restify.queryParse...
javascript
chosen
[ { "from": "system", "value": "Add info on setting parameters in route\n" }, { "from": "human", "value": "// var http = require(\"http\");\n// app.set('view engine', 'html');\nvar express = require('express');\nvar app = express();\napp.use(express.static(__dirname + '/views'));\napp.use(express....
javascript
chosen
[ { "from": "system", "value": "Use relative paths for componentTemplate and handlebarsHelpers paths\n" }, { "from": "human", "value": "module.exports = {\n handlebars: require('./lib/handlebars'),\n marked: require('./lib/marked'),\n componentTemplate: 'node_modules/foundation-docs/templates/c...
javascript
chosen
[ { "from": "system", "value": "Update tilelive pool factory create method to pass errors.\n" }, { "from": "human", "value": "var Map = require('./lib/map'),\n Format = require('./lib/format'),\n safe64 = require('./lib/safe64');\n\nmodule.exports = {\n Map: Map,\n Format: Format,\n ...
javascript
chosen
[ { "from": "system", "value": "Make the 'd' in 'updated' optional along with the space before the date\n" }, { "from": "human", "value": "\"use strict\";\n\nconst util = require(\"gulp-util\");\nconst through = require(\"through2\");\nconst moment = require(\"moment\");\n\nmodule.exports = functi...
javascript
chosen
[ { "from": "system", "value": "Fix ignore list to work with query string params.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n name: 'live-reload-middleware',\n\n serverMiddleware: function(options) {\n var app = options.app;\n options = options.options;\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add linkid to google analytics\n" }, { "from": "human", "value": "import ReactGA from 'react-ga'\nimport {config} from 'config'\n\nReactGA.initialize(config.googleAnalyticsId);\n\nexports.onRouteUpdate = (state, page, pages) => {\n ReactGA.pageview(state.pathname);...
javascript
chosen
[ { "from": "system", "value": "WIP: Add button to cancel job\n" }, { "from": "human", "value": "import JobStatus from 'girder_plugins/jobs/JobStatus';\n\nJobStatus.registerStatus({\n WORKER_FETCHING_INPUT: {\n value: 820,\n text: 'Fetching input',\n icon: 'icon-download',\...
javascript
chosen
[ { "from": "system", "value": "Use require() instead of import().\n" }, { "from": "human", "value": "import Enzyme from 'enzyme';\nimport Adapter from 'enzyme-adapter-react-16';\n\n// Configure Enzyme\nEnzyme.configure({ adapter: new Adapter() });\n\n// Add RAF for React 16\nglobal.requestAnimati...
javascript
chosen
[ { "from": "human", "value": "Write first component and start first API call\n" }, { "from": "gpt", "value": "class SearchBox extends React.Component {\n // constructor(){\n // super();\n // this.state = {\n // searched:false;\n // };\n // }\n\trender() {\n\t\treturn (\n <div...
javascript
chosen
[ { "from": "system", "value": "Make the port attribute lowercase\n\n```\n// truffle-config.js\n{\n// ...\n db: {\n port: 69420\n }\n}\n\n```\n" }, { "from": "human", "value": "const command = {\n command: \"serve\",\n description: \"Start Truffle's GraphQL UI playground\",\n builder: {},\...
javascript
chosen
[ { "from": "system", "value": "Add POC for showing the closes weather observation data" }, { "from": "human", "value": "require('jquery')\nrequire('expose?$!expose?jQuery!jquery')\nrequire(\"bootstrap-webpack\")\nrequire('./less/index.less')\n" }, { "from": "gpt", "value": "require('j...
javascript
chosen
[ { "from": "system", "value": "Use Object.entries instead of Object.keys\n" }, { "from": "human", "value": "import * as path from 'path';\nimport {fs} from 'node-promise-es6';\nimport * as fse from 'fs-extra-promise-es6';\n\nexport default class {\n constructor(basePath) {\n this.basePath = p...
javascript
chosen
[ { "from": "system", "value": "Use built-in utils to format the string.\n" }, { "from": "human", "value": "var notify = require(\"./notify\");\n\nmodule.exports = function notifyStyleLint (stdout) {\n var messages = stdout.split(\"\\n\");\n\n messages.pop(); // Remove last empty new message.\n\...
javascript
chosen
[ { "from": "system", "value": "Add jquery UI drag/drop functionality\n" }, { "from": "human", "value": "appRun();\n\nfunction appRun() {\n\n $(document).ready(function() {\n console.log(\"READY\");\n\n $(\".loading\").hide();\n $(\".complete\").show();\n\n //PAGE SWIPES...
javascript
chosen
[ { "from": "system", "value": "Add meted only if exist\n" }, { "from": "human", "value": "// @flow\nconst promiseBindMiddleware = (\n { dispatch } : { dispatch : Function },\n) => (next: Function) => (action: Object) => {\n if (action && action.promise && typeof action.promise === 'function') {...
javascript
chosen
[ { "from": "system", "value": "Refactor dataLayerPush to use func.arguments.\n" }, { "from": "human", "value": "\n/**\n * Internal dependencies\n */\nimport { DATA_LAYER } from './index.private';\n\n/**\n * Returns a function which, when invoked will initialize the dataLayer and push data onto it...
javascript
chosen
[ { "from": "system", "value": "Add a model for Object.assign\n" }, { "from": "human", "value": "export default function(state, ctx, model, helpers) {\n\n\tconst ConcretizeIfNative = helpers.ConcretizeIfNative;\n\n\t//TODO: Test IsNative for apply, bind & call\n\tmodel.add(Function.prototype.apply...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Move config file from gateway to config/config\n" }, { "from": "human", "value": "var nconf = require('nconf');\n\nnconf\n .env()\n .file({ file: './gateway.json' });\n\nnconf.defaults({\n 'RIPPLE_REST_API': 'http://localhost:5990',\n 'DATABASE_URL': '...
javascript
chosen
[ { "from": "system", "value": "Refactor displayStream. Add background-image and onClick\n" }, { "from": "human", "value": "//onReady\n$(function() {\n //temporary testing functionality\n $('#refreshBtn').on('click', function() {\n updateStreams();\n });\n});\n\n\nfunction updateStreams() {...
javascript
chosen
[ { "from": "system", "value": "Fix file name case on example import\n" }, { "from": "human", "value": "/**\n * Created by leojin on 3/20/16.\n */\nimport ReactDom from 'react-dom';\nimport React from 'react';\nimport App from './App';\n\nReactDom.render(<App/>, document.getElementById(\"examples\...
javascript
chosen
[ { "from": "system", "value": "Set rework `source` from `relativePath`\n\nThis will enable sourcemaps generated from rework to refer to the source by\nits name, versus the generic `source.css`.\n" }, { "from": "human", "value": "'use strict';\n\nvar assign = require('object-assign');\nvar Filter ...
javascript
chosen
[ { "from": "system", "value": "Set component div to 100% height\n" }, { "from": "human", "value": "'use strict'\n\nvar document = require('global/document')\nvar Loop = require('main-loop')\nvar virtualDom = require('virtual-dom')\nvar assert = require('assert')\nvar partial = require('ap').parti...
javascript
chosen
[ { "from": "system", "value": "Throw an error for invalid declaration types\n" }, { "from": "human", "value": "export class DecoratorUtils {\n static declarationType = [\n \"CLASS\",\n \"CLASS_METHOD\",\n \"CLASS_ACCESSOR\",\n \"OBJECT_LITERAL_METHOD\",\n \"OBJECT_LITERAL_ACCESSOR...
javascript
chosen
[ { "from": "system", "value": "Update dropdown menu tests to use enzyme.\n" }, { "from": "human", "value": "/* Copyright (C) 2017 Canonical Ltd. */\n\n'use strict';\n\nconst React = require('react');\n\nconst DropdownMenu = require('./dropdown-menu');\nconst Panel = require('../panel/panel');\n\n...
javascript
chosen
[ { "from": "system", "value": "Use null instead of empty object as {} != false but null == false\n" }, { "from": "human", "value": "var needle = require('needle');\n\nfunction Client(base_url, token) {\n this.base_url = base_url\n this.token = token || {}\n}\n\nClient.prototype.get = function (...
javascript
chosen
[ { "from": "system", "value": "Put statuses back to correct, adjust unsupported status\n" }, { "from": "human", "value": "(function(ext) {\n // Cleanup function when the extension is unloaded\n ext._shutdown = function() {};\n \n\n // Status reporting code\n // Use this to report m...
javascript
chosen
[ { "from": "system", "value": "Add security on time filter to be sure this is an integer and not a float\n" }, { "from": "human", "value": "(function(app){\n\n \"use strict\"\n\n /**\n * Creates a filter to convert a time in milliseconds to \n * an hours:minutes:seconds format.\n *\n * ...
javascript
chosen
[ { "from": "system", "value": "Add check for if mobilenav exists\n" }, { "from": "human", "value": "/* global document window */\nimport { focusFirstEl } from '../../../../../packages/spark-core/utilities/elementState';\n\nconst hideMobileNav = (nav) => {\n document.body.classList.remove('sprk-u...
javascript
chosen
[ { "from": "system", "value": "Use reduce to avoid mutating the object unneededly.\n" }, { "from": "human", "value": "'use strict';\n\nconst externalDeps = [\n\t'@angular/*',\n\t'angular',\n\t'angular-mocks',\n\t'rxjs/*',\n\t'lodash',\n\t'moment',\n\t'moment-timezone',\n];\n\nconst map = {\n\t'@a...
javascript
chosen
[ { "from": "system", "value": "Change reporter style in Karma.\n" }, { "from": "human", "value": "// Karma configuration\n// http://karma-runner.github.io/0.10/config/configuration-file.html\n\nmodule.exports = function(config) {\n config.set({\n // base path, that will be used to resolve fil...
javascript
chosen
[ { "from": "system", "value": "Add my account to header\n" }, { "from": "human", "value": "import React from 'react';\nimport MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';\nimport AppBar from 'material-ui/AppBar';\nimport IconButton from 'material-ui/IconButton';\nimport IconMenu f...
javascript
chosen