conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove logging of 401 status codes\n" }, { "from": "human", "value": "angular.module('juiceShop', [\n 'ngRoute',\n 'ngCookies',\n 'ngTouch',\n 'ngAnimate',\n 'ui.bootstrap'\n]);\n\nangular.module('juiceShop').factory('authInterceptor', ['$rootScope', ...
javascript
chosen
[ { "from": "system", "value": "Fix changelog url open bug.\n" }, { "from": "human", "value": "console.log( \"=== simpread version load ===\" )\r\n\r\nimport {browser} from 'browser';\r\n\r\n/**\r\n * Manifest.json version\r\n */\r\nconst version = browser.runtime.getManifest().version;\r\n\r\n/**...
javascript
chosen
[ { "from": "system", "value": "Use prefered method of locating actual app instance\n\nNewer versions of ember-cli have a `_findHost` function to do this for\nus but for backward compatibility we also polyfill the functionality\nwhen it's not available.\n" }, { "from": "human", "value": "/* eslint...
javascript
chosen
[ { "from": "system", "value": "Update Checking and Checkbox Behavior\n\nRemove multiline statement broke by commas. Make it all one line.\nWhen the item is checked, move it to completed.\nIf the object is checked when in completed, move it back to the active\nlist.\n" }, { "from": "human", "value...
javascript
chosen
[ { "from": "system", "value": "Make sure 'end' is dispatched only once\n" }, { "from": "human", "value": "var stream = require('stream')\n\nfunction BufferStream(source, encoding, options) {\n stream.Duplex.call(this, options)\n\n this.__buffer = typeof source === 'string' || source instanceof ...
javascript
chosen
[ { "from": "system", "value": "Add toLower() function to pass return type test\n" }, { "from": "human", "value": "/**\n * Has Vowels\n * \n * hasVowel tests if the String calling the function has a vowels\n * \n * @param {void}\n * @return {Boolean} returns true or false indicating if the string\...
javascript
chosen
[ { "from": "system", "value": "Use variable instead of static 3000 port\n" }, { "from": "human", "value": "var theme = require('./lib/theme');\nvar express = require('express');\nvar bodyParser = require('body-parser');\nvar cors = require('cors');\nvar app = express();\nvar minify = require('exp...
javascript
chosen
[ { "from": "system", "value": "Add basic middleware for parsing and serving static files\n" }, { "from": "human", "value": "var express = require('express');\n\nvar app = express();\n\nrequire('./server/utils/middleware.js')(app, express);\nrequire('./server/routes')(app, express);\nmodule.export...
javascript
chosen
[ { "from": "system", "value": "Fix default mass property of Boid class\n" }, { "from": "human", "value": "function setup() {\n createCanvas(640, 480);\n}\n\nfunction draw() {\n ellipse(50, 50, 80, 80);\n}\n\n/**\n * Boid class\n */\nfunction Boid() {\n this.location = createVector();\n this.v...
javascript
chosen
[ { "from": "system", "value": "Revert back to Local API\n" }, { "from": "human", "value": "export const TYPE_STORIES = 'story';\nexport const TYPE_TACTICS = 'tactic';\nexport const TYPE_PRINCIPLES = 'principle';\nexport const TYPE_THEORIES = 'theory';\nexport const TYPE_METHODOLOGIES = 'methodolo...
javascript
chosen
[ { "from": "system", "value": "Add onerror retry for flag loader\n" }, { "from": "human", "value": "import {generateQuizOptions} from '../data/quiz';\n\nexport const SELECT_COUNTRY = 'SELECT_COUNTRY';\nexport const SET_QUIZ = 'SET_QUIZ';\n\nexport const setQuiz = (quiz) => ({\n type: SET_QUIZ,\n...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Add route for creating transactions\n" }, { "from": "human", "value": "var express = require('express')\nvar requireAll = require('./lib/require-all')\n\nctrls = requireAll({\n dirname: __dirname + '/app/controllers',\n filter: /(.+)\\.js(on)?$/\n})\n\nv...
javascript
chosen
[ { "from": "system", "value": "Change body-parser to now be able to parse text rather than jsom\n" }, { "from": "human", "value": "const express = require('express')\nconst app = express()\nconst path = require('path')\nvar cors = require('cors')\nvar bodyParser = require('body-parser')\n\napp.us...
javascript
chosen
[ { "from": "system", "value": "Use environment defined port if available\n" }, { "from": "human", "value": "var locomotive = require('locomotive')\n , bootable = require('bootable');\n\n// Create a new application and initialize it with *required* support for\n// controllers and views. Move (or...
javascript
chosen
[ { "from": "system", "value": "Fix user event module resolution\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nvar Router = Ember.Router.extend({\n location: DashboardENV.locationType\n});\n\nRouter.map(function() {\n this.route('userevents', {path: '/userevents/:organization/...
javascript
chosen
[ { "from": "system", "value": "Fix 'this' unavailable in strict mode.\n" }, { "from": "human", "value": "/**!\n * jsDigest v<%= @version %> (<%= @release %>)\n * http://github.com/coiscir/jsdigest/\n *\n * Copyright (c) 2009-2011 Jonathan Lonowski\n * Released and distributed under the MIT Li...
javascript
chosen
[ { "from": "system", "value": "Update ngconstant version after releasing\n" }, { "from": "human", "value": "\"use strict\";\n// DO NOT EDIT THIS FILE, EDIT THE GRUNT TASK NGCONSTANT SETTINGS INSTEAD WHICH GENERATES THIS FILE\nangular.module('publisherApp')\n\n.constant('ENV', 'dev')\n\n.constant(...
javascript
chosen
[ { "from": "system", "value": "Watch for the user property in state directly\n" }, { "from": "human", "value": "/* @flow */\n\nimport React from 'react';\nimport Connect from '../../../modules/store/Connect';\nimport App from '../views/App';\n\nconst mapSubscriptionToProps = {\n\tuser: {\n\t\tkey...
javascript
chosen
[ { "from": "system", "value": "Stop logging from activity tracker\n" }, { "from": "human", "value": "export class ActivityTrackerService {\r\n constructor() {\r\n this.track();\r\n }\r\n\r\n get mostRecentActivity() {\r\n return this.timestamp;\r\n }\r\n\r\n track() {\r\n this.times...
javascript
chosen
[ { "from": "system", "value": "Update the banner URL to https.\n" }, { "from": "human", "value": "/*!\n * jquery.cue.js - <%= pkg.version %>\n * Playlist and other functionality for MediaElement.js\n * http://audiotheme.com/\n *\n * Copyright 2014, AudioTheme LLC\n * License: MIT\n */\n" }, {...
javascript
chosen
[ { "from": "system", "value": "Solve bug when creating new pages\n\n\nFormer-commit-id: 99f6349b33753887e39e44262e4259a3f209d4d1" }, { "from": "human", "value": "function loadCreator (collectionId) {\n var pageType, releaseDate;\n\n getCollection(collectionId,\n success = function (response)...
javascript
chosen
[ { "from": "system", "value": "Return only the last compass reading\n" }, { "from": "human", "value": "module.exports = function(app) {\n\tapp.get('/imu', (req, res, next) => {\n\t\tlet db = app.get('db');\n\t\tlet compass = db.collection('compass');\n\n\t\tif (compass !== undefined) {\n\t\t\tcom...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary adding of anchor class\n" }, { "from": "human", "value": "angular.module('directives')\n.directive('listItem',[function(){\n return {\n 'restrict': 'A',\n 'link' :function($scope,$elem,$attrs) {\n $elem.addClass('anchor');\n $elem...
javascript
chosen
[ { "from": "system", "value": "Use ChromeHeadless for karma tests\n" }, { "from": "human", "value": "'use strict';\n\nconst os = require('os');\n\nmodule.exports = (config) => {\n config.set({\n basePath: '',\n frameworks: [\n 'jasmine-jquery',\n 'jasmine'\n ],\n files: [\n...
javascript
chosen
[ { "from": "system", "value": "Change redux dev tool to redux dev tool extension\n" }, { "from": "human", "value": "// Redux\nimport { createStore, applyMiddleware, compose } from 'redux';\nimport thunk from 'redux-thunk';\nimport createLogger from 'redux-logger';\nimport Immutable from 'immutabl...
javascript
chosen
[ { "from": "system", "value": "Fix a typo to meet the example in the book.\n" }, { "from": "human", "value": "var child_process = require('child_process');\n\nvar child = child_process.fork('./child.js', []);\n\nchild.on('close', function (code) {\n\n console.log('child process exited with cod...
javascript
chosen
[ { "from": "system", "value": "Add loader functionality for jpeg, jpg and gif to webpack\n" }, { "from": "human", "value": "\n'use strict';\n\nvar path = require('path');\nvar webpack = require('webpack');\nvar HtmlWebpackPlugin = require('html-webpack-plugin');\nvar ExtractTextPlugin = require(\...
javascript
chosen
[ { "from": "human", "value": "Update gulp file for tests\n" }, { "from": "gpt", "value": "var gulp = require('gulp'),\n watch = require('gulp-watch'),\n mocha = require('gulp-mocha');\n\ngulp.task('tests', function() {\n return gulp.src(['tests/**/*.js'], { read: false })\n .pipe(...
javascript
chosen
[ { "from": "system", "value": "Remove set locale here, not needed\n" }, { "from": "human", "value": "'use strict';\n\n// Load our requirements\nconst i18n = require('i18n'),\n path = require('path'),\n logger = require('../log');\n\n// Variables\nlet localeDir = path.resolve('./locales'...
javascript
chosen
[ { "from": "system", "value": "Reset kernel NUX because the gesture changed\n\nfbshipit-source-id: c436c1b\n" }, { "from": "human", "value": "/**\n * Copyright 2015-present 650 Industries. All rights reserved.\n *\n * @providesModule StorageKeys\n */\n'use strict';\n\nimport mapValues from 'lodas...
javascript
chosen
[ { "from": "system", "value": "Add graph type for type checking.\n" }, { "from": "human", "value": "/**\n * dummyLayout.js\n *\n * This takes an existing graph and lays it out simply in O(n*m) time, where n\n * is the number of vertices in the top level and m is the maximal number of\n * ports th...
javascript
chosen
[ { "from": "system", "value": "Add theme for syntax highlighting\n" }, { "from": "human", "value": "// custom typefaces\nimport \"typeface-montserrat\"\nimport \"typeface-merriweather\"\n" }, { "from": "gpt", "value": "// custom typefaces\nimport \"typeface-montserrat\"\nimport \"type...
javascript
chosen
[ { "from": "system", "value": "Allow non-q promises to match `__.promise()`\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('lodash')\n\t, q = require('q')\n\t, TypeSafeMatcher = require('./TypeSafeMatcher')\n\t;\n\nfunction IsPromise() {\n\treturn _.create(new TypeSafeMatcher...
javascript
chosen
[ { "from": "system", "value": "Add remote debugging host setting\n" }, { "from": "human", "value": "/* eslint-env node */\nmodule.exports = {\n test_page: 'tests/index.html?hidepassed',\n disable_watching: true,\n launch_in_ci: [\n 'Chromium'\n ],\n launch_in_dev: [\n 'Chromium'\n ],\...
javascript
chosen
[ { "from": "system", "value": "Document why `key` comes first\n" }, { "from": "human", "value": "/* eslint-env node */\n\nconst FormData = require('form-data');\nconst got = require('got');\n\n\nconst BASE_URL = 'https://debuglogs.org';\n\n// Workaround: Submitting `FormData` using native `FormDa...
javascript
chosen
[ { "from": "system", "value": "Add flag for new module loader.\n" }, { "from": "human", "value": "/*\n ___ usage ___ en_US ___\n usage: prolific udp <options>\n\n -u, --url <string>\n The URL of the logging destination.\n\n --help\n Display this message.\...
javascript
chosen
[ { "from": "system", "value": "Remove Unneeded Props from Heading Story\n" }, { "from": "human", "value": "import React from 'react';\nimport { storiesOf } from '@storybook/react';\nimport { text, boolean } from '@storybook/addon-knobs';\nimport notes from './notes.md';\nimport Heading from './he...
javascript
chosen
[ { "from": "system", "value": "Enable the skipped test case\n" }, { "from": "human", "value": "const test = require('ava')\nconst { tmpdir } = require('os')\nconst { join } = require('path')\nconst rollup = require('rollup')\nconst config = require('../rollup.config')\n\ntest.skip('build: creates...
javascript
chosen
[ { "from": "system", "value": "Add state to game page\n" }, { "from": "human", "value": "import React from 'react';\nimport { graphql } from 'react-apollo';\nimport PropTypes from 'prop-types';\n\nimport GameShow from '../components/GameShow/GameShow';\nimport Loader from '../components/Loader';\...
javascript
chosen
[ { "from": "system", "value": "Add spec file in yo write\n" }, { "from": "human", "value": "const fountain = require('fountain-generator');\n\nmodule.exports = fountain.Base.extend({\n prompting() {\n this.fountainPrompting();\n },\n\n configuring() {\n this.mergeJson('package.json', {\n...
javascript
chosen
[ { "from": "system", "value": "Add a custom `log` to the example\n" }, { "from": "human", "value": "var Fleur = require('..');\n\nvar Foo = Fleur.actions('foo', {\n synchronous: function(state) {\n return Fleur.assign(state, {\n status: 'pending'\n });\n },\n asynchronous: function(...
javascript
chosen
[ { "from": "system", "value": "Allow adapter to be set by Class name string\n" }, { "from": "human", "value": "/* RESTClient\n * Core interface that houses the REST adapter and revision of the API to target.\n * Setting a Client is optional and will automatically use a base client.\n *\n * You ca...
javascript
chosen
[ { "from": "system", "value": "Make student searchbar noisier when there are no results\n" }, { "from": "human", "value": "$(function() {\n\n $(\"#student-searchbar\").autocomplete({\n source: function(request, response) {\n $.ajax({\n url: \"/students/names\",\n data: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add cy-GB and es-ES languages\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n\tdefaultLangTag: 'en',\n\tprimary: [\n\t\t'ar',\n\t\t'da',\n\t\t'de',\n\t\t'en',\n\t\t'es',\n\t\t'fi',\n\t\t'fr',\n\t\t'ja',\n\t\t'ko',\n\t\t'nb',\n\t\t'nl',\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Initialize bolt progress bar widget" }, { "from": "human", "value": "/**\n * Main mixin for the Bolt buic module.\n *\n * @mixin\n * @namespace Bolt.buic\n *\n * @param {Object} bolt - The Bolt module.\n * @param {Object} $ - jQuery.\n */\n(function (bolt, $) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix e2e tests for mock data changes\n" }, { "from": "human", "value": "describe('Praad App', function() {\n 'use strict';\n\n describe('Offer list view', function() {\n var offers, clickPromise;\n\n beforeEach(function() {\n browser.manage().deleteAllCo...
javascript
chosen
[ { "from": "system", "value": "Change wording of nomination submit\n\n" }, { "from": "human", "value": "// @flow\nimport * as React from 'react';\n\nimport HouseholdForm from './form/head-of-household';\nimport AddressForm from './form/address';\nimport PhoneNumbers from './form/phone-numbers';\n...
javascript
chosen
[ { "from": "system", "value": "Create the anonymous user server side instead\n" }, { "from": "human", "value": "var express = require('express');\nvar User = require('../schemas/userSchema.js');\n\nvar app = express();\n\napp.get('/users', function (req, res, next) {\n res.json({\n \"users\":...
javascript
chosen
[ { "from": "system", "value": "Fix test for returning correct value. String trimmed and parsed.\n" }, { "from": "human", "value": "var expect = require('chai').expect;\nvar thirteen = require('../index.js');\n\ndescribe('thirteen', function () {\n it('should be a function', function () {\n ex...
javascript
chosen
[ { "from": "system", "value": "Fix required parameter for Modal popup\n" }, { "from": "human", "value": "'use strict'\n\nimport React from 'react'\nimport {\n\tView,\n\tTouchableHighlight,\n Image,\n\tText,\n Modal\n} from 'react-native';\n\nvar css = require('../../styles/css');\n\n// Modal wi...
javascript
chosen
[ { "from": "system", "value": "Add support for import statements\n" }, { "from": "human", "value": "'use babel';\n\nimport { CompositeDisposable } from 'atom';\n\nexport default {\n\n subscriptions: null,\n\n activate(state) {\n // Events subscribed to in atom's system can be easily cleaned ...
javascript
chosen
[ { "from": "system", "value": "Change not to be reduced to localhost access\n" }, { "from": "human", "value": "var ws = new WebSocket(\"ws://localhost:8000/websocket\");\nws.onmessage = function(evt){\n\tmyOutput.value = evt.data;\n}\n\nfunction sendRain(){\n var msg = {\n type: \"message\",\...
javascript
chosen
[ { "from": "system", "value": "Use passive flag on addEventListener\n" }, { "from": "human", "value": "\"use strict\";\n\nconst getActivities = wrapper => {\n return new Promise(resolve => {\n const observer = new MutationObserver(mutations => {\n for (let mutation of mutatio...
javascript
chosen
[ { "from": "system", "value": "Load Google visualization lbirary here so that we don't have to load it in hte inlcuding html.\n\n" }, { "from": "human", "value": "\nfunction annotatedTimeLineChart(chart_element, url, dataString) {\n var chart_element = $('#line_chart');\n\n chart_element.te...
javascript
chosen
[ { "from": "system", "value": "Remove unfinished chapter from tests" }, { "from": "human", "value": "module.exports = {\n 'p1': require('../tutorial/p1').test,\n 'p2': require('../tutorial/p2').test, \n 'p3': require('../tutorial/p3').test,\n 'p4': require('../tutorial/p4').test\n}\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Add Chapter 04, exercise 4\n" }, { "from": "human", "value": "// Number of object properties\nfunction propCount(obj) {\n var ctr = 0;\n for (var prop in obj)\n ++ctr;\n return ctr;\n}\n\nfunction deepEqual(obj1, obj2) {\n if (typeof obj1 == \"obj...
javascript
chosen
[ { "from": "system", "value": "Fix unrelated bug with data fetching\n" }, { "from": "human", "value": "import {\n createFragmentContainer,\n graphql\n} from 'react-relay'\n\nimport Authentication from 'js/components/Authentication/Authentication'\n\nexport default createFragmentContainer(Authen...
javascript
chosen
[ { "from": "system", "value": "Comment and toast delete tested\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n angular\n .module('drinks', ['ngAnimate', 'toastr'])\n .controller('DrinksListController', DrinksListController);\n\n DrinksListController.$inject = ['Drin...
javascript
chosen
[ { "from": "system", "value": "Update to only focus login fields\n\nWells Fargo updated its homepage to include a “Save Username” checkbox!\nBut it still doesn’t autofocus input fields on load. Grrrr…\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n function init() {\n u....
javascript
chosen
[ { "from": "system", "value": "Move to using chainable calls on syrup in console snippet\n\n" }, { "from": "human", "value": "const syrup = require('../../');\n\nsyrup.scenario('array', `${__dirname}/test-array`);\nsyrup.scenario('object', `${__dirname}/test-object`);\nsyrup.scenario('save', `${_...
javascript
chosen
[ { "from": "system", "value": "Allow rate limiter's config to be overridden for specific routes\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = (config, { strapi }) => async (ctx, next) => {\n const ratelimit = require('koa2-ratelimit').RateLimit;\n\n const message = [\n ...
javascript
chosen
[ { "from": "system", "value": "Disable BrowserSync synchronisation of scroll and clicks\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\n\nvar serveTask = function (gulp, plugins, config, helpers, generator_config) {\n <% if(projectType == 'wp-with-fe') { %>\n va...
javascript
chosen
[ { "from": "system", "value": "Initialize object w/ stored container.\n" }, { "from": "human", "value": "import Injector from './injector';\n\nfunction injectServices(obj) {\n console.log('Injecting...');\n for (var prop in obj) {\n var val = obj[prop];\n if (val instanceof Injector) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the lack of whitespace after the 'catch' keyword\n" }, { "from": "human", "value": "import evalModule from \"eval\"\nimport yaml from \"js-yaml\"\nimport stripJsonComments from \"strip-json-comments\"\n\nexport default function parser(content, file) {\n try {\n...
javascript
chosen
[ { "from": "system", "value": "Put routes in order of use.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Contains all of the functions necessary to deal with user\n * signup and authentication.\n *\n * 1. decodeToken: decodes a token into user data using.\n * 2. getToken middleware ...
javascript
chosen
[ { "from": "system", "value": "Add passive supervizer module support\n" }, { "from": "human", "value": "/**\n * Otagai.js\n * Based on https://github.com/olafurnielsen/form5-node-express-mongoose-coffeescript\n */\n\nvar express = require('express'),\n http = require('http'),\n fs = require...
javascript
chosen
[ { "from": "system", "value": "Set script shebang and make it runnable\n" }, { "from": "human", "value": "import http from 'http';\nimport app from \"./app\";\n\nconst httpServer = http.createServer(app);\n\nconst port = process.env.PORT || 3000;\n\nhttpServer.listen(port, () => {\n console.lo...
javascript
chosen
[ { "from": "system", "value": "Fix regression, install firebase bower dep, not emberfire\n" }, { "from": "human", "value": "'use strict';\n\nvar EOL = require('os').EOL;\nvar chalk = require('chalk');\n\nmodule.exports = {\n normalizeEntityName: function() {\n // this prevents a...
javascript
chosen
[ { "from": "system", "value": "Refactor to avoid pkg dependency\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar constantFunction = require( '@stdlib/utils/constant-function' );\n\n\n// MAIN //\n\n/**\n* Polyfill for returning a numeric user identity for environments which...
javascript
chosen
[ { "from": "system", "value": "Add a helper for css classes\n" }, { "from": "human", "value": "/* ---------------------------------------------------- +/\n\n## Handlebars Helpers ##\n\nCustom Handlebars helpers.\n\n/+ ---------------------------------------------------- */\n\nHandlebars.registerH...
javascript
chosen
[ { "from": "system", "value": "Add access control header that allows origin\n" }, { "from": "human", "value": "const requestsController = require('../../controllers/requests.js');\nconst requestHelper = require('../../helpers/requestHelper.js');\n\nmodule.exports = {\n '/:request/top10': {\n ...
javascript
chosen
[ { "from": "system", "value": ":fire: Remove un-used argument in Main::Action\n" }, { "from": "human", "value": "\n\n\"use strict\";\nvar Main = module.parent.exports;\n\nMain.ActionSet = function(Child, Request, Message){\n Main.ValidateArguments(Main.ARGS_EVEN, Request.length);\n for(let Numb...
javascript
chosen
[ { "from": "system", "value": "Add blaze layout injection to client app instance\n" }, { "from": "human", "value": "\nTodoMVC = Space.Application.extend('TodoMVC', {\n\n requiredModules: ['Space.flux'],\n\n stores: ['TodoMVC.TodosStore'],\n\n components: [\n 'TodoMVC.Input',\n 'TodoMVC.F...
javascript
chosen
[ { "from": "system", "value": "test: Add test for double assertion\n" }, { "from": "human", "value": "/* eslint-env mocha */\nconst {expect} = chai;\nimport React from './React';\nimport TestUtils from './TestUtils';\n\ndescribe('React components', () => {\n it('should find valid xpath in react ...
javascript
chosen
[ { "from": "system", "value": "Fix ajax for user update modal\n" }, { "from": "human", "value": "$(document).ready(function() {\n\n const $form = $('.edit_user');\n $form.on('submit', function(event) {\n\n let url = $form.attr('action');\n let method = $form.attr('method');\n let data ...
javascript
chosen
[ { "from": "system", "value": "Add `style` to PropTypes for ESlint *sigh*\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport css from './FilterControlGroup.css';\n\nconst propTypes = {\n children: PropTypes.oneOfType([\n PropTypes.arrayO...
javascript
chosen
[ { "from": "system", "value": "Add projects band to about page\n" }, { "from": "human", "value": "import React from 'react';\n\nimport IntroBand from '../components/IntroBand';\nimport AboutBand from '../components/AboutBand';\n\nconst AboutPage = () => (\n <div className=\"about-page\">\n <I...
javascript
chosen
[ { "from": "system", "value": "Fix relevance-sorting on tag page\n" }, { "from": "human", "value": "import { TagRels } from './collection.js';\nimport { ensureIndex } from '../../collectionUtils';\n\nTagRels.addDefaultView(terms => {\n return {\n selector: {\n deleted: false,\n },\n ...
javascript
chosen
[ { "from": "system", "value": "Remove auto open of the browser on gulp serve\n" }, { "from": "human", "value": "const lit = require('fountain-generator').lit;\n\nmodule.exports = function browsersyncConf(props) {\n const conf = {\n server: {\n baseDir: []\n }\n };\n\n if (props.dist...
javascript
chosen
[ { "from": "system", "value": "Remove left over console logging\n" }, { "from": "human", "value": "$(function() {\n\n $(\"a.officelaunchlink\").click(function() {\n\tvar ua = window.navigator.userAgent;\n\twindow.console.log(\"Checking UA %s\", ua);\n\tif (~ua.indexOf('MSIE ') || ~ua.indexOf('...
javascript
chosen
[ { "from": "system", "value": "Simplify project banner on home page\n" }, { "from": "human", "value": "import React from 'react'\nimport {\n Card,\n Box,\n Text,\n Icon,\n Container,\n Flex,\n Link\n} from '@hackclub/design-system'\n\nexport default () => (\n <Container maxWidth={38}>\n ...
javascript
chosen
[ { "from": "system", "value": "Move mouse events to thumbnail\n" }, { "from": "human", "value": "import React, {\n PropTypes\n} from 'react';\nimport '../../css/SearchGifView.css'\n\nclass SearchGifView extends React.Component {\n constructor(props) {\n super(props);\n\n this....
javascript
chosen
[ { "from": "system", "value": "Return attachment ID instead of URL\n" }, { "from": "human", "value": "/*\n * Adapted from: http://mikejolley.com/2012/12/using-the-new-wordpress-3-5-media-uploader-in-plugins/\n */\njQuery(document).ready(function ($) {\n// Uploading files\n var file_frame;\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add socket.io to handle client real-time requests\n" }, { "from": "human", "value": "const path = require('path');\nconst favicon = require('serve-favicon');\nconst compress = require('compression');\nconst cors = require('cors');\nconst helmet = require('helmet');\...
javascript
chosen
[ { "from": "system", "value": "Update demo server version response\n" }, { "from": "human", "value": "const EventEmitter = require(\"events\");\nclass DemoClient extends EventEmitter {}\n\nconst Client = new DemoClient();\nexports.client = Client;\n\nClient.connect = () => {\n Client.emit(\"read...
javascript
chosen
[ { "from": "system", "value": "Send pageview on app load and THEN listen\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Route, Router } from 'react-router';\nimport ReactGA from 'react-ga';\nimport createHistory from 'history/createBrowserHistory';\nimport ...
javascript
chosen
[ { "from": "system", "value": "Extend base checker to use fixer\n" }, { "from": "human", "value": "class BaseChecker {\n constructor(reporter, ruleId, meta) {\n this.reporter = reporter\n this.ruleId = ruleId\n this.meta = meta\n }\n\n error(ctx, message) {\n this.reporter.error(ct...
javascript
chosen
[ { "from": "system", "value": "Make file names use local timestamps without :\n" }, { "from": "human", "value": "'use strict';\n\nlet util = require('util'),\n urlParser = require('url'),\n moment = require('moment');\n\nmodule.exports.fileNamer = function() {\n // ensure all files for a given...
javascript
chosen
[ { "from": "system", "value": "Remove commented out dev server\n" }, { "from": "human", "value": "const webpack = require('webpack'),\n webpackMerge = require('webpack-merge'),\n ExtractTextPlugin = require('extract-text-webpack-plugin'),\n commonConfig = require('./webpack.common....
javascript
chosen
[ { "from": "system", "value": "Disable host check in dev-server for mobile testing\n" }, { "from": "human", "value": "// Note: You must restart bin/webpack-watcher for changes to take effect\n\nconst merge = require('webpack-merge')\nconst common = require('./common.js')\n\nconst { resolve } = re...
javascript
chosen
[ { "from": "system", "value": "Update check rights to deal with regexp\n" }, { "from": "human", "value": "'use strict';\n\n\nmodule.exports = function checkRights(usernames, rights='', defaultValue=false) {\n if (! rights) return defaultValue;\n if (! usernames) return false;\n if (! Arr...
javascript
chosen
[ { "from": "system", "value": "Apply Tonya's suggestion for pointer styling.\n\nFix issue where pointer didn't appear alongside the AMP menu item.\nUses the show function, as Tonya suggested.\n" }, { "from": "human", "value": "/**\n * Adds an admin pointer that describes new features in 1.0.\n */...
javascript
chosen
[ { "from": "system", "value": "[util] Add url builder and preprocessor\n" }, { "from": "human", "value": "module.exports = {\n\tstring: require('./string'),\n\tobject: require('./object')\n};\n" }, { "from": "gpt", "value": "module.exports = {\n\tstring: require('./string'),\n\tobject...
javascript
chosen
[ { "from": "system", "value": "style(line-break): Remove line break between comment and import statements\n" }, { "from": "human", "value": "/* eslint-disable no-underscore-dangle */\n\nimport append from './append';\nimport keys from './keys';\nimport prop from './prop';\nimport reduce from './r...
javascript
chosen
[ { "from": "system", "value": "Make data.labels and data.series optional\n" }, { "from": "human", "value": "import React from 'react';\nimport Chartist from 'chartist';\n\nexport default class Chart extends React.Component {\n componentDidMount() {\n this.updateChart(this.props);\n }\n\n co...
javascript
chosen
[ { "from": "system", "value": "Add Firefox 3.6 to Sauce\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function(config) {\n\n var customLaunchers = {\n iOSSafari: {\n base: \"SauceLabs\",\n browserName: \"iphone\",\n version: \"5....
javascript
chosen
[ { "from": "system", "value": "Create a new mongoose connection\n\nRather than making use of the global mongoose.connection object.\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar config = require(softblu + 'config');\nvar deferred = require(softblu + 'util/deferred');...
javascript
chosen
[ { "from": "system", "value": "Prepend log entries to try to stay above the fold\n" }, { "from": "human", "value": "(function() {\n var opQueue = new OperationQueue(),\n counter = 0;\n\n function demoLog(msg) {\n var li = document.createElement(\"li\");\n li.appendChild...
javascript
chosen
[ { "from": "system", "value": "Allow registerDependencies to merge with existing arrays\n" }, { "from": "human", "value": "import merge from 'lodash/merge'\n\nconst dependencies = {}\n\nexport const registerDependencies = dep => merge(dependencies, dep)\n\nexport default dependencies\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Throw on TypeScript compile error\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n var ts = require('typescript-api');\n var compiler = new ts.TypeScriptCompiler();\n\n /**\n * Compile a string of TypeScript, return as a string of JavaScript\...
javascript
chosen