conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove quotes from string because they break e.g. box shadows\n" }, { "from": "human", "value": "function convertJsToSass(obj, syntax) {\n const suffix = syntax === 'sass' ? '' : ';'\n const keys = Object.keys(obj)\n const lines = keys.map(key => `$${key}: ${form...
javascript
chosen
[ { "from": "system", "value": "Clear terminal with each webpack rebuild\n" }, { "from": "human", "value": "const childProcess = require(\"child_process\");\nconst electron = require(\"electron\");\nconst webpack = require(\"webpack\");\nconst config = require(\"./webpack.app.config\");\n\nconst c...
javascript
chosen
[ { "from": "system", "value": "Break gutters only on large devices\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport { Link, IndexLink } from 'react-router';\n\n// This is a class-based component because the current\n// version of hot reloading won't hot reload ...
javascript
chosen
[ { "from": "system", "value": "Remove redundant source from PMO\n\nThis removes the redundant source that was left over from the DoneJS 2\nguide. Fixes #1156\n" }, { "from": "human", "value": "import { Component } from 'can';\nimport './list.less';\nimport view from './list.stache';\nimport Resta...
javascript
chosen
[ { "from": "system", "value": "Add native component list to featured experiences\n\nfbshipit-source-id: 7a6210a\n" }, { "from": "human", "value": "/**\n * Copyright 2015-present 650 Industries. All rights reserved.\n *\n * @providesModule FeaturedExperiences\n */\n'use strict';\n\nfunction setRef...
javascript
chosen
[ { "from": "system", "value": "fix(): Use typeof(window) to check if being used in non browser environments\n\nhttps://github.com/rcdexta/react-trello/issues/15\n" }, { "from": "human", "value": "import React, {Component, PropTypes} from 'react'\nimport BoardContainer from './BoardContainer'\nimp...
javascript
chosen
[ { "from": "system", "value": "Fix launch command on windows platform.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n// daab run\n\nvar fs = require('fs');\nvar spawn = require('child_process').spawn;\nvar program = require('commander');\nvar auth = require('./auth');\n\nprogram\n .all...
javascript
chosen
[ { "from": "system", "value": "Set default loop interval to 1 minute\n" }, { "from": "human", "value": "//app-specific sentence\n\nmodule.exports = {\n serverPort : 8080,\n pingInteralInMilliseconds : 1000*5, // server main loop interval. 6 hours\n postBeforeTheMatch : true,\n postAfterTheMat...
javascript
chosen
[ { "from": "system", "value": "Fix menu close btn position\n" }, { "from": "human", "value": "import * as React from 'react'\nimport { Link } from 'gatsby'\n\nimport { Container } from './Container'\nimport { CloseIcon } from './icons/Close'\n\nexport const Menu = ({ showMenu, onClick }) => {\n ...
javascript
chosen
[ { "from": "system", "value": "Make isFinite() and isNaN() direct ref copy of the builtin functions\n" }, { "from": "human", "value": "var check = {\n\tisNaN : function(value) {\n\t\t\"use strict\";\n\n\t\treturn isNaN(value);\n\t},\n\tisZero : function(value) {\n\t\t\"use strict\";\n\n\t\treturn...
javascript
chosen
[ { "from": "system", "value": "Fix purging hidden post list\n" }, { "from": "human", "value": "/*\n Hide posts you don't like\n */\n\nlet main = require('./main');\n\n// Remember hidden posts for 7 days only, to perevent the cookie from\n// eclipsing the Sun\nlet hidden = new main.Memory('hide', ...
javascript
chosen
[ { "from": "system", "value": "Add exclude list to addon dedupe logic" }, { "from": "human", "value": "'use strict';\n\n/**\n * Deduplicate one addon's children addons recursively from hostAddons.\n *\n * @private\n * @param {Object} hostAddons\n * @param {EmberAddon} dedupedAddon\n * @param {Str...
javascript
chosen
[ { "from": "system", "value": "Use pristine Object to work out if a thing is an array\n" }, { "from": "human", "value": "var pristineEnv = require('./pristine-env');\n\nfunction macgyver(thing) {\n if (Object.prototype.toString.call(thing) === '[object Array]') {\n return (new pristineE...
javascript
chosen
[ { "from": "system", "value": "ADD - PORT env var\n" }, { "from": "human", "value": "require('./db/connection');\n\nconst Koa = require('koa');\nconst bodyParser = require('koa-bodyparser');\nconst logger = require('koa-logger');\nconst json = require('koa-json');\nconst onerror = require('koa-on...
javascript
chosen
[ { "from": "system", "value": "Handle log level correctly for raw logs\n" }, { "from": "human", "value": "'use strict';\n\nvar bunyan = require('bunyan');\nvar config = require('coyno-config');\n\nfunction createLogger() {\n var log;\n\n if (!!config.log.pretty) {\n var PrettyStream = requir...
javascript
chosen
[ { "from": "system", "value": "Add comment about the order of passes.\n" }, { "from": "human", "value": "/*global define*/\ndefine([\n '../Core/freezeObject'\n ], function(\n freezeObject) {\n \"use strict\";\n\n /**\n * The render pass for a command.\n *\n * @p...
javascript
chosen
[ { "from": "system", "value": "Add export to use as module\n" }, { "from": "human", "value": "// https://www.codewars.com/kata/death-by-coffee/javascript\n\nconst coffeeLimits = function(y,m,d) {\n let healthNumber = y * 10000 + m * 100 + d;\n let currentHex;\n let current;\n let i;\n...
javascript
chosen
[ { "from": "system", "value": "Remove class method of Template\n" }, { "from": "human", "value": "const Handlebars = require('handlebars');\n\nHandlebars.registerHelper('removeBreak', (text) => {\n text = Handlebars.Utils.escapeExpression(text);\n text = text.replace(/(\\r\\n|\\n|\\r)/gm, ' ');...
javascript
chosen
[ { "from": "system", "value": "Include Grunt partials in jshint task.\n" }, { "from": "human", "value": "// Check JS assets for code quality\nmodule.exports = function(grunt) {\n grunt.config('jshint', {\n all: ['Gruntfile.js',\n 'scripts/main.js'],\n });\n\n grunt.lo...
javascript
chosen
[ { "from": "system", "value": "Replace deprecated url.parse() with WHATWG URL API\n" }, { "from": "human", "value": "const redis = require('redis')\nconst config = require('config')\nconst url = require('url')\nconst logger = require('./logger.js')()\n\nconst initRedisClient = function () {\n le...
javascript
chosen
[ { "from": "system", "value": "[FIND-57] Stop saved snapshots querying for promotions [rev: jon.soul]\n" }, { "from": "human", "value": "/*\n * Copyright 2016 Hewlett-Packard Development Company, L.P.\n * Licensed under the MIT License (the \"License\"); you may not use this file except in compli...
javascript
chosen
[ { "from": "system", "value": "Increase delay before considering file written\n" }, { "from": "human", "value": "// Utility for rendering html images to files\n'use strict';\nconst webshot = require('webshot');\nconst Jimp = require('jimp');\nconst fs = require(`fs`);\n\nconst webshotOptions = {...
javascript
chosen
[ { "from": "system", "value": "Use a placeholder png to hold the image size\n" }, { "from": "human", "value": "Photo = function (doc) {\n _.extend(this, doc);\n};\n\n_.extend(Photo.prototype, {\n\tgetImgTag: function (dimension) {\n\t\treturn {\n\t\t\t'class': 'lazy',\n\t\t\t'data-src': _.str.sp...
javascript
chosen
[ { "from": "system", "value": "Clear counter when Metronome is stopped\n" }, { "from": "human", "value": "function Metronome(tempo, beatsPerMeasure){\n this.tempo = Number(tempo);\n this.beatsPerMeasure = Number(beatsPerMeasure);\n this.interval = null;\n}\n\nMetronome.prototype.start = functi...
javascript
chosen
[ { "from": "system", "value": "Add support for dropping files into window.\n" }, { "from": "human", "value": "(function () {\n var root = this;\n var $file_input = document.querySelector(\"input#file\");\n var $holder = document.querySelector(\"#notebook-holder\");\n\n var render_note...
javascript
chosen
[ { "from": "system", "value": "Change size of donation popup\n" }, { "from": "human", "value": "/*\n * Author: Pierre-Henry Soria <hello@ph7cms.com>\n * Copyright: (c) 2015-2017, Pierre-Henry Soria. All Rights Reserved.\n * License: GNU General Public License; See PH7.LICENSE.txt...
javascript
chosen
[ { "from": "system", "value": "Replace touch with date get/setter\n" }, { "from": "human", "value": "import { debuglog } from 'util';\nimport AbstractCache from './abstract';\n\nexport default class ListCache extends AbstractCache {\n constructor() {\n super();\n\n this._log = debuglog('ca...
javascript
chosen
[ { "from": "system", "value": "Switch router to history mode\n" }, { "from": "human", "value": "import Vue from 'vue';\nimport VueResource from 'vue-resource';\nimport VueRouter from 'vue-router';\n\nimport App from './App.vue';\nimport About from './components/About.vue';\n\nimport store from '....
javascript
chosen
[ { "from": "system", "value": "Add regex for finding path params\n" }, { "from": "human", "value": "'use strict';\n\nvar resourcify = angular.module('resourcify', []);\n\nfunction resourcificator ($http, $q) {\n\n var $resourcifyError = angular.$$minErr('resourcify'),\n requestOptions = ['q...
javascript
chosen
[ { "from": "system", "value": "Add support for creating Satisfaction Ratings\n\nAs documented at https://developer.zendesk.com/rest_api/docs/core/satisfaction_ratings#create-a-satisfaction-rating" }, { "from": "human", "value": "//SatisfactionRatings.js: Client for the zendesk API.\n\n\nvar util ...
javascript
chosen
[ { "from": "system", "value": "Fix nodejs v6 'TypeError: Object.values is not a function'\n" }, { "from": "human", "value": "const chalk = require('chalk');\n\nLOG_TYPES = {\n NONE: 0,\n ERROR: 1,\n NORMAL: 2,\n DEBUG: 3\n};\n\nlet logType = LOG_TYPES.NORMAL;\n\nconst setLogType = (ty...
javascript
chosen
[ { "from": "system", "value": "Throw error when trying to use web specific APIs on Node\n" }, { "from": "human", "value": "import fs from 'fs';\nimport {\n pdf,\n View,\n Text,\n Link,\n Page,\n Font,\n Note,\n Image,\n version,\n Document,\n StyleSheet,\n PDFRenderer,\n createInstan...
javascript
chosen
[ { "from": "system", "value": "Reduce amount of information in reference links\n" }, { "from": "human", "value": "define(['rules/rules.module'\n ],\nfunction() {\n angular.module('rules').factory('references',\n [\n function() {\n function generateReference(query) {\n ...
javascript
chosen
[ { "from": "system", "value": "Make new code pass all new tests\n\nThis was done by setting the moderator flag in the helper\nfunction that creates admin users.\n" }, { "from": "human", "value": "const Bluebird = require('bluebird');\nconst mongoose = require('mongoose');\nconst Alternative = req...
javascript
chosen
[ { "from": "human", "value": "Add ES5 test by @stoeffel\n" }, { "from": "gpt", "value": "import test from 'tape-catch';\n\nvar Symbol = require('es6-symbol');\nvar { curry, _ } = require('../module/index')({ Symbol });\n\ntest('The API is in good shape.', (is) => {\n is.equal(\n typeof curry,...
javascript
chosen
[ { "from": "system", "value": "Update 'add cordova platforms' to match latest command output\n" }, { "from": "human", "value": "var selftest = require('../selftest.js');\nvar Sandbox = selftest.Sandbox;\nvar files = require('../files.js');\n\n// Add plugins to an app. Change the contents of the p...
javascript
chosen
[ { "from": "system", "value": "Add null as error argument for callback\n\nRefs: #13\nPR-URL: https://github.com/metarhia/metasync/pull/152\nReviewed-By: Timur Shemsedinov <6dc7cb6a9fcface2186172df883b5c9ab417ae33@gmail.com>\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = (api...
javascript
chosen
[ { "from": "system", "value": "Write out version spec that's being used, to make version errors more intuitive." }, { "from": "human", "value": "var semver = require('semver');\n\nvar versions = module.exports;\n\n/**\nReturns a number representation of the version number that can be compared wit...
javascript
chosen
[ { "from": "system", "value": "Add request to MFA error for keeping session context.\n" }, { "from": "human", "value": "/**\n * Module dependencies.\n */\nvar TokenError = require('./tokenerror');\n\n/**\n * `TokenError` error.\n *\n * @api public\n */\nfunction MFARequiredError(message, uri, use...
javascript
chosen
[ { "from": "system", "value": "Fix logic for removing the custom element callbacks\n" }, { "from": "human", "value": "import * as privateMethods from './elements/private-methods.js';\n\nconst callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];\n\ne...
javascript
chosen
[ { "from": "system", "value": "Switch demo to use mock-fs rather than memory-fs\n" }, { "from": "human", "value": "'use strict';\n\nvar sandboxFactory = require('..'),\n MemoryFS = require('memory-fs'),\n memoryFS = new MemoryFS(),\n sandbox = sandboxFactory.create(memoryFS);\n\nmemoryFS...
javascript
chosen
[ { "from": "system", "value": "Add URL support with history.pushState\n" }, { "from": "human", "value": "import HomeView from './HomeView';\nimport JoinView from './JoinView';\n\nexport default class ViewManager {\n\tconstructor(target) {\n\t\tthis.target = target;\n\n\t\tthis.home = new HomeView...
javascript
chosen
[ { "from": "system", "value": "Allow the same error on different lines\n" }, { "from": "human", "value": "var Promise = require('es6-promise').Promise;\nvar lodash = require('lodash');\nvar validateWithHtmllint = require('./html/htmllint.js');\nvar validateWithSlowparse = require('./html/slowpars...
javascript
chosen
[ { "from": "system", "value": "Add position and size to code_inline\n" }, { "from": "human", "value": "// Parse backticks\n\n'use strict';\n\nmodule.exports = function backtick(state, silent) {\n var start, max, marker, matchStart, matchEnd, token,\n pos = state.pos,\n ch = state.src.c...
javascript
chosen
[ { "from": "system", "value": "Check if postValidationModel is defined for the tab in question\n" }, { "from": "human", "value": "ManageIQ.angular.app.directive('resetValidationStatus', ['$rootScope', function($rootScope) {\n return {\n require: 'ngModel',\n link: function (scope, elem, at...
javascript
chosen
[ { "from": "system", "value": "Fix typo/miss spell in method names\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';\n\nconst { Route, RSVP } = Ember;\nconst { Promise, all, map } = RSVP;\n\nexp...
javascript
chosen
[ { "from": "system", "value": "Increase gRenderer frame max to 240\n" }, { "from": "human", "value": "gRenderer = {\r\n frame: 0,\r\n render: function() {\r\n this.context.fillStyle = '#000';\r\n this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height);\r\n\r\n ...
javascript
chosen
[ { "from": "system", "value": "Fix url to real production url\n" }, { "from": "human", "value": "const LifeforcePlugin = require(\"../utils/LifeforcePlugin.js\");\n\nconst serverhostname = \"http://localhost:16001\";\n//const serverhostname = \"https://api.repkam09.com\";\n\nclass MetaEndpoints e...
javascript
chosen
[ { "from": "system", "value": "Update to the new drive state\n" }, { "from": "human", "value": "'use strict';\n\nvar should = require('should');\nvar config = require('../config/configuration.js');\nvar retrieve = require('../lib/provider-google-drive/helpers/retrieve.js');\n\ndescribe(\"Retrieve...
javascript
chosen
[ { "from": "system", "value": "Correct exit code on help\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\"use strict\";\n\nprocess.title = \"oui\";\n\nvar arg = process.argv[2],\n oui = require(\"./\"),\n spin = require(\"char-spinner\");\n\nif (arg === \"--update\") {\n var i...
javascript
chosen
[ { "from": "system", "value": "Define all Date toISOString properties with Object.defineProperty, using the descriptors configurable, writable and non-enumerable.\n" }, { "from": "human", "value": "/**\n * Date.prototype.toISOString()\n * version 0.0.0\n * Feature\t Chrome Firefox Interne...
javascript
chosen
[ { "from": "system", "value": "Add workaround to introduce slightly better syntax\nhighlighting.\n" }, { "from": "human", "value": "$(\".presentation\").each(function() {\n var md = new Remarkable('full', { html: true });\n var markup = md.render($(this).html());\n var slides = markup.sp...
javascript
chosen
[ { "from": "system", "value": "Move task reading into a standalone function.\n\n- Also, use readFileSync (synchronous).\n" }, { "from": "human", "value": "/**\n * Created by Kanthanarasimhaiah on 14/11/13.\n */\nfs = require('fs');\n\nvar num_of_tasks;\nvar total_time;\nvar fileName = process.arg...
javascript
chosen
[ { "from": "system", "value": "Remove 's' from UserRecipe(s) in user controller\n" }, { "from": "human", "value": "let UserRecipes = require(`${__dirname}/../schemas.js`).UserRecipes;\n\nmodule.exports = {\n signup: (req, res) => {\n\n },\n\n login: (req, res) => {\n\n },\n\n logout: (req, r...
javascript
chosen
[ { "from": "system", "value": "Fix conventional errors from previos commit\n" }, { "from": "human", "value": "'use strict';\n//Import events\nconst events = require('events');\n\n//Create EventHandler function\nclass EventHandler extends events.EventEmitter {\n constructor() {\n super()\n }\...
javascript
chosen
[ { "from": "system", "value": "Refactor CaretakerRolesGateway to use factory pattern\n" }, { "from": "human", "value": "/*\n Makes API calls to fetch caretaker roles.\n\n However, until there is an API to call, it returns canned data.\n*/\n\nexport default class CaretakerRolesGateway {\n\n s...
javascript
chosen
[ { "from": "system", "value": "Add space between anon function and parens.\n" }, { "from": "human", "value": "/* \n * To Title Case 2.0 – http://individed.com/code/to-title-case/\n * Copyright © 2008–2012 David Gouch. Licensed under the MIT License. \n */\n\nString.prototype.toTitleCase = functi...
javascript
chosen
[ { "from": "system", "value": "Remove problematic not tool from the equation toolbar;\n\n\\not is used in conjunction with other commands such as \\equiv or\n\\infty. Mathquill however does not support this and changes \\not to\n\\neg.\n" }, { "from": "human", "value": "module.exports = [\n { ...
javascript
chosen
[ { "from": "system", "value": "feat: Add default not found route\n" }, { "from": "human", "value": "const UserController = require('../src/Http/Controllers/User');\n\nconst { define, wrap, post, get } = require('spirit-router');\nconst { json } = require('body-parser');\nconst express = require(...
javascript
chosen
[ { "from": "system", "value": "Fix small issue with ember dropzone\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n classNames: ['draggable-dropzone'],\n classNameBindings: ['dragClass'],\n dragClass: 'deactivated',\n\n dragLea...
javascript
chosen
[ { "from": "system", "value": "Resolve linting errors after upgrades\n" }, { "from": "human", "value": "module.exports = {\n extends: [\"matrix-org\"],\n plugins: [\n \"babel\",\n ],\n env: {\n browser: true,\n node: true,\n },\n\n rules: {\n \"no-var...
javascript
chosen
[ { "from": "system", "value": "Update eslint rules to allow no-spaces between function name and argument parenthesis\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOptions: {\n sourceType: 'module'\n },\n // https://github.com/feross/...
javascript
chosen
[ { "from": "system", "value": "Test push after changing local remote\n" }, { "from": "human", "value": "angular.module('gitphaser') \n .controller('NearbyCtrl', NearbyCtrl); \n\n// @controller NearbyCtrl\n// @params: $scope, $reactive\n// @route: /tab/nearby\n//\n// Exposes Meteor mongo 'connec...
javascript
chosen
[ { "from": "system", "value": "Fix redirect after poll creation\n\nRedirect to /#/Manage/<ManageId> rather than /Manage/<ManageId>\n" }, { "from": "human", "value": "(function () {\n angular\n .module('GVA.Creation')\n .controller('CreateBasicPageController', ['$scope', 'Account...
javascript
chosen
[ { "from": "system", "value": "Set focus automatically to first field\n" }, { "from": "human", "value": "const $answer = $('.answer')\nconst {makeRichText} = require('./math-editor')\n\nconst save = ($elem, async = true) => $.post({\n url: '/save',\n data: {text: $elem.html(), answerId: $el...
javascript
chosen
[ { "from": "system", "value": "Remove Button, only in Download Menu" }, { "from": "human", "value": "// toggle display of all code cells' inputs\n\ndefine([\n 'jquery',\n 'base/js/namespace',\n 'base/js/events'\n], function(\n $,\n Jupyter,\n events\n) {\n \"use strict\";\n\n...
javascript
chosen
[ { "from": "system", "value": "Add missing underscore on query param to contacts\n" }, { "from": "human", "value": "const { getContact } = require('../../contacts/repos')\n\nfunction setInteractionsDetails (req, res, next) {\n res.locals.interactions = {\n returnLink: `/contacts/${req.params....
javascript
chosen
[ { "from": "system", "value": "Check all elements, not just [span, div, img], for unfocusableElementsWithOnClick\n" }, { "from": "human", "value": "// Copyright 2012 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compl...
javascript
chosen
[ { "from": "system", "value": "Disable not-safe PostCSS value conversions\n" }, { "from": "human", "value": "module.exports = {\n options: {\n map: true, // inline sourcemaps\n\n processors: [\n require('pixrem')(), // add fallbacks for rem units\n require('autoprefixer...
javascript
chosen
[ { "from": "system", "value": "Add update fucntion to CLI\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar ncp = require('ncp').ncp;\nvar path = require('path');\n\nrequire('yargs')\n .usage('$0 <cmd> [args]')\n .option('directory', {\n alias: 'd',\n describe: 'Pr...
javascript
chosen
[ { "from": "system", "value": "Set docdown style to github. [ci skip]\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar _ = require('lodash');\nvar docdown = require('docdown');\nvar fs = require('fs');\nvar path = require('path');\nvar srcPath = path.join(__dirname, '../src');\nvar o...
javascript
chosen
[ { "from": "system", "value": "Format support for w.error() if possible.\n" }, { "from": "human", "value": "(function(global) {\n 'use strict';\n define([\n ], function() {\n// $HEADER$\n\n /**\n * This will be the <code>warmsea</code> namespace.\n * @namespace\n * @alias warmse...
javascript
chosen
[ { "from": "system", "value": "Change the min feature to a parameter as ?min=true to get data form joiner.\n" }, { "from": "human", "value": "/*\n * Module dependencies\n */\n\nvar app = module.parent.exports,\n\tJoiner = require('../libs/joiner').Joiner;\n\n/*\n * Middlewares\n */\n\nfunction is...
javascript
chosen
[ { "from": "system", "value": "Add progress notification to clean cache command\n" }, { "from": "human", "value": "'use babel';\n\nimport yarnExec from '../yarn/exec';\nimport reportError from '../report-error';\n\nconst cleanCache = async () => {\n const success = await yarnExec(null, 'cache', ...
javascript
chosen
[ { "from": "system", "value": "Add test to cover container collisions\n" }, { "from": "human", "value": "(function() {\n\n var defur = require('../../../src/defur');\n var assert = require('chai').assert;\n\n suite('defur:', function() {\n var services = null;\n\n setup(fun...
javascript
chosen
[ { "from": "system", "value": "Fix deprecation warning in for using EmberApp.concatFiles\n" }, { "from": "human", "value": "/**\n * Monkeypatches the EmberApp instance from Ember CLI to contain the hooks we\n * need to filter environment-specific initializers. Hopefully we can upstream\n * simila...
javascript
chosen
[ { "from": "system", "value": "Replace dummy code for flight case with flight component\n" }, { "from": "human", "value": "import React from 'react'\n\nexport default function TravelObject(props) {\n let content = null;\n switch(props.type) {\n case 'event':\n content = <d...
javascript
chosen
[ { "from": "system", "value": "Stop passing all store in each action\n" }, { "from": "human", "value": "import isFunction from 'lodash/isFunction';\nimport { createAction as CA, handleActions as handle } from 'redux-actions';\n\n// matches action names with reducers and returns an object to\n// b...
javascript
chosen
[ { "from": "system", "value": "Refactor panel triggers for speed\n" }, { "from": "human", "value": "\"use strict\";\n\n// Generators for Arethusa code for things such as\n// - useful directives\n\nfunction ArethusaGenerator() {\n this.panelTrigger = function panelTrigger(service, trsl, trslKey, ...
javascript
chosen
[ { "from": "system", "value": "[fix] Make moment global for debugging.\n" }, { "from": "human", "value": "import _ from \"lodash\";\nimport jQuery from \"jquery\";\nimport moment from \"moment\";\n\nimport Config from \"./config.js\";\nimport DText from \"./dtext.js\";\nimport Tag from \"./tag....
javascript
chosen
[ { "from": "system", "value": "Add offline action to default commit and rollback actions\n" }, { "from": "human", "value": "import { busy, scheduleRetry } from './actions';\nimport { JS_ERROR } from './constants';\nimport type { Config, OfflineAction, ResultAction } from './types';\n\nconst compl...
javascript
chosen
[ { "from": "system", "value": "fix: Fix issue only exposed by certain situations with the shadydom polyfill.\n" }, { "from": "human", "value": "import props from './props';\n\nfunction getValue (elem) {\n const type = elem.type;\n if (type === 'checkbox' || type === 'radio') {\n return elem....
javascript
chosen
[ { "from": "system", "value": "Add helper to change AMP mode.\n" }, { "from": "human", "value": "\n/**\n * WordPress dependencies\n */\nimport { activatePlugin, visitAdminPage } from '@wordpress/e2e-test-utils';\n\n/**\n * The allow list of AMP modes.\n *\n */\nexport const allowedAmpModes = {\n\...
javascript
chosen
[ { "from": "system", "value": "Fix using \"native\" code on node 8+\n" }, { "from": "human", "value": "module.exports = function(moduleName) {\n var majorVersion = parseInt(process.version.match(/^v(\\d+)/) || [])[1]\n if (majorVersion >= 8) {\n return require('./src/' + moduleName)\n } els...
javascript
chosen
[ { "from": "system", "value": "Add a shortcut to set the result function in Cooldown\n\n" }, { "from": "human", "value": " var seconds_match = /^(\\d)*s$/;\n function Cooldown(frames)\n {\n frames = frames || 10\n if ($.type(frames) == \"string\")\n {\n var seconds = frames.match...
javascript
chosen
[ { "from": "system", "value": "Add filter/directives for about page\n" }, { "from": "human", "value": "angular.module('services', [])\n\n.filter('file', function () {\n\n return function (input) {\n\n return input.split(' ').join('_').toLowerCase()\n }\n\n})\n\n.factory('responsive', functio...
javascript
chosen
[ { "from": "system", "value": "Set up more common Kanban columns" }, { "from": "human", "value": "var possibleStates = [\n\t'P,Pipeline',\n\t'R,Request Evaluation',\n\t'Rm,Requirements',\n\t'C,Concept',\n\t'D,Development',\n\t'Dy,Deployment',\n\t'L,Live'\n];\n\nvar possible_colors = 4;" }, { ...
javascript
chosen
[ { "from": "system", "value": "Improve code quality by change '==' into '==='\n" }, { "from": "human", "value": "/**\n * Parse profile.\n *\n * @param {Object|String} json\n * @return {Object}\n * @api private\n */\nexports.parse = function(json) {\n if ('string' == typeof json) {\n json = JS...
javascript
chosen
[ { "from": "system", "value": "Allow downloading objectives & phone\n" }, { "from": "human", "value": "const ALLOWED_CSV_FIELD_PATHS = [\n 'ids.GB-CHC',\n 'ids.charityId',\n 'name',\n 'contact.email',\n 'contact.person',\n 'contact.postcode',\n 'contact.address',\n 'contact.geo.longitude'...
javascript
chosen
[ { "from": "system", "value": "Switch from \"display:none\" to \"visibility:hidden\".\n\nThat way the page layout won't be affected but it will still be hidden.\n" }, { "from": "human", "value": "(function () {\n \"use strict\";\n var settings, display;\n\n if (window !== window.top) {\n...
javascript
chosen
[ { "from": "system", "value": "Use month instead of initialMonth\n" }, { "from": "human", "value": "import React from 'react';\nimport DayPicker from '../../../src';\n\nimport '../../../src/style.css';\nimport '../styles/year.css';\n\nexport default class YearCalendar extends React.Component {\n\...
javascript
chosen
[ { "from": "system", "value": "Build the example site into _site (published as Github pages)\n" }, { "from": "human", "value": "var thumbsup = require('../src/index');\n\n\nthumbsup.build({\n\n // the input folder\n // with all photos/videos\n input: 'example/media',\n\n // the output folder\...
javascript
chosen
[ { "from": "system", "value": "Add CSS to asset manifest\n" }, { "from": "human", "value": "'use strict';\n\nvar sass = require('gulp-sass');\nvar bourbon = require('node-bourbon');\nvar rev = require('gulp-rev');\nvar minify = require('gulp-minify-css');\n\n/*\ncompile sass with bourbon\...
javascript
chosen
[ { "from": "system", "value": "Make sure to reset alias when switching between characters if the new one has no alias\n" }, { "from": "human", "value": "$(document).ready(function() {\n // Bind both change() and keyup() in the icon keyword dropdown because Firefox doesn't\n // respect up/down k...
javascript
chosen
[ { "from": "system", "value": "Remove dead duplicate code for gallery minmax\n" }, { "from": "human", "value": "/* global gon */\n$(document).ready(function() {\n // Bind both change() and keyup() in the icon keyword dropdown because Firefox doesn't\n // respect up/down key selections in a drop...
javascript
chosen
[ { "from": "system", "value": "Use the database seeds from the Feature spec\n" }, { "from": "human", "value": "var assert = require('assert');\nvar Feature = require('../feature');\n\ndescribe('Feature', function () {\n describe('schema', function () {\n it('successfully creates a valid docum...
javascript
chosen
[ { "from": "system", "value": "Add test to make sure `no-var` is in the recommended config\n" }, { "from": "human", "value": "import fs from 'fs';\nimport test from 'ava';\nimport pify from 'pify';\nimport index from '../';\n\ntest('Every rule is defined in index file', async t => {\n const file...
javascript
chosen
[ { "from": "system", "value": "Use ES6 style modules for consistency\n" }, { "from": "human", "value": "import React from 'react'\nimport { render } from 'react-dom'\nimport FlexTableExample from '../FlexTable/FlexTable.example'\nimport VirtualScrollExample from '../VirtualScroll/VirtualScroll.ex...
javascript
chosen
[ { "from": "system", "value": "Add id of mobile stack to parse sample\n" }, { "from": "human", "value": "var path = require(\"path\");\n\nmodule.exports = {\n id: \"parse\",\n name: \"Parse\",\n\n sample: path.resolve(__dirname, \"sample\"),\n detector: path.resolve(__dirname, \"detec...
javascript
chosen
[ { "from": "system", "value": "Remove unused config module import\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2014-2020 Bjoern Kimminich.\n * SPDX-License-Identifier: MIT\n */\n\nconst request = require('request')\nconst colors = require('colors/safe')\nconst logger = require('../lib/...
javascript
chosen