conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update Help Props So Popup Remains On-Screen\n" }, { "from": "human", "value": "import React from 'react';\nimport { storiesOf } from '@storybook/react';\nimport { text, select } from '@storybook/addon-knobs';\nimport OptionsHelper from '../../utils/helpers/options-...
javascript
chosen
[ { "from": "system", "value": "Add ObjectRoleModel.roleUsers for user/role mapping\n" }, { "from": "human", "value": "import {BaseModel} from 'nxus-storage'\n\nexport default BaseModel.extend({\n attributes: {\n role: {\n model: 'users-role'\n },\n object: {\n model: 'subclass...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary comment from Javascript file\n" }, { "from": "human", "value": "/**\n * Project: masterroot24.github.io\n */\n\n$(document).ready(function () {\n\n /* Add the current year to the footer */\n function getYear() {\n var d = new Date();\...
javascript
chosen
[ { "from": "system", "value": "Make the suggestion colorbox a square (increased the height)\n" }, { "from": "human", "value": "/*\n * Author: Pierre-Henry Soria <hello@ph7cms.com>\n * Copyright: (c) 2015-2019, Pierre-Henry Soria. All Rights Reserved.\n * License: GNU General Publ...
javascript
chosen
[ { "from": "system", "value": "reportLeftRecursion: Change handling of the |visitedRules| array\n\nBefore this commit, the |reportLeftRecursion| pass was written in\nfunctional style, passing the |visitedRules| array around as a parameter\nand making a new copy each time a rule was visited. This apparently\n...
javascript
chosen
[ { "from": "system", "value": "Fix delayed load and capital image extension\n" }, { "from": "human", "value": "var banner = $(\"#homepage-banner\");\n\nvar imageNames = ['bot', 'soccer', 'teamCrop', 'working'];\nvar imageIndex = Math.floor((Math.random() * imageNames.length));\nvar imageUrl = \"a...
javascript
chosen
[ { "from": "system", "value": "Fix agent not finding address of app err.\n" }, { "from": "human", "value": "import co from 'co';\nimport test from 'blue-tape';\nimport agent from 'promisify-supertest';\n\nimport createApplication from '../src';\n\nconst setup = () => {\n return agent(createAppli...
javascript
chosen
[ { "from": "system", "value": "Add getVariantUrl to content node.\n" }, { "from": "human", "value": "'use strict';\n\nconst ContentNode = function (context) {\n\n const self = this;\n const api = require('../api');\n const config = require('../config');\n\n this.uuid = context.content.uuid;\n...
javascript
chosen
[ { "from": "system", "value": "Make Serializer work with nest API\n\nThis fixes the root resource name to match what the API expects.\n" }, { "from": "human", "value": "import DS from \"ember-data\";\nimport Ember from 'ember';\n\nvar singularize = Ember.String.singularize;\nvar camelize = Ember....
javascript
chosen
[ { "from": "system", "value": "Return after flushing the database\n" }, { "from": "human", "value": "var messenger = require('../lib/messenger');\nvar session = require('../lib/session');\n\nmodule.exports = function (server) {\n \n server.post('/messages', function (req, res, next) {\n var ...
javascript
chosen
[ { "from": "system", "value": "Make ngModel for hidden input field work with parent scope\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc directive\n * @name angular-uploadcare.directive:UploadCare\n * @description Provides a directive for the Uploadcare widget.\n * # UploadCar...
javascript
chosen
[ { "from": "system", "value": "Make sure constant name is not renamed\n" }, { "from": "human", "value": "goog.require('app');\n\ngoog.provide('app.constants');\n\n/**\n * @const\n * Constants for the module.\n * Access them like app.constants.SCREEN\n */\napp.module.constant('constants', app.cons...
javascript
chosen
[ { "from": "system", "value": "Validate query document and output Xcode compatible errors\n" }, { "from": "human", "value": "import {\n parse,\n visit,\n visitWithTypeInfo,\n TypeInfo\n} from 'graphql';\n\nexport default function parseQueryDocument(queryDocument, schema) {\n const typeInfo =...
javascript
chosen
[ { "from": "system", "value": "Add test module for globals\n" }, { "from": "human", "value": "var assertionsModifier = require('../src/modifiers/assertions');\nvar testsModifier = require('../src/modifiers/tests');\nvar assert = require('assert');\nvar fs = require('fs');\nvar noOfData = 2;\n\nva...
javascript
chosen
[ { "from": "system", "value": ":art: Move setup code to beforeEach\n" }, { "from": "human", "value": "// Copyright (c) 2017 The Regents of the University of Michigan.\n// All Rights Reserved. Licensed according to the terms of the Revised\n// BSD License. See LICENSE.txt for details.\n\nconst log...
javascript
chosen
[ { "from": "system", "value": "label: Use TranslatedText component to get translated text.\n" }, { "from": "human", "value": "/* @flow */\nimport React, { PureComponent } from 'react';\nimport { Text } from 'react-native';\nimport { FormattedMessage } from 'react-intl';\n\nimport type { Localizab...
javascript
chosen
[ { "from": "system", "value": "Update Redux DevTools to log only in production env\n" }, { "from": "human", "value": "import {\n applyMiddleware,\n combineReducers,\n createStore,\n} from 'redux';\nimport thunk from 'redux-thunk';\nimport enhancer from './storeEnhancer';\nimport { composeWithD...
javascript
chosen
[ { "from": "system", "value": "Add guid to checkbox select\n" }, { "from": "human", "value": "import FormControlsAbstractSelectComponent from './abstract-select';\nimport { action } from '@ember/object';\nimport { arg } from 'ember-arg-types';\nimport { string, bool } from 'prop-types';\nimport {...
javascript
chosen
[ { "from": "system", "value": "Send browser credentials with fetch instead of hard coding them\n" }, { "from": "human", "value": "export default {\n\tfetch(url) {\n\t\treturn fetch(url, {\n\t\t\theaders: {\n\t\t\t\taccept: \"application/json\",\n\t\t\t\tauthorization: \"Basic \" + btoa(\"nick:Nic...
javascript
chosen
[ { "from": "system", "value": "Remove a debug console error statement\n" }, { "from": "human", "value": "function replace_t_co_links() {\n $('.twitter-timeline-link').each(function(){\n\n if (!$(this).attr('data-url-expanded')) {\n data_expanded_url = $(this).attr('data-expanded-...
javascript
chosen
[ { "from": "system", "value": "Use decodeURIComponent when getting username param from iframe\n" }, { "from": "human", "value": "var CURRENT_USER = {}\n\nvar CHAT_CHANNEL = \"global\";\nlocation.search.slice(1).split(\"&\").forEach(function(item){\n var param = item.split(\"=\")[0];\n if (p...
javascript
chosen
[ { "from": "system", "value": "Change 'restart' to 'play again'\n" }, { "from": "human", "value": "import ButtonView from './button_view'\nimport React from 'react'\nimport classnames from 'classnames'\nimport styles from '../../assets/stylesheets/styles.scss'\n\nexport default class GameOverView...
javascript
chosen
[ { "from": "system", "value": "Set the selector to look for a dynamically-set locale first, then the setting, then default to English\n" }, { "from": "human", "value": "import strings from \"../locales/locales\";\n\n/**\n * Returns localized strings based on 'locale' setting\n */\nexport function...
javascript
chosen
[ { "from": "human", "value": "Add start function and random math function\n" }, { "from": "gpt", "value": "\n$( document ).ready(function() {\n console.log( \"document loaded\" );\n\nstartgame();\n//addactiveclass();\n});\n\n\n\nfunction startgame (){\n start = $('.start-game');\n start....
javascript
chosen
[ { "from": "system", "value": "Remove id-map dependency from mongo-id\n" }, { "from": "human", "value": "Package.describe({\n summary: 'JS simulation of MongoDB ObjectIDs',\n version: '1.0.7',\n documentation: null\n});\n\nPackage.onUse(function (api) {\n api.export('MongoID');\n api.use(['e...
javascript
chosen
[ { "from": "system", "value": "Set up \"grid\" and create snake\n\nUsing the blocks, set up a snake array with is adjust an array containing arrays of rows and columns. We also render the snake as well :)\n" }, { "from": "human", "value": "var Game = Game || {};\n\n\nGame.SnakeGame = function(wid...
javascript
chosen
[ { "from": "system", "value": "tests/login: Use Polly.js instead of Pretender\n" }, { "from": "human", "value": "import { module, test } from 'qunit';\nimport { setupApplicationTest } from 'ember-qunit';\nimport { visit, click } from '@ember/test-helpers';\n\nimport { setupPretender } from 'skyli...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Use new validations, clean up ripple addresses express controller.\n" }, { "from": "human", "value": "var RippleAddress = require('../models/ripple_address');\n\nfunction respondToValidationErrors(req, res) {\n\tvar errors = req.validationErrors();\n\tif (...
javascript
chosen
[ { "from": "system", "value": "Put a tool tip on the first player token.\n" }, { "from": "human", "value": "\"use strict\";\n\ndefine([\"create-react-class\", \"prop-types\", \"react-dom-factories\"],\n function(createReactClass, PropTypes, DOM)\n {\n var AgentLabel = createReactClass(\n...
javascript
chosen
[ { "from": "system", "value": "Fix js config caching issue\n" }, { "from": "human", "value": "/**\n * Module dependencies.\n */\n\nvar Promise = require('bluebird');\nvar yaml = require('js-yaml');\nvar _ = require('lodash');\nvar path = require('path');\nvar logger = require('winsto...
javascript
chosen
[ { "from": "system", "value": "Remove second type element if empty\n" }, { "from": "human", "value": "const DocumentedItem = require('./item');\n\nclass DocumentedVarType extends DocumentedItem {\n\tregisterMetaInfo(data) {\n\t\tthis.directData = data;\n\t}\n\n\tserialize() {\n\t\tconst names = [...
javascript
chosen
[ { "from": "system", "value": ":arrow_up: Upgrade package to ucompiler v3\n" }, { "from": "human", "value": "'use babel'\n\nimport Path from 'path'\nimport Less from 'less'\n\nexport const minifier = false\nexport const compiler = true\nexport function process(contents, {relativePath, absolutePat...
javascript
chosen
[ { "from": "system", "value": "Fix issue with websocket and Chrome (add Authorization header)\n" }, { "from": "human", "value": "/* global localStorage */\n\nimport axios from 'axios'\n\nconst FD_API_URL = process.env.FD_API_URL || 'http://localhost:9111/v3'\n\nexport default axios.create({\n ba...
javascript
chosen
[ { "from": "system", "value": "Use extracted option in NewChannel form\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Query } from 'react-apollo';\n\nimport newChannelGroupsQuery from 'react/components/NewChannelForm/com...
javascript
chosen
[ { "from": "system", "value": "Test guarded access to `stats` in `fs.statSync()` wrapper\n\nAdds extra test that’s left over from an attempted alternative\nto 14aaa19ecfba000.\n" }, { "from": "human", "value": "'use strict';\nvar test = require('tap').test\nvar util = require('util')\nvar fs = re...
javascript
chosen
[ { "from": "system", "value": "Use a more cross-platform touch detection method\n\nDetect more than just iDevices for touch support" }, { "from": "human", "value": "const userAgent = navigator.userAgent.toLowerCase()\nconst event = userAgent.match(/(iphone|ipod|ipad)/) ? 'touchstart' : 'click'\n\...
javascript
chosen
[ { "from": "system", "value": "Move matrix init to top\n" }, { "from": "human", "value": "var numRows = 4\nvar numCols = 4\n\nvar matrix = [\n [false, false, false, false],\n [false, false, false, false],\n [false, false, false, false],\n [false, false, false, false]\n]\n\nfunction ge...
javascript
chosen
[ { "from": "system", "value": "Test angepasst, jetzt erfolgreich: es existiert ein svg-Element\n" }, { "from": "human", "value": "describe('Testing the first D3.js function drawKaryo', function() {\n var c;\n\n beforeEach(function() {\n c = drawKaryo();\n c.render();\n });\n\n afterEach...
javascript
chosen
[ { "from": "system", "value": "Implement CSV generator logic in collection view\n" }, { "from": "human", "value": "import tabsWithCards from \"./tabs-with-cards.js\";\nimport bookmarkButtons from \"./bookmark-buttons.js\";\nimport lazyLoadImages from \"./lazy-load-images.js\";\n\ndocument.addEven...
javascript
chosen
[ { "from": "system", "value": "Add simple tets for new function. Test fails\n" }, { "from": "human", "value": "defaultConf = {\n height: 100,\n width: 300,\n fingerprintLength: 4\n};\n\ndescribe(\"The constructor is supposed a proper Captcha object\", function() {\n it('Constructor Ca...
javascript
chosen
[ { "from": "system", "value": "Fix ClickableBox throw when clicked w/ null onClick\n" }, { "from": "human", "value": "// @flow\nimport Box from './box'\nimport React from 'react'\nimport {FlatButton} from 'material-ui'\n\nimport type {Props} from './clickable-box'\n\nconst ClickableBox = (props: ...
javascript
chosen
[ { "from": "system", "value": "Create Datafield in Magento ignores Default Value\nCreate DataField in Magento ignores Visibility\n" }, { "from": "human", "value": "define(['jquery'], function($){\n \"use strict\";\n\n /**\n * Initializer\n * @param url\n */\n function init(ur...
javascript
chosen
[ { "from": "system", "value": "Tweak index.html Cache-Control header value in SPA\n" }, { "from": "human", "value": "var _ = require('lodash'),\n express = require('express'),\n STATIC_CACHE_AGE = 365 * 24 * 60 * 60 * 1000; // 1 year;\n\nmodule.exports = function configureServer(config, app...
javascript
chosen
[ { "from": "system", "value": "Fix a bug when the list name was not visible\n" }, { "from": "human", "value": "import _ from 'lodash'\nimport {\n COMPANY_LISTS__LISTS_LOADED,\n COMPANY_LISTS__SELECT,\n COMPANY_LISTS__COMPANIES_LOADED,\n COMPANY_LISTS__FILTER,\n COMPANY_LISTS__ORDER,\n} from ...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary bash hack line\n\nRefs #3 & #4\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\":\" //# why? http://sambal.org/?p=1014 ; exec /usr/bin/env node --harmony \"$0\" \"$@\"\n\n'use strict';\n\nvar packageJson = require('./package.json'),\n ...
javascript
chosen
[ { "from": "system", "value": "Fix small error with circular refferences\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n var oldLog = console.log;\n console.log = function (message) {\n var body = document.querySelector(\"body\");\n var p = document.cre...
javascript
chosen
[ { "from": "system", "value": "Use new Function() rather than call() to improve performance even further.\n" }, { "from": "human", "value": "var ArgumentError = require('./ArgumentError');\nvar topiarist = require('topiarist');\n\nfunction verifierMethod(verifierMethod) {\n return function(arg) ...
javascript
chosen
[ { "from": "system", "value": "Change from settings to config\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @constructor\n */\nfunction Hitokotonushi() {}\n\n/**\n * @param {object} settings\n */\nHitokotonushi.prototype.setSettings = function(settings) {\n this.settings = settings...
javascript
chosen
[ { "from": "system", "value": "Disable prompt when form is submitted\n" }, { "from": "human", "value": "define([\n 'jquery',\n 'DoughBaseComponent'\n], function (\n $,\n DoughBaseComponent\n) {\n 'use strict';\n\n var UnsavedChangesPromptProto,\n defaultConfig = {\n defaultMessa...
javascript
chosen
[ { "from": "system", "value": "Fix close button visibility on smaller screens\n" }, { "from": "human", "value": "'use strict';\n\nconst React = require('react');\nconst {string, func} = React.PropTypes;\n\nconst InventoryDetail = React.createClass({\n displayName: 'InventoryDetail',\n propTypes...
javascript
chosen
[ { "from": "system", "value": "Update PredictionModel defaults to average values.\n" }, { "from": "human", "value": "App.module(\"Predictor\", function(Mod, App, Backbone, Marionette, $, _) {\n\n\tMod.PredictionModel = Backbone.Model.extend({\n\t\tdefaults: {\n\t\t\t'launchTime': Date.now(),\n\t\...
javascript
chosen
[ { "from": "system", "value": "Use named parameters on command-line\n\ncloses #202\n" }, { "from": "human", "value": "process.env.NODE_ENV = 'test'\nconst {MongoClient} = require('mongodb'),\n N = require('nitroglycerin')\n\n\nvar db = null\nconst getDb = (done) => {\n if (db) return done(d...
javascript
chosen
[ { "from": "system", "value": "Add jshint rules to bubble sort\n" }, { "from": "human", "value": "(function (root, factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n define([], function () {\n return (root.bubbleSort = factory());\n });\n } else if (typ...
javascript
chosen
[ { "from": "system", "value": "Use empty test driver for test that doesn't need Mocha\n" }, { "from": "human", "value": "var selftest = require('../tool-testing/selftest.js');\nvar Sandbox = selftest.Sandbox;\n\nselftest.define(\"'meteor test --port' accepts/rejects proper values\", function () {...
javascript
chosen
[ { "from": "system", "value": "Fix typo and style for GSBPM sub process details\n\n" }, { "from": "human", "value": "import React from 'react'\nimport { connectFromRoute } from '../routes'\nimport { sparqlConnect } from '../sparql/configure-sparql'\nimport { LOADED } from 'sparql-connect'\nimport...
javascript
chosen
[ { "from": "system", "value": "Update the messages route handlers.\n" }, { "from": "human", "value": "'use strict';\n\nvar MsgsModel = require('../models/msgs');\nvar easySession = require('easy-session');\n\nmodule.exports = function (router) {\n\n var model = new MsgsModel();\n\n router.g...
javascript
chosen
[ { "from": "system", "value": "Fix bug where id were not stored\n" }, { "from": "human", "value": "const low = require(\"lowdb\");\nconst userDb = low('./data/userdb.json');\nconst dataDb = low('./data/datadb.json');\nconst Requester = require('../controllers/requester');\nconst Parser = require(...
javascript
chosen
[ { "from": "system", "value": "Save peer id in socket ds.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n// vim: set ts=2 et:\n\nvar express = require('express'),\n app = express(),\n http = require('http').createServer(app),\n io = require('socket.io').listen(http),\n PeerSe...
javascript
chosen
[ { "from": "system", "value": "Replace the old Flipbox name by the new one\n" }, { "from": "human", "value": "tetra.view.register('card', {\n\tscope: 'card',\n\n\tconstr: function(me, app, _) {\n\t\t'use strict';\n\n\t\treturn {\n\t\t\tevents: {\n\t\t\t\tuser: {\n\t\t\t\t\t'click': {\n\t\t\t\t\t\...
javascript
chosen
[ { "from": "system", "value": "Use POST, also data for event trigger should use bracket.\n" }, { "from": "human", "value": "var Moebooru = {\n '__slug__': {}\n};\nvar Moe = jQuery(Moebooru);\n\nMoebooru.addData = function (data) {\n if (data.posts)\n Moe.trigger(\"post:add\", [data.posts]);\...
javascript
chosen
[ { "from": "system", "value": "Use an index instead of prev/next pointers\n" }, { "from": "human", "value": "import DS from 'ember-data';\n\nexport default DS.Model.extend({\n prev: DS.attr(),\n next: DS.attr(),\n elements: DS.hasMany('element')\n});\n" }, { "from": "gpt", "value":...
javascript
chosen
[ { "from": "system", "value": "Add ability to use specific directory opts\n" }, { "from": "human", "value": "'use strict'\n\nconst { mergeWith, reduce } = require('lodash')\nconst mergeProps = require('../util/merge-props')\n\nfunction createFlow (directories) {\n function flow (str) {\n retu...
javascript
chosen
[ { "from": "system", "value": "Change the wording of the text in the box on the /equality page.\n" }, { "from": "human", "value": "define([], function() {\n\n return [\"$timeout\", \"$rootScope\", \"api\", function($timeout, $rootScope, api) {\n\n return {\n scope: {\n ...
javascript
chosen
[ { "from": "system", "value": "Change working dir to converjons root dir.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nprocess.env.NODE_CONFIG_DIR = __dirname + '/config';\nif (!process.env.NODE_ENV) {\n process.env.NODE_ENV = 'development';\n}\n\nvar config = require('config');\n...
javascript
chosen
[ { "from": "system", "value": "Set canvas size to 1080p\n" }, { "from": "human", "value": "pandaConfig = {\n system: {\n webGL: true\n },\n storage: {\n id: 'com.innojam8.game'\n }\n};" }, { "from": "gpt", "value": "pandaConfig = {\n system: {\n web...
javascript
chosen
[ { "from": "system", "value": "Improve Inferno example. Thanks Scotty!\n" }, { "from": "human", "value": "import { render } from \"inferno\";\nimport { h as hyper } from \"inferno-hyperscript\";\nimport { setup } from \"../common\";\nimport { sv } from \"seview\";\n\nconst processAttrs = (attrs =...
javascript
chosen
[ { "from": "system", "value": "Set textarea value using 'value' prop\n" }, { "from": "human", "value": "import ClearButton from '../buttons/ClearButton'\nimport React, {PropTypes} from 'react'\nimport FormBuilderPropTypes from '../FormBuilderPropTypes'\nimport equals from 'shallow-equals'\nimport...
javascript
chosen
[ { "from": "system", "value": "Test port config definition for hapi-auth-hawk\n" }, { "from": "human", "value": "/**\n * Created by Omnius on 6/15/16.\n */\n'use strict';\n\nconst Boom = require('boom');\n\nexports.register = (server, options, next) => {\n\n server.auth.strategy('hawk-login-au...
javascript
chosen
[ { "from": "system", "value": "Make build separate src and test directories\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar path = require('path');\nvar runSequence = require('run-sequence');\nvar tslint = require('gulp-tslint');\nvar typescript = require('gulp-typescript');\n...
javascript
chosen
[ { "from": "system", "value": "Update jshint for new gulp api\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar react = require('gulp-react');\nvar jshint = require('gulp-jshint');\n\nvar jsFiles = [\n 'app/**/*.js',\n 'test/**/*.js',\n '*.js'\n];\n\ngulp.task('jshint', funct...
javascript
chosen
[ { "from": "system", "value": "Use console.error to log mocha errors.\n" }, { "from": "human", "value": "var exec = require('child_process').exec,\n\n gulp = require('gulp'),\n size = require('gulp-size'),\n concat = require('gulp-concat')\n\ngulp.task('build_tests', function() {\n retu...
javascript
chosen
[ { "from": "system", "value": "Add build task and remove unused processors\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n postcss = require('gulp-postcss'),\n importCss = require('gulp-import-css'),\n cssimport = require(\"gulp-cssimport\"),\n cssnext = require(\"gul...
javascript
chosen
[ { "from": "system", "value": "fix: Correct property name used with mLab\n" }, { "from": "human", "value": "const mongoClient = require('mongodb').MongoClient;\nconst env = require('./env');\n\nconst URI = env.MONGOLAB_URI || 'mongodb://localhost:27017/review-bot';\n\nmodule.exports = {\n\n conn...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"Revert \"Disable ads\"\"\"\n\nThis reverts commit 965d00519797bcfd136dcac69866b95517c35d46.\n\nbeetlejuice beetlejuice beetlejuice\n" }, { "from": "human", "value": "// This file is another configuration-type file. We need to reference `import`\n//...
javascript
chosen
[ { "from": "system", "value": "Use the ellipsis icon from FontAwesome instead of three dots\n" }, { "from": "human", "value": "$(function () {\n var mainMenu = document.getElementById('header-nav');\n\n $(mainMenu).bind('scroll', mainMenuDropShadow);\n $(window).bind('resize', function()...
javascript
chosen
[ { "from": "system", "value": "Add a draft of an ssh tunnel handling" }, { "from": "human", "value": "import { wait } from '../utils';\n\n\nexport async function listTables (server, databaseName, eventHandler) {\n eventHandler.onTunnelConnecting();\n await wait(1000);\n eventHandler.onTunnelCo...
javascript
chosen
[ { "from": "system", "value": "Switch order of login post-processing\n\nTo try to close re-submit window? See #4784\n" }, { "from": "human", "value": "'use strict';\n\napp.directive('loginForm', [\n '$route', 'modelService', 'routerService', '$timeout',\n function ($route, models, router, $tim...
javascript
chosen
[ { "from": "system", "value": "Use the basic mixin object directly\n" }, { "from": "human", "value": " /**\n @class\n <p>A basic filter score function, which mathces a filter and applies a\n weight.</p>\n\n @name ejs.FilterScoreFunction\n @ejs scorefunction\n @borrows ejs.Score...
javascript
chosen
[ { "from": "system", "value": "Cover some edge cases in utility funtions\n" }, { "from": "human", "value": "export function uuidv4() {\n return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>\n (c ^\n (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))\n ).toS...
javascript
chosen
[ { "from": "system", "value": "Use prefix parameter to set prefixPath\n" }, { "from": "human", "value": "const FaviconsWebpackPlugin = require('favicons-webpack-plugin');\n\nmodule.exports.onCreateWebpackConfig = ({ actions, stage, getConfig }, { logo, icons = {}, title, background }) => {\n if ...
javascript
chosen
[ { "from": "system", "value": "Use Meteor.wrapAsync instead of Fibers.\n" }, { "from": "human", "value": "// Get our NPM stuff.\nvar Future = Npm.require(\"fibers/future\");\nrequest = Npm.require(\"request\");\n\n// This is our main wrapping function, using Fibers.\nvar requestSync = function(ur...
javascript
chosen
[ { "from": "system", "value": "Remove unused task for css sprites\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n //grunt-svgmin\n grunt.config('svgmin', {\n dist: {\n files: [{\n expand: true,\n cwd: '<%= config.spri...
javascript
chosen
[ { "from": "system", "value": "Remove sortObjectKeys to fix comparison function is undefined\n" }, { "from": "human", "value": "import React from 'react'\nimport { Segment, Message } from 'semantic-ui-react'\nimport JSONTree from 'react-json-tree'\n\ntype Props = {\n loading: boolean,\n expande...
javascript
chosen
[ { "from": "system", "value": "Write a specific message to the queue\n" }, { "from": "human", "value": "async function activemq_service(args) {\n/*\ndescription(\"ActiveMQ Service\")\nbase_component_id(\"activemq_service\")\nload_once_from_file(true)\nonly_run_on_server(true)\n*/\n var promise...
javascript
chosen
[ { "from": "system", "value": "Call .toString() before console.logging buffers\n" }, { "from": "human", "value": "var assert = require('assert'),\n Lapidus = require('../index.js'),\n spawnSync = require('child_process').spawnSync,\n fs = require('fs');\n\ndescribe('MySQL', function () {...
javascript
chosen
[ { "from": "system", "value": "Fix bug when it crashes on non existent ids. Refactor\n" }, { "from": "human", "value": "\nset_readmore(\n document.getElementById('olga_readmore'),\n document.getElementById('olga_readmore_btn'),\n 'Leggi tutto', 'Meno'\n)\nset_readmore(\n document.getE...
javascript
chosen
[ { "from": "system", "value": "Update Saved Model to use validators\n" }, { "from": "human", "value": "import Base from './base';\n\nclass Save extends Base {\n constructor(props) {\n props._type = 'Save';\n super(props);\n\n var save = this;\n\n this.validators = {\n id: functi...
javascript
chosen
[ { "from": "system", "value": "Add a little arrow to selected item in toctree\n\n" }, { "from": "human", "value": "// We don't want the sidebar to include list of examples, that's just\n// much. This simple script tries to select those items and hide them.\n// \"aside\" selects sidebar elements, ...
javascript
chosen
[ { "from": "system", "value": "Update Karma Test Config to exclude sw.js\n" }, { "from": "human", "value": "// Polyfill fn.bind() for PhantomJS\n/* eslint-disable no-extend-native */\nFunction.prototype.bind = require('function-bind')\n\n// require all test files (files that ends with .spec.js)\n...
javascript
chosen
[ { "from": "system", "value": "Initialize the Joyride demo on the KitchenSink demo\n" }, { "from": "human", "value": "// Foundation JavaScript\n// Documentation can be found at: http://foundation.zurb.com/docs\n$(document).foundation();" }, { "from": "gpt", "value": "// Foundation Jav...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix issue with Space Before Colon\n" }, { "from": "human", "value": "'use strict';\n\nvar helpers = require('../helpers');\n\nmodule.exports = {\n 'name': 'space-before-colon',\n 'defaults': {\n 'include': false\n },\n 'detect': function (ast, parser) {...
javascript
chosen
[ { "from": "system", "value": "Extend is for objects, merge is for arrays.\n" }, { "from": "human", "value": "'use strict';\n\n/*****\n * Vain\n *\n * A view-first templating engine for Node.js.\n*****/\nvar jsdom = require('jsdom'),\n $ = require('jquery')(jsdom.jsdom().createWindow()),\n ...
javascript
chosen
[ { "from": "system", "value": "Fix linting error (import extension missing)\n" }, { "from": "human", "value": "import Map from '../../../src/ol/Map.js';\nimport View from '../../../src/ol/View.js';\nimport Static from '../../../src/ol/source/ImageStatic.js';\nimport {\n get as getProjection,\n ...
javascript
chosen
[ { "from": "system", "value": "Update for plug-in : MetMuseum\n" }, { "from": "human", "value": "var hoverZoomPlugins = hoverZoomPlugins || [];\nhoverZoomPlugins.push({\n name:'metmuseum.org',\n version:'0.1',\n prepareImgLinks:function (callback) {\n var res = []; \n \n ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Temp debugging for weird provider bug\"\n\nThis reverts commit 328ce1303977ea296157995b14298e084ac5f6f8.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar restify = require('restify');\nvar async = require('async');\nvar Anyfetch = require('anyfetch...
javascript
chosen
[ { "from": "system", "value": "Add logging for insert error\n" }, { "from": "human", "value": "'use strict';\n\nconst rethinkDB = require('rethinkdb');\nconst program = require('commander');\n\nconst log = require('./../server/log');\n\nexport class CoralUserGenerator {\n constructor (conn, numb...
javascript
chosen
[ { "from": "system", "value": "Add use strict to helper\n" }, { "from": "human", "value": "var searchForListByName = function(lists, name) {\n var ret;\n\n lists.forEach(function(list) {\n if (list.name === name) {\n ret = list;\n }\n });\n return ret;\n};\n\n...
javascript
chosen
[ { "from": "system", "value": "Apply golUtil.getMatrixDimension() to verify params.matrix and get its dimension in Constructor\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nfunction GameOfLife(params) {\n params = params || {};\n if (Object.keys(params).length == 0) {\n pa...
javascript
chosen
[ { "from": "system", "value": "Return all collections when db is supplied\n" }, { "from": "human", "value": "var exec = require('child_process').execSync;\nvar iter = require('super-iter');\n\nvar comongo = require('co-mongo');\n\nvar findIndex = iter.findIndex;\n\nmodule.exports = function* mong...
javascript
chosen
[ { "from": "system", "value": "Add animation options for delay and duration\n" }, { "from": "human", "value": "/*globals document*/\n'use strict';\n\nvar animationEndEvent = (function () {\n var el = document.createElement('div');\n var animations = {\n 'animation' : 'animationend',\n ...
javascript
chosen