conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add go to main page in about section\n" }, { "from": "human", "value": "const About = () => {\n return (\n <header id=\"header\" className=\"component\">\n <img className=\"header-logo\" src=\"assets/images/online_logo.svg\" alt=\"\" />\n <h1>Velkommen...
javascript
chosen
[ { "from": "system", "value": "Check if user has valid id in method pushSong()\n" }, { "from": "human", "value": "Meteor.methods({\n pushSong: function(song) {\n song.owner = this.userId;\n delete song.url;\n return MusicCollection.insert(song);\n }\n});\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Fix platform add after uri -> url config change\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = exports = function defaultConfig(ccaRoot) {\n return {\n plugin_search_path: [\n path.join(ccaRoot, 'cordova'),\n pat...
javascript
chosen
[ { "from": "system", "value": "Update the message API definitions.\n" }, { "from": "human", "value": "module.exports = {};\n\nfunction define( key, value ) {\n module.exports[key] = value;\n}\n\ndefine( 'user', {\n 'getToken' : '/user/getToken',\n 'refresh' : '/user/refresh',\n 'ch...
javascript
chosen
[ { "from": "system", "value": ":art: Make installPackages work with buffers\n" }, { "from": "human", "value": "'use babel'\n\nimport {BufferedProcess} from 'atom'\n\nexport function installPackages(packageNames, callback) {\n return new Promise(function(resolve, reject) {\n const stdErr = []\...
javascript
chosen
[ { "from": "system", "value": "Update with reference to global nav partial\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar cssstats = require('cssstats')\n\nvar module = require('tachyon...
javascript
chosen
[ { "from": "system", "value": "Enable translation of multiple HTML attributes\n" }, { "from": "human", "value": "[].forEach.call(document.querySelectorAll(\"[data-i18n]\"), function(el) {\n const name = el.getAttribute(\"data-i18n\");\n const value = $STR(name);\n if (name.startsWith(\"l...
javascript
chosen
[ { "from": "system", "value": "Remove superfluous TXT records in MDNS\n" }, { "from": "human", "value": "var mdns = require('mdns'),\n serviceType = mdns.makeServiceType({\n name: 'radiodan-http', protocol: 'tcp', subtypes: ['radiodanv1']\n }),\n txtRecord = {radiodan: true, video: ...
javascript
chosen
[ { "from": "system", "value": "Fix code to follow eslint rules\n" }, { "from": "human", "value": "'use babel';\n\n/* global atom */\n\nimport { exec } from 'child-process-promise';\nimport { dirname } from 'path';\n\nexport default {\n config: {\n vhdlCompiler: {\n title: 'VHDL Compiler'...
javascript
chosen
[ { "from": "system", "value": "Refactor to use setImmediate in route creation\n" }, { "from": "human", "value": "\nfunction createRoute(fn) {\n if (fn.length == 1)\n return function (message, context, cb) {\n try {\n cb(null, fn(message));\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Fix capitalization on Primus module name\n" }, { "from": "human", "value": "var app = require('express')(),\n http = require('http'),\n server = http.createServer(app),\n primus = new (require('Primus'))(server, { transformer: 'engine.io' });\n\n// Fire up ...
javascript
chosen
[ { "from": "system", "value": "Resolve custom config path so plugins extracting it can work with it\n" }, { "from": "human", "value": "var path = require('path');\nvar fs = require('fs');\nvar os = require('os');\n\n'use strict';\n\nmodule.exports = {\n User: User\n}\n\n/**\n * Manages user sett...
javascript
chosen
[ { "from": "system", "value": "fix: Print error to avoid silent failure\n" }, { "from": "human", "value": "const sass = require('node-sass');\nconst fs = require('fs');\nconst path = require('path');\nconst { apps_list, get_app_path, get_public_path, get_options_for_scss } = require('./rollup/rol...
javascript
chosen
[ { "from": "human", "value": "Add ajax call for tertiary table\n" }, { "from": "gpt", "value": "function get_tertiary_table(row, primary, secondary) {\n\t$.ajax({\n\t\turl: \"tertiary/\"+primary+\"/\"+secondary,\n\t\tcontext: document.body,\n\t\ttype: \"post\",\n\t\tbeforeSend :function() {\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Update constants to es6 syntax\n" }, { "from": "human", "value": "var baseUrl = 'https://www.googleapis.com/auth/';\n\n/**\n * Google Calendar API url https://developers.google.com/google-apps/calendar/\n * Google Calendar User Directory https://developers.google...
javascript
chosen
[ { "from": "system", "value": "[user] Add method to update the user store.\n" }, { "from": "human", "value": "var userBuiltInStore = require('./built-in-store');\n\nvar isArray = require('lodash/lang/isArray');\nvar intersection = require('lodash/array/intersection');\nvar dispatcher = require('....
javascript
chosen
[ { "from": "system", "value": "Print help in console when user messages help or ?\n" }, { "from": "human", "value": "'use strict';\n\nconst Bot = require('slackbots');\nconst util = require('util');\n\nconst RoundpiecesBot = function Constructor(settings) {\n this.settings = settings;\n};\n\nRou...
javascript
chosen
[ { "from": "system", "value": "Correct rsync to be on non-Windows.\n" }, { "from": "human", "value": "module.exports = {\n // Dynamically determine the ideal concurrency for parallel operations.\n // Algorithm courtesy of grunt-concurrent.\n concurrency: Math.max((require('os').cpus().length |...
javascript
chosen
[ { "from": "system", "value": "Fix typo in demo gulp file\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n styleguide = require('./lib/styleguide'),\n source = 'lib/app/**/*.scss',\n ouputPath = 'demo-output';\n\ngulp.task('styleguide', ['static'], function() {\n return gulp.s...
javascript
chosen
[ { "from": "system", "value": "Make it clear that you can set 'pathPrefix'\n" }, { "from": "human", "value": "import rc from 'rc'\n\nexport default rc('david', {\n brains: {\n cacheTime: 86400000\n },\n github: {\n api: {\n version: '3.0.0',\n protocol: 'https',\n host: 'a...
javascript
chosen
[ { "from": "system", "value": "Hide stripes from screen readers\n" }, { "from": "human", "value": " var stripy = function (element, stripes) {\n\n element.style.position = \"relative\";\n element.style.display = \"block\";\n\n var text = element.innerHTML;\n\n var newstripe = functio...
javascript
chosen
[ { "from": "system", "value": "Adjust root url setting for production build\n" }, { "from": "human", "value": "/* eslint-env node */\n\nvar pkg = require('../package.json');\n\nmodule.exports = function (environment) {\n var rootURL = '/';\n var ENV = {\n modulePrefix: 'purecloud-sky...
javascript
chosen
[ { "from": "system", "value": "Return null if the prefix is not valid\n" }, { "from": "human", "value": "'use babel';\n\nimport completions from '../data/completions';\n\nclass CurryProvider {\n constructor() {\n this.scopeSelector = '.source.curry';\n this.disableForScopeSelector = '.sour...
javascript
chosen
[ { "from": "system", "value": "Fix select of select controls\n" }, { "from": "human", "value": "'use strict';\n\nvar Db = require('./base');\n\nDb.Base.set('DOMSelectBox', Db.fixed(function () {\n\tvar Parent, Box, proto;\n\tParent = this.DOMInputBox;\n\tBox = function (document) {\n\t\tthis.docu...
javascript
chosen
[ { "from": "system", "value": "Add total score to stats\n" }, { "from": "human", "value": "class Stats extends Phaser.State {\n\n\tcreate() {\n\t\tthis.totalScore = this.game.state.states['Main'].totalScore\n this.game.stage.backgroundColor = '#DFF4FF';\n\n\t\tlet statsHeader = \"STATS\"\n ...
javascript
chosen
[ { "from": "system", "value": "Disable Vue tips when running Jest\n" }, { "from": "human", "value": "import Vue from 'vue';\nimport Translate from '~/vue_shared/translate';\nimport axios from '~/lib/utils/axios_utils';\nimport { initializeTestTimeout } from './helpers/timeout';\n\n// wait for pen...
javascript
chosen
[ { "from": "system", "value": "Use a faster source map implementation\n" }, { "from": "human", "value": "const path = require('path');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\n\nmodule.exports = {\n entry: ['./client/src/index.js'],\n devtool: 'source-map',\n output: {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove Component Test Blueprint `assert.expect`s\n\nAll steps in the generated exercise and assertion phases occur\nsynchronously. Therefore, the `assert.expect(n)` lines:\n\n* add noise to the generated file\n* make the resulting tests brittle\n* encourages new Ember developer...
javascript
chosen
[ { "from": "system", "value": "Fix behavior on create new version\n\n- Was not redirecting to the correct state\n" }, { "from": "human", "value": "(function() {'use strict';\n\nangular.module('ag-admin').controller(\n 'ApiVersionController',\n function($scope, $timeout, $state, $stateParams...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary call for details\n" }, { "from": "human", "value": "const axios = require('axios');\nconst chalk = require('chalk');\n\nconst time = require('./time');\n\nfunction getLaunchDetails(launchId, callback) {\n axios.get('https://launchlibrary.net/1.2/...
javascript
chosen
[ { "from": "system", "value": "Fix for running exported function instead of result of last statement.\n" }, { "from": "human", "value": "\"use strict\"\n\nvar JavaScriptPlaygroundEditor = require(\"./JavaScriptPlaygroundEditor.js\")\n , vm = require(\"vm\")\n\nvar JavaScriptPlayground = module.e...
javascript
chosen
[ { "from": "system", "value": "Stop extending if `String` flag is `false`\n\nAllow `Ember.EXTEND_PROTOTYPES.String` is `false`.\n" }, { "from": "human", "value": "require('ember-inflector/system/string');\r\n\r\nif (Ember.EXTEND_PROTOTYPES) {\r\n /**\r\n See {{#crossLink \"Ember.String/plural...
javascript
chosen
[ { "from": "system", "value": "Add fetch method to base view.\n" }, { "from": "human", "value": "define(\n [\n 'underscore', 'backbone',\n 'models',\n 'text!templates/main.utpl'\n ], function(_, B, M, t_main) {\n var V = {};\n\n V.Base = Backbone.View.extend({\n initialize: ...
javascript
chosen
[ { "from": "system", "value": "Handle case where all rows in EE table should be included.\n" }, { "from": "human", "value": "const ee = require('ee')\nconst _ = require('lodash')\n\nconst toGeometry = aoi => {\n switch (aoi.type) {\n case 'POLYGON':\n return polygon(aoi)\n case 'E...
javascript
chosen
[ { "from": "system", "value": "Remove widget addon bar context menu workaround.\n\nRemove the widget 'Prevent the addon bar context menu from showing on right click' workaround. This bug was fixed in Addon SDK 1.6.\n" }, { "from": "human", "value": "/*global self: false */\n\n/**\n * Emits events...
javascript
chosen
[ { "from": "system", "value": "Fix not swapping global plugin anonymous consumer id to username\n" }, { "from": "human", "value": "import invariant from 'invariant';\n\nconst getConsumerById = (id, consumers) => {\n const consumer = consumers.find(x => x._info.id === id);\n\n invariant(cons...
javascript
chosen
[ { "from": "system", "value": "Support a Promise result from alterItems to indicate mutations are complete.\n" }, { "from": "human", "value": "\nconst errors = require('@feathersjs/errors');\nconst getItems = require('./get-items');\nconst replaceItems = require('./replace-items');\n\nmodule.expo...
javascript
chosen
[ { "from": "system", "value": "Add export of Step component\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nexport { Button, ProgressBar } from 'react-native-ui-components';\n\nexport { AutocompleteSelector } from './AutocompleteSelector'...
javascript
chosen
[ { "from": "system", "value": "Disable preloader so the site isn't blanked out with js disabled" }, { "from": "human", "value": "//<![CDATA[\n $(window).load(function() { // makes sure the whole site is loaded\n $('#status').fadeOut(); // will first fade out the loading animation\n $...
javascript
chosen
[ { "from": "system", "value": "Update sample of google chrome developer tools\n" }, { "from": "human", "value": "console.warn('devtools.js');\n\nchrome.devtools.panels.create(\n 'sample',\n '',\n './panel.html',\n (panel) => {\n let _panelWindow;\n\n // a-0. connect to b...
javascript
chosen
[ { "from": "system", "value": "Fix remove echoPermission option in PopoverModel\n" }, { "from": "human", "value": "\n// ----------------------------------------------------------------\n// Popover Class\n\nclass PopoverModel extends CommonModel {\n constructor({\n name = 'Popover',\n selec...
javascript
chosen
[ { "from": "system", "value": "Update custom aria message example\n" }, { "from": "human", "value": "// @flow\nimport React from 'react';\n\nimport Select from 'react-select';\nimport { colourOptions } from '../data';\n\nexport default function CustomAriaLive() {\n return (\n <form>\n <l...
javascript
chosen
[ { "from": "system", "value": "Disable blend tree view when tab-bar isn't tinted\n" }, { "from": "human", "value": "'use babel';\n\nimport toggleClassName from '../helper/toggle-class-name';\n\natom.config.observe('atom-material-ui.tabs.tintedTabBar', (value) => {\n toggleClassName('amu-tinted...
javascript
chosen
[ { "from": "system", "value": "Add a test to check for thrown exception.\n" }, { "from": "human", "value": "describe(\"sqrt\", function() {\n\n it(\"should compute the square root of 4 as 2\", function() {\n expect(My.sqrt(4)).toEqual(2);\n });\n\n});\n" }, { "from": "gpt", "valu...
javascript
chosen
[ { "from": "system", "value": "Disable refresh in iso mode.\n" }, { "from": "human", "value": "const REFRESH_PERIOD = 30 * 60 * 1000 // 30 minutes in microseconds\nconst focusSupported = typeof document.addEventListener !== 'undefined' &&\n typeof document.visibilityState !=...
javascript
chosen
[ { "from": "system", "value": "Create function that works for someone else\n" }, { "from": "human", "value": "(function(ext) {\n // Cleanup function when the extension is unloaded\n ext._shutdown = function() {};\n\n // Status reporting code\n // Use this to report missing hardware, p...
javascript
chosen
[ { "from": "system", "value": "Use 8080 as dev port\n\nI use that elsewhere so better to use it here as well to avoid\nconfusion... Perhaps it would be nice to dig this from the env.\n" }, { "from": "human", "value": "'use strict';\nvar webpack = require('webpack');\nvar WebpackDevServer = requir...
javascript
chosen
[ { "from": "system", "value": "Fix async Rainbow.color in node\n\nFor some reason node.js does not like the setTimeout inside the web\nworker. I haven't had a chance to dig into it and see why, but for now\nthis works.\n" }, { "from": "human", "value": "import Prism from './prism';\n\nexport defa...
javascript
chosen
[ { "from": "system", "value": "Fix issue sending photo command with video\n" }, { "from": "human", "value": "// This module is responsible for capturing videos\n\nconst config = require('config');\nconst PiCamera = require('pi-camera');\nconst myCamera = new PiCamera({\n mode: 'video',\n output...
javascript
chosen
[ { "from": "system", "value": "Update example to use more terse \"-loader\"-less format\n" }, { "from": "human", "value": "import NpmInstallPlugin from \"npm-install-webpack-plugin\";\nimport path from \"path\";\n\nexport const defaults = {\n context: process.cwd(),\n\n externals: [],\n\n modu...
javascript
chosen
[ { "from": "system", "value": "Add a text vs number composite statement example\n" }, { "from": "human", "value": "import Local\nimport Global\n\n\"Global.x:\" <input data=Global.x dataType=\"number\" style={ display:'block' }/>\n\"Global.y:\" <input data=Global.y dataType=\"number\" style={ disp...
javascript
chosen
[ { "from": "system", "value": "Use local JSON for dev\n" }, { "from": "human", "value": "'use strict';\n\n/* Services */\n\nvar splitcoinServices = angular.module('splitcoin.services', ['ngResource']);\n\n// Demonstrate how to register services\n// In this case it is a simple value service.\nspli...
javascript
chosen
[ { "from": "system", "value": "Add a bit for drawing the bbox of some svg.\n" }, { "from": "human", "value": "define([], function() {\n 'use strict';\n function SvgPartitionRenderer(svgDocArg) {\n var svgDoc = svgDocArg;\n\n this.render = function(p) {\n var draw = svgDoc.nested();\n...
javascript
chosen
[ { "from": "system", "value": "Add more tests against filtering\n" }, { "from": "human", "value": "'use strict';\n\nimport test from 'tape';\nimport {cards} from '../';\n\ntest('all', (t) => {\n t.equal(cards.all().length, 28);\n t.end();\n});\n\ntest('valid', (t) => {\n t.equal(cards.valid()....
javascript
chosen
[ { "from": "system", "value": "Use config instead of _config in tests\n" }, { "from": "human", "value": "// Dependencies\nvar Debug = require(\"../index\");\n\nDebug._config.logLevel = 4;\n\n// Test defaults\nDebug\n .log(\"A fancy error message\", \"error\")\n .log(\"Info messages are useful\"...
javascript
chosen
[ { "from": "system", "value": "Rename variable for \"no-shadow\" in eslint\n" }, { "from": "human", "value": "import template from './builder';\nimport kms from './kms';\nimport cw from './post';\nimport auth from './auth';\n\nexports.handler = (event, context) => {\n console.log('Received event...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix bug breaking webpages with yt embeds\n" }, { "from": "human", "value": "// listen for page navigations, detect if they're YT & include our disable\nchrome.webNavigation.onBeforeNavigate.addListener((details) => {\n if(detectYTURL(details.url) && details.u...
javascript
chosen
[ { "from": "system", "value": "Add CanoOptionNode item selection widget\n" }, { "from": "human", "value": "\nfunction CanoOptionNode(params) {\n var self=this,\n canopy = params.canopyClient,\n $me;\n\n $.extend(this, new CanoNode());\n\n this.get$ = function() {\n r...
javascript
chosen
[ { "from": "system", "value": "Add comment for xml-js lib\n" }, { "from": "human", "value": "courses = {\n 0:{\n 'dept':'CS',\n 'num':383,\n 'sections':{\n 'A':{\n 'M':[],\n 'T':[],\n 'W':[],\n 'R':[],\...
javascript
chosen
[ { "from": "system", "value": "fix(loader): Update example to match updated README\n" }, { "from": "human", "value": "const { resolve } = require('path');\n\nmodule.exports = {\n entry: resolve(__dirname, 'src/index.js'),\n output: {\n filename: 'bundle.js',\n path: resolve(__dirname, 'di...
javascript
chosen
[ { "from": "system", "value": "Change indentation in js file\n" }, { "from": "human", "value": "HTMLWidgets.widget({\n\n name: 'trackWidget',\n\n type: 'output',\n\n factory: function(el, width, height) {\n\n // Define shared variables for this instance\n var tntins = null;\n var init...
javascript
chosen
[ { "from": "system", "value": "Remove music button for now\n" }, { "from": "human", "value": "import { createDownloadMP3Button } from './youtubeinmp3';\n\nlet playerIframe;\n\nexport default function startMixerBoxMainScript() {\n console.log('MixerBox+ loaded.');\n playerIframe = document.getEl...
javascript
chosen
[ { "from": "system", "value": "Load it once, not every time, Jeeves.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar updater = require('update-notifier'),\n\tpkg = require('../package.json');\n\nupdater({pkg: pkg}).notify();\n\nvar yargs = require('yargs')\n\t.option('registry',...
javascript
chosen
[ { "from": "system", "value": "Add allow/deny for post editing/deleting\n" }, { "from": "human", "value": "Posts = new Mongo.Collection('posts');\n\nMeteor.methods({\n postInsert: function(postAttributes) {\n check(Meteor.userId(), String);\n check(postAttributes, {\n title: String,\n...
javascript
chosen
[ { "from": "system", "value": "Set replace to false in pushState method\n" }, { "from": "human", "value": "import { _win } from 'core/variables';\nimport { genTimeKey } from './key';\n\nlet _key = genTimeKey();\n\nexport const supportsPushState = _win.history && _win.history.pushState;\n\n/**\n *...
javascript
chosen
[ { "from": "system", "value": "Return only resident latesst activity by type.\n" }, { "from": "human", "value": "Meteor.methods({\n 'getResidentsLatestActivityByType': function (activityTypeId) {\n // Get resident latest activity by type\n var residentLastActivityByType = Activities.aggreg...
javascript
chosen
[ { "from": "system", "value": "Make the A look better. ('Cause it matters, right?)\n" }, { "from": "human", "value": "function makeFont(width, height, sparsity) {\n return {\n a: function (x, y) {\n var cx = 0, i = 0, cy = 0;\n var f = [\n function (...
javascript
chosen
[ { "from": "system", "value": "Use fs to output file.\n" }, { "from": "human", "value": "var utils = require('./tools/utils')\nvar shellRunner = require('./tools/shellRunner').setCommand('wkhtmltoimage');\nvar imagesPath = 'public/snapshots/';\n\nvar take = function (url) {\n var options = {\n...
javascript
chosen
[ { "from": "system", "value": "[lib] Handle empty filename in fileInfoFromData\n" }, { "from": "human", "value": "// @flow\n\nimport type { MediaType } from '../types/media-types';\n\nimport fileType from 'file-type';\n\ntype FileInfo = {| name: string, mime: string, mediaType: MediaType |};\nfun...
javascript
chosen
[ { "from": "system", "value": "fix(src): Add logic to handle empty path usecase\n" }, { "from": "human", "value": "// @flow\n\nimport hasKey from \"./hasKey\";\n\nimport type {Composite, Path} from \"./types\";\n\n/**\n * Returns value located at the given path or undefined otherwise.\n */\nconst...
javascript
chosen
[ { "from": "system", "value": "fix(project): Select project id from route parameters first\n\nFixes a problem where project was set in wrong order.\n\ncloses #535\n" }, { "from": "human", "value": "// @flow\nimport {createSelector} from 'reselect'\n\nimport selectCurrentScenario from './current-s...
javascript
chosen
[ { "from": "system", "value": "Fix deployment script to include yarn\"\n" }, { "from": "human", "value": "require('shelljs/global');\n\nconst platform = {\n path: 'sashimi-platform',\n buildPath: 'public'\n};\nconst webapp = {\n path: 'sashimi-webapp',\n buildPath: 'dist'\n};\n\nlet statusBui...
javascript
chosen
[ { "from": "system", "value": "Fix bug: Do not push if saga is undefined\n" }, { "from": "human", "value": "import { createActions, handleActions } from 'redux-actions'\nimport { takeEvery } from 'redux-saga/effects'\n\nexport const createModule = (moduleName, definitions, defaultState) => {\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add `annConfig` to globals option\n" }, { "from": "human", "value": "const path = require('path')\n\nmodule.exports = {\n env: {\n browser: true,\n es6: true,\n node: true,\n },\n extends: [\n 'plugin:@typescript-eslint/recommended',\n 'plugin:impo...
javascript
chosen
[ { "from": "system", "value": "Add initial client unit test.\n" }, { "from": "human", "value": "// Loader to create the Ember.js application\n/*global require */\n\nwindow.App = require('ghost/app')['default'].create();\n" }, { "from": "gpt", "value": "// Loader to create the Ember.js...
javascript
chosen
[ { "from": "system", "value": "Use Atom's new Dock feature\n" }, { "from": "human", "value": "/** @babel */\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport IssuesList from './components/issues-list';\n\nexport default class GhIssuesView {\n\n constructor(serializedState) {...
javascript
chosen
[ { "from": "system", "value": "Configure web-fonts to swap after being loaded\n" }, { "from": "human", "value": "import './assets/style/main.scss';\n\nconst resources = {\n\tmanifest: '/application.webmanifest',\n\tfonts: 'https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700%7cRob...
javascript
chosen
[ { "from": "system", "value": "Add trace option for Sass.\n" }, { "from": "human", "value": "// Compile SCSS files to CSS\n\nmodule.exports = function(grunt) {\n grunt.config('sass', {\n dev: {\n options: {\n sourcemap: true,\n style: 'nested',\n...
javascript
chosen
[ { "from": "system", "value": "Allow importing directly from carbon-ui\n" }, { "from": "human", "value": "export { default as ThemeProvider } from './ThemeProvider'\nexport { default as connectTheme } from './connectTheme'\n" }, { "from": "gpt", "value": "export * from './styles'\n\ne...
javascript
chosen
[ { "from": "system", "value": "Fix after update prettier to 1.7\n" }, { "from": "human", "value": "import { applyMiddleware, compose } from 'redux';\n\nexport default function createMiddleware(clientMiddleware) {\n const middleware = applyMiddleware(clientMiddleware);\n const composeEnhancers =...
javascript
chosen
[ { "from": "system", "value": "Test passes, test setup works. Ready to go.\n" }, { "from": "human", "value": "import assert from 'assert';\n\ndescribe('test setup', () => {\n it('works?', () => {\n assert(false);\n });\n});" }, { "from": "gpt", "value": "import assert from 'asser...
javascript
chosen
[ { "from": "system", "value": "Use defaults from eslint react plugin\n" }, { "from": "human", "value": "module.exports = {\n 'env': {\n 'browser': true,\n 'commonjs': true,\n 'es6': true\n },\n 'extends': 'eslint:recommended',\n 'installedESLint': true,\n 'pars...
javascript
chosen
[ { "from": "system", "value": "Fix diagonalMovement = Always not working\n\nChanged the values of DiagonalMovement enum because when it had a\nvalue of zero the check \"if (!diagonalMovement)\" became true in the\nconstructor of the finder classes.\n" }, { "from": "human", "value": "var DiagonalM...
javascript
chosen
[ { "from": "system", "value": "Move type checkers to the bottom of the file\n" }, { "from": "human", "value": "export default function * forc (bindings, body) {\n for (const [key, value] of pairs(bindings)) {\n const iter = isFunction(value) ? value(/* bindings... */) : value\n\n for (cons...
javascript
chosen
[ { "from": "system", "value": "Handle creation w/o passing namespace\n" }, { "from": "human", "value": "const debug = require('debug');\nconst path = require('path');\nconst stackTrace = require('stack-trace');\nconst appRoot = require('app-root-path');\n\nfunction debugWrapper (namespace) {\n c...
javascript
chosen
[ { "from": "system", "value": "Change to predict 'on demand'\n" }, { "from": "human", "value": "// Entry point of the application\n\nvar parser = require('./parser');\nvar Renderer = require('./renderer');\nvar Interpreter = require('./interpreter');\nvar Predictor = require('./predictor');\n\nva...
javascript
chosen
[ { "from": "system", "value": "Make Balance get the balance from the Wallets instead of the db\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\nvar ObjectId = mongoose.Schema.Types.ObjectId;\n\nvar User = require(\"./user_model\");\n...
javascript
chosen
[ { "from": "system", "value": "Update Marionette Wires to work with the inspector\n" }, { "from": "human", "value": "require('./plugins');\nvar Backbone = require('backbone');\nvar Application = require('src/application/application');\n\nvar app = new Application();\n\napp.module('modal', {\n mo...
javascript
chosen
[ { "from": "system", "value": "Fix for when a user edits a Client Relationship Manager\n" }, { "from": "human", "value": "const { get, includes } = require('lodash')\n\nfunction filterActiveAdvisers ({ advisers = [], includeAdviser = [] }) {\n includeAdviser = [...includeAdviser]\n return advis...
javascript
chosen
[ { "from": "system", "value": "Add Explicit Model Hook for Course\n\nThe implicit model behavior of ember now causes some deprecation\nwarnings from ember-data so let's ensure we have a hook.\n" }, { "from": "human", "value": "import { inject as service } from '@ember/service';\nimport Route from...
javascript
chosen
[ { "from": "system", "value": "emoji: Add types on Unicode-emoji mapmaking code.\n\nSadly `Object.values` has a bogus type in Flow's definitions,\nreturning `Array<mixed>`; the least-ugly solution I can find is to\nswitch to `Object.keys`.\n" }, { "from": "human", "value": "/* @flow */\n/* eslint...
javascript
chosen
[ { "from": "system", "value": "Use chalk for ANSI codes\n\nfbshipit-source-id: 2b2b9f8\n" }, { "from": "human", "value": "import { Diagnostics } from 'xdl';\nimport { print as envinfoPrint } from 'envinfo';\n\nimport simpleSpinner from '@expo/simple-spinner';\n\nimport log from '../log';\n\nasync...
javascript
chosen
[ { "from": "system", "value": "Add backgroun color to help button\n" }, { "from": "human", "value": "import React from 'react';\n\nconst Help = ({ activate }) => {\n return (\n <button onClick={activate}>Help</button>\n );\n};\n\nexport default Help;" }, { "from": "gpt", "value":...
javascript
chosen
[ { "from": "system", "value": "Fix test when license is not set\n" }, { "from": "human", "value": "var path = require('path');\nvar assert = require('yeoman-generator').assert;\nvar helpers = require('yeoman-generator').test;\n\ndescribe('app', function () {\n before(function (done) {\n helpe...
javascript
chosen
[ { "from": "system", "value": "Remove opt_this param in forEach function\n" }, { "from": "human", "value": "/**\n * @module ol/geom/flat/segments\n */\n\n\n/**\n * This function calls `callback` for each segment of the flat coordinates\n * array. If the callback returns a truthy value the functio...
javascript
chosen
[ { "from": "system", "value": "Enable to set up other ImmutableThunk's properties\n" }, { "from": "human", "value": "import deepEqual from 'deep-equal';\r\n\r\n// `ImmutableThunk` may be used with virtual-dom/vnode.\r\nexport default class ImmutableThunk {\r\n\r\n constructor(fn, args, equalArgs...
javascript
chosen
[ { "from": "system", "value": "Make sure we can rebuild the menu\n" }, { "from": "human", "value": "'use strict'\n\nvoid (function () {\n const remote = require('remote')\n const Tray = remote.require('tray')\n const Menu = remote.require('menu')\n const MenuItem = remote.require('menu-item')...
javascript
chosen
[ { "from": "system", "value": "Use forEach since we don't want array as return value\n" }, { "from": "human", "value": "export function getInterfaceLanguage() {\n if (!!navigator && !!navigator.language) {\n return navigator.language;\n } else if (!!navigator && !!navigator.languages && !!na...
javascript
chosen
[ { "from": "system", "value": "Use more human names for text style utilities\n" }, { "from": "human", "value": "import defineClasses from '../util/defineClasses'\n\nexport default function() {\n return defineClasses({\n 'italic': { 'font-style': 'italic' },\n 'normal': { 'font-style': 'nor...
javascript
chosen
[ { "from": "system", "value": "Fix get stickynotes from url param\n" }, { "from": "human", "value": "/**\n * @file Manages stickynotes API endpoints\n */\n\nconst api = require(__dirname + '/../libs/api.js');\nconst stickynotes = require(__dirname + '/../libs/stickynotes.js');\n\nmodule.exports =...
javascript
chosen