conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Use 'end' instead of 'exit' to guarantee that streams are flushed.\n"
},
{
"from": "human",
"value": "var cp = require('child_process');\nvar Q = require('q');\nvar createError = require('./createError');\n\n// Executes a shell command\n// Buffers the stdout and std... | javascript | chosen |
[
{
"from": "system",
"value": "Update example to allow downgrading to http1"
},
{
"from": "human",
"value": "var path = require('path');\nvar fs = require('fs');\nvar pino = require('pino');\nvar restify = require('../../lib');\n\nvar srv = restify.createServer({\n http2: {\n cert: fs.r... | javascript | chosen |
[
{
"from": "system",
"value": "Fix syntax error for gtm experiment js\n"
},
{
"from": "human",
"value": "function utmx_section(){}function utmx(){}(function(){var k='73768344-10',d=document,l=d.location,c=d.cookie; if(l.search.indexOf('utm_expid='+k)>0)return; function f(n){if(c){var i=c.indexOf(... | javascript | chosen |
[
{
"from": "system",
"value": "Add 'app' option as alias\n"
},
{
"from": "human",
"value": "#! /usr/bin/env node\n/**\n * Created by garusis on 31/01/17.\n */\nimport yargs from \"yargs\"\n\nconst argv = yargs\n .usage(\"lb-migration <cmd> [args]\")\n .command('migrate [--ds] [--models]', '... | javascript | chosen |
[
{
"from": "system",
"value": " Change current line if nothing is selected\n"
},
{
"from": "human",
"value": "import vscode from 'vscode'\nimport convert from './convert.js'\n\nfunction positionFactory (positionObj) {\n return new vscode.Position(positionObj._line, positionObj._character)\n}\n\n... | javascript | chosen |
[
{
"from": "system",
"value": "InlineCKEditor: Remove 'pre', it has never been part of the recommended tags\n"
},
{
"from": "human",
"value": "(function () {\n const DEFAULTS = {\n format_tags: \"h1;h2;h3;p;pre\",\n toolbar: \"Custom\",\n toolbar_Custom: [\n [\n \"Format\",\... | javascript | chosen |
[
{
"from": "system",
"value": "Set public org access when using public repos\n"
},
{
"from": "human",
"value": "var _ = require('underscore');\nvar Backbone = require('backbone');\nvar Org = require('../models/org');\nvar config = require('../config');\nvar cookie = require('../cookie');\n\nmodul... | javascript | chosen |
[
{
"from": "system",
"value": "Add some commented-out code to hide the text label of rich text elements\n"
},
{
"from": "human",
"value": "/* global django, CKEDITOR */\n(function($) {\n // Activate and deactivate the CKEDITOR because it does not like\n // getting dragged or its underlying ... | javascript | chosen |
[
{
"from": "system",
"value": "Add all gt-Classes they are active\n"
},
{
"from": "human",
"value": "/**\n * Helper function that dynamically adds eg. gt480 class to element if it's width is >480px\n *\n * Basically simulates media queries for elements\n */\nKwf.Utils.ResponsiveEl = function(sele... | javascript | chosen |
[
{
"from": "system",
"value": "Add getHaikuById query to queryFactoy\n"
},
{
"from": "human",
"value": "const queries = require('./queries');\n\nexports.createHaikuMutation = haiku => (\n {\n query: queries.createHaikuMutation,\n variables: {\n haiku: {\n author: haiku.author,\... | javascript | chosen |
[
{
"from": "system",
"value": "Remove intial value for base\n"
},
{
"from": "human",
"value": "angular.module(\"currencyJa\", [])\n .controller(\"TradersCtrl\", function ($scope, traderService) {\n $scope.base = 1;\n $scope.currency = \"USD\";\n $scope.traders = traderService.findByCurr... | javascript | chosen |
[
{
"from": "system",
"value": "Replace custom status codes with http module\n"
},
{
"from": "human",
"value": "module.exports = function (app, nus) {\n var opts = app.get('opts')\n , router = require('express').Router();\n\n router.route('/shorten')\n .post(function (req, res) {\n nu... | javascript | chosen |
[
{
"from": "system",
"value": "Remove not needed 'fallback' message string\n"
},
{
"from": "human",
"value": "/* global define, socket */\n\ndefine('plugins/smoothshorts/config', ['translator'], function(i18n) {\n var ssConfig = {\n fallback: true,\n // modifier key (ctrl, alt or shift) to... | javascript | chosen |
[
{
"from": "system",
"value": "Use the new syntax priority name\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar yeoman = require('yeoman-generator');\n\n/**\n * Initialize Mocha generator\n *\n * @param {String|Array} args\n * @param {Object} options\n * @api public\n */\nvar MochaGenerat... | javascript | chosen |
[
{
"from": "system",
"value": "Create skeleton using app generator\n"
},
{
"from": "human",
"value": "'use strict';\nvar yeoman = require('yeoman-generator');\nvar chalk = require('chalk');\nvar yosay = require('yosay');\n\nmodule.exports = yeoman.generators.Base.extend({\n prompting: function (... | javascript | chosen |
[
{
"from": "system",
"value": "Add d3.arc to D3 build\n"
},
{
"from": "human",
"value": "export {\n event,\n selection,\n select,\n selectAll,\n local\n} from \"d3-selection\";\n\nimport \"d3-transition\";\n\nexport {\n chord,\n ribbon\n} from \"d3-chord\";\n\nexport {\n scaleOrdinal,\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix the ignored error in dsipatchSession\n"
},
{
"from": "human",
"value": "import { atob } from 'Base64';\nimport { PrivateAPI } from '@r/private';\n\nimport Session from '../../app/models/Session';\nimport makeSessionFromData from './makeSessionFromData';\nimport ... | javascript | chosen |
[
{
"from": "system",
"value": "Reduce empty space above first element in editor\n"
},
{
"from": "human",
"value": "import insertCSS from \"insert-css\"\n\ninsertCSS(`\n\n.ProseMirror {\n border: 1px solid silver;\n position: relative;\n}\n\n.ProseMirror-content {\n padding: 4px 8px 4px 14px;\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add pager functionality to members component TODO: move page to its own component?\n"
},
{
"from": "human",
"value": "import React, { Component } from 'react';\nimport DocumentMeta from 'react-document-meta';\nimport MembersPreview from './MembersPreview';\n\nclass ... | javascript | chosen |
[
{
"from": "system",
"value": "Use appview as new entry point\n"
},
{
"from": "human",
"value": "require.config({\n shim: {\n 'underscore': {\n exports: '_'\n },\n 'backbone': {\n deps: ['jquery', 'underscore'],\n exports: 'Backbone'\n }\n },\n\n paths: {\n jquery... | javascript | chosen |
[
{
"from": "system",
"value": "Reduce timeouts to 10 seconds for e2e tests\n\n[#29]\n"
},
{
"from": "human",
"value": "exports.config = {\n allScriptsTimeout: 120 * 1000,\n\n specs: [\n 'src/test/e2e/support/*.js',\n 'src/test/e2e/*.js'\n ],\n\n capabilities: {\n 'browserName': 'chro... | javascript | chosen |
[
{
"from": "system",
"value": "Add TapReporter to Protractor reports\n"
},
{
"from": "human",
"value": "'use strict'\n\nvar proxy = {\n proxyType: 'autodetect'\n}\n\nif (process.env.HTTP_PROXY !== undefined && process.env.HTTP_PROXY !== null) {\n proxy = {\n proxyType: 'manual',\n httpPro... | javascript | chosen |
[
{
"from": "system",
"value": "Fix displaying of Factlink Bubble\n\nSigned-off-by: tomdev <96835dd8bfa718bd6447ccc87af89ae1675daeca@codigy.nl>\n"
},
{
"from": "human",
"value": "(function () {\n function createIframe() {\n var body = document.getElementsByTagName(\"body\")[0];\n var iframe... | javascript | chosen |
[
{
"from": "system",
"value": "Remove label for groups field\n"
},
{
"from": "human",
"value": "import SimpleSchema from \"simpl-schema\";\nSimpleSchema.extendOptions([\"autoform\"]);\n\nAutoForm.addInputType(\"dropdown\", {\n template: \"quickForm_dropdown\",\n valueIsArray: true,\n valueOut(... | javascript | chosen |
[
{
"from": "system",
"value": "Add the default IRC network for tests\n\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nvar config = require(\"../../../defaults/config.js\");\n\nconfig.public = true;\nconfig.prefetch = true;\nconfig.host = config.bind = \"127.0.0.1\";\nconfig.port = 61337;\n... | javascript | chosen |
[
{
"from": "system",
"value": "Update to return the correct mangled string\n"
},
{
"from": "human",
"value": "var esprima = require('esprima');\nvar esmangle = require('esmangle');\nvar escodegen = require('escodegen');\n\nBlend.defineClass('Minify', {\n singleton: true,\n js: function (scr... | javascript | chosen |
[
{
"from": "system",
"value": "Work on Android even if style is not passed in\n\nOtherwise we get a \"Cannot read property 'borderRadius' of undefined\" since [flattenStyle() will return undefined](https://github.com/facebook/react-native/blob/62e8ddc20561a39c3c839ab9f83c95493df117c0/Libraries/StyleSheet/fla... | javascript | chosen |
[
{
"from": "system",
"value": "Add support for controlling API url in UI without modifying code.\n\nReviewed at https://reviews.apache.org/r/63040/\n"
},
{
"from": "human",
"value": "function makeClient() {\n const transport = new Thrift.Transport('/api');\n const protocol = new Thrift.Protocol... | javascript | chosen |
[
{
"from": "system",
"value": "Create json object rather than forming the strings ourselves\n"
},
{
"from": "human",
"value": "// Decodes data received\r\nfunction decode(content){\r\n var lsRegExp = /\\%20/g;\r\n var lsRegExp2 = /\\%2B/g;\r\n\r\n content = String(unescape(content)).repl... | javascript | chosen |
[
{
"from": "system",
"value": "Add missing js assets in core manifest\n"
},
{
"from": "human",
"value": "//= link_tree ../images\n\n//= link refinery/refinery.js\n//= link admin.js\n//= link modernizr-min.js\n\n//= link refinery/refinery.css\n//= link refinery/formatting.css\n//= link refinery/si... | javascript | chosen |
[
{
"from": "system",
"value": "Solve issue with HeaderCtrl in course_material page admin\n"
},
{
"from": "human",
"value": "(function (angular) {\n 'use strict';\n\n angular.module('courseMaterial', [\n 'courseMaterial.controllers',\n 'courseMaterial.services',\n 'cours... | javascript | chosen |
[
{
"from": "system",
"value": "Make sure including the asset from the gem works.\n"
},
{
"from": "human",
"value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/... | javascript | chosen |
[
{
"from": "system",
"value": "Add default filters to theme templating engine\n"
},
{
"from": "human",
"value": "var path = require('path');\nvar nunjucks = require('nunjucks');\nvar DoExtension = require('nunjucks-do')(nunjucks);\n\nvar TEMPLATES_FOLDER = require('../../constants/templatesFolder... | javascript | chosen |
[
{
"from": "system",
"value": "Make sure that unhandled rejections are thrown so that eg. mocha will pick them up and consider the test suite to have failed.\n"
},
{
"from": "human",
"value": "/*global Promise:true*/\nvar Promise = require('bluebird');\n\nvar workQueue = {\n queue: [],\n dr... | javascript | chosen |
[
{
"from": "system",
"value": "Fix stateless component. cc @catalinmiron\n"
},
{
"from": "human",
"value": "import React, { PropTypes } from 'react';\n\nconst styles = {\n wrapper: {\n width: 50,\n height: 50,\n border: '5px solid chocolate',\n backgroundColor: 'green',\n position... | javascript | chosen |
[
{
"from": "system",
"value": "Disable root-token head changes when not editing\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nangular.module('arethusa.core').directive('rootToken', [\n 'state',\n function(state) {\n return {\n restrict: 'A',\n scope: {},\n link: functi... | javascript | chosen |
[
{
"from": "system",
"value": "fix(create-npm): Allow for default branch names other than master\n"
},
{
"from": "human",
"value": "import childProcess from 'child_process'\nimport {promisify} from 'util'\n\nconst exec = promisify(childProcess.exec)\n\nexport default async function (projectDirect... | javascript | chosen |
[
{
"from": "system",
"value": "Add additional columns and indexes\n"
},
{
"from": "human",
"value": "var table = function (table) {\n table.increments().primary();\n table.string('file_name').notNullable().unique();\n\n table.boolean('completed').notNullable();\n table.integer('transferred_by... | javascript | chosen |
[
{
"from": "system",
"value": "Remove leaf node @each usage.\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport InstanceItemComponent from \"./instance-item\";\n\nconst { computed } = Ember;\n\nexport default InstanceItemComponent.extend({\n itemType: 'method',\n routeName: '... | javascript | chosen |
[
{
"from": "system",
"value": "Add \"disabled\" class binding to checkbox's div\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport TooltipEnabled from '../mixins/sl-tooltip-enabled';\n\n/**\n * @module components\n * @class sl-checkbox\n */\nexport default Ember.Component.exte... | javascript | chosen |
[
{
"from": "system",
"value": "Remove space in response json\n"
},
{
"from": "human",
"value": "\nimport getComponents from '../utils/dynamoDB'\n\nexport async function handler (event, context, callback) {\n console.log('getComponents called')\n try {\n let comps = await getComponents()\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Remove preserveSymlinks that didn't actually help\n"
},
{
"from": "human",
"value": "/* eslint-disable no-console */\nconst fs = require('fs');\nconst path = require('path');\nconst shell = require('shelljs');\n\nfunction getCommand(watch) {\n const tsc = path.join... | javascript | chosen |
[
{
"from": "system",
"value": "Rectify meta-comment in user routes\n"
},
{
"from": "human",
"value": "const express = require('express')\nconst ERRORS = require('../../errors')\nconst User = require('../../models/User')\nconst utils = require('../../utils')\nconst router = express.Router()\n\n\n/... | javascript | chosen |
[
{
"from": "system",
"value": "Use SW default behavior for installing/updating\n"
},
{
"from": "human",
"value": "import React from 'react'\nimport ReactDom from 'react-dom'\nimport { AppContainer } from 'react-hot-loader'\nimport OfflinePluginRuntime from 'offline-plugin/runtime'\nimport App fro... | javascript | chosen |
[
{
"from": "system",
"value": "Allow `insecure` HTTPS calls if that flag is set.\n"
},
{
"from": "human",
"value": "import _ from 'lodash'\nimport axios from 'axios'\nimport * as task from './task'\nimport pipe from './pipe'\nimport pipes from './pipes'\nimport connections from './connections'\n\... | javascript | chosen |
[
{
"from": "system",
"value": "Clean up how UI is used\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar Q = require('q'),\n scorer = require('./scorer'),\n print = require('./board/print');\n\nmodule.exports = {\n play: function(board, player_x, player_o) {\n var self = thi... | javascript | chosen |
[
{
"from": "system",
"value": "Use wrap factory in tests.\n"
},
{
"from": "human",
"value": "exports[\"test: geoscript\"] = require(\"./test_geoscript\");\n\nif (require.main == module || require.main == module.id) {\n system.exit(require(\"test\").run(exports));\n}"
},
{
"from": "gpt"... | javascript | chosen |
[
{
"from": "system",
"value": "gui: Add support for multiple stacked modals\n\nGitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3288\n"
},
{
"from": "human",
"value": "angular.module('syncthing.core')\n .directive('modal', function () {\n return {\n restrict: ... | javascript | chosen |
[
{
"from": "system",
"value": "Support for generic UI navigation\n"
},
{
"from": "human",
"value": "/* See license.txt for terms of usage */\n\n\"use strict\";\n\ndefine(function(require, exports, module) {\n\n// Dependencies\nconst React = require(\"react\");\nconst { Reps } = require(\"reps/rep... | javascript | chosen |
[
{
"from": "system",
"value": "Change search route\nremove multiple createuser routes\nchange getAllRegular to getAll Role\n"
},
{
"from": "human",
"value": "import express from 'express';\nimport userController from '../controllers/userController';\n// import documentController from '../controll... | javascript | chosen |
[
{
"from": "system",
"value": "Simplify even more since we don't need a global reference to rootNode any more, either\n"
},
{
"from": "human",
"value": "\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { connect, Provider } from 'react-redux';\nimport { createStore } from '... | javascript | chosen |
[
{
"from": "system",
"value": "Fix keys for incoming worker message\n"
},
{
"from": "human",
"value": "module.exports = {\n PROTOCOL_WORKER: \"MDPW02\",\n PROTOCOL_CLIENT: \"MDPC02\",\n READY: \"\\x01\",\n REQUEST: \"\\x02\",\n REPLY: \"\\x03\",\n HEARTBEAT: \"\\x04\",\n DISC... | javascript | chosen |
[
{
"from": "system",
"value": "[fix] Use default value for diff length\n"
},
{
"from": "human",
"value": "//\n// ### function diffsplit (diff)\n// #### @diff {array|string} Diff to split.\n// Splits an unified diff into chunks.\n//\nmodule.exports = function diffsplit(diff) {\n var chunks = [],\... | javascript | chosen |
[
{
"from": "system",
"value": "Add support of multiple molds per raw\n"
},
{
"from": "human",
"value": "var buildMoldsSelector = require('./build-molds-selector');\n\nmodule.exports = function fillMold(raw, fillers, alias) {\n\n\tvar filled;\n\tvar moldsSelector = buildMoldsSelector(alias);\n\tva... | javascript | chosen |
[
{
"from": "system",
"value": "Make f.gotRight() work with actual arrays\n"
},
{
"from": "human",
"value": "module.exports = function (stackName, id) {\n\tif (typeof id === 'string') {\n\t\tid = this.idByFront(stackName, id)\n\t}\n\tthis.stacks[stackName][id].right += 1\n}\n"
},
{
"from":... | javascript | chosen |
[
{
"from": "system",
"value": "Use symbol.for for node environments with potentially multiple loads\n"
},
{
"from": "human",
"value": "import _ from 'lodash'\nconst unique = Symbol('lacona-unique-key')\n\nexport default unique\n\nfunction getUniqueValue (result) {\n if (!_.isObject(result)) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add dimension for expense subtype\n"
},
{
"from": "human",
"value": "window.OpenBudget = {\"data\":{\"meta\":{\n \"hierarchy\": [\"Funding Source\", \"Department\", \"Expense Type\", \"Subcategory\"],\n \"page_title\": \"City of Philadelphia Budget\",\n \"d... | javascript | chosen |
[
{
"from": "system",
"value": "Use ES2015 + strict mode\n"
},
{
"from": "human",
"value": "var npmWhich = require('npm-which')(process.cwd())\n\nmodule.exports = function findBin (binName, paths, config, cb) {\n var binPath = 'npm'\n var args = ['run', '-s', binName, '--'].concat(paths)\n ... | javascript | chosen |
[
{
"from": "system",
"value": "[RFR] Fix wrapped conditions when passing a web element\n"
},
{
"from": "human",
"value": "import { until, By, WebElement } from 'selenium-webdriver';\n\nexport default (elementOrLocator, driver) => {\n if (elementOrLocator instanceof WebElement) {\n retur... | javascript | chosen |
[
{
"from": "system",
"value": "[core] Fix test is not loaded\n"
},
{
"from": "human",
"value": "/*\n * loquat-core test / prim.Result\n * copyright (c) 2016 Susisu\n */\n\n\"use strict\";\n\ndescribe(\".Result\", () => {\n require(\"./Result/constructor.js\");\n});\n"
},
{
"from": "gpt... | javascript | chosen |
[
{
"from": "system",
"value": "Fix typo: delayWhileIdle should be delay_while_idle\n"
},
{
"from": "human",
"value": "/**\n * This module defines all the arguments that may be passed to a message.\n * \n * Each argument may contain a field `__argName`, if the name of the field\n * should be diffe... | javascript | chosen |
[
{
"from": "system",
"value": "Change from shallowMount to mount\n"
},
{
"from": "human",
"value": "import { shallowMount } from '@vue/test-utils'\nimport ActionButton from '~/components/ActionButton'\n\ndescribe('ActionButton', () => {\n describe('icon props', () => {\n test('pass string', (... | javascript | chosen |
[
{
"from": "system",
"value": "Implement more props for Header\n\nMakes it more flexible to reuse in footer\n"
},
{
"from": "human",
"value": "import React from 'react';\n\nexport default class Header extends React.Component {\n render() {\n const h1Style = {\n margin: 0,\n padding:... | javascript | chosen |
[
{
"from": "system",
"value": "Test that when called, the loader returns a string\n"
},
{
"from": "human",
"value": "const assert = require('assert');\nconst configMergeLoader = require('../index.js');\n\ndescribe('Config Merge Loader', function() {\n it('should return a function', function() {\... | javascript | chosen |
[
{
"from": "system",
"value": "Remove import.meta.url from the output bundles\n"
},
{
"from": "human",
"value": "import resolve from \"@rollup/plugin-node-resolve\";\nimport babel from \"@rollup/plugin-babel\";\nimport rust from \"@wasm-tool/rollup-plugin-rust\";\nimport { terser } from \"rollup-... | javascript | chosen |
[
{
"from": "system",
"value": "Fix pending test for PUT collection\n"
},
{
"from": "human",
"value": "var expect = require('expect.js');\nvar request = require('request');\n\nvar fixtures = require('./fixtures');\n\ndescribe('PUT plural', function () {\n before(fixtures.vegetable.init);\n befor... | javascript | chosen |
[
{
"from": "system",
"value": "Change path to 'templates' folder in requirejs config\n"
},
{
"from": "human",
"value": "requirejs.config({\n\tbaseUrl: 'js/lib',\n\twaitSeconds: 30,\n\n\tpaths: {\n\t\tapp: '../app',\n\t\tmodel: '../app/models',\n\t\troute: '../app/routes',\n\t\ttemplate: '../../te... | javascript | chosen |
[
{
"from": "system",
"value": "Add name and email basic test\n"
},
{
"from": "human",
"value": "describe('Users', function() {\n\n describe('Creation', function () {\n\n context('When creating a new user', function() {\n var some_guy = jsf(mocks.user);\n it('Should have an id', func... | javascript | chosen |
[
{
"from": "system",
"value": "ESLint: Remove \"embertest\" globals from tests\n"
},
{
"from": "human",
"value": "module.exports = {\n env: {\n embertest: true\n },\n globals: {\n 'server': true,\n 'wait': true,\n },\n};\n"
},
{
"from": "gpt",
"value":... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"got rid of redundant city selector on home page js\"\n\nThis reverts commit 604c27398793760a9353ad1b90f5c03bc83b3c1b."
},
{
"from": "human",
"value": "import './common'\nlet location = require('./location/locationSelector')\nconst templating = require('./te... | javascript | chosen |
[
{
"from": "system",
"value": "Remove hiding gas tanks as it hides the new tiered versions.\n"
},
{
"from": "human",
"value": "if (FML.isModLoaded(\"Mekanism\")) {\r\n NEI.override(\"Mekanism:MachineBlock2\", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);\r\n NEI.override(\"Mekani... | javascript | chosen |
[
{
"from": "system",
"value": "Use `console.warn` instead of `log.warn`\n"
},
{
"from": "human",
"value": "function ServerCookies(req, res) {\n if (!req) {\n throw new Error('req is required');\n }\n\n if (!res) {\n throw new Error('res is required');\n }\n\n this.req = req;\n this.re... | javascript | chosen |
[
{
"from": "system",
"value": "Remove trailing commas for IE\n"
},
{
"from": "human",
"value": "var RestoreViewMixin = {\n restoreView: function () {\n var storage = window.localStorage || {};\n if (!this.__initRestore) {\n this.on('moveend', function (e) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Clear query on component unmount\n"
},
{
"from": "human",
"value": "import { createElement } from 'react';\nimport Proptypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { withRouter } from 'react-router';\nimport { deburrUpper } from 'app/util... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"Minor Formatting Changes for Day of Week Test\"\n\nThis reverts commit 363cad30e656eb83f2b5f97b4ed97d8a4c923e2d.\n"
},
{
"from": "human",
"value": "var assert = require(\"assert\");\n\nvar dateFormat = require(\"./../lib/dateformat\");\n\ndescribe(\"dayOfWe... | javascript | chosen |
[
{
"from": "system",
"value": "Add to view count, javascript\n"
},
{
"from": "human",
"value": "\n\n$( document ).ready(function() {\n\n});"
},
{
"from": "gpt",
"value": "$(document).ready(function() {\n addToViewCounter();\n});\n\nconst addToViewCounter = () => {\n if (sessionStora... | javascript | chosen |
[
{
"from": "system",
"value": "Use cookies for requests in !title/!websel\n\nPrevents redirect loops (e.g. for New York Times).\n"
},
{
"from": "human",
"value": "var cheerio = require('cheerio'),\n request = require('request');\n\nmodule.exports.command = 'title';\n\nfunction getSelector(url,... | javascript | chosen |
[
{
"from": "system",
"value": "Add action to toggle entity\n"
},
{
"from": "human",
"value": "import { ADD_ENTITY } from '../constants/ActionTypes';\n\nfunction cmsAppState(state = [], action) {\n switch (action.type) {\n case ADD_ENTITY:\n return [\n ...state, {\n id: ac... | javascript | chosen |
[
{
"from": "system",
"value": "TINY-4847: Document new ui API methods\n"
},
{
"from": "human",
"value": "/**\n * This editor ui instance.\n *\n * @class tinymce.editor.ui.Ui\n */\n\n/**\n * Editor UI registry instance.\n *\n * @property registry\n * @type tinymce.editor.ui.Registry\n */\n\n/**\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix the name of the test\n"
},
{
"from": "human",
"value": "import { expect } from 'chai';\n\nimport { updateCellSource, executeCell } from '../../../src/notebook/actions';\nimport { liveStore, dispatchQueuePromise, waitForOutputs } from '../../utils';\n\ndescribe('... | javascript | chosen |
[
{
"from": "system",
"value": "Add a familiar warn to quickly access console.log\n\n"
},
{
"from": "human",
"value": "var round = function(num)\n{\n return (num + 0.5) | 0\n}\nvar floor = function(num)\n{\n return num | 0\n}\nvar ceil = function(num)\n{\n return (num | 0) == num ? num | 0 : (n... | javascript | chosen |
[
{
"from": "system",
"value": "Change behavior to quit after two Meta-Q presses in under 1s.\n"
},
{
"from": "human",
"value": "// Define keyboard shortcuts for showing and hiding a custom panel.\nvar { Hotkey } = require(\"hotkeys\");\n \nvar showHotKey = Hotkey({\n combo: \"accel-meta-q\",\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Document \"../../\" in example as being \"express-state\"\n"
},
{
"from": "human",
"value": "var express = require('express'),\n exphbs = require('express3-handlebars'),\n state = require('../../'),\n\n app = express();\n\napp.engine('hbs', exphbs());\na... | javascript | chosen |
[
{
"from": "system",
"value": "Use a reference browser instead of autocomplete\n"
},
{
"from": "human",
"value": "import React from 'react'\nimport {createReferenceInput} from 'role:@sanity/form-builder'\nimport client from 'client:@sanity/base/client'\nimport {unprefixType} from '../utils/unpref... | javascript | chosen |
[
{
"from": "system",
"value": "[TASK] Adjust web_tests for Map and Set data structure.\n"
},
{
"from": "human",
"value": "importScripts('../dist/yatern.js');\n\naddEventListener('message', function (e) {\n var data = e.data;\n //console.log(e.data.code);\n var t1 = (new Date).getTime();\... | javascript | chosen |
[
{
"from": "system",
"value": "Use const instead of var\n"
},
{
"from": "human",
"value": "var Reporter = require('jasmine-terminal-reporter');\n\njasmine.getEnv().clearReporters();\njasmine.getEnv().addReporter(new Reporter({isVerbose: true}));\n"
},
{
"from": "gpt",
"value": "const ... | javascript | chosen |
[
{
"from": "system",
"value": "Change how the library is exported\n\nThis commit makes the library define the |PEG| global variable (for\nbrowser export) and possibly assign it into |module.exports| (for\nNode.js export) later. The |module.exports| assignment is done *outside*\nthe main library |function| st... | javascript | chosen |
[
{
"from": "system",
"value": "refactor: Delete unnecessary imports and import new Routes component\n"
},
{
"from": "human",
"value": "'use strict';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Router, Route, IndexRoute, hashHistory, browserHistory } from 'react-router... | javascript | chosen |
[
{
"from": "system",
"value": "Update to the latest nwjs version, fix dynamic links\n"
},
{
"from": "human",
"value": "/* global nw, angular, console, require, Peer, StellarSdk */\n\nangular.module('app', [\n\t'ngRoute',\n\t'ionic'\n])\n.run(function ($rootScope, $window) {\n\t'use strict';\n\t$r... | javascript | chosen |
[
{
"from": "system",
"value": "Set post limit to 30\n"
},
{
"from": "human",
"value": "Meteor.publish('posts', function () {\n \"use strict\";\n var result = Posts.find({}, {\n sort: {\n time: -1\n },\n limit: 8\n });\n return result;\n});\n"
},
{
"from": "gpt",
"val... | javascript | chosen |
[
{
"from": "system",
"value": "Update testing frontend a bit\n"
},
{
"from": "human",
"value": "/* global: io */\nconst socket = io.connect('http://localhost:3000');\nsocket.on('connection', () => {});\nsocket.on('meeting', (data) => {\n let title = 'Ingen aktiv generalforsamling.';\n\n if (dat... | javascript | chosen |
[
{
"from": "system",
"value": "Fix some component imports that were broken when refactoring them for component splitting\n"
},
{
"from": "human",
"value": "import { importComponent } from 'meteor/vulcan:lib';\n\nimportComponent(\"FieldErrors\", () => require('../../components/vulcan-forms/FieldEr... | javascript | chosen |
[
{
"from": "system",
"value": "Fix exporting of mixpanel module\n"
},
{
"from": "human",
"value": "// Workaround because mixpanel.cjs.js doesn't pass flow-checks\nexport Mixpanel from 'mixpanel-browser/build/mixpanel.cjs.js'\n"
},
{
"from": "gpt",
"value": "// Workaround because mixpa... | javascript | chosen |
[
{
"from": "system",
"value": "Split json messages on carraige returns.\n"
},
{
"from": "human",
"value": "var net = require('net');\n\nvar HOST = '127.0.0.1';\nvar PORT = 13854;\n\n\n/* Network Socket to Thinkgear Connector */\n\nvar client = new net.Socket();\n\nclient.connect(PORT, HOST, funct... | javascript | chosen |
[
{
"from": "system",
"value": "Remove prefix from the keys we add\n"
},
{
"from": "human",
"value": "const PREFIX = '#';\nconst SEPARATOR = '===';\n\nexport default function keyFor(collection, key, number) {\n let result = (\n PREFIX + collection +\n SEPARATOR + key\n );\n if (arguments.... | javascript | chosen |
[
{
"from": "system",
"value": "Complete regular expressions tests to pass\n"
},
{
"from": "human",
"value": "\nmodule(\"About Regular Expressions (topics/about_regular_expressions.js)\");\n\ntest(\"exec\", function() {\n var numberFinder = /(\\d).*(\\d)/;\n var results = numberFinder.exec(\... | javascript | chosen |
[
{
"from": "system",
"value": "Add more fixture file info.\n"
},
{
"from": "human",
"value": "\nimport tables from '../../database/tables'\n\nexport const tableNames = tables\n\nexport const tableKeys = {\n users: {\n hash: 'id',\n range: null\n },\n userLevels: {\n hash: 'id',\n r... | javascript | chosen |
[
{
"from": "system",
"value": "Add Button with the Spinner story.\n"
},
{
"from": "human",
"value": "/**\n * Site Kit by Google, Copyright 2022 Google LLC\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.... | javascript | chosen |
[
{
"from": "system",
"value": "Fix light cycle for traffic lights\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst gpio = require('rpi-gpio');\n\n// The pins we want to manipulate\nlet greenPin = 3\nlet yellowPin = 5\nlet redPin = 7;\n\nlet pinOrder = [greenPin, yellowPin, redPin];\n\n//... | javascript | chosen |
[
{
"from": "system",
"value": "Change a let to a const\n"
},
{
"from": "human",
"value": "/**\n * OfflineMobile Android Index\n * Sustainable Solutions (NZ) Ltd. 2016\n */\n\nexport class Scheduler {\n constructor() {\n this.intervalIds = [];\n }\n\n schedule(onInterval, interval) {\n co... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.