conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use Meteor.methods to set up post (including user)\n" }, { "from": "human", "value": "Posts = new Mongo.Collection('posts');\n\nPosts.allow({\n insert: function(userId, doc) {\n // only allow posting if you are logged in\n return !! userId;\n }\n});" }, ...
javascript
chosen
[ { "from": "system", "value": "Add test for MqttConnection creation\n" }, { "from": "human", "value": "/**\n * Testing includes\n */\n\nvar should = require('should');\n\n/**\n * Unit under test\n */\n\nvar mqtt = require('../lib/mqtt');\n\ndescribe('mqtt', function() {\n describe('#createClient...
javascript
chosen
[ { "from": "system", "value": "Make it compatible with node 4.0\n" }, { "from": "human", "value": "'use strict';\n\nvar OCL = require('openchemlib');\n\nmodule.exports = function getConnectivityMatrix(options={}) {\n var {\n sdt,\n mass\n } = options;\n\n this.ensureHelperA...
javascript
chosen
[ { "from": "system", "value": "Add New Class To Link\n" }, { "from": "human", "value": ";(function() {\n \"use strict\";\n\n angular.\n module(\"bookApp\").\n component(\"bookApp\", {\n template: `\n <div class=\"nav\"><a href=\"new-book\">Add new book</a></div>\n\n <di...
javascript
chosen
[ { "from": "system", "value": "Tidy up JS, add commentary" }, { "from": "human", "value": "window.atthemovies = {\n init: function() {\n var body = document.querySelectorAll(\"body\")[0];\n var jsController = body.getAttribute(\"data-js-controller\");\n var jsAction = body.getAttribute(...
javascript
chosen
[ { "from": "system", "value": "Return all arguments from AJAX\n" }, { "from": "human", "value": "\nfunction doAjax(options, retries, dfr) {\n $.ajax(options).pipe(function(data) {dfr.resolve(data);}, function(jqXhr) {\n if (retries > 0) {\n setTimeout(doAjax, 100, options, retries - 1, d...
javascript
chosen
[ { "from": "system", "value": "Add jshint as grunt task\n" }, { "from": "human", "value": "/*\n * Copyright 2013, All Rights Reserved.\n *\n * Code licensed under the BSD License:\n * https://github.com/node-gh/gh/blob/master/LICENSE.md\n *\n * @author Zeno Rocha <zno.rocha@gmail.com>\n * @author...
javascript
chosen
[ { "from": "system", "value": "Extend the PATH env var instead of replacing it\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n pkg : grunt.file.readJSON( 'package.json' ),\n env: {\n casper: {\n BASEURL: \"http://www.google.com\",\n ...
javascript
chosen
[ { "from": "system", "value": "Print warnings when tests are taking ages so we can see which ones it is\n" }, { "from": "human", "value": "/* Copyright (c) Royal Holloway, University of London | Contact Blake Loring (blake@parsed.uk), Duncan Mitchell (Duncan.Mitchell.2015@rhul.ac.uk), or Johannes...
javascript
chosen
[ { "from": "system", "value": "Change VSTS integration for markup change\n" }, { "from": "human", "value": "/*jslint indent: 2, plusplus: true */\n/*global $: false, document: false, togglbutton: false, createTag:false, window: false, MutationObserver: false */\n'use strict';\n\n// Individual Wor...
javascript
chosen
[ { "from": "system", "value": "Fix inserting touch action stylesheet for Shadow DOM Polyfill\n" }, { "from": "human", "value": "(function() {\n function selector(v) {\n return '[touch-action=\"' + v + '\"]';\n }\n function rule(v) {\n return '{ -ms-touch-action: ' + v + '; touch-action: ...
javascript
chosen
[ { "from": "system", "value": "Add ability to get block type for a position\n" }, { "from": "human", "value": "let zlib = require('zlib'),\n NBT = require('kld-nbt'),\n Tag = NBT.Tag,\n ReadBuffer = NBT.ReadBuffer;\n\nmodule.exports = class Chunk {\n constructor() {\n this.data...
javascript
chosen
[ { "from": "system", "value": "Clean up the area of study headings\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar React = require('react');\n\nvar RequirementSet = require(\"./requirementSet\");\n\nvar AreaOfStudy = React.createClass({\n\trender: function() {\n\t\tconsole.log(...
javascript
chosen
[ { "from": "system", "value": "Remove 'Subject:' from displayTrialData text\n" }, { "from": "human", "value": "'use strict';\n\n// Display Trial Data for debugging\nangular.module('core').directive('displayTrialData', function() {\n return {\n restrict: 'AE',\n template: '<div><h3>Trial Da...
javascript
chosen
[ { "from": "system", "value": "chore: Fix quoted postcss plugins name\n" }, { "from": "human", "value": "module.exports = () => ({\n plugins: {\n 'postcss-easy-import': {\n extensions: [\n '.pcss',\n '.css',\n '.postcss',\n '.sss'\n ]\n },\n 'stylel...
javascript
chosen
[ { "from": "system", "value": "Fix args of inline controllers to use context\n" }, { "from": "human", "value": "export default (app, route) => {\n route.named('hello')\n .maps('/hello')\n .to('hello:index')\n\n route.named('foo').maps('/foo/{bar}').to(async (req, res, {bar}) => {\n res...
javascript
chosen
[ { "from": "system", "value": "Simplify webpack, unsuccessfull at fixing sourcemap output\n" }, { "from": "human", "value": "const path = require('path');\nconst webpack = require('webpack');\nconst WebpackNotifierPlugin = require('webpack-notifier');\nconst styleLintPlugin = require('stylelint-w...
javascript
chosen
[ { "from": "system", "value": "Verify that the cart does not contain an unavailable item\n" }, { "from": "human", "value": "import { Store } from 'consus-core/flux';\nimport StudentStore from './student-store';\n\nlet checkouts = [];\nlet checkoutsByActionId = new Object(null);\n\nclass CheckoutS...
javascript
chosen
[ { "from": "system", "value": "Refactor unit tests, add watch task.\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\n\nvar $ = require('gulp-load-plugins')();\n\nvar wiredep = require('wiredep');\n\ngulp.task('test', function () {\n var bowerDeps = wiredep({\n ...
javascript
chosen
[ { "from": "system", "value": "Add script issue and title fields\n" }, { "from": "human", "value": "'use strict';\n\n// scripts-model.js - A mongoose model\n// \n// See http://mongoosejs.com/docs/models.html\n// for more of what you can do here.\n\nconst mongoose = require('mongoose');\nconst Sch...
javascript
chosen
[ { "from": "system", "value": "Migrate rest of src overto createClass pkg\n" }, { "from": "human", "value": "import React from 'react';\nimport Select from './Select';\n\nfunction reduce(obj, props = {}){\n return Object.keys(obj)\n .reduce((props, key) => {\n const value = obj[key];\n if...
javascript
chosen
[ { "from": "system", "value": "Load dist css file in example\n" }, { "from": "human", "value": "// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from 'vue'\nimport Router from 'vue-router'\nimp...
javascript
chosen
[ { "from": "system", "value": "Fix js to preventDefault and work more places" }, { "from": "human", "value": "$(document).ready(function () {\n\n $(\".menu-btn a\").click(function () {\n $(\".overlay\").fadeToggle(200);\n $(this).toggleClass('btn-open').toggleClass('btn-close');\...
javascript
chosen
[ { "from": "system", "value": "Fix requestFrame in IE, where splice requires the deleteCount argument.\n" }, { "from": "human", "value": "/*\nrequestFrame / cancelFrame\n*/\"use strict\"\n\nvar array = require(\"prime/es5/array\")\n\nvar requestFrame = global.requestAnimationFrame ||\n ...
javascript
chosen
[ { "from": "system", "value": "Add chapter 4, exercise 4\n" }, { "from": "human", "value": "function deepEqual(obj1, obj2) {\n if (typeof obj1 != \"object\" || obj1 == null ||\n typeof obj2 != \"object\" || obj2 == null) return obj1 === obj2;\n\n let keys1 = Object.keys(obj1), keys2 ...
javascript
chosen
[ { "from": "system", "value": "Add the `LoadAverage` rule to the example\n" }, { "from": "human", "value": "var\n EchoRule = require('../lib/rules/echo.js'),\n Heartbeat = require('../lib/rules/heartbeat.js')\n ;\n\nvar rules = [];\n\nrules.push(new EchoRule());\nrules.push(new Heartbea...
javascript
chosen
[ { "from": "system", "value": "Increase interval to 5 seconds\n" }, { "from": "human", "value": "(function() {\n \"use strict\";\n\n var lastKeys = \"\";\n function fetchRedlines() {\n var baseUrl = $('#baseUrl').val();\n var artworkUrl = $('#artworkUrl').val();\n $....
javascript
chosen
[ { "from": "system", "value": "Disable the menubar when running from source\n" }, { "from": "human", "value": "var electron = require('electron'); // Module to control application life.\nvar process = require('process');\nconst {app} = electron;\nconst {BrowserWindow} = electron;\nlet win; // E...
javascript
chosen
[ { "from": "system", "value": "Make browserify default settings accessible\n" }, { "from": "human", "value": "var browserify = require('browserify-middleware')\nvar babelify = require('babelify')\n\nmodule.exports = function (entries, brOptions, baOptions) {\n brOptions = brOptions || {}\n brOp...
javascript
chosen
[ { "from": "system", "value": "Change login state When LOGIN action was triggered.\n" }, { "from": "human", "value": "/* Define your initial state here.\n *\n * If you change the type from object to something else, do not forget to update\n * src/container/App.js accordingly.\n */\nconst initialS...
javascript
chosen
[ { "from": "system", "value": "Check if a user has given a valid selector when trying to get or update\n\n" }, { "from": "human", "value": "function DomStorage() {\r\n\tvar cache = {};\r\n\tfunction getFromCache(selector){\r\n\t\tif(!cache[selector]){\r\n\t\t\tcache[selector] = $(selector);\r\n\t...
javascript
chosen
[ { "from": "system", "value": "chore(compile): Make the app link clickable\n\nThis small change makes the link clickable in some terminal emulators (like xfce-terminal), which makes it easier to open the app in a browser.\n" }, { "from": "human", "value": "import config from '../config'\nimport s...
javascript
chosen
[ { "from": "system", "value": "Fix tab selection on the navbar.\n\nSplit API paths by dots to prevent matching of the dots.\n" }, { "from": "human", "value": "'use strict';\n\n\nvar _ = require('lodash');\n\n\n//\n// Observe quicksearch focus to tweak icon style\n//\nN.wire.once('navigate.done', ...
javascript
chosen
[ { "from": "system", "value": "Remove capture group from URL reg exp.\n\nYou get the whole match anyway. And now you can more easily use the source of\nthe regexp as a part for constructing more complicated regular expressions.\n\ne.g. var x = new RegExp( RegExp.url.source + \"|\" + RegExp.email.source, 'i' ...
javascript
chosen
[ { "from": "system", "value": "Load markdown docs in help command\n\nSigned-off-by: Nathan Stier <013f9af474b4ba6f842b41368c6f02c1ee9e9e08@gmail.com>\n" }, { "from": "human", "value": "module.exports = function(target) {\n if (tasks[target])\n console.log(tasks[target].help)\n else\n cons...
javascript
chosen
[ { "from": "system", "value": "Change path name to posixPath\n" }, { "from": "human", "value": "var Readable = require('stream').Readable;\nvar path = require('path-posix');\nvar util = require('util');\nvar File = require('vinyl');\n\n// Because the index.html files in our site don't necessarily...
javascript
chosen
[ { "from": "system", "value": "Use enumerator instead of lists\n" }, { "from": "human", "value": "angular\n .module('ngSharepoint.Lists')\n .factory('JSOMConnector', function($q, $sp) {\n return ({\n getLists: function() {\n return $q(function(resolve, rejec...
javascript
chosen
[ { "from": "system", "value": "Add items to firebase and repopulate on page load or refresh\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport firebase, { reference, signIn } from '../firebase';\nimport { pick, map, extend } from 'lodash';\nimport Input from './In...
javascript
chosen
[ { "from": "system", "value": "Use variables to initialize the maze\n" }, { "from": "human", "value": "(function(document, MazeGenerator, MazePainter, MazeInteraction) {\n 'use strict';\n\n // DOM Elements\n var canvas = document.getElementById('maze');\n var bGenerate = document.getElementBy...
javascript
chosen
[ { "from": "system", "value": "Allow annotations and line-breaks in headings.\n" }, { "from": "human", "value": "import { TextNode, TEXT } from 'substance'\n\nexport default class Heading extends TextNode {}\nHeading.schema = {\n type: 'heading',\n level: { type: 'number', default: 1 },\n cont...
javascript
chosen
[ { "from": "system", "value": "Mark all scripts as 0o755\n\nThis gives execute permission for everyone even if Atom is installed as root:\nhttps://github.com/atom/atom/issues/19367\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar cp = require('child_process')\nvar fs = require('fs')\...
javascript
chosen
[ { "from": "system", "value": "Configure Bluebird before first use of Promise.\n\nTurn browser_scripts#defaultScripts into a get property, so it's not executed when the file is being required. This to avoid:\nError: cannot enable long stack traces after promises have been created\n" }, { "from": "hum...
javascript
chosen
[ { "from": "system", "value": "Add speech prefixes - still required in 2012, so should be left in due to reader issues\n" }, { "from": "human", "value": "\"use strict\";\n\n/**\n * Properties to prefix.\n */\nvar postcss = require(\"postcss\"),\n\t\tprops = [\n\t\t\t\"hyphens\",\n\t\t\t\"line-bre...
javascript
chosen
[ { "from": "system", "value": "Handle supplying metric collector by env var.\n" }, { "from": "human", "value": "var net = require('net');\nvar config = require('hyperflowMonitoringPlugin.config.js');\n\nvar MonitoringPlugin = function () {\n};\n\nMonitoringPlugin.prototype.sendMetrics = function ...
javascript
chosen
[ { "from": "system", "value": "[server] Add option to choose between local and npm\n" }, { "from": "human", "value": "const webpack = require('webpack');\nconst WebpackDevServer = require('webpack-dev-server');\nconst webpackConfig = require('./webpack.config.local');\n\nnew WebpackDevServer(webp...
javascript
chosen
[ { "from": "system", "value": "Reduce test transition-delay from 200ms to 100ms\n" }, { "from": "human", "value": "import m from 'mithril';\nimport AppComponent from '../../app/scripts/components/app.js';\nimport AIPlayer from '../../app/scripts/models/ai-player.js';\nimport { qs } from './utils....
javascript
chosen
[ { "from": "system", "value": "Enable React devtools by exposing React (setting window.React)\n" }, { "from": "human", "value": "/**\n * This file is provided by Facebook for testing and evaluation purposes\n * only. Facebook reserves all rights not expressly granted.\n *\n * THE SOFTWARE IS PROV...
javascript
chosen
[ { "from": "system", "value": "Fix for broken sorting on own fields: remove sort_model from params if the field relation is own\n" }, { "from": "human", "value": "import { connect } from 'react-redux'\nimport merge from 'lodash/merge'\nimport clone from 'lodash/clone'\nimport pickBy from 'lodash/...
javascript
chosen
[ { "from": "system", "value": "Fix to allow provider to be shown in the content manager\n\n" }, { "from": "human", "value": "module.exports = {\n user: {\n actions: {\n create: 'User.create', // Use the User plugin's controller.\n update: 'User.update',\n destroy: 'User.destroy...
javascript
chosen
[ { "from": "system", "value": "Throw error if used on another OS than OS X\n" }, { "from": "human", "value": "'use strict';\nvar execFile = require('child_process').execFile;\n\nmodule.exports = function (str, cb) {\n\texecFile('osascript', ['-e', str], function (err, stdout) {\n\t\tif (err) {\n\...
javascript
chosen
[ { "from": "system", "value": "Use bind instead of intermediate function\n\nExec method is 'undefined' if no command callback were defined.\n\nSigned-off-by: Harri Kovalainen <2ecf1d4f49b9d136d53b819dc389c152487e9e18@gmail.com>\n" }, { "from": "human", "value": "\"use strict\";\n\nvar util = requ...
javascript
chosen
[ { "from": "system", "value": "Update to work with new versions of ember-cli\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-cli-inject-asset-map',\n\n // Add asset map hash to asset-map controller\n postBuild: function (results) {...
javascript
chosen
[ { "from": "system", "value": "Send notification based on the sites settings\n" }, { "from": "human", "value": "\"use strict\";\n\nvar Mail = require('./channels/Mail');\nvar Console = require('./channels/Console');\n\nclass SiteDownNotification {\n\n\tconstructor(site)\n\t{\n\t\tthis.site = site...
javascript
chosen
[ { "from": "system", "value": "Fix ntee -h/--help not showing right name and version and showing cli's ones instead\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar cli = require('cli').enable('version');\nvar fs = require('fs');\nvar path = require('path');\nvar cwd ...
javascript
chosen
[ { "from": "system", "value": "Add close and destroy; force fixed chunk length\n" }, { "from": "human", "value": "module.exports = Storage\n\nfunction Storage () {\n if (!(this instanceof Storage)) return new Storage()\n this.chunks = []\n}\n\nStorage.prototype.put = function (index, buf, cb) {...
javascript
chosen
[ { "from": "system", "value": "Use `String.search` instead of `RegExp.test`\n" }, { "from": "human", "value": "'use strict';\n\nvar consecutiveSlash = /(:)?\\/+/g;\nvar endsWithExtension = /[^\\/]*\\.[^\\/]+$/g;\n\nvar fn = function(match, c) {\n return c ? '://' : '/';\n};\n\nvar pppath = funct...
javascript
chosen
[ { "from": "system", "value": "Make pair generation extensible to multiple words\n" }, { "from": "human", "value": "var generatePairs = function(string) {\n var pairs = [];\n string = string.toLowerCase();\n for (var i = 0; i < string.length - 1; i++) {\n pair = string.substr(i, 2);\n if...
javascript
chosen
[ { "from": "system", "value": "Use startsWith and endsWith functions\n" }, { "from": "human", "value": "module.exports = function (paths, ignores) {\n let result = []\n let edge = String.prototype\n\n for (let i = 0, ignoresLength = ignores.length; i < ignoresLength; i++) {\n let ignore = i...
javascript
chosen
[ { "from": "system", "value": "chore(templating): Update the newest templating API" }, { "from": "human", "value": "import {TemplateDirective, View, ViewPort, ViewFactory, InitAttrs} from 'templating';\nimport {Injector, Inject} from 'di';\n\n@TemplateDirective({selector: 'router-view-port'})\nex...
javascript
chosen
[ { "from": "system", "value": "Include req.baseUrl is asset path\n\nIf app is namespaced under another route then this needs to be taken into account when importing assets\n" }, { "from": "human", "value": "var path = require('path'),\n servestatic = require('serve-static');\n\nvar basedir = p...
javascript
chosen
[ { "from": "system", "value": "Add the wormhole destination in the {{content-for “body-footer”}}" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-power-select'\n};\n" }, { "from": "gpt", "value": "/* jshint node: true */\n'u...
javascript
chosen
[ { "from": "system", "value": "Rename `ware` internally from `parser` to `ware`\n" }, { "from": "human", "value": "'use strict';\n\n/*\n * Dependencies..\n */\n\nvar Ware;\n\nWare = require('ware');\n\n/*\n * Components.\n */\n\nvar parse,\n stringify;\n\nparse = require('./lib/parse.js');\nst...
javascript
chosen
[ { "from": "system", "value": "Add target attribute to a.fancybox to prevent default theme's links following\n" }, { "from": "human", "value": "'use strict';\nvar cheerio = require('cheerio');\nvar _ = require('underscore');\nvar multiline = require('multiline');\n\nvar template = _.template(mult...
javascript
chosen
[ { "from": "system", "value": "Increase timeouts for very slow servers\n" }, { "from": "human", "value": "'use strict';\n\nconst got = require('got');\n\nconst awaitUrl = (url, option) => {\n const config = Object.assign({}, option, {\n interval : 1000,\n tries : 60\n });\n...
javascript
chosen
[ { "from": "system", "value": "Fix options passed to es6-transpiler\n\nOtherwise, `options` is useless." }, { "from": "human", "value": "var es6tr = require(\"es6-transpiler\");\n\nvar createES6TranspilerPreprocessor = function(args, config, logger, helper) {\n config = config || {};\n var log ...
javascript
chosen
[ { "from": "system", "value": "Use a named function instead of anon\n" }, { "from": "human", "value": "'use strict';\n\nvar EventEmitter = require('events').EventEmitter;\nvar Promise = require('bluebird');\n\nvar emitThen = function (event) {\n var args = Array.prototype.slice.call(argumen...
javascript
chosen
[ { "from": "system", "value": "Move proxyRes out of request handler; trap errors\n" }, { "from": "human", "value": "var httpProxy = require('http-proxy');\nvar http = require('http');\n\nvar CORS_HEADERS = {\n 'access-control-allow-origin': '*',\n 'access-control-allow-methods': 'HEAD, POST, GE...
javascript
chosen
[ { "from": "system", "value": "Add support for WPA2 Enterprise\n\nFixes #1.\n" }, { "from": "human", "value": "'use strict';\nvar execFile = require('child_process').execFile;\nvar wifiName = require('wifi-name');\n\nfunction getPassword(ssid, cb) {\n\tvar cmd = 'sudo';\n\tvar args = ['cat', '/et...
javascript
chosen
[ { "from": "system", "value": "Revert the default DNS lookup order to IPv4-first\n\nFix #467\n" }, { "from": "human", "value": "'use strict';\n\nconst EventEmitter = require('events');\n\nconst devtools = require('./lib/devtools.js');\nconst Chrome = require('./lib/chrome.js');\n\nfunction CDP(op...
javascript
chosen
[ { "from": "system", "value": "Change code as per @johnotander's suggestion\n" }, { "from": "human", "value": "'use strict'\n\nvar postcss = require('postcss')\nvar isVendorPrefixed = require('is-vendor-prefixed')\n\nmodule.exports = postcss.plugin('postcss-remove-prefixes', function (options) {\...
javascript
chosen
[ { "from": "system", "value": "Check ember-source version from NPM, if not found use ember from bower\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar path = require('path');\nvar filterInitializers = require('fastboot-filter-initializers');\nvar VersionChecker = r...
javascript
chosen
[ { "from": "system", "value": "Add path for supporting Windows\n" }, { "from": "human", "value": "module.exports = function (path) {\n var req = require;\n return function (module_name) {\n try {\n return req(module_name);\n } catch (err) {\n var resolve = null;\n req.main....
javascript
chosen
[ { "from": "system", "value": "Enable newrelic only if config exists\n" }, { "from": "human", "value": "import bluebird from 'bluebird'\nimport consoleStamp from 'console-stamp'\nimport 'newrelic';\n\nimport { getSingleton as initApp } from './app/app'\n\n\nglobal.Promise = bluebird\nglobal.Promi...
javascript
chosen
[ { "from": "system", "value": "Use previous source map and don't inline the source maps.\n\nThis fixes source mapping when used with sass-loader.\nAlso, we don't want to map to the postcss generated source, we want to map to the pre-postcss source.\n" }, { "from": "human", "value": "var loaderUti...
javascript
chosen
[ { "from": "system", "value": "Fix every case a special character is suppressed\n\nI refer to https://github.com/jonschlinkert/remarkable/blob/dev/lib/common/utils.js#L45 for regex writing." }, { "from": "human", "value": "var toc = require('markdown-toc');\n\nmodule.exports = {\n book: {},\n ...
javascript
chosen
[ { "from": "system", "value": "Fix for dir being ignored when supplied and files always saved to cwd.\n" }, { "from": "human", "value": "const createUrl = require('./lib/create-url');\nconst downloadAndSave = require('./lib/download-and-save');\nconst parsePage = require('./lib/parse-page');\n\nm...
javascript
chosen
[ { "from": "system", "value": "Use content.outputFilePath and use pass sourcemap" }, { "from": "human", "value": "var DtsCreator = require('typed-css-modules');\nvar loaderUtils = require('loader-utils');\nvar objectAssign = require('object-assign');\n\nmodule.exports = function(source, map) {\n ...
javascript
chosen
[ { "from": "system", "value": "Allow PORT to be set from cli" }, { "from": "human", "value": "'use strict'\nvar express = require('express'),\n app = express(),\n bodyParser = require('body-parser'),\n config = require('./libs/config'),\n email = require('./libs/email')\n \napp.use...
javascript
chosen
[ { "from": "system", "value": "Tidy things up, remove requirement for PORT env var\n" }, { "from": "human", "value": "/* Uses the slack button feature to offer a real time bot to multiple teams */\nvar Botkit = require('botkit');\n\nif (!process.env.TOKEN || !process.env.PORT) {\n console.log('E...
javascript
chosen
[ { "from": "system", "value": "Send back the doc not the s3 object\n" }, { "from": "human", "value": "var AWS = require('aws-sdk');\nvar s3 = new AWS.S3();\nvar yaml = require('js-yaml');\n\n// const s3EnvVars = require('s3-env-vars');\n// var doc = s3EnvVars(\"mybucketname\", \"folderpathinbucke...
javascript
chosen
[ { "from": "system", "value": "Check passed coordinates to be correct\n" }, { "from": "human", "value": "import dataComplete from './actions/dataComplete';\nimport preprocessData from './actions/preprocessData';\nimport readFile from '../functions/file/readFile';\nimport preprocessFile from '../f...
javascript
chosen
[ { "from": "system", "value": "Fix Campaign keyword, send Gambit reply\n" }, { "from": "human", "value": "'use strict';\n\nconst Campaigns = require('../../app/models/Campaign');\n\nmodule.exports = function getCampaignForKeyword() {\n return (req, res, next) => {\n if (req.reply.template) {\...
javascript
chosen
[ { "from": "system", "value": "Add 'cjsTranslate' config option to build profile\n" }, { "from": "human", "value": "({\n mainConfigFile: './requirejs.conf.js',\n paths: {\n jquery: 'lib/jquery/jquery.min',\n almond: 'lib/almond/almond'\n },\n baseUrl: '.',\n name: \"streamhub-map\",\n ...
javascript
chosen
[ { "from": "system", "value": "Add replaceable module id for curl's make utility.\n" }, { "from": "human", "value": "/** @license MIT License (c) copyright 2014 original authors */\n/** @author Brian Cavalier */\n/** @author John Hann */\n\ndefine(['curl/_privileged'], function (priv) {\n\tvar lo...
javascript
chosen
[ { "from": "system", "value": "Remove admin dashboard for now\n" }, { "from": "human", "value": "import React from 'react';\nimport { Router, Route, IndexRoute, browserHistory } from 'react-router';\nimport { Provider } from 'react-redux';\nimport store from 'lib/store';\nimport App from 'compone...
javascript
chosen
[ { "from": "system", "value": "Move connection initial state to variable" }, { "from": "human", "value": "import * as types from '../actions/connections';\n\n\nexport default function(state = {}, action) {\n switch (action.type) {\n case types.CONNECTION_REQUEST: {\n const { server, database...
javascript
chosen
[ { "from": "system", "value": "Fix detection of Windows 7\n" }, { "from": "human", "value": "export default {\n isDarwin: process.platform === 'darwin',\n isNonDarwin: process.platform !== 'darwin',\n isWindows: process.platform === 'win32',\n isLinux: process.platform === 'linux',\n isWindo...
javascript
chosen
[ { "from": "system", "value": "Use .env to store secret\n" }, { "from": "human", "value": "const _ = require(\"lodash\");\nconst express = require(\"express\");\nconst router = express.Router();\nconst session = require(\"express-session\");\nconst connect = require(\"../../utils/database.js\");\...
javascript
chosen
[ { "from": "system", "value": "Make path to server more TS friendly by removing strict file type\n" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\nconst fs = require('fs');\n\nconst nodePaths = (process.env.NODE_PATH || '')\n .split(process.platform === 'win32' ?...
javascript
chosen
[ { "from": "system", "value": "Update file input RaisedButton example\n\nThis shows how to correctly embed a file input file into a RaisedButton ensuring that the file input remains clickable cross browser #3689 #4983 #1178" }, { "from": "human", "value": "import React from 'react';\nimport Raise...
javascript
chosen
[ { "from": "system", "value": "Include coverage for index files\n" }, { "from": "human", "value": "module.exports = {\n collectCoverageFrom: [\n \"**/src/**/*.{js,jsx}\",\n \"!**/index.js\",\n ],\n coverageDirectory: \"<rootDir>/packages/storybook/coverage\",\n coveragePathIgnorePattern...
javascript
chosen
[ { "from": "system", "value": "Add Redux devtool extension connection - will need to only be available in dev in the future\n" }, { "from": "human", "value": "const createLogger = require('redux-logger');\nconst enableBatching = require('redux-batched-actions').enableBatching;\nconst promiseMiddl...
javascript
chosen
[ { "from": "system", "value": "Change redirects to project form\n" }, { "from": "human", "value": "ProjectsController.$inject = [ 'TbUtils', 'projects', '$rootScope' ];\n\nfunction ProjectsController(TbUtils, projects, $rootScope) {\n const vm = this;\n\n vm.searchObj = term => { return { N...
javascript
chosen
[ { "from": "system", "value": "Update Schema to change userIds to userTokens\n" }, { "from": "human", "value": "var mysql = require('mysql');\n\nexports.connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'uncovery'\n});\n\nexports.initialize = function(callb...
javascript
chosen
[ { "from": "system", "value": "Add explicit refs to test case.\n" }, { "from": "human", "value": "defaultScope(4);\nintRange(-8, 7);\n\nc10_Car = Clafer(\"c10_Car\").withCard(4, 4);\nc11_owner = c10_Car.addChild(\"c11_owner\").withCard(1, 1);\nc21_Person = Clafer(\"c21_Person\").withCard(4, 4);\n...
javascript
chosen
[ { "from": "system", "value": "Remove unused var to fix lint error\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport {LineChart} from 'react-d3-basic'\n\nimport classes from './RoomChart.scss'\n\nclass RoomChart extends React.Component {\n static propTypes = {\n...
javascript
chosen
[ { "from": "system", "value": "Add project collision test from truffle-init\n" }, { "from": "human", "value": "var path = require(\"path\");\nvar fs = require(\"fs-extra\");\nvar assert = require(\"assert\");\n\nvar Box = require(\"../\");\n\nvar TRUFFLE_BOX_DEFAULT = \"git@github.com:trufflesuit...
javascript
chosen
[ { "from": "system", "value": "Fix filters in storeConfig: they where shared across multiple stores\n\nProblem was that storeConfig is an object and thus modified by reference\n" }, { "from": "human", "value": "Ext.define('Densa.overrides.HasMany', {\n override: 'Ext.data.association.HasMany',...
javascript
chosen
[ { "from": "system", "value": "Clean redis after succeeded jobs\n" }, { "from": "human", "value": "\"use strict\";\n\nvar autoload = require('auto-load');\nvar kue = require('kue');\nvar async = require('async');\nvar debug = require('debug')('kue:boot');\nvar jobs = autoload(__dirname);\n\nmodul...
javascript
chosen
[ { "from": "system", "value": "Change icon_url to use adorable.io" }, { "from": "human", "value": "var _ = require('lodash');\nvar logger = require('winston');\nvar request = require('superagent');\n\nfunction SlackGateway(incomingURL, channelMapping) {\n this.incomingURL = incomingURL;\n this....
javascript
chosen