conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Check 3 times for web3 before going localhost\n" }, { "from": "human", "value": "// console.log('package-pre-init start')\nimport { Session } from 'meteor/session';\n\nweb3Obj = new Web3();\nSession.set('web3ObjReady', false);\nsetTimeout(\n function() {\n if (w...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded usage of state" }, { "from": "human", "value": "var App = (function () { \"use strict\";\n var pub = {};\n var scores = {\n 1: 0,\n 2: 0,\n };\n\n function render() {\n React.unmountComponentAtNode(document.getElementById('scoreboard'));...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Add function in client to register admin user.\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('publicApp')\n .controller('LoginCtrl', ['$scope', '$http', '$location', 'UserService', function ($scope, $http, $location, $user) {\n fun...
javascript
chosen
[ { "from": "system", "value": "Improve jQuery object iteration; remove unused deconstructed property\n" }, { "from": "human", "value": "import Component from 'ember-forge-ui/components/ef-list';\nimport Ember from 'ember';\n\nconst {\n computed,\n get\n} = Ember;\n\n/**\n * @module\n * @augment...
javascript
chosen
[ { "from": "system", "value": "Remove unused parameter from object.\n" }, { "from": "human", "value": "var LoadingBar = function(game, parent, color) {\n Phaser.Group.call(this, game, parent);\n\n // Images loaded by MyGame.Init\n this.background = game.add.sprite(game.world.centerX, gam...
javascript
chosen
[ { "from": "system", "value": "Refactor url parsing into function\n" }, { "from": "human", "value": "import React from 'react';\n\nimport FeaturedItems from '../FeaturedItems';\nimport ItemCard from '../ItemCard';\n\nconst Jobs = props => {\n return (\n <FeaturedItems>\n {props.data.map(...
javascript
chosen
[ { "from": "system", "value": "Remove AMP menu in non-AMP window\n" }, { "from": "human", "value": "/**\n * WordPress dependencies\n */\nimport domReady from '@wordpress/dom-ready';\n\nconst { parent } = window;\n\nif ( parent.pairedBrowsingApp ) {\n\twindow.ampPairedBrowsingClient = true;\n\tcon...
javascript
chosen
[ { "from": "system", "value": "Add author info in the document info if it doesn't exist.\n" }, { "from": "human", "value": "exports.nit = function(env) {\n var $ = env.$;\n // at least one author\n var authors = $(\".section#authors address\");\n if (authors.length < 1) {\n ret...
javascript
chosen
[ { "from": "system", "value": "Fix merging of the ‘Options’ object\n" }, { "from": "human", "value": "/**\n * Validation\n *\n * @constructor\n * @param {object} options\n */\nvar Validation = function(options) {\n\n // Save a reference to the ‘this’\n var self = this;\n\n var defaultOptions =...
javascript
chosen
[ { "from": "system", "value": "Clean code of browser policy file\n" }, { "from": "human", "value": "import { BrowserPolicy } from 'meteor/browser-policy-common';\nBrowserPolicy.content.allowConnectOrigin(\"wss:\");\nBrowserPolicy.content.allowConnectOrigin(\"ws:\");\nBrowserPolicy.content.allowFo...
javascript
chosen
[ { "from": "system", "value": "Load environment variable first in express app\n" }, { "from": "human", "value": "var express = require('express');\nvar passport = require('passport');\nvar util = require('./lib/utility.js');\n\n// Load environment variables\nif (process.env.NODE_ENV !== 'integrat...
javascript
chosen
[ { "from": "system", "value": "Clean up backen search js\n" }, { "from": "human", "value": "/**\n * All methods related to the search\n */\njsBackend.search =\n{\n // init, something like a constructor\n init: function()\n {\n $synonymBox = $('input.synonymBox');\n\n // syn...
javascript
chosen
[ { "from": "system", "value": "Add 1500 to build number until next minor bump\n" }, { "from": "human", "value": "const fs = require('fs-extra');\nconst path = require('path');\nconst yargs = require('yargs').argv;\n\nconst validEnvironments = ['beta', 'development'];\nif (!validEnvironments.inclu...
javascript
chosen
[ { "from": "system", "value": "Correct type (\"(\" instead of \")\")\n" }, { "from": "human", "value": "module.exports = {\n 'swagger--collection-format': function (value) {\n return {\n 'csv': 'comma separated (`foo,bar`)',\n 'ssv': 'space separated (`foo bar`)',\...
javascript
chosen
[ { "from": "system", "value": "Update config to point at keff.dev\n" }, { "from": "human", "value": "module.exports = {\n siteMetadata: {\n title: 'keff',\n },\n plugins: [\n 'gatsby-plugin-react-helmet',\n 'gatsby-plugin-sass',\n {\n resolve: 'gatsby-plugin-manifest',\n ...
javascript
chosen
[ { "from": "system", "value": "Add a link to the API\n" }, { "from": "human", "value": "'use strict';\n\nimport React, { Component } from 'react';\nimport Navbar from 'react-bootstrap/lib/Navbar';\nimport Nav from 'react-bootstrap/lib/Nav';\nimport NavItem from 'react-bootstrap/lib/NavItem';\n\nc...
javascript
chosen
[ { "from": "system", "value": "Allow the use of the json_metadata 'canonical_link' to set a canonical link on top of the app tag\n" }, { "from": "human", "value": "import Apps from 'steemscript/apps.json';\n\nexport function makeCanonicalLink(d) {\n var canonicalUrl = 'https://steemit.com' + d...
javascript
chosen
[ { "from": "system", "value": "Add rolling-rate-limiter for limiting api request rate\n" }, { "from": "human", "value": "const validKeys = ['key1','key2', 'key3', 'key4', 'key5']; //TODO replace API keys in request with JWT-token?\nconst validator = {\n validateKey: function(req, res, next){\n...
javascript
chosen
[ { "from": "system", "value": "Add key down handler for debounceTime options\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport './OperationCard.css';\n\nclass OperationCard extends Component {\n render() {\n const { ope...
javascript
chosen
[ { "from": "system", "value": "Remove router, we just have ONE GET, nothing more.\n" }, { "from": "human", "value": "var express = require('express');\nvar http = require('http');\nvar path = require('path');\nvar app = express();\nvar ser...
javascript
chosen
[ { "from": "system", "value": "Add references to node and express typings grabbed with grab-typings (thanks bengreenier!)\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\n\nvar colors = [ \"red\", \"yellow\", \"green\" ];\n\nvar data = {\n\t\n\tcolor: co...
javascript
chosen
[ { "from": "system", "value": "Disable socket server listener for now\n" }, { "from": "human", "value": "var http = require('http')\n , server = http.createServer().listen(8005)\n , io = require('socket.io')(server)\n , nsp = io.of('/socket.io')\n , peopleManager = require('./utils/peopleMana...
javascript
chosen
[ { "from": "system", "value": "Fix help message when command is empty\n" }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\n\nconst lexicon = [];\n{\n const directory = path.join(__dirname, 'lexicon');\n fs.readdirSync(directory).forEach(function(file) {\n...
javascript
chosen
[ { "from": "system", "value": "Switch to route based request" }, { "from": "human", "value": "(function(window){\n window.ajax = function(url, options) {\n var method = options.method || 'GET',\n data = options.data || {},\n success = options.success || function(re...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix CLI throw when less argument\n" }, { "from": "human", "value": "#!/usr/bin/env node\nconst qr = require('qrcode-terminal')\nconst argv = require('minimist')(process.argv.slice(2), { string: '_' })\nconst generatePayload = require('./')\nconst target = argv...
javascript
chosen
[ { "from": "system", "value": "Cut the over than 80 columns code\n" }, { "from": "human", "value": "\n\nmodule.exports = function (app, passport) {\n\n var authorization = require('../controllers/authorization'),\n pages = require('../controllers/pages'),\n users = require('../controll...
javascript
chosen
[ { "from": "system", "value": "Return a HTML doc for the list of feature files, include link to the feature file.\n" }, { "from": "human", "value": "\"use strict\";\n/* eslint new-cap: 0 */\n\nvar express = require('express');\nvar router = express.Router();\n\nvar getFeatureFilePaths = require(\...
javascript
chosen
[ { "from": "system", "value": "Add name config property to the simple config fixture\n" }, { "from": "human", "value": "module.exports = function() {\n return {\n 'translation.af': JSON.stringify({\n '' : {\n 'domain' : 'messages',\n 'lang' : '...
javascript
chosen
[ { "from": "system", "value": "Fix import of json in settings\n" }, { "from": "human", "value": "define([\n \"src/schema\"\n], function(Schema) {\n var _ = codebox.require(\"hr/utils\");\n var hr = codebox.require(\"hr/hr\");\n var File = codebox.require(\"models/file\");\n\n var M...
javascript
chosen
[ { "from": "human", "value": "Add a one-to-one corresponding view in model.\n" }, { "from": "gpt", "value": "var app = app || {};\n\n// Todo項目のビュー\n\n// Todo項目を表すDOM要素\napp.TodoView = Backbone.View.extend({\n\n tagName: 'li',\n\n template: _.template($('#item-template').html()),\n\n events: {\...
javascript
chosen
[ { "from": "system", "value": "Add to Directive scope activeCategory value\n" }, { "from": "human", "value": "// js/directives/nw-category-select.directive\n\n(function() {\n \"use strict\";\n\n angular.module(\"NoteWrangler\")\n .directive(\"nwCategorySelect\", nwCategorySelectDirective);\n...
javascript
chosen
[ { "from": "system", "value": "Remove illegal character ( right arrow ) from (.js)\n\nFor square-it (.js); No carriage return right arrows allowed\n" }, { "from": "human", "value": "//Square It\n\"use strict\";\n//Declare and assign the arrow function to accept one argument\nlet SQ = (nbr) => {\n...
javascript
chosen
[ { "from": "system", "value": "Update API path of geting sensors\n" }, { "from": "human", "value": "(function(){\n $.ajax({\n url: 'evanxd/sensors',\n })\n .done(function(sensors) {\n var sensorList = $('#sensor-list ul');\n var html = '';\n sensors.forEach(function(sensor) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use of export...from instead of" }, { "from": "human", "value": "// @flow\n\nexport const union = require('./shapely/interfaceFunctions/union').default;\nexport const any = require('./shapely/interfaceFunctions/any').default;\nexport const nil = require('./shapely/i...
javascript
chosen
[ { "from": "system", "value": "Add Opbeat performance flag for client\n" }, { "from": "human", "value": "import initOpbeat from 'opbeat-react';\nimport 'opbeat-react/router';\n\nlet opbeat_app_id = process.env.REACT_APP_OPBEAT_APP_ID;\nlet opbeat_org_id = process.env.REACT_APP_OPBEAT_ORG_ID;\n\ni...
javascript
chosen
[ { "from": "system", "value": "Test if it works with zip\n" }, { "from": "human", "value": "/* eslint-env node, jest */\nconst { partition, range } = require('iter-tools')\n\ndescribe('partition', function () {\n describe('evens and odds', function () {\n const isEven = n => n % 2 === 0\n\n ...
javascript
chosen
[ { "from": "system", "value": "Fix old qunit import name in test-dev\n\n4002d5840e4b869b6ca2509372b4d70daed11474\n" }, { "from": "human", "value": "global._noQUnitBridge = true;\n\nimport \"./main\";\nimport { start } from \"QUnit\";\nimport nwGui from \"nw.gui\";\n\n\nconst nwWindow = nwGui.Wind...
javascript
chosen
[ { "from": "system", "value": "Add more desktop browsers to list of browsers to test\n\nCurrently don’t test mobile browsers as it looks like sauce are in the middle of restructuring how all the stuff works.\n" }, { "from": "human", "value": "/* eslint import/no-extraneous-dependencies: [\"error\...
javascript
chosen
[ { "from": "system", "value": "Remove coverage for now (its getting stuck)\n\nRemove coverage for now (its getting stuck)" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (grunt) {\n grunt.initConfig({\n\n jshint: {\n options: {\n jshintrc: '.jshintrc'\n...
javascript
chosen
[ { "from": "system", "value": "Add a Grunt task to produce a minified version of pixadee.js.\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\n\tgrunt.initConfig({\n\n\t\tpkg: grunt.file.readJSON('package.json'),\n\n\t\tclean: {\n\t\t\tbuild: {\n\t\t\t\tsrc: \"build\"\n\t\...
javascript
chosen
[ { "from": "system", "value": "fix: Correct function used to curry.\n" }, { "from": "human", "value": "import * as most from 'most';\nimport { curryN } from 'ramda';\n\nexport const curry2 = r.curryN(2);\n\nexport const mfilterc = r.curry2(most.filter);\nexport const mmapc = r.curry2(most.map);\n...
javascript
chosen
[ { "from": "system", "value": "Fix type of complement of\n" }, { "from": "human", "value": "var SetOperatorNode = require(\"../SetOperatorNode.js\");\n\nmodule.exports = (function () {\n\n\tvar o = function (graph) {\n\t\tSetOperatorNode.apply(this, arguments);\n\n\t\tvar that = this;\n\n\t\tthis...
javascript
chosen
[ { "from": "system", "value": "Add heuristics to fallback preview component\n" }, { "from": "human", "value": "import React, {PropTypes} from 'react'\n\nexport default function FallbackPreviewComponent(props) {\n return (\n <div><pre>{JSON.stringify(props.value, null, 2)}</pre></div>\n )\n}\...
javascript
chosen
[ { "from": "system", "value": "Fix bug where list rows are not cleaned up\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nmodule.exports = function($templateRequest, $compile, $interpolate) {\n\n typeCounts = {};\n\n return {\n restrict: 'E',\n link: function(...
javascript
chosen
[ { "from": "system", "value": "Fix up the dump options for Control.Zoom\n" }, { "from": "human", "value": "/*\n Control.Zoom.debug.js\n This is wrapping the L.Control.Zoom class with .debug\n\n\t(c) 2013, Aaron Racicot, Z-Pulley Inc.\n*/\n'use strict';\n\nvar ControlZoomDebug = L.Class.extend({...
javascript
chosen
[ { "from": "system", "value": "Unify promiseThrottler. Add 'key' to options.\n" }, { "from": "human", "value": "/*\n * Author: CM\n */\n\n(function(global) {\n\n /**\n * @callback PromiseThrottled\n * @param {...Object|String|Number} any number of optional params\n * @return {Promise}\n ...
javascript
chosen
[ { "from": "system", "value": "[v3]: Remove whitespace around inserted links" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the Licen...
javascript
chosen
[ { "from": "system", "value": "Change menu 'not implemented' alert ¯\\_(ツ)_/¯\n" }, { "from": "human", "value": "import React from 'react';\nimport Button from '../Button';\nimport styles from './styles.css';\n\nconst Header = () => (\n <div className={styles.header}>\n <h1 className={styles....
javascript
chosen
[ { "from": "system", "value": "Fix submodules for the \"no-prebuilt install from npm\" case\n\n" }, { "from": "human", "value": "var path = require(\"path\");\nvar rootDir = path.join(__dirname, \"../..\");\nvar exec = require(path.join(rootDir, \"./utils/execPromise\"));\n\nmodule.exports = func...
javascript
chosen
[ { "from": "system", "value": "Enable resolve find brand from multiple directories\n" }, { "from": "human", "value": "'use strict'\n\nconst createAddFactory = require('../create-add')\nconst { sails } = require('../../directory')\nconst category = require('../../category')\nconst carbon = require...
javascript
chosen
[ { "from": "system", "value": "HOTFIX: Fix cloudfoundry using wrong node version\n" }, { "from": "human", "value": "var locationGraph = require('../assets/data/demo-picker-data-1.json')\n\nfunction isCanonicalNode (node) {\n return node.meta.canonical\n}\n\nfunction presentableName (node, locale...
javascript
chosen
[ { "from": "system", "value": "Revert \"fix ES5 shim test\"\n\nThis reverts commit ae8728dc7bbdec7109b70c07a97333ffac4662a3.\n" }, { "from": "human", "value": "define('implementations', [], function () {\n 'use strict';\n return {\n 'es5': [\n {\n isAvailable: function () {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove no longer necessary IE8 shims\n" }, { "from": "human", "value": "require('es5-shim');\nrequire('es5-shim/es5-sham');\n\n(function () {\n\nif (typeof console === 'undefined') {\n window.console = {};\n window.console.log = function () {};\n}\n\n// These ...
javascript
chosen
[ { "from": "system", "value": "Extend visualisation period until end of 2015\n" }, { "from": "human", "value": "\nvar moment = require('moment');\n\n// NOTE: month indices are zero-based\n\nmodule.exports.DATA_START_YEAR = 2012;\nmodule.exports.DATA_START_MONTH = 0;\nmodule.exports.DATA_START_MOM...
javascript
chosen
[ { "from": "system", "value": "Test for ignoring Mac DS_STORE\n" }, { "from": "human", "value": "var expect = require('expect.js');\nvar ignore = require('../lib/ignore');\n\ndescribe('ignoring files', function() {\n it('determine if a directory matches an ignore glob', function () {\n expect...
javascript
chosen
[ { "from": "system", "value": "Update avoider's use of BBCServices\n" }, { "from": "human", "value": "var utils = require(\"radiodan-client\").utils,\n logger = utils.logger(__filename);\n\nmodule.exports = routes;\n\nfunction routes(app, radiodan, bbcServices) {\n var avoidPlayer = radiod...
javascript
chosen
[ { "from": "system", "value": "Exclude publishing tests from unit tests\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (config) {\n config.set({\n basePath: '../',\n frameworks: ['browserify', 'mocha'],\n plugins: [\n 'karma-browserify',\n 'karma...
javascript
chosen
[ { "from": "system", "value": "Use to make GET request\n" }, { "from": "human", "value": "'use strict';\n\n/* Controllers */\n\nangular.module('myApp.controllers', []).\n controller('AppCtrl', function($scope) {\n $scope.website = {url: ''};\n $scope.check = function() {\n var url = ...
javascript
chosen
[ { "from": "system", "value": "Add initial specs for custom features (pending)\n" }, { "from": "human", "value": "// Tests FileLoader.Promise with the Promises / A+ Test Suite (https://github.com/promises-aplus/promises-tests)\nrequire(\"./support/titanium\");\nvar expect = require(\"...
javascript
chosen
[ { "from": "system", "value": "Fix description of CLI encode test\n" }, { "from": "human", "value": "/* global describe it */\nvar path = require('path')\nvar chai = require('chai')\nvar shell = require('shelljs')\n\nvar expect = chai.expect\n\nvar INDEX_JS = path.join(__dirname, '/../index.js')\...
javascript
chosen
[ { "from": "system", "value": "Fix add Ember Try config for 1.12.X\n" }, { "from": "human", "value": "module.exports = {\n scenarios: [\n {\n name: 'default',\n dependencies: { }\n },\n {\n name: 'ember-1.13.X',\n dependencies: {\n 'ember': '1.13.10'\n }\...
javascript
chosen
[ { "from": "system", "value": "Move fonts inside themes, at css level" }, { "from": "human", "value": "module.exports = {\n fonts: {\n files: [{\n expand: true,\n cwd: 'node_modules/cartoassets/src/fonts',\n src: ['**/*'],\n dest: '<%= config.dist %>/fonts/'\n }]\n }\n...
javascript
chosen
[ { "from": "system", "value": "Enable a test case which was failing previously.\n" }, { "from": "human", "value": "'use strict';\n\nvar csslint = require('../lib/csslint'),\n fs = require('fs'),\n path = require('path');\n\nvar formatter = csslint.getFormatter('compact');\n\nmodule.exports ...
javascript
chosen
[ { "from": "system", "value": "Test config can be passed as object instead of path\n" }, { "from": "human", "value": "import path from 'path'\nimport postcss from 'postcss'\nimport tailwind from '../src/index'\n\ntest('it uses the values from the custom config file', () => {\n return postcss([ta...
javascript
chosen
[ { "from": "system", "value": "Return the promise before it is resolved\n\nAsyncProcess was returning undefined until the promise is resolved, but\nwe can return the promise itself and maybe make this more usable.\n" }, { "from": "human", "value": "import { tracked } from '@glimmer/tracking';\nim...
javascript
chosen
[ { "from": "system", "value": "Change default day format to 3-letter day.\n" }, { "from": "human", "value": "'use strict';\n\nangular\n .module('mwl.calendar')\n .provider('calendarConfig', function() {\n\n var defaultDateFormats = {\n hour: 'ha',\n day: 'D MMM',\n month: 'MMM...
javascript
chosen
[ { "from": "system", "value": "Change console.log to error using debug module.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar debug = require('debug')('socket');\nvar io = require('socket.io')();\nvar room = require('./room');\n\nexports.attach = function (server) {\n io.attach(server...
javascript
chosen
[ { "from": "system", "value": "Add functionatlity for rendering all browser\n" }, { "from": "human", "value": "\nvar swig = require('swig');\nvar http = require('http');\nvar url = require('url');\n\n\nvar output = swig.renderFile('./opensearch-template/chrome-splunk.xml', {\n host: 'local...
javascript
chosen
[ { "from": "system", "value": "Set reset showDateRangeSelector for PageHeader VRT.\n" }, { "from": "human", "value": "/**\n * External dependencies\n */\nimport { storiesOf } from '@storybook/react';\nimport PageHeader from 'GoogleComponents/page-header';\n\nstoriesOf( 'Global', module )\n\t.add(...
javascript
chosen
[ { "from": "system", "value": "Fix preview of bodies with no content\n" }, { "from": "human", "value": "Template.registerHelper('preview', function(value, options) {\n var length = options.hash.length || 140;\n var content = value.replace(/<(?:.|\\n)*?>/gm, ' ');\n if(content.length > length) ...
javascript
chosen
[ { "from": "system", "value": "Add error handler on html preprocessing\n\nClose #238\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\n\nvar paths = gulp.paths;\n\nvar $ = require('gulp-load-plugins')();\n\ngulp.task('markups', function() {\n function renameToHtml(...
javascript
chosen
[ { "from": "system", "value": "Change document.origin to window.origin on DOM JS\n\nA deprecation warning has been issue on Chrome about DOM API method `document.origin`. I changed to `window.origin`\n" }, { "from": "human", "value": "module.exports = Dom;\n\nfunction Dom () { }\n\nDom.prototyp...
javascript
chosen
[ { "from": "system", "value": "Use Constants service instead of hardcoded apiRoot\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('scegratooApp')\n.service('Project', function Project($resource, $http) {\n // AngularJS will instantiate a singleton by calling \"new\" on this fu...
javascript
chosen
[ { "from": "system", "value": "Add failing test example to scaffolded tests\n" }, { "from": "human", "value": "/*global describe,it*/\n'use strict';\nvar assert = require('assert'),\n <%= safeSlugname %> = require('../lib/<%= slugname %>.js');\n\ndescribe('<%= slugname %> node module.', function...
javascript
chosen
[ { "from": "system", "value": "Add recipe listing with optional expansion of properties\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar JsonDB = require('node-json-db');\n\n// Recipes listing\nrouter.get('/', function (req, res, next) {\n ...
javascript
chosen
[ { "from": "system", "value": "Support event on root element" }, { "from": "human", "value": "\n// Events are in the Backbone form of\n// {\n// '[type] [selector]':'[function]'\n// }\n// where selector may have a space, e.g. 'foo > bar'\nfunction DOMViewMixin(view) {\n var _this = this;\n var...
javascript
chosen
[ { "from": "system", "value": "Move propTypes & defaultProps outside of the component class\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport Box from '../box';\nimport cx from 'classnames';\nimport theme from './theme.cs...
javascript
chosen
[ { "from": "system", "value": "Write weekdayName.slice in a shorter way\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst WeekDay = ({ weekday, className, localeUtils, locale, size }) => {\n const weekdayName = localeUtils.formatWeekdayLo...
javascript
chosen
[ { "from": "system", "value": "Add an option to API.fetch to not trigger the loader\n" }, { "from": "human", "value": "import NProgress from 'nprogress'\nimport 'nprogress/nprogress.css'\n\nNProgress.configure({\n\tparent: '.header'\n})\n\nconst API = {\n\tfetch(url, params) {\n\t\tparams = param...
javascript
chosen
[ { "from": "system", "value": "Access results only on travis\n" }, { "from": "human", "value": "const spawn = require('spawndamnit');\nconst ember = `./node_modules/.bin/ember`;\n\nconst userName = process.env['BROWSERSTACK_USERNAME']\nconst accessKey = process.env['BROWSERSTACK_ACCESS_KEY']\n\nc...
javascript
chosen
[ { "from": "system", "value": "Update is public access logic\n" }, { "from": "human", "value": "var loopback = require('loopback'),\n debug = require('debug')('openframe:isPublicOrOwner');\n\n/**\n * This mixin requires a model to have 'is_public: true' or the current user\n * to be the object...
javascript
chosen
[ { "from": "system", "value": "Add documentation on wait parameter\n" }, { "from": "human", "value": "import 'babel-polyfill';\n\nimport meow from 'meow';\nimport logSymbols from 'log-symbols';\nimport parseURL from './lib/parse-url';\nimport checkURL from './lib/check-url';\n\nconst cli = meow(`...
javascript
chosen
[ { "from": "system", "value": "Fix tests for browsers that support native custom elements.\n" }, { "from": "human", "value": "import helperElement from '../lib/element';\nimport helperFixture from '../lib/fixture';\nimport helperReady from '../lib/ready';\nimport skate from '../../src/index';\nim...
javascript
chosen
[ { "from": "system", "value": "Revert \"Update stylelint config link\"\n\nThis reverts commit c78bda6184b3fa11491d38c83e9c001c57f78c75.\n" }, { "from": "human", "value": "/**\n * Configure Stylint\n *\n * @see https://stylelint.io/user-guide/configuration\n */\nmodule.exports = {\n extends: ['st...
javascript
chosen
[ { "from": "system", "value": "Fix custom directive test (typo)\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n var app = angular.module('pie', ['chart.js']);\n\n app.directive('mySpecialPie', function (ChatJsFactory) { return new ChatJsFactory('Pie'); });\n\n app.contro...
javascript
chosen
[ { "from": "system", "value": "Use run_plugin directly for tests.\n" }, { "from": "human", "value": "/**\n * Created by zsolt on 3/31/14.\n */\n\n'use strict';\nif (typeof window === 'undefined') {\n\n // server-side setup\n var requirejs = require(\"requirejs\");\n var testConfig = requ...
javascript
chosen
[ { "from": "system", "value": "Verify that the service starts the library\n" }, { "from": "human", "value": "import {\n moduleFor,\n test\n} from 'ember-qunit';\n\nmoduleFor('service:tour', {\n // Specify the other units that are required for this test.\n // needs: ['service:foo']\n});\n\n// ...
javascript
chosen
[ { "from": "system", "value": "chore(pack): Add check for electron-builder dependencies\n" }, { "from": "human", "value": "var colors = require('colors');\n\nif (process.platform === 'win32') {\n var fs = require('fs');\n var path = require('path');\n // https://github.com/atom/apm/blob/master...
javascript
chosen
[ { "from": "system", "value": "Fix typo in withStore export\n" }, { "from": "human", "value": "import createDispatcher from './createDispatcher'\nimport withActions from './withActions'\nimport withStore from './widthStore'\n\nexport {\n createDispatcher,\n withActions,\n withStore\n}\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Allow components and sections to be used in parallel\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { setComponentsNames, globalizeComponents, promoteInlineExamples, flattenChildren } from './utils/utils';\ni...
javascript
chosen
[ { "from": "system", "value": "Fix problem when loading module with javascript\n" }, { "from": "human", "value": "require('coffee-script');\n\nexports.validate = require('./validate');\nexports.matchers = require('./matchers');\n" }, { "from": "gpt", "value": "require('coffee-script/r...
javascript
chosen
[ { "from": "system", "value": "Use lib instead of src.\n" }, { "from": "human", "value": "import assign from 'object-assign';\nimport render from 'skatejs/src/api/render';\n\nfunction getState (elem) {\n return Object.keys(elem.constructor.properties || {}).reduce(function (prev, curr) {\n pr...
javascript
chosen
[ { "from": "system", "value": "Use correct port in test.\n" }, { "from": "human", "value": "var assert = require('assert')\nvar cluster = require('cluster')\nvar request = require('request')\nvar test = require('tape')\nvar slacker = require('../')\n\ntest('http connections', function(t) {\n t.p...
javascript
chosen
[ { "from": "system", "value": "Include fs module, add empty get route for games\n" }, { "from": "human", "value": "var express = require('express');\n\nvar app = express();\n\napp.get('/', function(req, res){\n res.send(\"Welcome to my app!\");\n})\n\napp.listen(3000, console.log(\"Server listen...
javascript
chosen
[ { "from": "system", "value": "Update file to render PokeGame\n" }, { "from": "human", "value": "import React from 'react';\nimport PokeMap from './components/PokeMap';\n\nlet pokemons = [\n { name: \"Bulbasaur\", position: {lat: 19.541980, lng: -96.927581} },\n { name: \"Yvisaur\", position: {...
javascript
chosen
[ { "from": "system", "value": "Fix bugs introduced by Code Climate changes\n" }, { "from": "human", "value": "// Root file loaded by RequireJS\n\nrequire.config({\n paths: {\n 'jquery': 'lib/jquery',\n 'handlebars': 'lib/handlebars'\n },\n});\n\nrequire([\n 'jQuery',\n '...
javascript
chosen
[ { "from": "system", "value": "Add getUserNameFromRequest helper method to server\n" }, { "from": "human", "value": "import { Promise } from 'es6-promise';\nimport distance from 'google-distance';\nimport dotenv from 'dotenv';\n\ndotenv.load();\n\ndistance.apiKey = process.env.GOOGLE_DISTANCE_API...
javascript
chosen
[ { "from": "system", "value": "Rollback on changes from commonsJS require to import." }, { "from": "human", "value": "import path from 'path';\nimport express from 'express';\nimport exphbs from 'express-handlebars';\nimport mongoose from 'mongoose';\nimport Bootstrap from 'bootstrap/dist/css/bo...
javascript
chosen
[ { "from": "system", "value": "Build command added to bash wrapper\n" }, { "from": "human", "value": "var kiwi_app = './kiwi.js';\r\n\r\n\r\nvar daemon = require('daemonize2').setup({\r\n main: kiwi_app,\r\n name: 'kiwiirc',\r\n pidfile: '../kiwiirc.pid'\r\n});\r\n\r\nswitch (process.arg...
javascript
chosen
[ { "from": "system", "value": "Use let instead of var\n" }, { "from": "human", "value": "import {Controller} from \"stimulus\"\n\nexport default class extends Controller {\n\n static targets = [\"mapInfo\"]\n\n connect() {\n const courseId = this.mapInfoTarget.dataset.courseId;\n ...
javascript
chosen