conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add extra check to ensure child is an actual React component\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport Box from '../box';\nimport cx from 'classnames';\nimport theme from './theme.cs...
javascript
chosen
[ { "from": "system", "value": "Tweak CesiumViewer build to avoid some warnings.\n" }, { "from": "human", "value": "var profile = {\n basePath : '../..',\n baseUrl : '.',\n releaseDir : './Build/Apps/CesiumViewer',\n action : 'release',\n cssOptimize : 'comments',\n mini : true,\...
javascript
chosen
[ { "from": "system", "value": "Watch for build configuration changes\n" }, { "from": "human", "value": "module.exports = {\n debug: {\n files: ['app/scripts/**/*', 'app/styles/**/*'],\n tasks: ['build:debug']\n },\n rails: {\n files: ['config/**/*.rb', 'lib/**/*.rb', 'Gemfile.lock'],\...
javascript
chosen
[ { "from": "system", "value": "Attach helpers to instead of\n" }, { "from": "human", "value": "'use strict';\n\nvar evalInScope = require('./helpers/eval-in-scope');\n\n/*eslint-disable*/\n\nfunction evalBEST(source, builder) {\n evalInScope(source, { component: builder });\n}\n\nfunction eva...
javascript
chosen
[ { "from": "system", "value": "Refactor to follow style guidelines\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport TooltipEnabled from '../mixins/sl-tooltip-enabled';\n\n/**\n * @module components\n * @class sl-tooltip\n */\nexport default Ember.Component.extend( TooltipEna...
javascript
chosen
[ { "from": "system", "value": "Use QuerySelectorAll to find links\n\nFaster, and avoid <A> that lack hrefs." }, { "from": "human", "value": "// Entire frame is insecure?\nif ((document.location.protocol == \"http:\") ||\n (document.location.protocol == \"ftp:\")) \n{\n document.body.style.b...
javascript
chosen
[ { "from": "system", "value": "Add lookup service tests for ip to mac\n" }, { "from": "human", "value": "// Copyright 2014, Renasar Technologies Inc.\n/* jshint node:true */\n\n'use strict';\n\ndescribe(__filename, function () {\n it('needs specs');\n});" }, { "from": "gpt", "value...
javascript
chosen
[ { "from": "system", "value": "Use addEventListener instead of onload\n" }, { "from": "human", "value": "(function() {\n // wait for polyfill to be loaded\n if (document.readyState == \"complete\") {\n init();\n } else {\n window.onload = init;\n }\n\n var loggedIn = false;\n\n functi...
javascript
chosen
[ { "from": "system", "value": "Reduce precision for fade out\n" }, { "from": "human", "value": "(function( $ ) {\n\tfunction setHeaderHeight() {\n\t\t$( '#screen-fill' ).css( 'height', $( window ).height() - 50 );\n\t}\n\n\t$( document ).ready( setHeaderHeight );\n\t$( window ).resize( setHeaderH...
javascript
chosen
[ { "from": "system", "value": "Add tissue and boneMarrow objects to tutorial state\n" }, { "from": "human", "value": "import Phaser from 'phaser-ce';\nimport { tissueColor, bacteriaColor } from './constants';\n\nexport default class TutorialState extends Phaser.State {\n\n bacteria = null;\n\n...
javascript
chosen
[ { "from": "system", "value": "Add missing copyright and license header\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar through = require('through2');\nvar consolify = require('consolify');\n\n\nmodule.exports = function (b, opts) {\n consolify(b, {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix for new version of marky-markdown\n" }, { "from": "human", "value": "module.exports.compile = compile\n\nvar hb = require('handlebars')\nvar marky = require('marky-markdown')\nvar fs = require('fs')\n\nfunction compile (page, partials) {\n var markybars = hb.cr...
javascript
chosen
[ { "from": "system", "value": "fix(ExampleBuilder): Fix example runner to support __BASE_PATH__ and serve the full vtk-js repo\n" }, { "from": "human", "value": "module.exports = function buildConfig(name, relPath, destPath, root) {\n return `\nvar loaders = require('../config/webpack.loaders.js...
javascript
chosen
[ { "from": "system", "value": ":construction: Add self-executing anonymous function to put it all in.\n" }, { "from": "human", "value": "/* Diaeresis.js | Copyright (C) 2016 Curiositry (http://curiositry.com) | MIT Licensed */\n" }, { "from": "gpt", "value": "/* Diaeresis.js | Copyrig...
javascript
chosen
[ { "from": "system", "value": "Stop showing atomic block in \"All\" example\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport DraftailEditor, { BLOCK_TYPE, INLINE_STYLE } from '../lib';\n\nimport allContentState from './utils/allContentStat...
javascript
chosen
[ { "from": "system", "value": "Use token and not data\n" }, { "from": "human", "value": "//////////////////////////////////////\n// User buys one ticket for himself //\n//////////////////////////////////////\n\n'use strict';\n\nvar Promise = require('bluebird');\n\nmodule.exports = function (db, ...
javascript
chosen
[ { "from": "system", "value": "[BUGFIX] Revert 60f69b3 as the var based syntax isn't working with the r.js optimizer\n" }, { "from": "human", "value": "/**\n * RequireJS configuration\n * @description Pass in options for RequireJS like paths, shims or the baseUrl\n */\nrequire.config({\n\tpaths: ...
javascript
chosen
[ { "from": "system", "value": "Bring back ALL THE ASSETS!\n" }, { "from": "human", "value": "//= require vendor\n//= require app\n//= require_tree ./lib\n//= require_tree ./app/controllers\n//= require_tree ./app/helpers\n//= require_tree ./app/models\n//= require sponsors\n//= require_tree ./spo...
javascript
chosen
[ { "from": "system", "value": "Fix off-canvas menu with Turbolinks\n\nSolution from Gian Marco Prazzoli's post in\nhttp://foundation.zurb.com/forum/posts/2348-foundation-5-topbar-menu-not-responding-on-rails4\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into a...
javascript
chosen
[ { "from": "system", "value": "Set currentUser to req.user before redirecting after login\n" }, { "from": "human", "value": "const express = require('express'),\n router = express.Router(),\n passport = require('passport'),\n User = require('../models/user');\n\nrouter.get('/', fun...
javascript
chosen
[ { "from": "system", "value": "Make sure lookup list isn't modified\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport SelectValues from 'hospitalrun/utils/select-values';\nexport default Ember.Component.extend({\n name: 'select-or-typeahead',\n className: null,\n hint: true...
javascript
chosen
[ { "from": "system", "value": "Add unix (sh -c) and win32 (cmd /c) to command head\n" }, { "from": "human", "value": "var spawn = require('child_process').spawn;\nvar dotenv = require('./dot-env');\nvar objectAssign = require('object-assign');\n\nmodule.exports = function exec(script) {\n\n\t// G...
javascript
chosen
[ { "from": "system", "value": "Use descriptor to override emit method\n" }, { "from": "human", "value": "'use strict';\n\nvar value = require('es5-ext/lib/Object/valid-value')\n , emit = require('./core').methods.emit;\n\nmodule.exports = function (emitter1, emitter2) {\n\tvalue(emitter1) && va...
javascript
chosen
[ { "from": "system", "value": "Use mz/fs instad of thenify\n" }, { "from": "human", "value": "var thenify = require('thenify')\nvar fs = require('fs')\nvar writeFile = thenify(fs.writeFile)\n\nmodule.exports = function save (pkg, installedPackages, saveType, useExactVersion) {\n var packageJson ...
javascript
chosen
[ { "from": "system", "value": "Bring back dependency for web-security services to MDS schema browser\n\nChange-Id: I71f289f9201bfad22d67e7d77d6b7065b53436a3\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n var mds = angular.module('mds', [ 'motech-dashboard', 'mds.servi...
javascript
chosen
[ { "from": "system", "value": "Use an empty write instead of drain event. Closes gh-5, gh-4.\n" }, { "from": "human", "value": "/*\n * exit\n * https://github.com/cowboy/node-exit\n *\n * Copyright (c) 2013 \"Cowboy\" Ben Alman\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nmodule.e...
javascript
chosen
[ { "from": "system", "value": "Add checkIsObject in set data()\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nimport Realm from 'realm';\n\n/**\n * A Report.\n *\n * @property {string} id\n * @property {string} ty...
javascript
chosen
[ { "from": "system", "value": "Add redirecting to sing in page if user not authorizated'\n" }, { "from": "human", "value": "'use strict';\n\n\nangular.module('core').controller('HomeController', ['$scope', '$http', 'Authentication', 'Users',\n\tfunction($scope, $http, Authentication, Users) {\n\t...
javascript
chosen
[ { "from": "system", "value": "Remove unused callback params from create() destroy()" }, { "from": "human", "value": ";(function(exports) {\n function Entities(coquette, game) {\n this.c = coquette;\n this.game = game;\n this._entities = [];\n };\n\n Entities.prototype = {\n update...
javascript
chosen
[ { "from": "system", "value": "Add YUI Doc tags to documentation blocks.\n" }, { "from": "human", "value": "/*!\n * YUI Mocha\n * Copyright 2011 Yahoo! Inc.\n * Licensed under the BSD license.\n */\n\n/**\n * File extension to MIME type map.\n *\n * Used by `serve.js` when streaming files from di...
javascript
chosen
[ { "from": "system", "value": "Use full-size image instead of the default one.\n" }, { "from": "human", "value": "var hoverZoomPlugins = hoverZoomPlugins || [];\nhoverZoomPlugins.push({\n name:'Instagram',\n prepareImgLinks:function (callback) {\n $('body').on('mouseenter', 'a[href*=...
javascript
chosen
[ { "from": "system", "value": "Add promisify function to reduce redundancy\n" }, { "from": "human", "value": "'use strict'\n\nconst childProcess = require('child_process')\nconst fs = require('fs')\n\nfunction exec (command, options) {\n return new Promise(function (resolve, reject) {\n child...
javascript
chosen
[ { "from": "system", "value": "Refactor and add function to determine color\n" }, { "from": "human", "value": "console.log(\"Hello Robot Kata!\");\n\nvar floorContext = document.getElementById('floor').getContext('2d');\nvar floorImage = new Image();\nvar floorOffset = $('#floor').offset();\n\nfl...
javascript
chosen
[ { "from": "system", "value": "Enable debug mode for JS config example" }, { "from": "human", "value": "// Configure client\nOpbeat.config({\n orgId: 'b3eba3d11f6e4c3a9db52f477caa4fa2',\n appId: 'e9797db8c7',\n token: '6451721d51b6d95cf6c6b09498feafd865f1f976'\n}).install()\n\n// Set optional ...
javascript
chosen
[ { "from": "system", "value": "Update reducer properties, allow `piece` key.\n\n* the `piece` is the target promote or not.\n" }, { "from": "human", "value": "import * as CONST from '../constants/actionTypes';\n\nconst initialState = { open: false };\n\nexport default function promoteModal(state ...
javascript
chosen
[ { "from": "system", "value": "Store the correct payment method\n" }, { "from": "human", "value": "(function() {\n\n /***********************************************************/\n /* Handle Proceed to Payment\n /***********************************************************/\n jQuery(fu...
javascript
chosen
[ { "from": "system", "value": "Use Date type for history on server side\n" }, { "from": "human", "value": "module.exports = {\n user: {\n type: 'document',\n schema: {\n attributes: {\n name: String\n }\n },\n user: true\n },\n\n ...
javascript
chosen
[ { "from": "system", "value": "Load '.env' files under docker\n" }, { "from": "human", "value": "if (!process.env.NODE_ENV) {\n process.env.NODE_ENV = 'development';\n}\n\nif (process.env.NODE_ENV === 'development') {\n const dotenv = require('dotenv');\n dotenv.config(); // this loads .env wi...
javascript
chosen
[ { "from": "system", "value": "Attach main function directly to exports, linting\n" }, { "from": "human", "value": "/*\n * gulp-hub\n * https://github.com/frankwallis/gulp-hub\n *\n * Copyright (c) 2014 Frank Wallis\n * Licensed under the MIT license.\n */\nvar gulp = require('gulp');\nvar path =...
javascript
chosen
[ { "from": "system", "value": ":art: Add return type to consumer method\n" }, { "from": "human", "value": "'use babel'\n\n/* @flow */\n\nimport {Disposable} from 'atom'\nimport {Main} from './main'\nimport type {Provider} from './types'\n\nmodule.exports = {\n config: {\n\n },\n activate() {\n...
javascript
chosen
[ { "from": "system", "value": "Make fakeNullFiber look a little less fake.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar fakeNullFiber = Object.create(null);\nvar localKey = \"_optimism_local\";\n\nfunction getCurrentFiber() {\n return fakeNullFiber;\n}\n\ntry {\n var fiberPath = re...
javascript
chosen
[ { "from": "system", "value": "Use of already installed file-loader :)\n... we can use import also for \"special webpack imports\"\n" }, { "from": "human", "value": "require('../css/main.scss');\n\nimport grindy from \"./grindy.js\"\n\n(function() {\n\n let game = grindy();\n game.start();\n\n}...
javascript
chosen
[ { "from": "system", "value": "Fix linter issue with test describe path" }, { "from": "human", "value": "describe('test-harness', function() {\n\n describe('globals', function() {\n\n it('should expose should as a global', function() {\n should.exist(should);\n });\n\n it('should e...
javascript
chosen
[ { "from": "system", "value": "Fix module for NodeJS - apped_dir_name\n" }, { "from": "human", "value": "var fs = require('fs');\nvar vm = require('vm');\nvar includeInThisContext = function(path) {\n var code = fs.readFileSync(path);\n vm.runInThisContext(code, path);\n}.bind(this);\ninclu...
javascript
chosen
[ { "from": "system", "value": "[DDW-212] Fix missing application menu on Windows build\n" }, { "from": "human", "value": "export const winLinuxMenu = (app, window, openAbout) => (\n [{\n label: 'Daedalus',\n submenu: [{\n label: 'About',\n click() {\n openAbout();\n }...
javascript
chosen
[ { "from": "system", "value": "Improve floating button item label styles\n" }, { "from": "human", "value": "'use strict'\n\nimport React, { Component } from 'react'\nimport ReactCSS from 'reactcss'\n\nimport colors from '../../styles/variables/colors'\nimport { spacing, sizing } from '../../style...
javascript
chosen
[ { "from": "system", "value": "Change switch statement to dynamic\n" }, { "from": "human", "value": "import React from 'react';\n\nconst requirementsObj = {\n list_symbol: \"◇\",\n username: [\"start with letter\", \"be between 3-10 characters\", \"contain only [a-zA-Z] characters\"],\n ['e-ma...
javascript
chosen
[ { "from": "system", "value": "Add operation parameter to recalls route\n\nInstead of having the operation parameter in the query string it\noptimizes for Restangular to have it as an action on the route.\n" }, { "from": "human", "value": "'use strict';\nvar _ = require('lodash'),\n Promise = ...
javascript
chosen
[ { "from": "system", "value": "Add adminKey, will be for early access to dz2\n\nCan be turned on with `launchctl setenv KEYBASE_FEATURES admin`\n" }, { "from": "human", "value": "/* @flow */\n\nimport getenv from 'getenv'\n\n// To enable a feature, include it in the environment variable KEYBASE_F...
javascript
chosen
[ { "from": "system", "value": "Add test for regular function loopers" }, { "from": "human", "value": "import Ember from 'ember';\nimport { csp, channel, looper } from 'ember-processes';\n\nmodule('Unit: Loopers');\n\ntest('loopers take a channel name', function(assert) {\n QUnit.stop();\n asser...
javascript
chosen
[ { "from": "system", "value": "Add parameter setting toaster's duration\n" }, { "from": "human", "value": "(function () {\n\t'use strict';\n\t\n\tangular\n\t\t.module('PLMApp')\n\t\t.factory('toasterUtils', toasterUtils);\n\t\n\ttoasterUtils.$inject = ['toaster', '$timeout'];\n\t\n\tfunction toas...
javascript
chosen
[ { "from": "system", "value": "Make isListed / isUnlisted query more specific\n\nAddress issue #141.\n" }, { "from": "human", "value": "'use strict'\n/**\n * @module registry\n */\n\nmodule.exports.isListed = isListed\nmodule.exports.isUnlisted = isUnlisted\n\nvar vocab = require('solid-namespace...
javascript
chosen
[ { "from": "system", "value": "Use MONGODB_URL from env variable if provided\n" }, { "from": "human", "value": "// default app configuration\nvar defaultConfig = {\n port: process.env.PORT || 4000,\n db: \"mongodb://nodegoat:owasp@widmore.mongohq.com:10000/nodegoat\",\n cookieSecret: \"s...
javascript
chosen
[ { "from": "system", "value": "[FIX] Make Visit Site link in the navbar open a new window\n" }, { "from": "human", "value": "import React from 'react';\nimport { Link } from 'react-router-dom';\n\n\nconst linkStyle = 'pt-button pt-minimal';\n\nclass MainNavigation extends React.Component {\n\n\tr...
javascript
chosen
[ { "from": "system", "value": "Add comment to simple done app example about toast\n" }, { "from": "human", "value": "// Simple \"Done\" application\n\nlet doneItems = []\nlet text\n\nfunction input(event) {\n text = event.target.value\n}\n\nfunction done(event) {\n doneItems.push(text)\n ...
javascript
chosen
[ { "from": "system", "value": "Edit Chinese translation of example\n" }, { "from": "human", "value": "/*\r\n * @name Copy() method\r\n * @frame 600,400\r\n * @description 一个如何使用copy()方法模拟为图像着色的示例。\r\n */\r\nlet draft, ready;\r\nfunction preload() {\r\n ready = loadImage(\"assets/parrot-color.png...
javascript
chosen
[ { "from": "system", "value": "Prepend / to AlwaysProcessHandler log output\n" }, { "from": "human", "value": "\"use strict\";\n\nconst Handler = require('../../router/handler');\n\nclass AlwaysProcessHandler extends Handler {\n init(context) {\n console.log(this.constructor.id, context.reque...
javascript
chosen
[ { "from": "system", "value": "Revert back to nodes assert module\n" }, { "from": "human", "value": "/*global module, require, process */\n\n(function () {\n 'use strict';\n\n var required = {\n util: require('./util'),\n\n testsUtil: require('./testsUtil'),\n\n assert:...
javascript
chosen
[ { "from": "system", "value": "Add user authentication to route\n" }, { "from": "human", "value": "import express from 'express';\n\nimport * as userController from '../../controllers/recipes.js';\n\nconst user = express.Router();\n\n// define route controllers for creating sign up, login and sig...
javascript
chosen
[ { "from": "system", "value": "Add some files that are needed for mutation testing\n" }, { "from": "human", "value": "module.exports = function(config) {\n config.set({\n coverageAnalysis: 'off',\n logLevel: 'info',\n mutate: [\n 'src/**/*.ts?',\n '!src/**/__tests__/*.ts?'\n ...
javascript
chosen
[ { "from": "system", "value": "Return the event object when you call on, once or off\n\n" }, { "from": "human", "value": " function Events()\n {\n var listeners = {}\n\n $.extend(this, {\n on: function(type, cb)\n {\n if (!$.isArray(listeners[type]))\n listeners[...
javascript
chosen
[ { "from": "system", "value": "Fix the bug of **Tried to load angular more than once.**.\n" }, { "from": "human", "value": "angular.module('specialBlogApp', [\n 'ngRoute',\n 'ngResource'\n])\n .config(function ($routeProvider, $locationProvider) {\n $routeProvider\n .when('/', {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove trailing single quote typo in favicon URL\n" }, { "from": "human", "value": "import React from 'react';\nimport Head from 'next/head';\nimport { color } from 'lib/variables';\n\n/**\n * Adds the Lagoon icon as the favicon for the website.\n */\nconst Favicon ...
javascript
chosen
[ { "from": "system", "value": "Add callback function.\nUse Strict.\nnoConflict support\n" }, { "from": "human", "value": "/**\n * Utility function for triggering animate.css animations\n */\n$.fn.animateOnce = function( className ) {\n\tvar animEndEvent = 'webkitAnimationEnd mozAnimationEnd MSAni...
javascript
chosen
[ { "from": "system", "value": "Create or recreate sequence counters for Monogo database objects\n" }, { "from": "human", "value": "db.counters.insert(\n {\n _id: \"cemetery\",\n seq: 0,\n }\n)\n\ndb.counters.insert(\n { ...
javascript
chosen
[ { "from": "system", "value": "Fix double JS on first page load" }, { "from": "human", "value": "//= require modernizr-2.8.3.custom\n//= require turbolinks\n//= require local_time\n\n//= require init\n//= require pages\n\ndocument.addEventListener(\"turbolinks:load\", atthemovies.init());\n\nif (...
javascript
chosen
[ { "from": "system", "value": "Remove newrelic from the project.\n" }, { "from": "human", "value": "'use strict';\n\nrequire('newrelic');\nconst common = require('../common/common');\nconst db = require('./db');\nconst logger = require('./logger');\nconst httpServer = require('./staticHttpServer'...
javascript
chosen
[ { "from": "system", "value": "Add trigger to navigate() calls\n" }, { "from": "human", "value": "define(['jquery', 'underscore', 'backbone', 'views'], \nfunction($ , _ , Backbone , View ) {\n var AppRouter = Backbone.Router.extend({\n routes: {\n '': 'showH...
javascript
chosen
[ { "from": "system", "value": "Add function for adding domains\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(app) {\n\tapp.controller('dataController',\n\t\t[ '$scope', 'HttpService', '$http', '$cookies',\n\t\tfunction($scope, HttpService, $http, $cookies) {\n\n\t\...
javascript
chosen
[ { "from": "system", "value": "Add temporary console.log for debugging.\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n var worker = null,\n $output = null;\n\n $output = $('#worker-output');\n\n /**\n worker = new Worker('/js/example-worker.js');\n\n ...
javascript
chosen
[ { "from": "system", "value": "Replace Boom variable in createUser()\n" }, { "from": "human", "value": "'use strict';\n\nconst Boom = require('boom');\n\nconst Errors = require('../lib/errors');\nconst Formatters = require('../lib/formatters');\n\nconst EXISTING_USER = Boom.conflict('User already...
javascript
chosen
[ { "from": "system", "value": "Make ConfigUtil runnable in both processes.\n" }, { "from": "human", "value": "'use strict';\n\nconst {app} = require('electron').remote;\nconst JsonDB = require('node-json-db');\n\nlet instance = null;\n\nclass ConfigUtil {\n\tconstructor() {\n\t\tif (instance) {\n...
javascript
chosen
[ { "from": "system", "value": "Update the EventService to use the local server. The event response is now an array\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc service\n * @name barteguidenMarkedsWebApp.eventService\n * @description\n * # eventService\n * Factory in the bart...
javascript
chosen
[ { "from": "system", "value": "Apply oneworld-fix patch before testing connectivity\n\nSummary:\nMaking the runner apply the necessary oneworld fix patch before running the tests.\n\nThis can't be a long term solution, but at least means not getting that breaking change landed doesn't stop our tests from run...
javascript
chosen
[ { "from": "system", "value": "[minor] Make sure we're listing to the right event\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Minimum viable WebSocket server for Node.js that works through the primus\n * interface.\n *\n * @runat server\n * @api private\n */\nmodule.exports = func...
javascript
chosen
[ { "from": "system", "value": "Edit filename for ExtractTextPlugin. Added HtmlWebpackPlugin, CleanWebpackPlugin\n" }, { "from": "human", "value": "// webpack.plugins.js\n\n\"use strict\";\n\nconst ExtractTextPlugin = require(\"extract-text-webpack-plugin\");\nconst UglifyJsWebpackPlugin = require...
javascript
chosen
[ { "from": "system", "value": "Add ability to return all regions\n\nThis walks the region’s directory and returns a Region instance for each .mca file in that directory.\n" }, { "from": "human", "value": "let path = require('path'),\n utils = require('./utils'),\n Region = require('./Region...
javascript
chosen
[ { "from": "system", "value": "Add tree to fix formio-util dependency.\n" }, { "from": "human", "value": "var fs = require('fs');\nmodule.exports = function (app) {\n\n app.config([\n 'formioComponentsProvider',\n function(formioComponentsProvider) {\n formioComponentsProvider.registe...
javascript
chosen
[ { "from": "system", "value": "Add site footer to each documentation generator\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar cssstats = require('cssstats')\n\nvar module = require('tac...
javascript
chosen
[ { "from": "system", "value": "Remove unused noble emitter code\n" }, { "from": "human", "value": "var EventEmitter = require('events').EventEmitter;\n\nvar hardware = module.exports = new EventEmitter();\n//var e = nobleEmitter.connect(peripheralUuid, serviceUuid, characteristicUuid);\n\nvar e =...
javascript
chosen
[ { "from": "system", "value": "Add `version` field in exports" }, { "from": "human", "value": "'use strict';\n\nconst Engine = require('./Engine');\nconst PublicSelect = require('./public/PublicSelect');\nconst PublicApiOptions = require('./PublicApiOptions');\nconst Explainer = require('./Explai...
javascript
chosen
[ { "from": "system", "value": "Return error if the method is not GET." }, { "from": "human", "value": "/**\n * Based on specs at: http://wiki.theory.org/BitTorrent_Tracker_Protocol\n */\n\nfunction announceHandler(req, res) {\n console.log(req);\n res.end('stub');\n}\n\nfunction register(server...
javascript
chosen
[ { "from": "system", "value": "Remove spaces from credit card\n" }, { "from": "human", "value": "const { GraphQLScalarType } = require('graphql')\nconst cc = require('credit-card')\n\nfunction parse (value) {\n const {\n card,\n validCardNumber,\n validCvv: validCVV,\n validExpiryMon...
javascript
chosen
[ { "from": "system", "value": "Add a gaurd clause for IE8 compatibility in subview rendering\n" }, { "from": "human", "value": "NailPolish.SubviewManager = {\n renderEach: function (subviews) {\n this._subviews = subviews;\n _.each(subviews, function (view) {\n view.parent = view.pare...
javascript
chosen
[ { "from": "system", "value": "Use base util is-nan to check for NaN value\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar powm1 = require( '@stdlib/math/base/special/powm1' );\nvar zeta = require( '@stdlib/math/base/special/riemann-zeta' );\nvar LN2 = require( '@stdlib/m...
javascript
chosen
[ { "from": "system", "value": "Rename export class for app generator\n" }, { "from": "human", "value": "import { Base } from 'yeoman-generator';\nimport generatorArguments from './arguments';\nimport generatorOptions from './options';\nimport generatorSteps from './steps';\n\nexport default class...
javascript
chosen
[ { "from": "system", "value": "Prepare for making it a kata.\n" }, { "from": "human", "value": "// 1: assertThat\n// To do: make all tests pass, leave the assert lines unchanged!\n\nimport {\n assertThat, equalTo,\n containsString, throws, returns,\n} from 'hamjest';\n\ndescribe('The core funct...
javascript
chosen
[ { "from": "system", "value": "Make the clock on the frontpage work.\n" }, { "from": "human", "value": "// Place your application-specific JavaScript functions and classes here\n// This file is automatically included by javascript_include_tag :defaults\n" }, { "from": "gpt", "value": ...
javascript
chosen
[ { "from": "system", "value": "Fix install issue with ember install ember-websockets\n" }, { "from": "human", "value": "module.exports = {\n normalizeEntityName: function() {},\n\n afterInstall: function() {\n return this.addBowerPackageToProject('uri.js');\n }\n};\n" }, { "from": "...
javascript
chosen
[ { "from": "system", "value": "Edit tags in edit form input\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\n\nclass EditActivityForm extends Component {\n componentDidMount() {\n this.description.focus();\n }\n\n updateActivity(e) {\n e.preventDef...
javascript
chosen
[ { "from": "system", "value": "Allow passing arguments to dynamic placeholders\n\n" }, { "from": "human", "value": "import { Action } from './../lib/Action';\nimport { Util } from '@aegis-framework/artemis';\n\nexport class Placeholder extends Action {\n\n\tstatic matchString ([ action ]) {\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Use JVM languages for carousel\n" }, { "from": "human", "value": "/*global document, Reveal, carousel*/\n(function(document, Reveal, carousel){\n 'use strict';\n\n Reveal.addEventListener('carousel', function(){\n var container = document.getElementById...
javascript
chosen
[ { "from": "system", "value": "Unify cases of create and no create\n" }, { "from": "human", "value": "import { select, local } from \"d3-selection\";\n\nvar componentLocal = local(),\n noop = function (){};\n\nexport default function (tagName, className){\n var create,\n render = noop,\n...
javascript
chosen
[ { "from": "system", "value": "Return an error in ChannelRequest library\n" }, { "from": "human", "value": "var ChannelRequest, Promise, refreshProviderObject, stopLongPolling, timeoutID;\n\nPromise = require('bluebird');\n\nrefreshProviderObject = null;\n\nChannelRequest = (function() {\n\n fun...
javascript
chosen
[ { "from": "system", "value": "BAP-10897: Fix issues found on demo\n" }, { "from": "human", "value": "define(function(require) {\n 'use strict';\n\n var AccessLevelsCollection;\n var _ = require('underscore');\n var RoutingCollection = require('oroui/js/app/models/base/routing-collect...
javascript
chosen
[ { "from": "system", "value": "Add an arrow next to what shard the bot is on\n" }, { "from": "human", "value": "const client = require('./../../');\n\nmodule.exports.info = {\n\taliases: [\n\t\t'ping',\n\t\t'pong'\n\t]\n};\n\nmodule.exports.command = message =>\n\tmessage.channel.createMessage(`\...
javascript
chosen
[ { "from": "system", "value": "Fix warnings with wrong PropTypes\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport SVG from 'svg-inline-react'\n\nconst Resource = ({ icon, value }) =>\n <li>\n <SVG src={icon}/>\n <span>{value}</span>\n </li>\n\nResource.p...
javascript
chosen
[ { "from": "system", "value": "fix(browser): Fix proptypes error when rendering too soon after corpus is selected\n" }, { "from": "human", "value": "import React from 'react'\nimport ErrorMessage from './ErrorMessage'\nimport Header from './Header'\nimport BrowserStack from './BrowserStack'\nimpo...
javascript
chosen
[ { "from": "system", "value": "Fix TOC anchor tags bug\n" }, { "from": "human", "value": "var directives = {\n TOC: function(text) {\n var toc = require('markdown-toc');\n return toc(text).content;\n }\n};\n\nmodule.exports = {\n directiveMap: directives\n};\n" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Remove excessive Encoder calls in HMAC -- 'ready' should already have been applied.\n" }, { "from": "human", "value": "// HMAC - keyed-Hash Message Authentication Code\nfunction hmac(hash, size, digest, data, hkey, block) {\n var i, akey, ipad, opad;\n \n data = ...
javascript
chosen