conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Return just a boolean from find\n" }, { "from": "human", "value": "/**\n * @fileoverview Enforce emojis are wrapped in <span> and provide screenreader access.\n * @author Ethan Cohen\n */\n\n// ------------------------------------------------------------------------...
javascript
chosen
[ { "from": "system", "value": "Make defining properties more robust for opera 12 or any browser that thinks things are non-configurable.\n" }, { "from": "human", "value": "export default function (obj, props) {\n Object.keys(props).forEach(function (name) {\n const desc = Object.getOwnPropert...
javascript
chosen
[ { "from": "system", "value": "Change command result receive part\n" }, { "from": "human", "value": "var express = require('express'),\n\trouter = express.Router(),\n\tnet = require('net'),\n\tfs = require('fs'),\n\tsocketPath = '/tmp/haproxy';\n\n\n/* GET home page. */\nrouter.post('/', function...
javascript
chosen
[ { "from": "system", "value": "Save game_id when joining game\n" }, { "from": "human", "value": "class MainController {\n constructor(_, $scope, $state, $log, SocketService) {\n 'ngInject';\n\n this._ = _;\n this.$log = $log;\n this.$state = $state;\n this.$scope = $scope;\n th...
javascript
chosen
[ { "from": "system", "value": "Refactor bubble legend compatibility rules with styles for clarity\n" }, { "from": "human", "value": "var _ = require('underscore');\nvar LegendTypes = require('builder/editor/layers/layer-content-views/legend/legend-types');\n\nmodule.exports = [\n {\n value: L...
javascript
chosen
[ { "from": "system", "value": "Use resolver to resolve the table name\n" }, { "from": "human", "value": "function select(database, options, callback) {\n var results = [];\n database.command('select', options, function(error, data) {\n if (error) {\n callback(error);\n } else {\n ...
javascript
chosen
[ { "from": "system", "value": "Check for weird function results\n" }, { "from": "human", "value": "\nvar math = require('mathjs');\n\nvar ERROR_RESPONSE = 'I can\\'t calculate that!';\n\nmodule.exports = function(argv, response) {\n var respBody;\n\n try {\n var expression = argv.slice(1).jo...
javascript
chosen
[ { "from": "system", "value": "Remove h5, h6 from tocify configuration parameters\n" }, { "from": "human", "value": "/**\n * User: powerumc\n * Date: 2014. 5. 18.\n */\n\n\n$(function() {\n\t$(function () {\n\t\t$.ajax({\n\t\t\turl: \"Requirements.md\",\n\t\t\ttype: \"GET\",\n\t\t\tsuccess: funct...
javascript
chosen
[ { "from": "system", "value": "Send the data in the functions\n" }, { "from": "human", "value": "\"use strict\";\n\n// Dependencies\nconst readJson = require(\"r-json\")\n , writeJson = require(\"w-json\")\n , mapO = require(\"map-o\")\n , ul = require(\"ul\")\n , findValue = require(...
javascript
chosen
[ { "from": "system", "value": "Use Model.settings.acls to get the acls\n\nUse `Model.settings.acls` to get the acls instead of `Model.definition.settings.acl`. `Model.definition` is an artifact created by datasource-juggler, but it wouldn't exists if you just use `loopback.createModel()`." }, { "from...
javascript
chosen
[ { "from": "system", "value": "Check to see if there is actually metadata to add.\n" }, { "from": "human", "value": "$(document).ready(function(){\n /**\n * Serialize metadata to json for submission\n */\n $(\"#edit-form\").submit(function(){\n var metadata = {};\n $(\...
javascript
chosen
[ { "from": "system", "value": "Read build step fields from array, Update comments\n" }, { "from": "human", "value": "import * as React from 'react';\n\nconst HEADERS = ['no', 'text', 'log'];\n\n/**\n * Table responsible for storing the data for a builder.\n *\n * @param {Object[]} props.buildStep...
javascript
chosen
[ { "from": "system", "value": "Fix injection in show dialog button directive\n" }, { "from": "human", "value": "function dialogClose() {\n return {\n restrict: 'EA',\n require: '^dialog',\n scope: {\n returnValue: '=?return'\n },\n link(scope, elem...
javascript
chosen
[ { "from": "system", "value": "Add support for notifications on gallery.gallerypicture\n" }, { "from": "human", "value": "// @flow\nimport React from 'react';\nimport { Link } from 'react-router';\nimport type { AggregatedActivity } from './types';\n\nexport function lookupContext(\n aggregatedA...
javascript
chosen
[ { "from": "system", "value": "Join channel and register on reconnect\n" }, { "from": "human", "value": "var chat = angular.module('chat', ['btford.socket-io']);\n\nvar channel = new Channel('hellas');\nvar me = null;\n\nchat.factory('chatServer', function (socketFactory) {\n var url = '/';\n\...
javascript
chosen
[ { "from": "system", "value": "Fix news & announcements to be reverse sorted.\n" }, { "from": "human", "value": "'use strict';\n// =========================================================================\n//\n// Controller for orgs\n//\n// ========================================================...
javascript
chosen
[ { "from": "system", "value": "Use more sensible class name\n" }, { "from": "human", "value": "import React from \"react\"\nimport Link from \"gatsby-link\"\nimport Helmet from \"react-helmet\"\n\nexport default class Index extends React.Component {\n render() {\n return (\n <div>\n ...
javascript
chosen
[ { "from": "system", "value": "Send temperature, humidity to server\n" }, { "from": "human", "value": "var mqtt = require('mqtt');\nvar SensorTag = require('sensortag');\n\nvar client = mqtt.connect('mqtt://tree:tree@m11.cloudmqtt.com:19539');\n\nclient.on('connect', function () {\n\tclient.publi...
javascript
chosen
[ { "from": "system", "value": "Test passing tag to <Posts>\n" }, { "from": "human", "value": "import { expect } from 'chai';\nimport { shallow } from 'enzyme';\nimport React from 'react';\nimport Posts from '../../src/js/components/Posts';\nimport PostPreview from '../../src/js/components/PostPre...
javascript
chosen
[ { "from": "system", "value": "Change the browse page layout temporarily\n" }, { "from": "human", "value": "import React from 'react';\nimport { connect } from 'react-redux';\nimport { fetchRecipes, setSearchTerm } from '../actions/';\nimport Header from '../components/Header';\nimport SearchHead...
javascript
chosen
[ { "from": "system", "value": "Include oauth2 and couchdb auth in `integreat.auths()`\n" }, { "from": "human", "value": "const gatherResources = require('../utils/gatherResources')\n\nconst auth = [\n 'options',\n 'token'\n]\n\nmodule.exports = gatherResources(auth, __dirname)\n" }, { "...
javascript
chosen
[ { "from": "system", "value": "Correct which to not through...\n\n...this was the whole point of it.\n" }, { "from": "human", "value": "var spawn = require('child_process').spawn;\nvar which = require('which');\n\nmodule.exports.transformer = childProcTransformer;\nmodule.exports.transform = chil...
javascript
chosen
[ { "from": "system", "value": "Set middleware function to be definable\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(gulp, $, config, _) {\n\tvar proxyTarget = _.get(config, 'proxy.url', config.consts.proxy.url);\n\tvar proxyPrefixes = _.get(config, 'proxy.prefixes...
javascript
chosen
[ { "from": "system", "value": "Add meta-comments + backbone of authenticate method\n" }, { "from": "human", "value": "const express = require('express')\nconst ERRORS = require('../../errors')\nconst User = require('../../models/User')\nconst utils = require('../../utils')\nconst router = express...
javascript
chosen
[ { "from": "system", "value": "Return FALSE if non-hex char detected\n\nReturn FALSE if non-hex char detected - same behaviour as PHP version of hex2bin()." }, { "from": "human", "value": "function hex2bin(s) {\n // discuss at: http://phpjs.org/functions/hex2bin/\n // original by: Dumitru Uzun...
javascript
chosen
[ { "from": "system", "value": "Update action fetchUserInfo ajax type to get\n" }, { "from": "human", "value": "import types from '../constants/ActionTypes'\nimport utils from '../../shared/utils'\n\nfunction replaceUserInfo(userInfo) {\n return {\n type: types.REPLACE_USER_INFO,\n ...
javascript
chosen
[ { "from": "system", "value": "Make addEventListener return this for function chaining.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @constructor\n */\nfunction EventEmitter() {\n this.eventHandlers = {};\n}\n\nEventEmitter.prototype.emit = function(event) {\n if (!this.eventHand...
javascript
chosen
[ { "from": "system", "value": "Change unit object format (server side)\n" }, { "from": "human", "value": "var units = {\n datacenter: {\n unitName: 'adminsys',\n unitStats: {\n attack: 10,\n security: 50,\n power: 5\n }\n },\n persona...
javascript
chosen
[ { "from": "system", "value": "Add \"is it\" as option to ask for temperature\n" }, { "from": "human", "value": "module.exports = {\n 'responses': {\n 'GREET': 'Hello! How are you doing today :\\)',\n 'HELP': 'I can help you with a bunch of things around your house.\\n\\n'\n + 'You ca...
javascript
chosen
[ { "from": "system", "value": "Create checkWinner Function that alerts when a player has reached the finish line\n" }, { "from": "human", "value": "function Game(){\n this.$track = $('#racetrack');\n this.finishLine = this.$track.width() - 54;\n}\n\nfunction Player(id){\n this.player = $('.pla...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix a presence check of Symbol function" }, { "from": "human", "value": "import padStart from './polyfill/padStart';\n\nconst THREE_MINUTES = 3 * 60 * 1000;\nconst privateDateProperty = typeof Symbol !== 'function' ?\n Symbol('privateDateProperty') : '_privat...
javascript
chosen
[ { "from": "system", "value": "Create merge conflict in master branch\n" }, { "from": "human", "value": "// ./src/hello-world.js\n\nvar console = require('gulp-messenger');\n\nconsole.success('Hello World!');" }, { "from": "gpt", "value": "// ./src/hello-world.js\n\nvar console = requ...
javascript
chosen
[ { "from": "system", "value": "Load Topics in background when stats page opens\n" }, { "from": "human", "value": "$( \".users-show, .users-sample\" ).ready( function() {\n $( \"#stats-area\" ).tabs({\n // Ajax request stuff, mostly pulled from jQuery UI's docs.\n beforeLoad: function( even...
javascript
chosen
[ { "from": "system", "value": "Rename helper methods for clarity\n" }, { "from": "human", "value": "function filter(arr) {\n var filteredArray = [], prev;\n arr.sort();\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] !== prev) {\n filteredArray.push(arr[i]);\n }\n prev = ar...
javascript
chosen
[ { "from": "system", "value": "Add interpolation support to the Line series component\n" }, { "from": "human", "value": "(function(d3, fc) {\n 'use strict';\n\n fc.series.line = function() {\n\n // convenience functions that return the x & y screen coords for a given point\n v...
javascript
chosen
[ { "from": "system", "value": "Make freshdesk widget run on customized domain support portals.\n" }, { "from": "human", "value": "if (ioradWebWidget.util.common.isFreshdeskKnowledgebase()) {\n ioradWebWidget.freshdesk.runApp(jQuery, window);\n}\n\nif (ioradWebWidget.util.common.isDeskKnowledgeb...
javascript
chosen
[ { "from": "system", "value": "Remove mapPkg from settings collections.\n\n" }, { "from": "human", "value": "import { isDev, getDevelopmentPackages } from 'worona-deps';\nimport { map } from 'lodash';\nimport { combineReducers } from 'redux';\nimport * as deps from '../deps';\n\nconst env = isDev...
javascript
chosen
[ { "from": "system", "value": "Rename mushroom to ship / player\n" }, { "from": "human", "value": "/* globals __DEV__ */\nimport Phaser from 'phaser'\nimport Mushroom from '../sprites/Ship'\n\nexport default class extends Phaser.State {\n init () {}\n preload () {}\n\n create () {\n game.ph...
javascript
chosen
[ { "from": "system", "value": "Change jwt storage from session to local\n" }, { "from": "human", "value": "import fetch from 'isomorphic-fetch'\n\nexport function signUpUser(register, history) {\n return(dispatch) => {\n\n const options = {\n method: 'POST',\n headers: { 'Content-Ty...
javascript
chosen
[ { "from": "system", "value": "Print the returned error message.\n" }, { "from": "human", "value": "const eg = require('../../eg');\nmodule.exports = class extends eg.Generator {\n constructor (args, opts) {\n super(args, opts);\n\n this.configureCommand({\n command: 'create [options]...
javascript
chosen
[ { "from": "system", "value": "Replace pseudo-code sketch with accurate comment\n" }, { "from": "human", "value": "// A bit of pseudo-code\n//\n// tickModel\n// var dt\n// for each canvas\n// canvasParticles = canvasParticles.filterOut(particlesOutsideOrTimeout)\n//\n// for each particle ...
javascript
chosen
[ { "from": "system", "value": "Use null instead of false to override the string-no-newline setting from the modularis stylelint config.\n" }, { "from": "human", "value": "const declarationBlockPropertiesOrder = require(`./.csscomb.json`)[`sort-order`][0];\n\nmodule.exports = {\n extends: `stylel...
javascript
chosen
[ { "from": "system", "value": "Clean up result math and notation\n" }, { "from": "human", "value": "import DicewareOptions from './DicewareOptions'\nimport React, { PureComponent } from 'react'\n\nexport default class App extends PureComponent {\n state = {\n length: 6\n }\n\n handleLengthC...
javascript
chosen
[ { "from": "system", "value": "Add 'password' to comment on required credentials\n" }, { "from": "human", "value": "'use strict';\n\n// Bitazza uses Alphapoint, also used by ndax\n// In order to use private endpoints, the following are required:\n// - 'apiKey'\n// - 'secret',\n// - 'uid' (userId ...
javascript
chosen
[ { "from": "system", "value": "Refactor TODO to be below the jumbotron\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\n\nclass App extends React.Component { // eslint-disable-line no-unused-vars\n render () {\n return (\n <div className=\"c...
javascript
chosen
[ { "from": "system", "value": "chore(test): Use common ts compiler options in karma test and webpack build\n" }, { "from": "human", "value": "module.exports = function (config) {\n config.set({\n basePath: '',\n frameworks: ['mocha', 'sinon-chrome', 'karma-typescript'],\n files: [\n ...
javascript
chosen
[ { "from": "system", "value": "Test compiled JS, not ES6 source\n" }, { "from": "human", "value": "import expect from 'expect.js';\n\nimport constantMirror from '../src';\n\ndescribe('constantMirror', () => {\n it('exports a function', () => {\n expect(constantMirror).to.be.a('function');\n ...
javascript
chosen
[ { "from": "system", "value": "Add comment our `toCode` function\n" }, { "from": "human", "value": "/* eslint-disable no-use-before-define */\n\nfunction toCodeArray(array) {\n return `[${array.map(item => toCode(item)).join(\",\")}]`\n}\n\nfunction toCodeObject(object) {\n return `{${Object.ke...
javascript
chosen
[ { "from": "system", "value": "Add class to all inputs\n" }, { "from": "human", "value": "$(document).ready(function() {\n\n // Add class to all inputs (input's type attribute value)\n $('input').each(function() {$(this).addClass(this.type)});\n \n // put all your jQuery code here\n});" }, ...
javascript
chosen
[ { "from": "system", "value": "Move functions outside of plugin block\n" }, { "from": "human", "value": "(function($) {\n\n $.fn.majesty = function() {\n\n var findDependents = function(rootElement) {\n return rootElement.find('[data-depends-on]');\n };\n\n var findMatches = functi...
javascript
chosen
[ { "from": "system", "value": "Set presenceExpiration outside of package\n" }, { "from": "human", "value": "var connections = {};\n\nvar expire = function(id) {\n Presences.remove(id);\n delete connections[id];\n};\n\nvar tick = function(id) {\n connections[id].lastSeen = Date.now();\n};\n\nMe...
javascript
chosen
[ { "from": "system", "value": "Make sure we are checking that apply exists\n" }, { "from": "human", "value": "(function() {\n /* globals define */\n 'use strict';\n\n function l(config) {\n var i = function() {\n i.c(arguments);\n };\n i.q = [];\n i.c = function(args) {\n ...
javascript
chosen
[ { "from": "system", "value": "Include license in transformed file\n\nInfer the year from the source file's code comments.\n" }, { "from": "human", "value": "'use strict';\n\nfunction makeFrontMatter(ast, dependencies) {\n\tvar value = [\n\t\t'es6id: ',\n\t\t'description: >'\n\t];\n\tvar includes...
javascript
chosen
[ { "from": "system", "value": "Set setEnv defaults to undefined\n" }, { "from": "human", "value": "const {webpack} = require('@webpack-blocks/webpack2');\n\n\n/**\n * Sets environment variables with all possible ways.\n */\nmodule.exports = (options = {}) => {\n const {\n nodeEnv = 'dev...
javascript
chosen
[ { "from": "system", "value": "Create onLoginPressed function and add to render function\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nimport {\n StyleSheet,\n Text,\n View,\n TextInput,\n TouchableHighlight,\n} from 'react-native';\n\nclass Login extends Co...
javascript
chosen
[ { "from": "system", "value": "Allow Cross Origin requests on create message endpoint\n" }, { "from": "human", "value": "var HttpError = require('../../lib/http-error');\nvar messageRepo = require('../../repository/message-repo');\n\nmodule.exports.create = function (req, res, next) {\n var me...
javascript
chosen
[ { "from": "system", "value": "Add redis and mongo URL in config\n" }, { "from": "human", "value": "/**\n * @file Defines the provider settings.\n *\n * Will set the path to Mongo, and applications id\n * Most of the configuration can be done using system environment variables.\n */\n\n// Load en...
javascript
chosen
[ { "from": "system", "value": "Update example to include static property\n" }, { "from": "human", "value": "class ClassWithStaticMethod {\n static staticMethod() {\n return 'static method has been called.';\n }\n}\n\nconsole.log(ClassWithStaticMethod.staticMethod());\n// expected output: \"s...
javascript
chosen
[ { "from": "system", "value": "Change GET_SOURCES action to default to selected:false\n" }, { "from": "human", "value": "import initialState from './initialState'\n\nexport default function sourcesReducer(state = initialState.sources, action) {\n switch (action.type) {\n case 'GET_SOURCES':\n...
javascript
chosen
[ { "from": "system", "value": "Add a <title>. We should make it dynamic eventually so history works.\n" }, { "from": "human", "value": "\n// Blank the document so the 404 page doesn't show up visibly.\ndocument.documentElement.style.display = 'none';\n\n// Can't use DOMContentLoaded, calling docu...
javascript
chosen
[ { "from": "system", "value": "Remove duplicate route for /\n" }, { "from": "human", "value": "var pg = require('pg');\nvar Hapi = require('hapi');\n\nvar server = new Hapi.Server();\n\n\nserver.connection({ port: 3000 });\n\nserver.start(function () {\n console.log('Server running at:', ser...
javascript
chosen
[ { "from": "system", "value": "Allow install of multiple programs\n\nFixes #26\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\nvar chalk = require('chalk');\nvar meow = require('meow');\nvar process = require('process');\n\nvar allPrograms = [\n 'atom',\n 'bash',\n 'bi...
javascript
chosen
[ { "from": "system", "value": "Fix issue where demo text does not autosize textarea.\n\nCloses #8\n" }, { "from": "human", "value": "const script = String.raw`<script type=\"text/javascript\">\n var emojis = \"tada, fire, grinning\"\n var selector = \"body\"\n var url = window.location.href.re...
javascript
chosen
[ { "from": "system", "value": "Check that scenarios works with xhr\n" }, { "from": "human", "value": "import test from 'tape';\nimport { Database, Router, Server } from '../../src';\n\n//\n// TODO: Check the same with XHR\n//\n\n\nexport const serverSpec = () => {\n // @TODO Test Server's config...
javascript
chosen
[ { "from": "system", "value": "Use resolveRegistration rather than container.lookupFactory to lookup the environment.\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst { run } = Ember;\n\nexport function initialize(app) {\n let config = app.container.lookupFactory('config:en...
javascript
chosen
[ { "from": "system", "value": "Add data to bar chart\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport rd3 from 'rd3';\nconst BarChart = rd3.BarChart;\n\nconst barData = [\n {\n name: 'Series A',\n values: [\n { x: 1, y: 91 },\n { x: 2, y: 290 }...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect use of `_.defaults`\n" }, { "from": "human", "value": "var async = require('async');\nvar _ = require('lodash');\n\nvar readTOML = require('./utils').readTOML;\nvar fileExists = require('./utils').fileExists;\n\nvar defaults = {\n account: {\n user...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded usage of tipsy\n\n* tooltip is already initialized\n" }, { "from": "human", "value": "$(document).ready(function() {\n\n\t$('#fileSharingSettings input').change(function() {\n\t\tvar value = 'no';\n\t\tif (this.checked) {\n\t\t\tvalue = 'yes';\n\t\t}...
javascript
chosen
[ { "from": "system", "value": "Allow .csvs to be processed\n" }, { "from": "human", "value": "'use strict';\nvar fs = require('fs');\nvar path = require('path');\nvar nodedir = require('node-dir');\n\nvar unzipGeoStream = require('./unzipGeoStream');\n\n\nfunction discover(input, counter, callbac...
javascript
chosen
[ { "from": "system", "value": "Save input values to localStorage\n" }, { "from": "human", "value": "function get(i){\n\treturn document.getElementById(i)\n}\nfunction random_number(){\n\tif(value('repeat')<1){\n\t\tget('repeat').value=1\n\t}\n\ti=value('repeat')-1;\n\trange=parseInt(value('range'...
javascript
chosen
[ { "from": "system", "value": "Use the Authorization request header field to send the token.\n\nPer http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-14#section-2.1\nthis is the recommended approach which must be supported by all servers.\n" }, { "from": "human", "value": "var TokenCache = re...
javascript
chosen
[ { "from": "system", "value": "Send button state for toggle buttons.\n" }, { "from": "human", "value": "/*\n * Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you ma...
javascript
chosen
[ { "from": "system", "value": "Make sure content app works when there are no variants\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n function RelatedLinksAppController($scope) {\n var vm = this;\n\n vm.relations = $scope.model.viewModel; \n v...
javascript
chosen
[ { "from": "system", "value": "Fix method and add d to isSecure\n" }, { "from": "human", "value": "module.exports = {\n isSecure: function (successCallback, errorCallback) {\n cordova.exec(successCallback, errorCallback, \"MobitorSecure\", \"isSecure\", [null]);\n }\n};" }, { ...
javascript
chosen
[ { "from": "system", "value": "Disable the YUICompressor and closure compiler tests\n\nThey're annoying because the fail on Travis half of the time." }, { "from": "human", "value": "var vows = require('vows'),\n assert = require('assert'),\n AssetGraph = require('../lib/AssetGraph');\n\nvow...
javascript
chosen
[ { "from": "system", "value": "Update API controller with team and challenge routes\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * GET /api/challenges\n * List of challenges.\n */\nexports.getChallenges = function getChallenges(req, res) {\n res.json({ challenges: [] });\n};\n\n/*...
javascript
chosen
[ { "from": "system", "value": "Make it working directory independent\n" }, { "from": "human", "value": "/**\n * App Dependencies.\n */\n\nvar loopback = require('loopback')\n , app = module.exports = loopback()\n , fs = require('fs')\n , path = require('path')\n , request = require('request')...
javascript
chosen
[ { "from": "system", "value": "Add rel on fork link\n" }, { "from": "human", "value": "import React from 'react'\nimport { makeStyles } from '@material-ui/core/styles'\nimport Fab from '@material-ui/core/Fab'\nimport Badge from '@material-ui/core/Badge'\n\nconst useStyles = makeStyles(() => ({\n\...
javascript
chosen
[ { "from": "system", "value": "Add missing global Rollup alias for apollo-link-http-common\n\nThis fixes #521, making it so that the apollo-link-http bundle resolves\napollo-link-http-common to global.apolloLink.utilities instead of\nglobal.apolloLinkHttpCommon (which does not exist).\n" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Stop propogation in any case\n" }, { "from": "human", "value": "const elements = document.querySelectorAll('bracket-less');\n\nfunction doAction(e) {\n if (e.target.tagName !== 'BRACKET-LESS') return;\n e.target.classList.toggle('bracket-less');\n e.stopPropagati...
javascript
chosen
[ { "from": "system", "value": "Move base style in the header\n" }, { "from": "human", "value": "import React from 'react'\nimport Document, { Head, Main, NextScript } from 'next/document'\nimport stylesheet from 'pages/styles.scss'\n\nexport default class MyDocument extends Document {\n render (...
javascript
chosen
[ { "from": "system", "value": "Load the style file in Firefox version as well.\n" }, { "from": "human", "value": "'use strict';\n/*jshint unused:false, newcap:false*/\n\n/**\n * Enable dubug mode\n * This allow to console.log in a firefox default configuration\n */\nrequire('sdk/preferences/servi...
javascript
chosen
[ { "from": "system", "value": "Add a back-reference to the repository.\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Greasemonkey EndomondoDesign\n// @namespace https://github.com/JanisE\n// @include *www.endomondo.com/*\n// @version 1\n// @grant none\n// ==/UserScript==\n\nvar c...
javascript
chosen
[ { "from": "system", "value": "Install ES2015 String polyfills in tool code, too.\n" }, { "from": "human", "value": "// This file exists because it is the file in the tool that is not automatically\n// transpiled by Babel\n\nfunction babelRegister() {\n require(\"meteor-babel/register\")({\n ...
javascript
chosen
[ { "from": "system", "value": "Test for functionality of setData method fails\n" }, { "from": "human", "value": "describe('The constructor is supposed a proper WgaPipeline object', function(){\n\tit('Constructor wgaPipeline exists', function(){\n\t\texpect(WgaPipeline).toBeDefined();\n\t});\n\tva...
javascript
chosen
[ { "from": "system", "value": "Use relative path until published\n" }, { "from": "human", "value": "const components = require('idyll-components');\nconst IdyllDocument = require('idyll-document');\nconst React = require('react');\n\nclass Renderer extends React.PureComponent {\n render() {\n ...
javascript
chosen
[ { "from": "system", "value": "Update cordova-plugin-statusbar from 2.3.0 to 2.4.3.\n\nIncluded by mobile-experience > mobile-status-bar.\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Good defaults for the mobile status bar\",\n version: \"1.0.14\"\n});\n\nCordova.depends({...
javascript
chosen
[ { "from": "system", "value": "Fix undefined name and scope variables\n" }, { "from": "human", "value": "var f = \"MMM Do YYYY\";\n\nfunction calcWidth(name) {\n return 250 + name.length * 6.305555555555555;\n}\n\nWebApp.connectHandlers.use(\"/package\", function(request, response) {\n if(reque...
javascript
chosen
[ { "from": "system", "value": "Fix zoom levels for example.\n" }, { "from": "human", "value": "var playlist = WaveformPlaylist.init({\n samplesPerPixel: 3000,\n mono: true,\n waveHeight: 100,\n container: document.getElementById(\"playlist\"),\n state: 'cursor',\n waveOutlineColor: '#E0EFF1...
javascript
chosen
[ { "from": "system", "value": "fix: Allow laneId to be passed as param to onCardClick handler\n\nhttps://github.com/rcdexta/react-trello/issues/34\n" }, { "from": "human", "value": "import React from 'react'\nimport {withInfo} from '@storybook/addon-info'\nimport {storiesOf} from '@storybook/reac...
javascript
chosen
[ { "from": "system", "value": "Indent by 4 spaces instead of 2\n" }, { "from": "human", "value": "var path = require('path'),\n fs = require('fs');\n\nvar routes = function (app) {\n fs.readdirSync(__dirname).filter(function (file) {\n return path.join(__dirname, file) != __filename;\n }).f...
javascript
chosen
[ { "from": "system", "value": "Throw the right error from failing second request\n\nFixes #4." }, { "from": "human", "value": "// @flow\n\ntype Configuration = {\n refreshToken: () => Promise<void>,\n shouldRefreshToken: (error: any) => boolean,\n fetch: (url: any, options: Object) => Promise<...
javascript
chosen
[ { "from": "system", "value": "core: Add function for retrieving DOM elements\n" }, { "from": "human", "value": "export class Machete {\n // TODO: Implement polyfills\n}\n" }, { "from": "gpt", "value": "export class Machete {\n // TODO: Implement polyfills\n\n /**\n * Uti...
javascript
chosen
[ { "from": "system", "value": "Set allCoursesFrontpageCourseID to 1 as default.\n" }, { "from": "human", "value": "this.mmooc = this.mmooc || {};\n\n// Course ID for selected course, which frontend page\n// will be swapped with All Courses list\nconst allCoursesFrontpageCourseID = 14;\n\nthis.mmo...
javascript
chosen
[ { "from": "system", "value": "Fix handling of image tag sources\n" }, { "from": "human", "value": "var performImage = function() {\n var t=[];\n function prepareString(withUrl) {\n return '<a href=\"' + withUrl + '\"><img title=\"'+ withUrl +'\" src=\"' + withUrl + '\"></a>';\n }...
javascript
chosen
[ { "from": "system", "value": "Add missing test for reducer action CLEAR_CUSTOMIZATION\n" }, { "from": "human", "value": "import React from 'react';\nimport { expect } from 'chai';\nimport { List as ImmutableList, Map } from 'immutable';\nimport reducer from '../src/reducer';\n\ndescribe('reducer...
javascript
chosen
[ { "from": "system", "value": "[SD-770] Fix homepage carousels on iOS\n" }, { "from": "human", "value": "//= require spree/frontend/viewport\n\nSpree.fetchProductCarousel = function (taxonId, htmlContainer) {\n return $.ajax({\n url: Spree.routes.product_carousel(taxonId)\n }).done(function ...
javascript
chosen
[ { "from": "system", "value": "Fix for updated default icon name\n" }, { "from": "human", "value": "var menubar = require('menubar');\nvar ipc = require('ipc');\nvar shell = require('shell')\n\nvar mb = menubar({\n dir: __dirname,\n width: 280,\n height: 87\n});\n\nmb.on('ready', functio...
javascript
chosen
[ { "from": "system", "value": "Fix date bug in moment.js\n" }, { "from": "human", "value": "import moment from 'moment';\nimport { maxPages } from '../../data/config';\n\n// Prevent webpack window problem\nconst isBrowser = () => typeof window !== 'undefined';\n\nconst isPage = () => (isBrowser()...
javascript
chosen
[ { "from": "system", "value": "Fix name and bug for get input value\n" }, { "from": "human", "value": "window.__i10c = {};\n\nwindow.__i10c.getInputValue = (inputEle) => {\n return inputEle.val;\n}\n\nwindow.__i10c.setInputValue = (inputEle, val) => {\n inputEle.value = val;\n}\n\nwindow.__...
javascript
chosen