conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix casing in some tests\n" }, { "from": "human", "value": "import Items from './stores/Items'\nimport Lists from './stores/Lists'\nimport Microcosm from '../../../src/Microcosm'\n\nclass Todos extends Microcosm {\n\n constructor() {\n super()\n\n // ...
javascript
chosen
[ { "from": "system", "value": "Introduce a library of the xtend.\n" }, { "from": "human", "value": "import Promise from 'bluebird'\nimport extend from 'xtend'\nimport * as gitlabClient from './gitlabClient'\n\n// MRのユーザを表示します。\nmodule.exports = function(objectKind, body) {\n if (objectKind === '...
javascript
chosen
[ { "from": "system", "value": "Remove too detailed logging, clean up \"take pushes\" stream\n" }, { "from": "human", "value": "import Bacon from 'baconjs'\nimport colors from 'colors'\n\nlet debug = require('debug')('tutum-tagger')\n\nexport default function takeNewBranchPushes(pushPayload) {\n ...
javascript
chosen
[ { "from": "system", "value": "Update user model with pw functions and crypto shit\n\n" }, { "from": "human", "value": "import mongoose from 'mongoose';\n\nconst { Schema } = mongoose;\n\nexport const UserSchema = new Schema({\n created: { type: Date, default: Date.now },\n displayName: String,...
javascript
chosen
[ { "from": "system", "value": "Use `rules` instead of `loaders`\n\nhttps://webpack.js.org/guides/migrating/\n" }, { "from": "human", "value": "const nodeExternals = require('webpack-node-externals');\nconst Dotenv = require('dotenv-webpack');\n\nmodule.exports = {\n entry: [\n 'babel-polyfill...
javascript
chosen
[ { "from": "system", "value": "Remove window refernece in UMD build\n" }, { "from": "human", "value": "var webpack = require(\"webpack\");\nvar libraryName = require(\"./package.json\").name;\nvar withLocalesSuffix = \"-i18n\";\n\nconst UglifyJsPlugin = require('uglifyjs-webpack-plugin');\n\nmodu...
javascript
chosen
[ { "from": "system", "value": "Use public folder for generated js\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar path = require('path');\n\nvar BUILD_DIR = path.resolve(__dirname, 'views/js');\nvar APP_DIR = path.resolve(__dirname, 'jsx');\n\nvar config = {\n entry: ...
javascript
chosen
[ { "from": "system", "value": "Update announcing to have proper cross-browser sizing\n" }, { "from": "human", "value": "import Button from 'rebass/dist/Button';\nimport { Shutdown } from './Emoji';\n\nexport default class Announcing extends React.Component {\n shutdown(activate) {\n ws....
javascript
chosen
[ { "from": "system", "value": "Handle async with DONE. Don't add DONE to other actions.\n" }, { "from": "human", "value": "\"use strict\";\n\nimport _ from \"lodash\";\n\nconst done = \"_DONE\";\n\nconst actionTypes = [\n\n // MESSAGES \n \"ADD_MESSAGE\",\n \"REMOVE_MESSAGE\",\n \"CLEAR_MESS...
javascript
chosen
[ { "from": "system", "value": "Sort choices by ID. Send choice ID to view.\n" }, { "from": "human", "value": "var uuidV4 = require('uuid/v4');\nvar models = require('../models');\nvar express = require('express');\nvar router = express.Router();\n\n/* GET home page. */\nrouter.get('/', function(r...
javascript
chosen
[ { "from": "system", "value": "Whitelist `assert` global for tests\n" }, { "from": "human", "value": "// For reference: https://github.com/airbnb/javascript\n\nmodule.exports = {\n env: {\n mocha: true,\n browser: true,\n },\n\n parserOptions: {\n sourceType: 'script',\n },\n\n rule...
javascript
chosen
[ { "from": "system", "value": "Fix gulp script (run metascript after clean).\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar metascriptPipe = require('gulp-metascript');\nvar headerPipe = require('gulp-header');\nvar chmod = require('gulp-chmod');\nvar clean = require('gulp-c...
javascript
chosen
[ { "from": "system", "value": "Implement basic Twitch Plays Pokemon for chat\n" }, { "from": "human", "value": "// Do NOT include this line if you are using the browser version.\nvar irc = require(\"tmi.js\");\n\nvar options = {\n options: {\n debug: true\n },\n connection: {\n ...
javascript
chosen
[ { "from": "system", "value": "Throw error when errorCallback isn't defined\n" }, { "from": "human", "value": "var request = require('request');\n\nvar wmataReq = request.defaults({\n baseUrl: 'https://api.wmata.com',\n qs: { api_key: process.env.WMATA_API_KEY }\n});\n\nexports.get = function (...
javascript
chosen
[ { "from": "system", "value": "Fix async actions for feedback form\n\nBroken after eslint changes due to an improper binding of `this`\n" }, { "from": "human", "value": "import Reflux from 'reflux';\nimport Feedback from '../models/Feedback';\n\nconst FeedbackActions = Reflux.createActions([\n {...
javascript
chosen
[ { "from": "system", "value": "Make sure `n` is defined and use `alert`\n\nChecking that `n` is not undefined before calling `n.length` prevents an exception. Droplr now also overrides `console.log` (and other console functions) so changed it to `alert`." }, { "from": "human", "value": "// First ...
javascript
chosen
[ { "from": "system", "value": "Remove failing w3c test due to us not supporting data URIs\n" }, { "from": "human", "value": "\"use strict\";\n\nvar w3cTest = require(\"./w3ctest\")(exports);\n\nw3cTest(\"dom/nodes/CharacterData-appendData.html\");\nw3cTest(\"dom/nodes/CharacterData-deleteData.ht...
javascript
chosen
[ { "from": "system", "value": "Revert \"Check testing environment has appropriate features\"\n\nThis reverts commit dbb0a79af0c061b1de7acb0d609b05a438d52cae.\n" }, { "from": "human", "value": "describe(\"Core Bliss\", function () {\n\t\"use strict\";\n\n\tbefore(function() {\n\t\tfixture.setBase(...
javascript
chosen
[ { "from": "system", "value": "[template] Change bare template to use function component\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Platform, StyleSheet, Text, View } from 'react-native';\n\nconst instructions = Platform.select({\n ios: 'Press Cmd+R to...
javascript
chosen
[ { "from": "system", "value": "Fix onError handler is called even on successful load\n\nThis causes \"re-fetching\" problem, because onError handler clears\nwebpack ``installedChunks`` state, which in this cases cleared \"loaded bundle\",\ninstead of \"stuck callbacks\". See #1\n" }, { "from": "human...
javascript
chosen
[ { "from": "system", "value": "Update to better answer by stealing\n\nbetter answer.\n" }, { "from": "human", "value": "//\n// 2520 is the smallest number that can be divided by each of the numbers from\n// 1 to 10 without any remainder.\n//\n// What is the smallest positive number that is evenly...
javascript
chosen
[ { "from": "system", "value": "Support templated body for request transforms.\n" }, { "from": "human", "value": "import http from 'http';\nimport bunyan from 'bunyan';\nimport handlebars from 'handlebars';\n\nimport Transform from './Transform';\nimport Template from '../server/Template';\n\nexpo...
javascript
chosen
[ { "from": "system", "value": "Create logs directory if not exists\n" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\n\nconst bunyan = require('bunyan');\nconst config = require('config');\n\nconst pkg = require('../../package.json');\n\nconst level = process.env.L...
javascript
chosen
[ { "from": "system", "value": "Comment out popup of resume on click of link. Difficulties with iframe to remove on click.\n" }, { "from": "human", "value": "$(document).ready(function(){\n $(\".navLinkContainer__resumeLink\").on (\"click\", function(){\n var iframe = document.createElement('i...
javascript
chosen
[ { "from": "system", "value": "Add methods for focusing in and out\n" }, { "from": "human", "value": ";(function () {\n 'use strict'\n\n // -----------------------------------------------------------------------------\n // Start\n\n var script = document.createElement('script')\n script.type...
javascript
chosen
[ { "from": "system", "value": "Rename style property to match usage\n" }, { "from": "human", "value": "import React, {Component} from 'react'\nimport {StyleSheet, View, Text, TouchableHighlight} from 'react-native'\nimport TabButton from './TabButton'\n\n\nexport default class extends Component {...
javascript
chosen
[ { "from": "system", "value": "Remove trailing comma to appease JSHint.\n" }, { "from": "human", "value": "(function () {\n \"use strict\";\n var delay, jitter, blacklist;\n\n safari.application.addEventListener('message', function (event) {\n if (event.name === 'getSettings') {\n...
javascript
chosen
[ { "from": "system", "value": "Update TwG Base store to reflect owned keys changes.\n" }, { "from": "human", "value": "/**\n * `modules/thank-with-google` base data store\n *\n * Site Kit by Google, Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\")...
javascript
chosen
[ { "from": "system", "value": "Correct order for post hooks\n" }, { "from": "human", "value": "'use strict';\nvar _ = require('lodash');\n\nvar themeFunctions = require('theme/functions') || {};\nvar config = require('config');\n\nvar applyHooks = function (posts, functionArray) {\n var posts = ...
javascript
chosen
[ { "from": "system", "value": "Add exit statement in script\n" }, { "from": "human", "value": "// Messages sent on a regular schedule\nvar config = require('./config');\nvar services = require('./services');\nvar bot = require('./bot');\n\nvar bots = {};\nconfig.bots.forEach(function (bot) {\n b...
javascript
chosen
[ { "from": "system", "value": "Set app root path to app root\n" }, { "from": "human", "value": "var path = require('path')\nvar webpack = require('webpack')\nvar ExtractTextPlugin = require('extract-text-webpack-plugin')\n\nmodule.exports = {\n entry: './index.js',\n output: {\n path: path.j...
javascript
chosen
[ { "from": "system", "value": "Include inline source maps with non library build.\n" }, { "from": "human", "value": "var webpack = require('gulp-utilities').webpack;\nvar library = require('./webpack.library.json');\n\nmodule.exports = webpack.library(library);\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Add ability to show and hide with the show attribute.\n\nThis will let you control its visibility with live binding.\n" }, { "from": "human", "value": "import can from 'can';\nimport $ from 'jquery';\nimport 'semantic-ui-dropdown/dropdown';\nimport 'semantic-ui-tran...
javascript
chosen
[ { "from": "system", "value": "Configure webpack dev server for pushState\n\n" }, { "from": "human", "value": "var path = require('path')\n\nmodule.exports = {\n devtool: '#eval-source-map',\n entry: {\n app: ['./src/index.js']\n },\n output: {\n path: path.resolve(__dirname, 'public/as...
javascript
chosen
[ { "from": "system", "value": "Move wp-i18n and wp-dom-ready into src directory\n" }, { "from": "human", "value": "/* global require, module, __dirname */\n\nconst path = require( 'path' );\n\nmodule.exports = {\n\tentry: {\n\t\t'./assets/js/amp-blocks-compiled': './blocks/index.js',\n\t\t'./asse...
javascript
chosen
[ { "from": "system", "value": "Add custom conflict error response\n" }, { "from": "human", "value": "var bcrypt = require( 'bcrypt' );\nvar appModels = require( '../models' );\nvar systemError = require( '../utils/error_messages' ).systemError;\n\n\nexports.isEmailInUse = function ( email, callba...
javascript
chosen
[ { "from": "system", "value": "Handle legacy ember-data api landing page url\n" }, { "from": "human", "value": "import Route from '@ember/routing/route';\nimport getLastVersion from '../utils/get-last-version';\nimport ScrollTracker from 'ember-api-docs/mixins/scroll-tracker';\n\nexport default R...
javascript
chosen
[ { "from": "system", "value": "Remove IE10 specific Spice file\n" }, { "from": "human", "value": "//= require jquery\n//= require spice-html5-bower/spiceHTML5/spicearraybuffer\n//= require spice-html5-bower\n//= require_tree ../locale\n//= require gettext/all\n\n$(function() {\n var host = windo...
javascript
chosen
[ { "from": "system", "value": "Add missing callback when generating documentation\n" }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\n\nconst commandsToMarkdown = require('roc/lib/documentation/markdown/commandsToMarkdown').default;\n\nconst commands = req...
javascript
chosen
[ { "from": "system", "value": "Convert to use a weakmap instead of an object on the element. This can be taken further when actually implementing a way to do server-side rendering.\n" }, { "from": "human", "value": "'use strict';\n\nexport default {\n /**\n * Adds data to the element.\n *\n ...
javascript
chosen
[ { "from": "system", "value": "Add a second test script.\n" }, { "from": "human", "value": "/* Test the message log. */\nlog('Greetings, program.');\n\nvar world = new World(Map.random('disc-rl', 24, 24, Wall, Floor, Floor));\nworld.player.move(1, 2);\nworld.monsters.push(new Script(5, 1));\n\n/*...
javascript
chosen
[ { "from": "system", "value": "Update animation actions to use new constants\n" }, { "from": "human", "value": "import Velocity from 'velocity-animate'\n\nimport {\n\tSCROLL_STARTED,\n\tSCROLL_ENDED\n} from '../constants'\n\nexport function scrollPage({ content=false, mainPage=false }) {\n\tif (...
javascript
chosen
[ { "from": "system", "value": "Switch ordering of preloaded types to improve performance.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport AjaxPromise from '../utils/ajax-promise';\nimport config from '../config/environment';\n\nexport default Ember.Mixin.create({\n\n preloa...
javascript
chosen
[ { "from": "system", "value": "Fix dependency injection in angular\n" }, { "from": "human", "value": "angular.module(\"currencyJa\", [])\n .controller(\"TradersCtrl\", function ($scope, traderService) {\n $scope.currency = \"USD\";\n $scope.traders = traderService.findByCurrency($scope.cur...
javascript
chosen
[ { "from": "system", "value": "Handle requests with a mapper or reducer depending on presence of references\n" }, { "from": "human", "value": "'use strict';\n\nvar Promise = require('bluebird');\nvar boom = require('boom');\nvar internals = {};\n\nexports.handler = function (batch, reply) ...
javascript
chosen
[ { "from": "system", "value": ":see_no_evil: Check for angular presence in workaround\n" }, { "from": "human", "value": "angular.module('ng').run(['$rootScope', function ($rootScope) {\n $rootScope.$on('$locationChangeSuccess', function (e, newUrl) {\n var evt = document.createEvent('CustomEv...
javascript
chosen
[ { "from": "system", "value": "Fix broken VM card placement when error message is printed out\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\n\nimport style from './style.css'\n\nconst VmStatusText = ({ vm }) => {\n const lastMessage = vm.get('lastMessage')\n const ...
javascript
chosen
[ { "from": "system", "value": "Reset cursor's styles after each write (Windows issue)\n" }, { "from": "human", "value": "'use strict'\n\nconst ansi = require('ansi')\nconst Jimp = require('jimp')\n\nmodule.exports = function imageToConsole (photoPath, cols, callback) {\n Jimp.read(photoPath, (er...
javascript
chosen
[ { "from": "system", "value": "Add plumber to LESS compile task\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar less = require('gulp-less');\nvar rename = require('gulp-rename');\n\ngulp.task('styles', function () {\n return gulp.src('src/styles/app.less')\n .pipe(less...
javascript
chosen
[ { "from": "system", "value": "Fix error on line 33\n" }, { "from": "human", "value": "(function(){ \n\n // Create your component here\n // http://x-tags.org/docs\n \n xtag.register(\"sam-tabbar\", {\n lifecycle: {\n created: function() {\n if (!this.role) {\n this.ro...
javascript
chosen
[ { "from": "system", "value": "Change the method of get config of config file, will not check receiver and botname again\n" }, { "from": "human", "value": "var logger = require('log4js').getLogger('APP_LOG');\nvar request = require('request');\n\nfunction sendMessage(config, receiver, message, bo...
javascript
chosen
[ { "from": "system", "value": "Use Ember.isBlank is notBlank validator.\n" }, { "from": "human", "value": "Flame.Validator.notBlank = Flame.Validator.create({\n validate: function(target, key) {\n var string = target.get(key);\n if (string) {\n return string.trim().len...
javascript
chosen
[ { "from": "system", "value": "[WIP] Fix cell update - liftEff couldnt call the function\n" }, { "from": "human", "value": "// module State\n\n\"use strict\";\n\nsocket.onopen = function () {\n socket.send(\"Hi! I am client\");\n}\n\nexports.makeEditor = function (_id) {\n return function(){\...
javascript
chosen
[ { "from": "system", "value": "Update Firefox pretty print test\n\nAt some point, firefox changed the exception message.\n" }, { "from": "human", "value": "describe(\"j$.pp (HTML Dependent)\", function () {\n it(\"should stringify HTML nodes properly\", function() {\n var sampleNode = documen...
javascript
chosen
[ { "from": "system", "value": "Add the Tale to the model\n" }, { "from": "human", "value": "import DS from 'ember-data';\n\nexport default DS.Model.extend({\n \"_accessLevel\": DS.attr('number'),\n \"_id\": DS.attr('string'),\n \"_modelType\": DS.attr('string'),\n \"authors\": DS.attr(),\n ...
javascript
chosen
[ { "from": "system", "value": "Add user role restriction to the app abstract state\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('module.core').config(function($stateProvider, USER_ROLES) {\n $stateProvider\n .state('app', {\n abstract: true,\n url: '/app',\n ...
javascript
chosen
[ { "from": "system", "value": "Remove logic from component, it's done in the data class." }, { "from": "human", "value": "import React from 'react';\n\nimport KataGroupsComponent from './katagroups';\nimport KatasComponent from './katas.js';\nimport KataComponent from './kata.js';\nimport KataGro...
javascript
chosen
[ { "from": "system", "value": "Fix argument passthrough to resolver\n" }, { "from": "human", "value": "'use strict';\n\nimport clone from 'clone';\nimport extend from 'xtend/mutable';\n\nconst methods = [\n 'card.createToken',\n 'bankAccount.createToken',\n 'bitcoinReceiver.createReceiver',\n ...
javascript
chosen
[ { "from": "system", "value": "Add comments to gulp file\n" }, { "from": "human", "value": "var git = require('gulp-git');\nvar gulp = require('gulp');\n\n/**\n * Release Tasks\n */\n\ngulp.task('publish:tag', function(done) {\n var pkg = JSON.parse(require('fs').readFileSync('./package.json'));...
javascript
chosen
[ { "from": "system", "value": "Use arrow function for this\n" }, { "from": "human", "value": "const gulp = require('gulp')\nconst babel = require('gulp-babel')\nconst cache = require('gulp-cached')\nconst ext = require('gulp-ext')\nconst check = require('gulp-if')\nconst path = require('path')\n\...
javascript
chosen
[ { "from": "system", "value": "Add cssnano to gulp build\n" }, { "from": "human", "value": "var gulp = require(\"gulp\");\nvar sass = require(\"gulp-sass\");\n\ngulp.task(\"sass\", function () {\n gulp.src(\"./sass/**/*.scss\")\n .pipe(sass({\n outputStyle: \"compressed\",\n ...
javascript
chosen
[ { "from": "system", "value": "Replace use of var with let in gruntfile.js\n" }, { "from": "human", "value": "'use strict'\n\nlet gulp = require('gulp')\nlet mocha = require('gulp-mocha')\nlet standard = require('gulp-standard')\nvar del = require('del')\n\ngulp.task('lint', function () {\n retu...
javascript
chosen
[ { "from": "system", "value": "Add cost to room model\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\nvar Objectid = mongoose.Schema.Types.ObjectId;\n\nvar RoomSchema = new Schema({\n\tlocation: Objectid,\n\tname: String,\n\timg...
javascript
chosen
[ { "from": "system", "value": "Fix track-analytics receiver in renderer\n" }, { "from": "human", "value": "import {ipcRenderer as ipcr} from 'electron';\nimport analytics from './analytics';\nimport webView from './webview';\n\n/**\n * Forward a message to the webview.\n */\nipcr.on('fwd-webview'...
javascript
chosen
[ { "from": "system", "value": "Fix regex to catch quotes in url('')\n" }, { "from": "human", "value": "var request = require('request')\nvar cheerio = require('cheerio')\n\nmodule.exports.scrape = scrape\n\nfunction scrape(id, callback) {\n\n var uri = \"http://ingatlan.com/\" + id\n\n request(...
javascript
chosen
[ { "from": "system", "value": "Use absolute usage file path\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nrequire('exit-code');\n\nvar fs = require('fs');\nvar minimist = require('minimist');\n\nvar argv = minimist(process.argv.slice(2), {\n alias: {\n n: 'node',\n b: 'browser'...
javascript
chosen
[ { "from": "system", "value": "Use forloop instead of filter for backward compliance\n" }, { "from": "human", "value": "/**\n * The Diode emits a heartbeat whenever any store state has changed.\n * When Stores change, they can use this entity to broadcast\n * that state has changed.\n */\n\nfunct...
javascript
chosen
[ { "from": "system", "value": "Add callback for custom render" }, { "from": "human", "value": "try {\n\t$( \".selectize\" ).each(function() {\n\t\tif ($(this).data('options').mode === 'full')\n\t\t{\n\t\t\t$(this).selectize({\n\t\t\t\tplugins: ($(this).data('options').plugins === null ? null : $(...
javascript
chosen
[ { "from": "system", "value": " Fix extension to work with latest state changes\n" }, { "from": "human", "value": "import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport PostControls from 'flarum/utils/PostControls';\nimport Button from 'flarum/components/Button';\n\nimpor...
javascript
chosen
[ { "from": "system", "value": "Use Router.TestLocation instead of bare string when testing.\n" }, { "from": "human", "value": "import React from 'react';\nimport Router from 'react-router';\nimport routes from './routes';\n// import SettingsActions from '.....
javascript
chosen
[ { "from": "system", "value": "Remove refernces to unused foundation scripts.\n" }, { "from": "human", "value": "require('normalize-css')\n\n// TODO: Remove foundation dependencies\nrequire('./foundation/jquery.foundation.alerts')\nrequire('./foundation/jquery.foundation.reveal')\n\nrequire('./_d...
javascript
chosen
[ { "from": "system", "value": "Fix error handling and pass store onmessage and onclose\n" }, { "from": "human", "value": "export default (init, {\n prepareAction = action => JSON.stringify({ action }),\n isWSAT = action => action.wsat !== false,\n getAction = ({ data }) => {\n const { actio...
javascript
chosen
[ { "from": "system", "value": "Make async and add some error handling\n" }, { "from": "human", "value": "import RNFetchBlob from 'react-native-fetch-blob';\n\nexport default function loadImages(images) {\n if (images && images.length > 0)\n images.forEach(saveImage);\n}\n\nasync function save...
javascript
chosen
[ { "from": "system", "value": "Use the mocha runner again.\n" }, { "from": "human", "value": "/* global process */\nimport {Controller as Main} from './main-controller';\nimport {getShortcutObject, metaKey} from './_util';\nimport {shortcuts as aceDefaultShortcuts} from './_aceDefaultShortcuts';\...
javascript
chosen
[ { "from": "system", "value": "Remove run player. Fix output\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nimport {spawn} from 'child_process';\nimport program from 'commander';\nimport animeDl from 'anime-dl';\nimport chalk from 'chalk';\nimport updateNotifier from '...
javascript
chosen
[ { "from": "system", "value": "Add range key in Campaign\n" }, { "from": "human", "value": "import { Model } from './model';\n\nclass Campaign extends Model {\n\n static get tableName() {\n return process.env.CAMPAIGNS_TABLE;\n }\n}\n\nmodule.exports.Campaign = Campaign;\n" }, { "fro...
javascript
chosen
[ { "from": "system", "value": "Hide metronome in reverse of form\n" }, { "from": "human", "value": "$(document).ready(function(){\n\n $(\".metronome-parameters\").on(\"submit\", function(event){\n event.preventDefault();\n if ($('#metronome-button').val() === \"Start\"){\n $('#metrono...
javascript
chosen
[ { "from": "system", "value": "Disable placeholderPattern for Babel 7 compat" }, { "from": "human", "value": "export default function plugin({ types: t, template }) {\n const expr = template('\"production\" !== process.env.NODE_ENV')();\n const bool = t.booleanLiteral('production' !== process.e...
javascript
chosen
[ { "from": "system", "value": "Add VideoList to App component\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport ReactDOM from 'react-dom';\nimport SearchBar from './components/SearchBar';\nimport YTSearch from 'youtube-api-search';\n\nconst YT_API = 'AIzaSyDqL_r...
javascript
chosen
[ { "from": "system", "value": "Fix runtime error due to missing file.\n" }, { "from": "human", "value": "/* eslint-disable */\nimport React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport DevApp from './DevApp'\nimport App from './App'\n\n// import all CSS\nimport 'codemirror/lib/codemir...
javascript
chosen
[ { "from": "system", "value": "Change http handler registration: initialize swagger models earlier\n" }, { "from": "human", "value": "\"use strict\";\n\nfunction register(basePath, {models, authenticator, swagger, logger, simpleDao, config, limiter}) {\n const fs = require(\"fs\");\n const reso...
javascript
chosen
[ { "from": "system", "value": "Lib: Patch test when logging methods changed\n" }, { "from": "human", "value": "var d3 = require('d3');\n\nvar Plotly = require('@lib/core');\n\nvar createGraphDiv = require('../assets/create_graph_div');\nvar destroyGraphDiv = require('../assets/destroy_graph_div')...
javascript
chosen
[ { "from": "system", "value": "Hide history actions from redux-logger\n" }, { "from": "human", "value": "import {applyMiddleware, createStore} from 'redux';\nimport createLogger from 'redux-logger';\nimport {TILE_SELECT} from './actions';\n\nconst middleWare = [];\n\nif (DEV) {\n const HIDDEN_AC...
javascript
chosen
[ { "from": "system", "value": "Change the location of unit suffix\n" }, { "from": "human", "value": "define(['jquery', 'base/js/utils'], function ($, utils) {\n function createDisplayDiv() {\n $('#maintoolbar-container').append(\n $('<div>').attr('id', 'nbresuse-display')\n ...
javascript
chosen
[ { "from": "system", "value": "Add a test for Codeview purify\n" }, { "from": "human", "value": "/**\n * Codeview.spec.js\n * (c) 2015~ Summernote Team\n * summernote may be freely distributed under the MIT license./\n */\nimport chai from 'chai';\nimport $ from 'jquery';\nimport Context from '.....
javascript
chosen
[ { "from": "system", "value": "Improve page title for experts [WAL-1041]\n" }, { "from": "human", "value": "// @ngInject\nexport default function expertRequestsRoutes($stateProvider) {\n $stateProvider\n .state('appstore.expert', {\n url: 'experts/:category/',\n template: '<expert-r...
javascript
chosen
[ { "from": "system", "value": "Add query for deleting a migration\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n CREATE_MIGRATIONS_TABLE: `CREATE TABLE \"_migrations\" (\n id SERIAL UNIQUE PRIMARY KEY,\n version VARCHAR(255) NOT NULL,\n name VARCHAR(255) NOT ...
javascript
chosen
[ { "from": "system", "value": ":heavy_check_mark: Fix link to window object in jsdom\n" }, { "from": "human", "value": "import jsdom from 'jsdom';\n\nglobal.document = jsdom.jsdom('<!doctype html><html><body></body></html>');\nglobal.window = document.parentWindow;\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Reset color to default when color been has changed\n" }, { "from": "human", "value": "import {\n FETCH_ASSETS,\n FETCH_ASSETS_FULFILLED,\n SET_CURRENT_ASSET,\n SET_CURRENT_COLOR\n} from '../constants/assets';\nimport keyBy from 'lodash/keyBy';\n\nconst initialSt...
javascript
chosen
[ { "from": "system", "value": "Revert New Project button style\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\n\nimport { Button, List, Menu } from 'semantic-ui-react';\nimport { Link } from 'react-router';\n\nfunction getProjectPath(id) {\n return `/project/${id}`;...
javascript
chosen
[ { "from": "system", "value": "Use url in query, not path\n" }, { "from": "human", "value": "// Mine\nconst getResponse = query => {\n const token = require('../config.json').token || false;\n\n if (!token) {\n throw new Error(`token is not defined`);\n }\n\n return require('gh-got')('http...
javascript
chosen
[ { "from": "system", "value": "Fix Accept of all HTTP requests to specify json\n" }, { "from": "human", "value": "export default {\n /**\n * smartStateFold is supposed to be given as the argument a\n * `scan` operation over a stream of state|updateFn. State is\n * expected to be an object,...
javascript
chosen
[ { "from": "system", "value": "Add options object to props\n" }, { "from": "human", "value": "var React = require('react');\nvar data = require('./data.full.js');\n\nvar ReactDataTable = React.createClass({\n render: function() {\n var createCell = function createCell (key, value) {\n r...
javascript
chosen
[ { "from": "system", "value": "Clear account model from form\n" }, { "from": "human", "value": "define([\n\n 'Backbone',\n\n //Collection\n 'app/collections/projects',\n\n //Views\n 'app/views/projectsController',\n\n //Templates\n 'text!templates/home/loginTemplate.html',\n], function(\n\...
javascript
chosen
[ { "from": "system", "value": "Send coverage in node 4 only\n" }, { "from": "human", "value": "module.exports = {\n 'v0.12': 'codeclimate-test-reporter < coverage/coverage.lcov'\n};\n" }, { "from": "gpt", "value": "module.exports = {\n 'v4.0.0': 'codeclimate-test-reporter < coverage...
javascript
chosen
[ { "from": "system", "value": "Add and delete dictionary items\n" }, { "from": "human", "value": "/**\n * Created by wktf64 on 4/14/16.\n */\nvar express = require(\"express\");\n\nvar app = express();\n\nvar skierTerms = [\n {\n term: \"Rip\",\n defined: \"To move at a high rate...
javascript
chosen
[ { "from": "system", "value": "Fix regexp to test regexps in tools.\n\nWithout this commit we've got\n`{ test: /\\.json$/, loader: 'react-hot!json' }`\nand it should be just as\n`{ test: /\\.json$/, loader: 'json' }`\n" }, { "from": "human", "value": "import _ from 'lodash';\nimport webpack from ...
javascript
chosen
[ { "from": "system", "value": "Remove package list on confirmation\n" }, { "from": "human", "value": "var _atom = require('atom');\r\nvar SelectListView = _atom.SelectListView;\r\nvar helpers = require('atom-helpers');\r\n\r\n\r\nfunction PackageListView() {\r\n SelectListView.__super__...
javascript
chosen
[ { "from": "system", "value": "Use of instead of in for iteration\n" }, { "from": "human", "value": "function checkDuplicateUser(playQueue, video, config) {\n if (config.userQueueLimit <= -1) return false;\n\n var count = 0;\n for (element in playQueue) {\n if (element.userId === video.user...
javascript
chosen
[ { "from": "system", "value": "Move code into DOM Ready event\n" }, { "from": "human", "value": "(function ($) {\n jQuery.expr[':'].contains = function (obj, index, meta){\n return (obj.textContent || obj.innerText || \"\").toUpperCase().indexOf(meta[3].toUpperCase()) >= 0;\n };\n\n var hea...
javascript
chosen