conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix typo in new docs\n" }, { "from": "human", "value": "var paddingMin = document.getElementById('slider-padding-value-min'),\n\tpaddingMax = document.getElementById('slider-padding-value-max');\n\npaddingSlider.noUiSlider.on('update', function ( values, handle ) {\...
javascript
chosen
[ { "from": "system", "value": "chore(fix-codeclimate-error): Fix violated ESLINT rule on codeclimate\n" }, { "from": "human", "value": "import axios from 'axios';\n\nconst API_URL = '/api/v1/users';\n/**\n * setAuthorizationToken - set token to request headers\n * @param {string} token Authoriza...
javascript
chosen
[ { "from": "system", "value": "Add lint rule to ESLint rule namespace\n" }, { "from": "human", "value": "'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@std...
javascript
chosen
[ { "from": "system", "value": "Clarify cases for updateBranchTitles action and ES6-ify\n" }, { "from": "human", "value": "export const UPDATE_BRANCH_TITLES = 'UPDATE_BRANCH_TITLES';\n\nexport function updateBranchTitles(payload) {\n return {\n type: UPDATE_BRANCH_TITLES,\n // FIX ME put th...
javascript
chosen
[ { "from": "system", "value": "Refactor SkiDaysCount as a stateless functional component.\n" }, { "from": "human", "value": "import { Component } from 'react'\nimport '../stylesheets/ui.scss'\n\nexport class SkiDayCount extends Component {\n\tpercentToDecimal(decimal) {\n\t\treturn ((decimal * 10...
javascript
chosen
[ { "from": "system", "value": "Add canDrop to not highlight not empty squares\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { DropTarget } from 'react-dnd';\n\nimport Square from '../components/square';\n\nconst dropTarge...
javascript
chosen
[ { "from": "system", "value": "Fix for collapsible-menu-active on menu header (wasn’t removing properly)\n" }, { "from": "human", "value": "/*\n * Collapsible widget extension: active menu item class\n * https://github.com/filamentgroup/collapsible\n * Copyright (c) 2016 Filament Group, Inc.\n * ...
javascript
chosen
[ { "from": "system", "value": "Fix a bug while getting contest update\n" }, { "from": "human", "value": "/**\n * Created by cpc on 3/28/16.\n */\n\nexport default {\n SET: 'contest-set',\n SET_PID: 'contest-set-pid',\n INIT: 'contest-init',\n UPDATE: 'contest-update',\n SET_LIST: 'contest-li...
javascript
chosen
[ { "from": "system", "value": "accountScreen: Drop \"onBack\" hack which prevented renders.\n\nMuch like the previous commit; see also the jsdoc on\n`connectPreserveOnBackOption` for details on what motivated this hack\nand how it's broken.\n\nUnlike the previous commit, we don't know of a specific user-visi...
javascript
chosen
[ { "from": "system", "value": "Add ... to the teasers\n" }, { "from": "human", "value": "Journal_entries = new Mongo.Collection('journal_entries')\n\nJournal_entries.attachSchema(new SimpleSchema({\n title: {\n type: 'string',\n max: 400\n },\n\n md_body: {\n type: String\n },\n\n h...
javascript
chosen
[ { "from": "system", "value": "Enable pointer events and gestures for native ShadowDOM\n" }, { "from": "human", "value": "(function(scope) {\n\nscope.WebkitShadowDOM = {\n ShadowRoot: function(inElement) {\n var root = inElement.webkitCreateShadowRoot();\n // TODO(sjmiles): .shadow, .host,...
javascript
chosen
[ { "from": "system", "value": "Make global-bind plugin safe in node envs, part 2\n\nFollow on from #465, which missed the ReferenceError from trying to use the Mousetrap global at the end of the file." }, { "from": "human", "value": "/**\n * adds a bindGlobal method to Mousetrap that allows you t...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary state init in reducer test\n" }, { "from": "human", "value": "import posts from '../reducers';\nimport {\n addPost,\n requestPosts,\n requestPostsError,\n receivePosts,\n} from '../actions';\n\nconst post = { title: 'A first post' };\n\nit('re...
javascript
chosen
[ { "from": "system", "value": "fix: Remove redis test for build platform travis\n" }, { "from": "human", "value": "const chai = require('chai');\nconst expect = chai.expect;\nconst sinon = require('sinon');\n\nconst proxyquire = require('proxyquire');\nconst confStub = {\n\tredis: {}\n};\n\ndescr...
javascript
chosen
[ { "from": "system", "value": "Add explicit exception required by the spec\n" }, { "from": "human", "value": "String.prototype.includes = function (string, index) {\n\treturn this.indexOf(string, index) !== -1;\n};\n" }, { "from": "gpt", "value": "String.prototype.includes = function ...
javascript
chosen
[ { "from": "system", "value": "Add font load dependency to Storybook\n" }, { "from": "human", "value": "import '../less/app.less';\r\n\r\nexport const parameters = {\r\n actions: { argTypesRegex: \"^on[A-Z].*\" },\r\n controls: {\r\n matchers: {\r\n color: /(background|color)$/i,\r\n ...
javascript
chosen
[ { "from": "system", "value": "Remove useless methods from controller\n" }, { "from": "human", "value": "/**\n * Home controller definition\n * @scope Controllers\n */\ndefine(['./module', 'jquery'], function (controllers, $) {\n 'use strict';\n\n controllers.controller('HomeController', ['$sco...
javascript
chosen
[ { "from": "system", "value": "Update to map select action to zoom.\n" }, { "from": "human", "value": "(function () {\n\nvar selection = {\n events : [\n 'select',\n 'click'\n ]\n};\n\nhumblevis.action = humblevis.action || {};\nhumblevis.action.selection = selection;\n\n})();\n" }, {...
javascript
chosen
[ { "from": "system", "value": "Use base parameter in URL.\n\nThis will help flatten out the nested try/catch.\n" }, { "from": "human", "value": "/**\n * Returns the file extension of the path component of a URL\n * @param {string} url\n * @returns {string} null if no extension found\n */\nexport ...
javascript
chosen
[ { "from": "system", "value": "Remove character in js click function\n" }, { "from": "human", "value": "//autocomplete for organism search\n $(\"#search_organism\").autocomplete({\n position: {\n my: \"right top\", at: \"right bottom\"\n },\n source: function (request, response) {\...
javascript
chosen
[ { "from": "system", "value": "Add disconnect event checker to game page\n" }, { "from": "human", "value": "class GameController {\n constructor() {\n 'ngInject';\n }\n}\n\nexport default GameController;\n" }, { "from": "gpt", "value": "class GameController {\n constructor($scop...
javascript
chosen
[ { "from": "system", "value": "Use Component instances in options\n" }, { "from": "human", "value": "import startCase from 'lodash/startCase'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport Panel from 'react-bootstrap/lib/Panel'\nimport Tab from 'react-bootstrap/lib/Tab'\ni...
javascript
chosen
[ { "from": "system", "value": "Fix username parameter to match the name in the resource\n" }, { "from": "human", "value": "define(function() {\n var ProjectCreationController = function($rootScope, $location, ProjectResource) {\n this.submit = function() {\n var newProject = ...
javascript
chosen
[ { "from": "system", "value": "Check for and 4xx status in registry\n\nIn case of a scope that does not exist or the current user have no access to, the response code will be 401 (unauthorized).\r\nThis check check against all 4xx codes and prevents a runtime error in trying to call `json` function on a non-...
javascript
chosen
[ { "from": "system", "value": "Correct typo; commandOptions are a local var\n" }, { "from": "human", "value": "module.exports = {\n name: 'deploy',\n description: 'Deploys an ember-cli app',\n works: 'insideProject',\n\n anonymousOptions: [\n '<deployTarget>'\n ],\n\n availableOptions: [...
javascript
chosen
[ { "from": "system", "value": "Add JSON Iterator Method to Utility\n" }, { "from": "human", "value": "module.exports = {\n generateQueryString: function (data) {\n var ret = []\n for (var d in data)\n if (data[d])\n ret.push(encodeURIComponent(d) + \"=\" + encodeURIComponent(da...
javascript
chosen
[ { "from": "system", "value": "Use slug as post url\n" }, { "from": "human", "value": "import React from 'react';\nimport moment from 'moment';\n\nimport { Link } from 'react-router';\n\n\nconst DATE_FORMAT = 'YYYY-MM-DD HH:mm';\n\nconst formatDate = (date) => moment(date).format(DATE_FORMAT);\n\...
javascript
chosen
[ { "from": "system", "value": "Validate resource schema are valid on startup\n" }, { "from": "human", "value": "'use strict'\nconst schemaValidator = module.exports = { }\n\nschemaValidator.validate = function (resources) {\n Object.keys(resources).forEach(resource => {\n Object.keys(resource...
javascript
chosen
[ { "from": "system", "value": "Fix line 40 to long issue." }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\nconst crypto = require('crypto');\n\nmodule.exports = function(options, fieldname, filename) {\n const dir = path.normalize(options.tempFileDir || ...
javascript
chosen
[ { "from": "system", "value": "Fix jitter on delay display.\n" }, { "from": "human", "value": "import EventEmitter from \"events\";\n\nimport App from \"../app.js\";\n\nclass SimpleStore extends EventEmitter {\n\n constructor(props) {\n super(props);\n this.props = props;\n this.dispatc...
javascript
chosen
[ { "from": "system", "value": "Check application environment for developing addon state\n" }, { "from": "human", "value": "'use strict';\n\nconst mergeTrees = require('broccoli-merge-trees');\nconst WatchedDir = require('broccoli-source').WatchedDir;\nconst json = require('broccoli-json-module');...
javascript
chosen
[ { "from": "system", "value": "Allow the on-request event listener to be parsed when creating the server\n" }, { "from": "human", "value": "'use strict';\n\nvar port = process.env.PORT = process.env.PORT || 5000;\n\nvar http = require('http');\nvar airserver = require('./lib/airserver');\n\nmodul...
javascript
chosen
[ { "from": "system", "value": "Return null if bkn API result is null\n" }, { "from": "human", "value": "var request = require(\"request\");\nvar cheerio = require(\"cheerio\");\n\nvar URL = \"http://www.bkn.go.id/profil-pns\";\n\nvar bknScrapper = function() {\n}\n\nbknScrapper.prototype.getData ...
javascript
chosen
[ { "from": "system", "value": "Fix typo in statsd stat\n" }, { "from": "human", "value": "// statsd/index.js\n// Setup some statsd stuff for qb\n\n// vendor\nvar StatsD = require('node-statsd').StatsD\n\nexports.enable = function (qb, statsdconf) {\n var statsd = new StatsD(statsdconf.host, stat...
javascript
chosen
[ { "from": "system", "value": "Add a simple healthcheck endpoint\n" }, { "from": "human", "value": "var yarn = require('@yarnpkg/lockfile')\nvar express = require('express')\nvar bodyParser = require('body-parser')\n\nvar app = express()\nvar port = process.env.PORT || 5000;\n\napp.disable('x-pow...
javascript
chosen
[ { "from": "system", "value": "[REFACTOR] Break out getSuccessResponseData function for clarity\n" }, { "from": "human", "value": "/*jslint node:true indent:2 */\n'use strict';\n\nmodule.exports = function (req, res, next) {\n\n function sendResponse(code, json) {\n return res.status(code).js...
javascript
chosen
[ { "from": "system", "value": "Remove iui.animOn = true (since it is now the default)\nAdd comment saying that your custom js code should go here (best practice)\n" }, { "from": "human", "value": "/*\n Copyright (c) 2007-9, iUI Project Members\n See LICENSE.txt for licensing terms\n */\niui.a...
javascript
chosen
[ { "from": "system", "value": "Fix data bindings within event callbacks on conversion\n" }, { "from": "human", "value": "'use strict';\n\n// Load requirements\nconst engine = require('../engine');\n\n// Configures and runs the conversion task\nmodule.exports = {\n\n run: function(job) {\n ret...
javascript
chosen
[ { "from": "system", "value": "Remove accelleration logic from vectorhelpers\n" }, { "from": "human", "value": "const GRAVITY = 0.00000010;\n\nconst massToRadius = mass => Math.log2(mass)/10;\n\nconst translate = (object3D, velocity) => {\n object3D.translateX(velocity.x);\n object3D.translateY...
javascript
chosen
[ { "from": "system", "value": "Return selected options for use with map function\n" }, { "from": "human", "value": "// each-resource-in.js\n/*\n Copyright (c) 2014 3 Round Stones Inc, Some Rights Reserved\n Licensed under the Apache License, Version 2.0, http://www.apache.org/licenses/LICENSE...
javascript
chosen
[ { "from": "system", "value": "Make the exported object smaller." }, { "from": "human", "value": "export const keyboardEventUtil = {\n\n PREVENT_DEFAULT_ACTION: 'preventDefault',\n\n _keyCodeToReadableKeyMap: {\n 16: 'Shift',\n 17: 'Control',\n 18: 'Alt',\n 91: 'Meta', // Seems not ...
javascript
chosen
[ { "from": "system", "value": "Localization: Fix sk translation of rangelength method\n\nCloses #1001\n" }, { "from": "human", "value": "/*\n * Translated default messages for the jQuery validation plugin.\n * Locale: SK (Slovak; slovenčina, slovenský jazyk)\n */\n$.extend($.validator.messages, {...
javascript
chosen
[ { "from": "system", "value": "Update name and JSDoc for raw email collab constant.\n" }, { "from": "human", "value": "/**\n * This file specifies the database collection and field names.\n */\nexport const COLLECTION_TRIPS = 'trips';\nexport const TRIPS_TITLE = 'title';\nexport const TRIPS_DESCR...
javascript
chosen
[ { "from": "system", "value": "Save public key in cookie\n" }, { "from": "human", "value": "/**\n * Copyright 2018 Rouslan Solomakhin\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a...
javascript
chosen
[ { "from": "system", "value": "Use Fetch API instead of XHR\n" }, { "from": "human", "value": "class Unsplash {\n static getImage (frequency) {\n return new Promise((resolve, reject) => {\n // Set proper frequency in URL + screen size\n var unsplashUrl = `https://source.unsplash.com...
javascript
chosen
[ { "from": "system", "value": "Change port number for ws on regtest to 8080\n" }, { "from": "human", "value": "var deposit_chaincode = \"b60befcc619bb1c212732770fe181f2f1aa824ab89f8aab49f2e13e3a56f0f04\";\nvar deposit_pubkey = \"036307e560072ed6ce0aa5465534fb5c258a2ccfbc257f369e8e7a181b16d897b3\"...
javascript
chosen
[ { "from": "system", "value": "Add if to ensure that el.child('img') is not null\n\nThis was throwing errors out of nowhere. Don't know where it came from but this solves the problem.\n" }, { "from": "human", "value": "Kwf.onElementReady('.kwcBasicImageEnlarge.showHoverIcon > a', function(el) {\n...
javascript
chosen
[ { "from": "system", "value": "Use a const and a ternary, rather than mutate" }, { "from": "human", "value": "const { merge } = require('webpack-merge')\n\nconst baseConfig = require('./base')\nconst devServer = require('../dev_server')\nconst { runningWebpackDevServer } = require('../env')\n\nco...
javascript
chosen
[ { "from": "system", "value": "Fix document load on windows\n" }, { "from": "human", "value": "require('!style!css!sass!./SelectFile.scss');\nvar React = require('react');\n\nvar SelectFile = React.createClass({\n contextTypes: {\n router: React.PropTypes.object.isRequired\n },\n\n getIniti...
javascript
chosen
[ { "from": "system", "value": "Set correct dependent property for formattedTopic\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Object.extend({\n\n name: '',\n userList: null,\n messages: null,\n connected: false,\n sockethubChannelId: null,\n topic: n...
javascript
chosen
[ { "from": "system", "value": "Fix 'Do not access attributes directly.' error on Activity\n" }, { "from": "human", "value": "var SharedModelMethods = require('mixins/shared_model_methods');\n\nvar Activity = module.exports = Backbone.Model.extend({\n name: 'activity',\n\n i18nScope: 'activereco...
javascript
chosen
[ { "from": "system", "value": "Add delete icon to downloaded list\n" }, { "from": "human", "value": "/**\n * View for viewing downloaded videos.\n */\nexport default class DownloadedList {\n /**\n * Default constructor for setting the values\n *\n * @param {HTMLElement} element - The HTML ...
javascript
chosen
[ { "from": "system", "value": "Make `injectBabelPlugin` compatible with older webpack versions\n\nSpecifically, this is needed for people using React StoryBook." }, { "from": "human", "value": "const path = require('path');\n\nconst babelLoaderMatcher = function(rule) {\n return rule.loader && r...
javascript
chosen
[ { "from": "system", "value": "Make it possible to excluded an entire form with the .no-focus class.\n" }, { "from": "human", "value": "var general = {\n init: function() {\n $('form input:visible:not(.no-focus):first').focus();\n }\n};\n\n$(function(){ general.init(); });\n" }, { "f...
javascript
chosen
[ { "from": "system", "value": "Use ECMAScript strict mode, fix jslint errors.\n" }, { "from": "human", "value": "(function($)\n{\n var REFRESH_SERVICES_TIMEOUT = 5000;\n\n $.ajaxSetup({\n error: function(e, req, options, error)\n {\n $('#url').text(settings.url);\n ...
javascript
chosen
[ { "from": "system", "value": "Fix invalid properties for default value of argument\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst ArgumentParser = require('argparse').ArgumentParser\nconst opn = require('opn')\nconst packageJson = require('../package.json')\n\nconst { createServ...
javascript
chosen
[ { "from": "system", "value": "Bring back tests with styles\n" }, { "from": "human", "value": "module.exports = {\n plugins: {\n 'postcss-import': {},\n 'postcss-preset-env': {\n stage: 0,\n preserve: false\n }\n }\n}\n" }, { "from": "gpt", "value": "module.export...
javascript
chosen
[ { "from": "system", "value": "Create constructor for binary search tree\n" }, { "from": "human", "value": "// Program that creates a binary search tree: each node has up to two children, and all left descendants of a node is less than or equal to the node and all right descendants are greater th...
javascript
chosen
[ { "from": "system", "value": "Add worflow validation to prevent user replacement assumptions\n" }, { "from": "human", "value": "(function( $ ) {\n $.fn.searchify = function() {\n return this.each(function() {\n $(this).autocomplete({\n source: $(this).data(\"s...
javascript
chosen
[ { "from": "system", "value": "Use fat arrow syntax for callbacks.\n" }, { "from": "human", "value": "{\n angular.module('marvelousnote.notesForm')\n .controller('NotesFormController', NotesFormController);\n\n NotesFormController.$inject = ['$state', 'Flash', 'NotesService'];\n function N...
javascript
chosen
[ { "from": "system", "value": "Add findTypeName, findTypeId, and capitalize functions\n" }, { "from": "human", "value": "import 'whatwg-fetch';\n\nvar helpers = {\n checkStatus,\n displayPrice,\n parseJSON,\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json...
javascript
chosen
[ { "from": "system", "value": "Convert punctuation to pure ASCII\n\nCurly quotes, en-dashes etc. can be produced by pandoc's --smart\noption.\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n document.addEventListener('DOMContentLoaded', function () {\n var instru...
javascript
chosen
[ { "from": "system", "value": "Add skip for testing status.\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar request = require('request');\n\nrouter.post('/', function(req, res) {\n if (req.query.secret !== process.env.SECRET) {\n res.s...
javascript
chosen
[ { "from": "system", "value": "Fix uncaught error when the click is on the HTML element" }, { "from": "human", "value": "// This code is injected into every page\n(function () {\n 'use strict';\n /*jslint browser: true */\n /*global chrome, console */\n\n var parents;\n\n\n // Get ...
javascript
chosen
[ { "from": "system", "value": "Add catch to promise bluetooth info example\n\nSigned-off-by: deadprogram <b937b287f61b7a223d4aac55072db1a5381d3bb3@hybridgroup.com>\n" }, { "from": "human", "value": "\"use strict\";\n\nvar sphero = require(\"../\");\nvar orb = sphero(process.env.PORT);\n\norb.conn...
javascript
chosen
[ { "from": "system", "value": "Add key to each message to get rid of annoying error message\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport firebase, { reference, signIn } from '../firebase';\nimport Message from './Message';\n\nconst MessageContainer = ({messa...
javascript
chosen
[ { "from": "system", "value": "Check in @ Fri Apr 29 10:34:20 IST 2016\n" }, { "from": "human", "value": "var ServiceModel = require('../core/service-model');\nmodule.exports = ServiceModel.create(\"Story\", {\n\n url: '/story',\n\n userSpace: {\n field: \"_user\"\n },\n timestamps: true,\...
javascript
chosen
[ { "from": "system", "value": "Fix a ESM bug in build script\n" }, { "from": "human", "value": "/*\n * Copyright 2021 Simon Edwards <simon@simonzone.com>\n *\n * This source code is licensed under the MIT license which is detailed in the LICENSE.txt file.\n */\nimport * as https from 'node:https'...
javascript
chosen
[ { "from": "system", "value": "Improve performance of remove prefixedclasses\n" }, { "from": "human", "value": "\ndefine(['jquery'], function() {\n 'use strict';\n\n $.fn.removePrefixedClasses = function(prefix) {\n\n return this.each(function() {\n var el = $(this),\n ...
javascript
chosen
[ { "from": "system", "value": "Exclude coffeescript from being loaded\n\n`require_tree` requires everything recursively under the given path,\nand we want to ignore `refills/coffeescript` entirely.\nSo we pair `require_directory` which does not share that behaviour, with\nrequiring the files we need form the...
javascript
chosen
[ { "from": "system", "value": "Test overriding a core plugin's config\n" }, { "from": "human", "value": "import configurePlugins from '../src/util/configurePlugins'\n\ntest('setting a plugin to false removes it', () => {\n const plugins = {\n fontSize: (options) => {\n return {\n ...
javascript
chosen
[ { "from": "system", "value": "FullscreenButton: Use `querySelector()` instead of jQuery\n" }, { "from": "human", "value": "/* global BigScreen */\n\nimport Component from '@ember/component';\nimport { action } from '@ember/object';\n\nimport $ from 'jquery';\n\nexport default Component.extend({\...
javascript
chosen
[ { "from": "system", "value": "Add deprecation warning if importing deprecated class names\n\nChange-Id: I2c6bc8c2302ed460d688a7414b96916601d22669\n" }, { "from": "human", "value": "/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the...
javascript
chosen
[ { "from": "system", "value": "Modify entrance url to prod.\n" }, { "from": "human", "value": "/**\n * Created by xubt on 22/11/2016.\n */\nkanbanApp.remote_entrance = \"http://127.0.0.1:8096/kanban/entrance\";" }, { "from": "gpt", "value": "/**\n * Created by xubt on 22/11/2016.\n */...
javascript
chosen
[ { "from": "system", "value": "Fix typos in Swedish weekdays translation\n" }, { "from": "human", "value": "// Swedish\n\n$.extend( $.fn.pickadate.defaults, {\n monthsFull: [ 'januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december...
javascript
chosen
[ { "from": "system", "value": "Revert \"We don't support some recurrences by now\"\n\n@nogates I expected to comment these options to don't show them to\nusers, but it seems it is not so easy. The recurrence value sent is null\n\nThis reverts commit 79221651db6dbfa31c4be70bfe71491b37cc00e0.\n" }, { "...
javascript
chosen
[ { "from": "system", "value": "Add region switcher to the global header\n" }, { "from": "human", "value": "import Component from '@ember/component';\n\nexport default Component.extend({\n onHamburgerClick() {},\n});\n" }, { "from": "gpt", "value": "import Component from '@ember/compo...
javascript
chosen
[ { "from": "system", "value": "Drop Android 2.3 from autoprefixer option\n" }, { "from": "human", "value": "// Parse CSS and add vendor prefixes\n//\n// grunt-postcss: <https://github.com/nDmitry/grunt-postcss>\n// Autoprefixer: <https://github.com/postcss/autoprefixer>\n\n'use strict';\n\nvar au...
javascript
chosen
[ { "from": "system", "value": "Check window.Vue.use for vue 2" }, { "from": "human", "value": "import semver from 'semver';\n\n(function () {\n/**\n * Install plugin\n * @param app\n * @param axios\n */\n\nfunction plugin(app, axios) {\n if (plugin.installed) {\n return;\n }\n\n if (!axios)...
javascript
chosen
[ { "from": "system", "value": "Remove outdated test to cleanup coverage report\n\n- uglify-js not used anymore\n" }, { "from": "human", "value": "/*global describe, it*/\n\n\n'use strict';\n\n\nvar fs = require('fs');\nvar path = require('path');\nvar assert = require('assert');\n\nvar p...
javascript
chosen
[ { "from": "system", "value": "Add headers to minified version.\n" }, { "from": "human", "value": "(function(){if(!this.Form){this.Form={}}var a=(\"placeholder\" in document.createElement(\"input\"));if(!(\"supportsPlaceholder\" in this)&&this.supportsPlaceholder!==false&&a){return}this.Form.Plac...
javascript
chosen
[ { "from": "system", "value": "Update extension with debug alert.\n" }, { "from": "human", "value": "(($) => {\n 'use strict';\n\n window.addEventListener('load', WindowLoad, false);\n\n function WindowLoad(event) {\n setTimeout(() => {\n $('<button/>')\n .text('++')\n .a...
javascript
chosen
[ { "from": "system", "value": "Add example to doc comment\n" }, { "from": "human", "value": "var React = require('react');\n\n/**\n * A mixin for components that need to know the routes, URL\n * params and query that are currently active.\n */\nvar ActiveState = {\n\n contextTypes: {\n active...
javascript
chosen
[ { "from": "system", "value": "Set decodeEntities to false for cheerio.\n" }, { "from": "human", "value": "'use strict';\n\nvar cheerio = require('cheerio');\n\nmodule.exports = function (html, options) {\n var results = {};\n var $ = cheerio.load(html);\n\n results.hrefs = [];\n\n $(...
javascript
chosen
[ { "from": "system", "value": "Increment by one. Show how to use disabled attribute with boolean var.\n" }, { "from": "human", "value": "import { app, html } from \"flea\"\n\nconst model = 0\n\nconst view = (model, dispatch) => html`\n <div>\n <h1>${model}</h1>\n <button onclick=...
javascript
chosen
[ { "from": "system", "value": "Return null if path is not specified\n" }, { "from": "human", "value": "var jstrans = function (path) {\n if (selector = document.querySelector('input[name=\\\"jstrans-value-for-' + path + '\\\"]')) {\n return selector.value;\n } else {\n var jso...
javascript
chosen
[ { "from": "system", "value": "Change name to be more noob friendly" }, { "from": "human", "value": "import pageLoader from './pageLoader';\n\n// All your dataloaders\nconst rootLoaders = {\n ...pageLoader\n}\n\nexport default function loaders () {\n return rootLoaders\n}\n" }, { "from"...
javascript
chosen
[ { "from": "system", "value": "Make jQuery available outside webapp sandbox.\n" }, { "from": "human", "value": "\n// Index page module.\nmodule.exports = function(utils, $, _) {\n console.log('index page module loaded');\n}\n" }, { "from": "gpt", "value": "\n// Index page module.\n...
javascript
chosen
[ { "from": "system", "value": "Use the constructor through the parent-constructor instead of listing it directly.\n" }, { "from": "human", "value": "{{#JSTSynonym}}\nfunction {{jstDetail.jstConstructor}} (v) {\n this.value = v;\n this.pack = function (u8buf, offset) {\n return this.value.pac...
javascript
chosen
[ { "from": "system", "value": "Allow extra context after location markers\n" }, { "from": "human", "value": ";(function()\n{\n\t// CommonJS\n\ttypeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;\n\n\tfunction Brush()\n\t{\n\t\tthis.regexList = [\n\t\t\...
javascript
chosen
[ { "from": "system", "value": "Remove extraneous check on translation key\n" }, { "from": "human", "value": "var I18n = function () {\n this.locale = jQuery.cookie('locale') || 'en';\n this.template = {\n error: \"Error\",\n voting: \"Voting\",\n vote_saved: \"Voting saved\",\n 'vot...
javascript
chosen
[ { "from": "system", "value": "Add default port for HAProxy\n" }, { "from": "human", "value": "var fork = require('child_process').fork;\nvar async = require('async');\nvar amountConcurrentUsers = process.argv[2] || 200;\nvar host = process.argv[3] || 'http://localhost';\nvar initialPort = proces...
javascript
chosen
[ { "from": "system", "value": "Format arrivalDate when creating reservation in db\n" }, { "from": "human", "value": "var db = require('./db.js');\nvar moment = require('moment');\nvar _ = require('lodash');\n\nvar get = function() {\n return db.get('reservations').value();\n};\n\nvar make = func...
javascript
chosen
[ { "from": "system", "value": "Fix Error on Version loader\n\nCloses-Bug: 1613719\nChange-Id: If68fb2a1d1229d0920dcff540bea63f63652aa36\n" }, { "from": "human", "value": "var fs = require('fs');\n\nfunction getVersion() {\n var packageContents = fs.readFileSync('./package.json', 'utf8');\n var ...
javascript
chosen
[ { "from": "system", "value": "Change users migration code to empty string\n" }, { "from": "human", "value": "'use strict';\n\nexports.up = function(knex) {\n return knex.schema.createTable('users', (table) => {\n table.increments();\n table.string('first_name')\n .notNullable()\n .d...
javascript
chosen
[ { "from": "system", "value": "Disable default Map UI + remove non-working coloring\n" }, { "from": "human", "value": "/* global google document */\nimport React from 'react';\nimport './scss/map.scss';\n\nclass VisitedMap extends React.Component {\n componentDidMount() {\n this.createMap();\...
javascript
chosen
[ { "from": "system", "value": "Patch from bus part 2" }, { "from": "human", "value": "// @flow\nimport type { ChooView } from \"./app\";\nimport type { ChooMiddleware } from \"./app\";\n\nconst app = require(\"choo\")();\nconst html = require(\"choo/html\");\nconst eventNames = require(\"./eventN...
javascript
chosen
[ { "from": "system", "value": "Use on, off instead of bind, unbind\n" }, { "from": "human", "value": "/**\n * Event\n *\n * @author Rakume Hayashi<i@fake.moe>\n */\n\nFaiash.ise.extend({\n bind: function() {\n var args = $.toArr(arguments);\n\n if (typeof args[0] === 'string') {\...
javascript
chosen
[ { "from": "system", "value": "Use border-box style for all elements\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\nimport { createGlobalStyle } from 'styled-components'\n\nimport { App } from './App'\nimport woff2 from './fonts/source-sans-pro-v11...
javascript
chosen
[ { "from": "system", "value": "Use of const and reduced duplication\n\nChanged code to use const instead of let, as these variables should be read-only references to these values.\r\nI've also removed the only duplicated variable definition; I've named it targetIndex as I couldn't think of anything better (n...
javascript
chosen