conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Make sure shard key is a string\n" }, { "from": "human", "value": "/* Copyright (c) 2014 Chico Charlesworth, MIT License */\n'use strict';\n\nvar sharder = require('sharder');\nvar async = require('async');\n\nvar name = 'seneca-shard-cache';\n\nmodule.exports = fun...
javascript
chosen
[ { "from": "system", "value": "Use config for default paths.\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n Elixir = require('laravel-elixir'),\n livereload = require('gulp-livereload'),\n config = Elixir.config;\n\n\nElixir.extend('livereload', function (src) {\n\n ...
javascript
chosen
[ { "from": "system", "value": "Fix path to global node_modules on Windows\n" }, { "from": "human", "value": "/*!\n * global-prefix <https://github.com/jonschlinkert/global-prefix>\n *\n * Copyright (c) 2015 Jon Schlinkert.\n * Licensed under the MIT license.\n */\n\n'use strict';\n\n/**\n * This ...
javascript
chosen
[ { "from": "system", "value": "Enable reg expression fetching of classes\n" }, { "from": "human", "value": "(function(root, factory) {\n\t// Basbosa registry should be loaded once\n\t\n\t\n\tif (typeof exports !== 'undefined') {\n \t// Node.js\n module.exports = factory(root);\n } else if (t...
javascript
chosen
[ { "from": "system", "value": "Allow the caller to force the recomputation of the version\n\nThe flag is added to permit users to always get the latest version.\nThis is important in scenarios where a server is monitoring a file\nsystem and automatically reloading when the contents change. With\nthe force fl...
javascript
chosen
[ { "from": "system", "value": "Fix bug: Call speedDrop too many times\n\nUse a boolean to record if it is speedDroping\n" }, { "from": "human", "value": "var ai = ai || {}; //!< @namespace ai\n\nai.init = function(){\n setInterval(\"ai._mainLoop();\", 1000 / 120);\n setInterval(\"api.keepPlay(...
javascript
chosen
[ { "from": "system", "value": "Use authorization middleware as fallback to agent secret\n" }, { "from": "human", "value": "var Agent = require( '../models/agent' ),\n NotAuthorizedError = require( '../errors/not-authorized' );\n\nmodule.exports = function( req, res, next ) {\n if ( 'string'...
javascript
chosen
[ { "from": "system", "value": "Add sort and sortCollection test helper methods\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nexports.formatNumber = function(dialect) {\n return {\n mysql: _.identity,\n sqlite3: _.identity,\n postgresql: function(count) { return count....
javascript
chosen
[ { "from": "system", "value": "Allow setting channel name parameter on ERR_NOTONCHANNEL\n" }, { "from": "human", "value": "\nvar\n\textend = req('/lib/utilities/extend'),\n\tReplyMessage = req('/lib/messages/reply'),\n\tReplies = req('/lib/constants/replies'),\n\tNotOnCh...
javascript
chosen
[ { "from": "system", "value": "Remove addressed XXX comment: verification tokens are now separate.\n" }, { "from": "human", "value": "// XXX autopublish warning is printed on each restart. super spammy!\n\nMeteor.publish(\"directory\", function () {\n // XXX too easy to accidentally publish the ...
javascript
chosen
[ { "from": "system", "value": "Add debug logs to preview release\n" }, { "from": "human", "value": "'use strict';\n\nconst { waterfall, mapSeries } = require('async');\nconst logger = require('../../lib/logger');\n\nmodule.exports = function createPreviewRelease(getConfig, getReleasePreview, noti...
javascript
chosen
[ { "from": "system", "value": "Fix double call to map rendering and debugger\n" }, { "from": "human", "value": "function onDownloadFinished(duration)\n{\n console.log(\"Finished download in: \" + duration + \"ms\");\n initGame();\n initDebugger();\n}\n\n/*\n * Called on a resource downlo...
javascript
chosen
[ { "from": "system", "value": "Add a test for pre-processing nested structures.\n" }, { "from": "human", "value": "(function() {\n module('gpub.spec.preprocess');\n\n test('Preprocess grouping', function() {\n var cache = new gpub.util.MoveTreeCache();\n var sgf = '(;GM[1]AW[aa]AB[ba];B[b...
javascript
chosen
[ { "from": "system", "value": "Convert arguments to text before writing them out.\n" }, { "from": "human", "value": "define(['jquery'], function ($) {\n var colors = {\n log: '#000000',\n warn: '#cc9900',\n error: '#cc0000'\n };\n \n var log = $('#log');\n \n ...
javascript
chosen
[ { "from": "system", "value": "Allow multiple var declarations per scope\n\nThe Crockford style guide explicitly uses multiple var declarations as\nan example. However, the JSCS Crockford style config explicitly\ndisallows multiple var declarations. I'll revisit in the future if it\nturns out this is requi...
javascript
chosen
[ { "from": "system", "value": "Remove a bit of logging\n" }, { "from": "human", "value": "import socketio from 'socket.io-client'\n\nimport log from 'services/log'\nimport foodsharing from 'services/foodsharing'\n\nexport let io = null\nexport const subscribers = []\n\nexport default {\n\n /*\n ...
javascript
chosen
[ { "from": "system", "value": "Add tests for object input (image rule)\n" }, { "from": "human", "value": "var expect = require('chai').expect;\nvar validator = require('../');\n\ndescribe('Image Validator', function() {\n var rules = {\n imageInput: ['image']\n };\n\n it('should fail on non...
javascript
chosen
[ { "from": "system", "value": "Change it so / has the latest, greatest view." }, { "from": "human", "value": "\"use strict\";\n/* global process */\n/*******************************************************************************\n * Copyright (c) 2015 IBM Corp.\n *\n * All rights reserved. \n *\...
javascript
chosen
[ { "from": "system", "value": "Make sprite unit tests more robust\n" }, { "from": "human", "value": "'use strict';\n\nGJS.Sprite.gfxPath = '../examples/assets/gfx/';\n\ndescribe('Sprite', function() {\n it('can be used before it is loaded', function() {\n var s = new GJS.Sprite('carrot....
javascript
chosen
[ { "from": "system", "value": "Stop using execSync for compatibility with Node 0.10\n\nSigned-off-by: Nicole Sullivan <4ab7e2960369063855aad4ef791fa27066322d72@pivotal.io>\n" }, { "from": "human", "value": "var path = require('path');\nvar childProcess = require('child_process');\n\nfunction gulp...
javascript
chosen
[ { "from": "system", "value": "Use one es6 feature, modules." }, { "from": "human", "value": "/* global require, describe, it */\n\nvar assert = require('assert');\nvar urlPrefix = 'http://katas.tddbin.com/katas/es6/language/';\nvar katasUrl = urlPrefix + '__grouped__.json';\n\nvar GroupedKata = ...
javascript
chosen
[ { "from": "system", "value": "Create mongoose model after static methods are defined\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\n\n// Create a new schema for tweets\nvar schema = new mongoose.Schema({\n twid : String,\n active : Boolean,\n author : St...
javascript
chosen
[ { "from": "system", "value": "Make compiled source file more readable\n" }, { "from": "human", "value": "import path from 'path';\nimport webpack from 'webpack';\nimport autoprefixer from 'autoprefixer';\n\nmodule.exports = {\n entry: {\n 'react-image-lightbox': './src/index',\n },\...
javascript
chosen
[ { "from": "system", "value": "Make it work more or less with HTML4\n" }, { "from": "human", "value": "import {NAMESPACE, PREFIX} from './constants';\n\nconst ast = require('parametric-svg-ast');\nconst arrayFrom = require('array-from');\nconst startsWith = require('starts-with');\n\nconst ELEMEN...
javascript
chosen
[ { "from": "system", "value": "Add loading text while Parse is fetching events\n" }, { "from": "human", "value": "import React from 'react';\nimport NextEvent from './NextEvent';\nimport UpcomingEvents from './UpcomingEvents';\nimport PreviousEvents from './PreviousEvents';\nimport ...
javascript
chosen
[ { "from": "system", "value": "fix: Call itemMediator in Array constructor\n" }, { "from": "human", "value": "import Class from '../class';\nimport Matreshka from '../matreshka';\nimport instanceMembers from './_prototype';\nimport matreshkaError from '../_helpers/matreshkaerror';\nimport initMK ...
javascript
chosen
[ { "from": "system", "value": "Handle empty response form /suggest\n" }, { "from": "human", "value": "/**\n * Created by Tomasz Gabrysiak @ Infermedica on 08/02/2017.\n */\n\nimport html from '../../templates/helpers';\n\nconst template = (context) => {\n return new Promise((resolve) => {\n c...
javascript
chosen
[ { "from": "system", "value": "Update javascript Tor example to reflect simplified handling of .onion addresses\n" }, { "from": "human", "value": "// Example of how to connect to a Tor hidden service and use it as a peer.\n// See demo.js to learn how to invoke this program.\n\nvar bcj = org.bitco...
javascript
chosen
[ { "from": "system", "value": "Rename /user route to /min-side\n" }, { "from": "human", "value": "var passport = require('passport');\nvar auth0 = require('../lib/services/auth0');\n\nmodule.exports = {\n type: 'authentication',\n module: auth0,\n initialize: (app) => {\n passport.use(auth0...
javascript
chosen
[ { "from": "system", "value": "Remove commented code not used.\n" }, { "from": "human", "value": "setupFlorence();\n\n\n//forms field styling markup injection\n//$('select:not(.small)').wrap('<span class=\"selectbg\"></span>');\n//$('select.small').wrap('<span class=\"selectbg selectbg--small\"><...
javascript
chosen
[ { "from": "system", "value": "Edit logic for creating mesage success action\n" }, { "from": "human", "value": "import { group, member, message } from '../actions/actionTypes';\n\nconst groupReducer = (state = {}, action = {}) => {\n switch (action.type) {\n case group.CREATE_SUCCESS:\n ...
javascript
chosen
[ { "from": "system", "value": "Make typeable test compatible with IE<=8\n\n[].indexOf is not defined on IE<=8\n" }, { "from": "human", "value": "steal(\"src/synthetic.js\", function (Syn) {\n\tmodule(\"synthetic/typeable\");\n\n\tvar isTypeable = Syn.typeable.test;\n\n\ttest(\"Inputs and textarea...
javascript
chosen
[ { "from": "system", "value": "Increase test timeout when run in TravisCI\n\n- potential fix for\n https://travis-ci.org/lidel/ipfs-firefox-addon/jobs/109478424#L271\n" }, { "from": "human", "value": "'use strict'\n\nrequire('../lib/peer-watch.js')\n\nconst { setTimeout } = require('sdk/timers')...
javascript
chosen
[ { "from": "system", "value": "[mock] Document noop `graphql` tagged template\n\n[skip ci]\n" }, { "from": "human", "value": "// Comes from https://github.com/facebook/relay/issues/161\n// Should be used in tests as a replacement for `react-storybooks-relay-container`\n//\nvar React = require.req...
javascript
chosen
[ { "from": "system", "value": "Add event listener to back button\n" }, { "from": "human", "value": "$().ready(loadContentSection);\n\n$(\"body\").on('click', '.keyword', function() {\n $(this).addClass(\"active\");\n $(\".base\").hide(200);\n $(\"#real-body\").addClass(\"focus\");\n});\n\n$(\"...
javascript
chosen
[ { "from": "system", "value": "Write new users to database.\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n angular.module('j.point.me').controller('FirstController', ['$scope', '$firebase', '$firebaseAuth', '$window',\n function ($scope, $firebase, $firebaseAut...
javascript
chosen
[ { "from": "system", "value": "Add the ability to specify snippets on a per-invocation basis.\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().cre...
javascript
chosen
[ { "from": "system", "value": "Add a 'project' namespace for custom translations of each project\n\nAdd a generic namespace where the projects can store custom\ntranslations that don't override the preset namespaces of the core\n\nIssue edina/fieldtrip-cobweb-project#1\n" }, { "from": "human", "v...
javascript
chosen
[ { "from": "system", "value": "Update Image Loader to HTTPS\n" }, { "from": "human", "value": "//Loads images and then initializes Datatables\n$(window).load(function() {\n\tvar tableTitle = $('.tableImage');\n\tvar imageTitle = $('.tableTitle a');\n\tvar i = 0;\n\n\t\n\tfor (i; i < tableTitle.le...
javascript
chosen
[ { "from": "system", "value": "Add additional guard for `global.navigator`\n" }, { "from": "human", "value": "import React from 'react'\nimport { getDisplayName, wrapDisplayName, setDisplayName } from 'recompose'\n\nconst fixLineHeight = (lineHeight, displayName) => {\n if (typeof lineHeight ===...
javascript
chosen
[ { "from": "system", "value": "Rename property for root element as private property\n" }, { "from": "human", "value": "(function(app) {\n 'use strict';\n\n var Root = app.Root || require('./components/root.js');\n\n var root = new Root();\n root.init();\n\n app.root = root;\n})(this.app || (...
javascript
chosen
[ { "from": "system", "value": "Add input as parameter to report bug\n" }, { "from": "human", "value": "export const reportBug = (data) => ({\n method: 'post',\n url: 'reports/bug',\n data\n});\n\nexport const reportCrash = (data) => ({\n method: 'post',\n url: 'reports/bug',\n d...
javascript
chosen
[ { "from": "system", "value": "Remove click handler from document when scope is destroyed\n" }, { "from": "human", "value": "angular.module('offClick',[])\n.directive('offClick', ['$document', function ($document) {\n \n function targetInFilter(target,filter){\n if(!target || !fi...
javascript
chosen
[ { "from": "system", "value": "Switch back to es6 object literal notation\n" }, { "from": "human", "value": "import { combineReducers } from 'redux';\nimport fuelSavingsAppState from './fuelSavings';\nimport cmsAppState from './cms.js';\n\nconst rootReducer = combineReducers({\n fuelSavingsAppSt...
javascript
chosen
[ { "from": "system", "value": "Fix build error on Node 7\n" }, { "from": "human", "value": "var path = require('path')\nvar cp = require('child_process')\n\nvar script = path.join(__dirname, 'postinstall')\nif (process.platform.indexOf('win') === 0) {\n script += '.cmd'\n} else {\n script += '....
javascript
chosen
[ { "from": "system", "value": "Change all expected variables to truthy values\n" }, { "from": "human", "value": "describe(\"About Expects\", function() {\n\n //We shall contemplate truth by testing reality, via spec expectations. \n it(\"should expect true\", function() {\n expect(false).to...
javascript
chosen
[ { "from": "system", "value": "Fix WOFF2 font so it passes OTS in Firefox\n" }, { "from": "human", "value": "var supportsWoff2 = (function( win ){\n\tif( !( \"FontFace\" in win ) ) {\n\t\treturn false;\n\t}\n\n\tvar f = new FontFace('t', 'url( \"data:application/font-woff2;base64,d09GMgABAAAAAADc...
javascript
chosen
[ { "from": "system", "value": "Add new REST API for getting the target location\n\n- /arduino/location?lat=123&lon=456\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar arduino = require('../lib/arduino');\n\n/* GET home page. */\nrouter.get...
javascript
chosen
[ { "from": "system", "value": "Remove ios files (use Xcode instead)\n" }, { "from": "human", "value": "// nS - No Space\n// lC - Lowercase\n\nexport function bundleIdentifiers(\n currentAppName,\n newName,\n projectName,\n currentBundleID,\n newBundleID,\n newBundlePath\n) {\n const nS_Cur...
javascript
chosen
[ { "from": "system", "value": "Remove actions .action. Add run command.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar fs = require('fs'),\n url = require('url'),\n http = require('http'),\n prompt = require('prompt'),\n pecanApp = require('command...
javascript
chosen
[ { "from": "system", "value": "Add chapter 6, exercise 1\n" }, { "from": "human", "value": "class Vec {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n }\n\n plus(v) {\n return new Vec(this.x + v.x, this.y + v.y);\n }\n\n minus(v) {\n return new Vec(...
javascript
chosen
[ { "from": "system", "value": "Remove fetch step from message-based experiment\n" }, { "from": "human", "value": "import {Socket} from \"phoenix\"\nwindow.Experiment = class Experiment {\n constructor(topic, token, update) {\n this.socket = new Socket(\"/socket\")\n this.socket.c...
javascript
chosen
[ { "from": "system", "value": "Update string for raw trip collab constant.\n" }, { "from": "human", "value": "/**\n * This file specifies the database collection and field names.\n */\nexport const COLLECTION_TRIPS = 'trips';\nexport const TRIPS_TITLE = 'title';\nexport const TRIPS_DESCRIPTION = ...
javascript
chosen
[ { "from": "system", "value": "Make GET /victim/<id> request to get the victimip\n" }, { "from": "human", "value": "import React from 'react';\nimport ConfigForm from '../containers/ConfigForm';\n\nexport default class AttackConfig extends React.Component {\n constructor() {\n super();\...
javascript
chosen
[ { "from": "system", "value": "Use npm style variable declarations.\n" }, { "from": "human", "value": "/**\n * Communicate back to the web app.\n */\n\nvar extensionRoot = (new File($.fileName)).parent + '/';\n\n$.evalFile(extensionRoot + '/constants.js'); \n$.evalFile(extensionRoot + '/Json.js'...
javascript
chosen
[ { "from": "system", "value": "Add section for required args in argparse\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst { ArgumentParser, Const } = require('argparse');\nconst { version } = require('../package.json');\n\nconst parser = new ArgumentParser({\n version,\n addHelp:...
javascript
chosen
[ { "from": "system", "value": "Move piping from stdin to the cli\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar yargs = require('yargs');\n\nvar argv = yargs\n .usage('Sends pino logs to AWS CloudWatch Logs.\\nUsage: node index.js | pino-cloudwatch [options]')\n .describe('aws_acce...
javascript
chosen
[ { "from": "system", "value": "Fix error in vanilla example" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n entry: './src/index.ts',\n output: { filename: 'dist/index.js' },\n module: {\n rules: [\n {\n test: /\\.tsx?$/,\n ...
javascript
chosen
[ { "from": "system", "value": "Fix dates sometimes not being localized on page load.\n" }, { "from": "human", "value": "// Place all the behaviors and hooks related to the matching controller here.\n// All this logic will automatically be available in application.js.\n$(document).ready(function()...
javascript
chosen
[ { "from": "system", "value": "Increase bullet speed for testing\n" }, { "from": "human", "value": "// import Platform from 'objects/platform';\nimport { ASSETS } from 'constants';\nimport Bullet from 'objects/bullet';\n\nexport default class Player extends Phaser.Sprite {\n constructor(game, x,...
javascript
chosen
[ { "from": "system", "value": "Add visual.ons to external link formatter (will enable event tracking for outbound clicks)\n" }, { "from": "human", "value": "// Using regex instead of simply using 'host' because it causes error with security on Government browsers (IE9 so far)\nfunction getHostnam...
javascript
chosen
[ { "from": "system", "value": "Add classname to title component\n" }, { "from": "human", "value": "import * as React from \"react\";\nimport { Navigation } from \"./Navigation\";\n\n/**\n * Main Navigation Component\n */\nexport const Header = () => {\n const TITLE = \"LLVM Build View\";\n\n re...
javascript
chosen
[ { "from": "system", "value": "[Adapter] Expand the addon to all adapters\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport uuid from 'ember-cli-uuid/utils/uuid-helpers';\n\nexport default {\n\n name: 'ember-cli-uuid',\n\n initialize: function () {\n\n console.log('uuid: ...
javascript
chosen
[ { "from": "system", "value": "Add missing semicolon, avoid var assignment" }, { "from": "human", "value": "(function(){\n\tif(!'Event' in window) return false;\n\n\tif(typeof window.Event === 'function') return true;\n\n\tvar result = true;\n\ttry{\n\t\tnew Event('click');\n\t}catch(e){\n\t\tres...
javascript
chosen
[ { "from": "system", "value": "Add the VirtualMachione model comment.\n" }, { "from": "human", "value": "var VirtualMachine = require('./virtualMachine');\n\n//define a criteria for a virtual machines search\n//inherit of all property of a virtual machine\nmodule.exports = VirtualMachine.extend({...
javascript
chosen
[ { "from": "system", "value": "Update test after recent changes\n" }, { "from": "human", "value": "'use strict';\n\nvar Database = require('dbjs')\n , defineDate = require('dbjs-ext/date-time/date');\n\nmodule.exports = function (t, a) {\n\tvar db = new Database()\n\t , toDateInTimeZone;\n\n\...
javascript
chosen
[ { "from": "system", "value": "Work around for lack of signal for collapsing of all methods\n" }, { "from": "human", "value": "// Auto-expand the accordion and jump to the target if url contains a valid hash\n(function(doc){\n \"use strict\";\n\n $(function(){\n var $section, hash = ...
javascript
chosen
[ { "from": "system", "value": "Fix indexerr caused by debug page in non-debug mode\n" }, { "from": "human", "value": "/* jshint devel: true */\n'use strict';\n\nxss.debug.NS = 'DEBUG';\n\n// Debug URL: debug.html?debug=level:0\nxss.debug.levelIndex = location.search.match(/debug=level:([0-9]+)$/)...
javascript
chosen
[ { "from": "system", "value": "Add isRunning method to Job\n" }, { "from": "human", "value": "var util = require('util');\nvar _ = require('underscore');\nvar EventEmitter = require('events').EventEmitter;\n\n/**\n * @param {String} app\n * @param {String} env\n * @param {String} task\n * @param ...
javascript
chosen
[ { "from": "system", "value": ":muscle: Use rest parameters instead of arguments\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...
javascript
chosen
[ { "from": "system", "value": "Unify error messages between lib and app\n" }, { "from": "human", "value": "import {formatSize} from '../../../core/src/common/utils';\nimport log from '../../../core/src/common/log';\n\nconst BLOB_SIZE_LIMIT = 10 * 1024 * 1024; // 10 MB\n\nexport function fetchURL(...
javascript
chosen
[ { "from": "system", "value": "Add check for comments at the end of the file\n" }, { "from": "human", "value": "const updateComment = (body, commentArr = []) => {\n body = body.map((obj, index, array) => {\n if (obj.type === 'Line' || obj.type === 'Block') {\n if (array[index + 1].type =...
javascript
chosen
[ { "from": "system", "value": "Fix instagram script on feed\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n window.scrollTo(0, document.body.scrollHeight);\n var likeElements = document.querySelectorAll(\".coreSpriteHeartOpen\");\n var likeCount = 0;\n var nextT...
javascript
chosen
[ { "from": "system", "value": "Add a status code mapping for NR-5000.\n" }, { "from": "human", "value": "var express = require('express');\n\nexports.PROXY_ERROR_CODE_TO_HTTP_CODE_MAP = {\n 'NR-1000': 400,\n 'NR-1001': 400,\n 'NR-1002': 401,\n\n 'NR-2000': 400\n};\n\nexports.getTestHttpServer...
javascript
chosen
[ { "from": "system", "value": "Remove extra option to absoluteUrl\n\nforce-ssl already sets this option by default\n" }, { "from": "human", "value": "navigate = function (hash) {\n window.location.replace(Meteor.absoluteUrl(null, { secure: true }) + hash);\n};\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Use fat arrow syntax for callbacks.\n" }, { "from": "human", "value": "{\n angular.module('meganote.notesForm')\n .controller('NotesFormController', NotesFormController);\n\n NotesFormController.$inject = ['$state', 'Flash', 'NotesService'];\n function NotesFo...
javascript
chosen
[ { "from": "system", "value": "Fix error and warning in test\n\nFix `jsx` extension\r\nFix warning \"Something is calling a React component directly\"" }, { "from": "human", "value": "'use strict';\n\ndescribe('<%= classedName %>', function () {\n var <%= scriptAppName %>, component;\n\n before...
javascript
chosen
[ { "from": "system", "value": "Change to correct isolate scope in shell\n" }, { "from": "human", "value": "export default function shellDirective() {\n return {\n templateUrl: 'app/layout/shell.html',\n restrict: 'EA',\n transclude: true,\n scope: true,\n controller: 'ShellControl...
javascript
chosen
[ { "from": "system", "value": "Add errorMessage notifcation from backend\n" }, { "from": "human", "value": "import WebSocketClient from 'websocket.js';\nimport config from '../config';\nimport createQueryString from './createQueryString';\nimport { User } from 'app/actions/ActionTypes';\n\nexport...
javascript
chosen
[ { "from": "system", "value": "Split publication route out of the main bundle\n\nReduce the initial bundle sizes for more than 9KB gzipped.\n" }, { "from": "human", "value": "import Publication from 'common/modules/Publication/pages/Publication/Publication'\nimport Organization from 'common/modul...
javascript
chosen
[ { "from": "system", "value": "Disable TAPi18next cookie feature that caused anomalies\n" }, { "from": "human", "value": "TAPi18next.init({resStore: {}, fallbackLng: globals.fallback_language});\n" }, { "from": "gpt", "value": "TAPi18next.init({resStore: {}, fallbackLng: globals.fallb...
javascript
chosen
[ { "from": "system", "value": "Check for test opts in data blob\n" }, { "from": "human", "value": "var assert = require('chai').assert;\nvar convert = require('../../browser');\n\nvar data = require('../data');\nvar formats = data.formats;\nvar tests = data.tests;\n\ndescribe('client-side', funct...
javascript
chosen
[ { "from": "system", "value": "Remove site tour from main app\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react'\nimport JoyRide from 'react-joyride'\n\nimport Library from '../containers/Library'\nimport Workspace from '../containers/Workspace'\n\nconst styles...
javascript
chosen
[ { "from": "system", "value": "Add database interaction error handling\n" }, { "from": "human", "value": "const { User } = require('./../models');\n\nconst getUser = (req, res) => {\n User.fetch({ facebook_id: req.query.facebook_id })\n .then(fetchedUser => {\n res.status(200).json(fetch...
javascript
chosen
[ { "from": "system", "value": "Create per browser screenshot folder\n" }, { "from": "human", "value": "var fs = require('fs');\n\n\nfunction createDir(directory) {\n if (!fs.existsSync(directory)){\n fs.mkdirSync(directory, 0766, function(err){\n if(err) console.log(err);\n });\n...
javascript
chosen
[ { "from": "system", "value": "Print debug message when there are unknown dependencies rather than throw\n" }, { "from": "human", "value": "let Promise = require('bluebird');\nlet fnArgs = require('fn-args');\n\nlet dict = {};\n\nmodule.exports = () => {\n let di = {\n value: (name, val) => {...
javascript
chosen
[ { "from": "system", "value": "Add the <projectName> to the generate command's help\n" }, { "from": "human", "value": "#! /usr/bin/env node\n\n// __ _____ _____ _____ _____ _____\n// | | | | | | __ | __| __ |\n// | |__| | | | | | __ -| __| -|\n// |_____|_____|_...
javascript
chosen
[ { "from": "system", "value": "Add start data moment to RefugeeConstants\n" }, { "from": "human", "value": "\nvar moment = require('moment');\n\n// note that month indices are zero-based\n\nmodule.exports.DATA_START_YEAR = 2012;\nmodule.exports.DATA_START_MONTH = 0;\n\nmodule.exports.DATA_END_YEA...
javascript
chosen
[ { "from": "system", "value": "Disable some new rules that are too strict for us\n" }, { "from": "human", "value": "// @flow\nmodule.exports = {\n env: {\n jest: true,\n },\n plugins: ['jest', 'testing-library', 'jest-formatting', 'jest-dom'],\n extends: [\n 'plugin:jest/recommended',\n...
javascript
chosen
[ { "from": "system", "value": "Add Firebase once promise wrapper to facilitate async/await\n" }, { "from": "human", "value": "import Firebase from 'firebase';\nimport config from 'config';\n\nexport function firebaseInit() {\n // Authenticate with Firebase\n const ref = new Firebase(config.get(...
javascript
chosen
[ { "from": "system", "value": "Fix WaterfallError to properly extend Error\n" }, { "from": "human", "value": "export default class WaterfallError extends Error {\n get results() {\n return this._results;\n }\n\n set results(results) {\n if (this._results == null) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add image to example component\n" }, { "from": "human", "value": "/*\n* Application root\n* */\n\nimport React from 'react';\n\nconst AppRoot = props => {\n\treturn (\n\t\t<div className=\"application\">\n\n\t\t</div>\n\t);\n};\n\nexport default AppRoot;" }, { ...
javascript
chosen
[ { "from": "system", "value": "Add function to create dynamic divs\n" }, { "from": "human", "value": "\nnum=0; \nfunction createDiv(fil) { \n obj=fil.form; \n tab = document.createElement('div');\n tab.id = 'calendario';\n tab.style.padding = \"1px\";\n tab.style.border = \"1px solid red\";\...
javascript
chosen
[ { "from": "system", "value": "Remove curly quotes as well\n\nI have a few of these in titles and they were showing up in CSS clases.\n" }, { "from": "human", "value": "/**\n * Simple pluralizer\n */\nHandlebars.registerHelper('pluralize', function(n, thing) {\n if (n === 1) {\n return '1 ' +...
javascript
chosen
[ { "from": "system", "value": "Add pkg json and project variables\n" }, { "from": "human", "value": "/*!\n * Generator-Gnar Gruntfile\n * http://gnarmedia.com\n * @author Adam Murphy\n */\n\n// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix \"SyntaxError: Unexpected token import\" when running mocha tests\n" }, { "from": "human", "value": "// Copyright © 2015-2017 Esko Luontola\n// This software is released under the Apache License 2.0.\n// The license text is at http://www.apache.org/licenses/LICE...
javascript
chosen
[ { "from": "system", "value": "Add htmlmin task to gruntfile\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n jshint: {\n build: ['Gruntfile.js', 'src/**/*.js']\n ...
javascript
chosen
[ { "from": "system", "value": "Disable StandardJS in Grunt to fix builds\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n var standaloneFiles = [\n 'bower_components/sockjs-client/dist/sockjs.min.js',\n 'bower_components/stomp-websocket/lib/stomp.min.js',\n 'src/...
javascript
chosen
[ { "from": "system", "value": "Add trailing commas (to secretly nudge travis-ci)\n" }, { "from": "human", "value": "/*\n * grunt-contrib-watch\n * http://gruntjs.com/\n *\n * Copyright (c) 2013 \"Cowboy\" Ben Alman, contributors\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nmodule....
javascript
chosen
[ { "from": "system", "value": "Use const and remove extra returns\n" }, { "from": "human", "value": "var assert, desktopCapturer;\n\nassert = require('assert');\n\ndesktopCapturer = require('electron').desktopCapturer;\n\ndescribe('desktopCapturer', function() {\n return it('should return a non-...
javascript
chosen