conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add switch statement for keydowns\n" }, { "from": "human", "value": "$(document).foundation()\n\ncontext = new AudioContext()\n\n// declare globals\nvar noteOne, noteTwo,\n volume = context.createGain()\n\n// initialize volume\nvolume.gain.value = 0.1\n\nfunction...
javascript
chosen
[ { "from": "system", "value": "Improve regex for implicit urls\n" }, { "from": "human", "value": "const getOptions = callback => {\n chrome.storage.sync.get({\n limit: 50,\n timeout: 1,\n serialize: true,\n inject: true,\n urls: 'https?:\\\\/\\\\/localhost|0\\\\.0\\\\.0\\\\.0:\\\\...
javascript
chosen
[ { "from": "system", "value": "Rewrite jQuery mainmenu code. From 43 lines down to 6.\n" }, { "from": "human", "value": "var mainMenu = (function() {\n\n\tvar $listItems = $( '#mainmenu > ul > li' ),\n\t\t$menuItems = $listItems.children( 'a' ),\n\t\t$body = $( 'body' ),\n\t\tcurrent = -1;\n\n\tf...
javascript
chosen
[ { "from": "system", "value": "Remove style jsx and place in global for ssr\n" }, { "from": "human", "value": "import React from 'react'\n\nconst RenderStatus = ({isServer}) => {\n return (\n <div className='_container align--center'>\n <div id='prefix' className='_box'>rendered on </d...
javascript
chosen
[ { "from": "system", "value": "Add classes to elements in Day\n" }, { "from": "human", "value": "import Event from './event';\n\nconst DAY_NAMES = [ 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag', 'Søndag' ];\nconst MONTH_NAMES = [ 'januar', 'februar', 'mars', 'april', 'mai', 'juni'...
javascript
chosen
[ { "from": "system", "value": "Fix the stupid flashing interval bug.\n" }, { "from": "human", "value": "index = 0;\nslogans = [\n \"when mission critical just doesn't make any sense.\",\n \"when you just don't need multi-master replication.\",\n \"when those other databases are just too ...
javascript
chosen
[ { "from": "system", "value": "test: Change to use _hasBeenCalled variable rather than hardcoded true :/\n" }, { "from": "human", "value": "var mockProcessExitApi = {};\n\nvar _originalProcessExit;\nvar _hasBeenCalled = false;\nvar _errorCode;\n\nmockProcessExitApi.enable = function() {\n\t_origi...
javascript
chosen
[ { "from": "system", "value": "Add use strict to satisfy jshint\n" }, { "from": "human", "value": "module.exports = (url, cb) => {\n cb(null, {\n type: 'FeatureCollection',\n features: [\n {\n type: 'Feature',\n id: 'way/4243736',\n properties: {\n highwa...
javascript
chosen
[ { "from": "system", "value": "Add path dependency to fix the test\n" }, { "from": "human", "value": "/* globals describe, it */\n'use strict'\n\nvar chai = require('chai')\nvar expect = chai.expect\n\nvar processTemplate = require('../lib/compolib.processTemplate.js')\nvar getOptions = require('...
javascript
chosen
[ { "from": "system", "value": "Fix set function with underscore isEqual" }, { "from": "human", "value": "ReactiveArray;\n\nthis.ReactiveArray = ReactiveArray = function(value) {\n var ifc, method, _addWrappedPrototypeMethod, _array, _arrayDep, _i, _len, _methods;\n if (!(this instanceof Reactiv...
javascript
chosen
[ { "from": "system", "value": "Use click as next (mostly for mobile)\n" }, { "from": "human", "value": "Template.layout.onCreated(function () {\n $(document).on('keyup', function (event) {\n var router = Router.current()\n var slideId = router && router.params._id\n var key = ev...
javascript
chosen
[ { "from": "system", "value": "Remove unused globals from fonts unit test file\n" }, { "from": "human", "value": "/* globals describe, it, expect, beforeAll, afterAll,\n checkProblematicCharRanges */\n\n'use strict';\n\ndescribe('Fonts', function() {\n it('checkProblematicCharRanges', ...
javascript
chosen
[ { "from": "system", "value": "Add yt_auth module again. Was taken off by mistake.\n" }, { "from": "human", "value": "var youtubeApp = angular.module('youtubeApp',\n\t[\n\t\t'ngRoute',\n\t\t'ngResource',\n\t\t'pascalprecht.translate',\n\t\t'reactTo',\n\t\trequire('./yt_result').name,\n\t\trequire...
javascript
chosen
[ { "from": "system", "value": "Change title of meta transactions page in docs sidebar\n\n(cherry picked from commit 773c7265e8725c87a8220c2de111c7e252becc8b)\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst path = require('path');\nconst proc = require('child_process');\nconst star...
javascript
chosen
[ { "from": "system", "value": "Enable debug logging via server.log(tags,...) when NODE_ENV=dev\n" }, { "from": "human", "value": "'use strict';\n\nconst Config = require('./config');\n\n// Glue manifest\nmodule.exports = {\n\n server: {\n app: {\n config: Config\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Increase time of Drinker swop\n" }, { "from": "human", "value": "//BG Color Change\nvar colors = [\"red\", \"green\", \"blue\", \"purple\", \"yellow\", \"orange\"];\nvar currentColor = 0;\nfunction switchColor() {\n if (currentColor >= colors.length) currentColor...
javascript
chosen
[ { "from": "system", "value": "Change interval for populating index for ctags codecomplete\n" }, { "from": "human", "value": "var _ = require(\"underscore\");\nvar tags = require(\"./tags\");\n\nfunction setup(options, imports, register) {\n var codecomplete = imports.codecomplete;\n var wo...
javascript
chosen
[ { "from": "system", "value": "Clear memory of dead screeps\n" }, { "from": "human", "value": "var roleHarvester = require('role.harvester');\nvar roleUpgrader = require('role.upgrader');\n\nmodule.exports.loop = function () {\n\n var harvesters = _.filter(Game.creeps, (creep) => creep.memory.ro...
javascript
chosen
[ { "from": "system", "value": "Make `isPlaying` function more straightforward\n" }, { "from": "human", "value": "'use strict';\n\n/* global Connector */\n\nConnector.playerSelector = '.player';\n\nConnector.trackSelector = '.p-info-display > a';\n\nConnector.artistSelector = '.p-artist';\n\nConne...
javascript
chosen
[ { "from": "system", "value": "Hide bottom bar since it's unused still\n" }, { "from": "human", "value": "'use strict';\n\nrequire('./app-main.less');\nconst R = require('react').createElement;\nconst T = require('./translation.json');\nconst LogView = require('./log-view');\nconst MainActionBar ...
javascript
chosen
[ { "from": "system", "value": "Add a session storage mock\n" }, { "from": "human", "value": "import fetch from 'jest-fetch-mock'\n\nconst createLocalStorageMock = () => {\n let store = {}\n\n return {\n setItem(key, value) {\n store[key] = value.toString()\n },\n getItem(key) {\n ...
javascript
chosen
[ { "from": "system", "value": "Update method to use Match check for audit-argument-checks compliance.\n\nIf a system is using the presence package and also forcing security checks using the Meteor package (audit-argument-checks)[http://docs.meteor.com/#auditargumentchecks] The security check will fail, throw...
javascript
chosen
[ { "from": "system", "value": "Update componentPickerTitle margin-bottom to 10px\n\nSigned-off-by: Julien Boudringhin <b9c726d5a16b9c496dc9bcb0fe66114f0a694817@gmail.com>\n" }, { "from": "human", "value": "import styled from 'styled-components';\n\n/* eslint-disable indent */\nconst ComponentsPic...
javascript
chosen
[ { "from": "system", "value": "Correct IE version for Sauce Labs\n" }, { "from": "human", "value": "define({\n\tsuites: [\n\t\t\"tests/unit/smoke\",\n\t\t\"tests/unit/environment\"\n\t],\n\tproxyPort: 9090,\n\tproxyUrl: \"http://localhost:9090/\",\n\tcapabilities: {\n\t\t\"selenium-version\": \"2...
javascript
chosen
[ { "from": "system", "value": "Remove the element after click\n" }, { "from": "human", "value": "$(function () {\n\n\tvar el = $(\".learn > a\");\n\tvar intro = $(\"#intro\");\n\tvar loadAbout = function () {\n\t\tintro.animate({opacity: 0}, 250);\n\t\tintro.animate({height: \"50px\"}, 250);\n\t\...
javascript
chosen
[ { "from": "system", "value": "Revert \"fixed the formatting such that the time has no \"0\" in front of it.\"\n\nThis reverts commit 0f167142d5329deed444e10cde11a42b634b899b.\n" }, { "from": "human", "value": "var readline = require('readline');\nvar chalk = require('chalk');\n\nfunction extract...
javascript
chosen
[ { "from": "system", "value": "Define User Manager via role\n" }, { "from": "human", "value": "// User manager (notary) related properties\n\n'use strict';\n\nvar memoize = require('memoizee/plain')\n , ensureDatabase = require('dbjs/valid-dbjs')\n , defineUser =...
javascript
chosen
[ { "from": "system", "value": "Fix NPM command that was failing and breaking code\n\nMay not handle all cases, but at least it's not broken anymore" }, { "from": "human", "value": "'use strict';\n\n// is this installed in a node_modules dir?\n// is this version not equal to npm latest?\n\nvar fs ...
javascript
chosen
[ { "from": "system", "value": "Use most_fields as search type\n" }, { "from": "human", "value": "var module = angular.module('JGivenApp',['ngSanitize']);\n\nvar elasticSearchHost = 'localhost'\n\nmodule.controller(\n 'ApplicationController',\n ['$scope', '$http',\n function( $scope, $ht...
javascript
chosen
[ { "from": "system", "value": "Move GET to a different route\n" }, { "from": "human", "value": "'use strict';\n\nconst Firebase = require('firebase');\nconst express = require('express');\nconst router = express.Router();\nconst FBURI = process.env.FBURI;\nconst ref = new Firebase(FBURI);\n\nrout...
javascript
chosen
[ { "from": "system", "value": "JSCBC-409: Fix bug with cluster management on real buckets\n\nMotivation\n----------\nA bug was causing certain cluster management tests to fail to\nexecute correctly during 'RealBucket' tests.\n\nChanges\n-------\nFixed incorrect use of bind rather than call.\n\nChange-Id: Ia6...
javascript
chosen
[ { "from": "system", "value": "Test serialization in json api format\n" }, { "from": "human", "value": "import { module, test } from 'qunit';\nimport { setupTest } from 'ember-qunit';\n\nmodule('Unit | Serializer | curriculum inventory sequence block', function(hooks) {\n setupTest(hooks);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Rename Gulp task for improved clarity\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar eslint = require('gulp-eslint');\nvar excludeGitignore = require('gulp-exclude-gitignore');\nvar jsonlint = require(\"gulp-jsonlint\");\nvar mo...
javascript
chosen
[ { "from": "system", "value": "Fix display of undefined attributes\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nexports.command = {\n description: 'get an attribute for a project',\n arguments: '<project> <attribute>'\n};\n\nif (require.main !== module) {\n return;\n}\n\nvar stora...
javascript
chosen
[ { "from": "system", "value": "Add tests for %d specifier\n" }, { "from": "human", "value": "/* global describe, it */\n\n'use strict';\n\nrequire('should');\nvar pff = require('..');\n\ndescribe('specifiers', function () {\n it('should substitute once in pattern', function () {\n pff('...
javascript
chosen
[ { "from": "system", "value": "Fix ReactiveDict on server (for iron:router)\n\nNote: We don’t officially support Tracker on the server." }, { "from": "human", "value": "ReactiveDict._migratedDictData = {}; // name -> data\nReactiveDict._dictsToMigrate = {}; // name -> ReactiveDict\n\nReactiveDict...
javascript
chosen
[ { "from": "system", "value": "Stop link events from bubbling\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\n\nexport default function Link(props) {\n const { handleClick, href } = props;\n const fn = (e) => {\n e.preventDefault();\n handleClick(href);\n };...
javascript
chosen
[ { "from": "system", "value": "Use relative url for logfile\n\nfixes #263\n" }, { "from": "human", "value": "/*\n * Copyright 2014 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the ...
javascript
chosen
[ { "from": "system", "value": "Make it clear it's an empty loop.\n" }, { "from": "human", "value": "var Events = {\n\tadd: function(obj, events) {\n\t\tfor (var type in events) {\n\t\t\tvar func = events[type];\n\t\t\tif (obj.addEventListener) {\n\t\t\t\tobj.addEventListener(type, func, false);\n...
javascript
chosen
[ { "from": "system", "value": "Add `computationInputs` property to `Project` model.\n" }, { "from": "human", "value": "'use strict';\n\nconst PouchDocument = require('./pouch-document');\nconst joi = require('joi');\n\n/**\n * @class Project\n * @extends PouchDocument\n * @constructor\n * @proper...
javascript
chosen
[ { "from": "system", "value": "Fix regex for win32 platform\n" }, { "from": "human", "value": "'use strict';\n/* global require */\n/* global process */\n\nvar fs = require ('fs');\nvar path = require ('path');\n\nvar mkdirSync = function (path) {\n try {\n fs.mkdirSync (path);\n } catch (e)...
javascript
chosen
[ { "from": "system", "value": "Add event tracking for answer comparison\n\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react'\nimport { connect } from 'react-redux'\nimport { showCompareView } from '../../actions/index'\nimport Button from '../../components/common/butt...
javascript
chosen
[ { "from": "system", "value": "Fix JS error preventing newly created dictionary items from opening automatically\n\n(cherry picked from commit 59f90bd08be677817133584fc877f4a53a349359)\n" }, { "from": "human", "value": "/**\n * @ngdoc controller\n * @name Umbraco.Editors.Dictionary.CreateControl...
javascript
chosen
[ { "from": "system", "value": "Fix for IE aborting on non existing global\n" }, { "from": "human", "value": "/**\n * Generates a string of 16 random Ascii characters using the native\n * `crypto` library and `btoa`.\n *\n * For IE11 it uses the prefixed `msCrypto` library. In case no crypto\n * l...
javascript
chosen
[ { "from": "system", "value": "Return 'ok' to display successful value\n" }, { "from": "human", "value": "var Cylon = require(\"cylon\");\n\nCylon.api(\"http\", {host: \"0.0.0.0\", ssl: false});\n\nCylon.robot({\n name: \"edison\",\n connections: {\n edison: { adaptor: 'intel-iot' }\n },\n\...
javascript
chosen
[ { "from": "system", "value": "Check for years when finding areas\n" }, { "from": "human", "value": "import major from './major'\nimport concentration from './concentration'\nimport emphasis from './emphasis'\nimport degree from './degree'\n\nimport _ from 'lodash'\nlet areas = [major, concentrat...
javascript
chosen
[ { "from": "system", "value": "Fix ignoring mock artifacts on release\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// This script removes the build artifacts of ignored contracts.\n\nconst fs = require('fs');\nconst path = require('path');\nconst cp = require('child_process');\nconst...
javascript
chosen
[ { "from": "system", "value": "[fix] Clean javascript. Empty value when cloning inputs.\n" }, { "from": "human", "value": "document.addEventListener('DOMContentLoaded', function() {\n var liMenu = document.querySelectorAll('#apps a'),\n colors = ['bluebg','purplebg','redbg','orangebg','gree...
javascript
chosen
[ { "from": "system", "value": "Remove dependency on setTimeout global." }, { "from": "human", "value": "\"use strict\";\n\nvar reducible = require(\"reducible/reducible\")\nvar reduce = require(\"reducible/reduce\")\nvar isReduced = require(\"reducible/is-reduced\")\nvar end = require(\"reducible...
javascript
chosen
[ { "from": "system", "value": "Add separate steps for production and development\n" }, { "from": "human", "value": "var path = require('path')\nvar CopyWebpackPlugin = require('copy-webpack-plugin')\nvar HtmlWebPackPlugin = require('html-webpack-plugin')\n\nconst production = process.env.NODE_ENV...
javascript
chosen
[ { "from": "system", "value": "Install the setActiveItem function to the view for convenience\n" }, { "from": "human", "value": "Blend.defineClass('Blend.layout.container.Stacked', {\n extend: 'Blend.layout.container.Fit',\n alias: 'layout.stacked',\n cssPrefix: 'stacked',\n activeIte...
javascript
chosen
[ { "from": "system", "value": "Make the attribute retreval and the context less hackish\n" }, { "from": "human", "value": "var contextMenu = require(\"context-menu\");\nvar tabs = require(\"tabs\");\n\nexports.main = function(options, callback) {\n var contextMenuImage = contextMenu.Item({\n ...
javascript
chosen
[ { "from": "system", "value": "Allow package to work in directory with a space in its name\n" }, { "from": "human", "value": "'use strict';\n\nvar _path = require('path');\n\n// Get full path to nuget.exe\nmodule.exports = function path() {\n return _path.resolve(__dirname,'../nuget.exe');\n}\...
javascript
chosen
[ { "from": "system", "value": "Format missing fields in errors more nicely\n" }, { "from": "human", "value": "module.exports = {\n dropExcludedProperties: function(propertyList, originalObject) {\n return propertyList.reduce(function(incompleteObject, property) {\n incompleteObject[prope...
javascript
chosen
[ { "from": "system", "value": "Remove loading spinner for user subscription wait\n" }, { "from": "human", "value": "import React from 'react';\n\nimport HeaderPrimary from './header-primary';\nimport HeaderSecondary from './header-secondary';\n// import Footer from './footer';\nimport MobileMenu ...
javascript
chosen
[ { "from": "system", "value": "Add new domain to message origin checking" }, { "from": "human", "value": "(function(){\n window.addEventListener(\"message\", function(e) {\n if (e.origin !== \"https://fragdenstaat.de\" && e.origin !== \"http://localhost:8000\") {return;}\n\n var iframeId =...
javascript
chosen
[ { "from": "system", "value": "Add user to leaderboard array before it is sorted by lowest handicap.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(app) {\n app.controller('DashboardController', ['$rootScope', '$scope', 'GameService', 'UserService', 'FriendService'...
javascript
chosen
[ { "from": "system", "value": "Set session default duration to 15 minutes\n" }, { "from": "human", "value": "$(document).ready(function () {\n\n var sessionDefaultDuration = 300;\n var sessionDurationElement = $('#session-duration');\n var sessionDurationTimepickerElement = $('#session-duratio...
javascript
chosen
[ { "from": "system", "value": "Add custom prop isOwn to descriptor\n\nMakes it possible to see if the descriptor\noriginates from the object or its prototype chain\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function getPropertyDescriptor(object, property) {\n var pr...
javascript
chosen
[ { "from": "system", "value": "Make instance initializer backwards compatible\n" }, { "from": "human", "value": "export function initialize(container, application) {\n application.inject('service:head-tags', 'router', 'router:main');\n}\n\nexport default {\n name: 'head-tags',\n initialize: in...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"Added angular boilerplate\"\"\n\nThis reverts commit 998372e81cf340665e9137c0a9c7db48444851b2.\n" }, { "from": "human", "value": "import React from 'react';\nimport {Decorator as Cerebral} from 'cerebral-view-react';\nimport styles from './styles.c...
javascript
chosen
[ { "from": "system", "value": "Update root URL for REST services...\n" }, { "from": "human", "value": "var EverestConfig = {\n\tendpoint: {\n\n\t\tbase: \"http://everest-build:8082\" /*,\n\t\tpatient: \t// show ability to extend\n\t\t*/\n\t}\n};" }, { "from": "gpt", "value": "var Ever...
javascript
chosen
[ { "from": "system", "value": "Add handler for disconnect to silence log\n" }, { "from": "human", "value": "/*\n * Copyright 2017 Red Hat Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may...
javascript
chosen
[ { "from": "system", "value": "Refactor dashboard collection for multiple filters\n\nWe want to filter the dashboard collection on multiple facets like\ntitle and department.\n\nTo make this easier, use Underscore's filter method to return true\nor false based on whether we want the dashboard included in the...
javascript
chosen
[ { "from": "system", "value": "Make simple option true by default as specified in README\n\nSimple was undefined (falsy) unless specified explicitly\n" }, { "from": "human", "value": "var Promise = require('bluebird'),\n request = require('request');\n\nfunction rp(options) {\n var stat...
javascript
chosen
[ { "from": "system", "value": "Fix error in console need to check type before call hasOwnProperty\n\nLook at this https://i.imgur.com/v2lpTuk.png" }, { "from": "human", "value": "/* eslint-env browser */\n\n;(function() {\n try {\n const onMessage = ({ data }) => {\n if (!data.wappalyzer...
javascript
chosen
[ { "from": "system", "value": "Update handleEditTrip to take prop tripData rather than rawTripData.\n" }, { "from": "human", "value": "import React from 'react';\n\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport Button from 'react-bootstrap/Button';\n\n/**\n * {@link ...
javascript
chosen
[ { "from": "system", "value": "Add click event to accept request\n" }, { "from": "human", "value": "Template.notifications.helpers({\n notifications: function() {\n return Notifications.find({ userId: Meteor.userId() });\n },\n notificationCount: function() {\n return Notifications.find(...
javascript
chosen
[ { "from": "system", "value": "Update graphic settings before renderer is created\n" }, { "from": "human", "value": "import { isWebGLSupported } from './core/utils';\nimport CanvasRenderer from './core/renderers/canvas/CanvasRenderer';\nimport WebGLRenderer from './core/renderers/webgl/WebGLRende...
javascript
chosen
[ { "from": "system", "value": "Add angular-moment dependency to karma\n" }, { "from": "human", "value": "// karma.conf.js\nmodule.exports = function(config) {\n config.set({\n basePath : '../../',\n frameworks: ['jasmine'],\n files : [\n 'bower_components/underscore/underscore.js',...
javascript
chosen
[ { "from": "system", "value": "Remove the sustained focus on the button after a click action\n\nmore pronounced when Reset is pressed\n" }, { "from": "human", "value": "ManageIQ.angular.app.component('miqButton', {\n bindings: {\n name: '@',\n enabled: '<',\n enabledTitle: '@?',\n di...
javascript
chosen
[ { "from": "system", "value": "Update example with comments, stop after 10 secs\n" }, { "from": "human", "value": "import RpmMeter, { PULSE_EVENT } from \"spin-bike-rpm-meter\";\n\nlet rpmMeter = new RpmMeter();\n\nrpmMeter.start().then((stop) => {\n\tconsole.log(stop);\n\n\trpmMeter.on(PULSE_EVE...
javascript
chosen
[ { "from": "system", "value": "Remove admin home page text\n" }, { "from": "human", "value": "/*\n * HomePage\n *\n * This is the first thing users see of our App, at the '/' route\n *\n * NOTE: while this component should technically be a stateless functional\n * component (SFC), hot reloading d...
javascript
chosen
[ { "from": "system", "value": "Fix Cancel and Complete Transaction\n" }, { "from": "human", "value": "'use strict';\n\n// CartsCheckout controller\nvar cartsApp = angular.module('carts');\n\ncartsApp.controller('CartCheckoutController', ['$scope', '$http', '$location', 'Authentication',\n\tfuncti...
javascript
chosen
[ { "from": "system", "value": "Build fails unless all browsers are tested\n" }, { "from": "human", "value": "// Copyright (c) 2014 Titanium I.T. LLC. All rights reserved. For license, see \"README\" or \"LICENSE\" file.\n(function() {\n\t\"use strict\";\n\n\t// Uncomment and modify the following ...
javascript
chosen
[ { "from": "system", "value": "Add Tooltip for sort icon\n\nFix #2\n" }, { "from": "human", "value": "import React from 'react'\nimport { inject, observer } from 'mobx-react'\nimport SortIcon from 'material-ui-icons/Sort'\nimport IconButton from 'material-ui/IconButton'\n\nconst iconStyle = {\n ...
javascript
chosen
[ { "from": "system", "value": "Use underscore .extend() to add fields instead of being a moron\n" }, { "from": "human", "value": "Meteor.methods({\n addProject: function(project) {\n project.createdAt = new Date();\n Projects.insert(project);\n }\n});\n" }, { "from": "gpt", "v...
javascript
chosen
[ { "from": "system", "value": "Add console log for debug." }, { "from": "human", "value": "var express = require(\"express\");\nvar app = express();\n\n\n// Static files directory\napp.use(express.static('public'));\n\n\n// Request handlers\napp.get('/', function(req, res) {\n res.redirect(307...
javascript
chosen
[ { "from": "system", "value": "Remove compression (done at NGINX level)\n" }, { "from": "human", "value": "/* jshint node: true, browser: false */\n'use strict';\n\n// CREATE HTTP SERVER AND PROXY\n\nvar app = require('express')();\nvar proxy = require('http-proxy').createProxyServer({});\n...
javascript
chosen
[ { "from": "system", "value": "Add support for windows-only drawer property \"win_buttonTheme\"\n\nSince the background of the drawer button can be changed independently\nfrom the navigation header, so has the theme. This is an experimental\nfeature and will for now only be documented in the windows client\n...
javascript
chosen
[ { "from": "system", "value": "Add job document name as metadata to S3 object\n" }, { "from": "human", "value": "'use stirct'\n\nvar opbeat = require('opbeat').start()\nvar uuid = require('node-uuid')\nvar AWS = require('aws-sdk')\nvar Printer = require('ipp-printer')\n\nvar port = process.env.PO...
javascript
chosen
[ { "from": "system", "value": "Move DOCTYPE definition out of the function\n" }, { "from": "human", "value": "/* @flow */\n\nimport type Site from '../site';\n\nimport React from 'react';\nimport ReactDOMServer from 'react-dom/server';\n\nimport Page from '../components/Page';\nimport { skipMeta,...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded return + add comment about require.resolve()\n" }, { "from": "human", "value": "var sass = require('node-sass'),\n path = require('path'),\n fs = require('fs');\n\nvar handledBaseFolderNames = {\n 'bower_components': 'bower_components',\n ...
javascript
chosen
[ { "from": "system", "value": "Fix path for handlebars helpers\n" }, { "from": "human", "value": "var path = require(\"path\");\n\n// Export function to create new config (builder is passed in from outside)\nmodule.exports = function(builder) {\n\n var bootstrapLess = require.resolve(\"bootstr...
javascript
chosen
[ { "from": "system", "value": "Allow to redefine scope via metadata\n" }, { "from": "human", "value": "\"use strict\";\n\nvar marked = require('meta-marked');\nvar jsxTransform = require('react-tools').transform;\nvar runtime = require.resolve('./runtime');\n\nfunction compile(src, opt...
javascript
chosen
[ { "from": "system", "value": "Support CR as line breaks\n" }, { "from": "human", "value": "'use strict'\n\nvar nl = /\\r?\\n/\n\nmodule.exports = function (str) {\n str = normalize(str)\n\n // remove leading start-line (e.g. HTTP/1.1 200 OK)\n var lines = str.split(nl)\n if (!~lines[0].index...
javascript
chosen
[ { "from": "system", "value": "Make node callback friendly and catch errors\n\nThis commit makes the callback given to the `calculate()` function node friendly.\r\nThis commit also wraps the `ffmpeg.ffprobe()` function in a `try/catch` expression\r\nto catch errors thrown in that function and propagate them...
javascript
chosen
[ { "from": "system", "value": "Make small change in order to test heroku\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar express = require('express')\nvar app = express()\nvar crawler = require('./src/crawler')\nvar Bacon = require('baconjs').Bacon\n\napp.use(express.static(__dirname ...
javascript
chosen
[ { "from": "system", "value": "Improve error catching and throwing\n\nNow catching errors from eslint's CLIEngine, for example if an unknown\nrule is used.\n\nAlso improved guard for throwing lint errors.\n" }, { "from": "human", "value": "var CLIEngine = require('eslint').CLIEngine;\nvar chalk =...
javascript
chosen
[ { "from": "human", "value": "Add file info loader source code.\n" }, { "from": "gpt", "value": "/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Vladimir Shafikov @kersh\n*/\nmodule.exports = function(content) {\n this.cacheable && this.cacheable();\n this.val...
javascript
chosen
[ { "from": "system", "value": "Fix mistake regarding `this` resolution.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function pluginSelfReference(schema, options) {\n // ensure `options` and `options.keys` are supplied\n if(!options || !(options.keys instanceof Array...
javascript
chosen
[ { "from": "system", "value": "Fix typo in jsdoc comment\n" }, { "from": "human", "value": "/*!\n * compressible\n * Copyright(c) 2013 Jonathan Ong\n * Copyright(c) 2014 Jeremiah Senkpiel\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module depe...
javascript
chosen
[ { "from": "system", "value": "New: Return child from execute method\n" }, { "from": "human", "value": "const spawn = require('child_process').spawn;\nconst reorder = require('./lib/reorder');\n\nexports.needed = function needed (flags, argv) {\n var shouldRespawn = false;\n if (!argv) {\n a...
javascript
chosen
[ { "from": "system", "value": "Replace superagent with nets 4 browserify support\n" }, { "from": "human", "value": "'use strict';\n\nvar request = require('superagent')\n , queryString = require('querystring')\n\nvar constructYoutubeApiUrl = function (key, endpoint, params) {\n var baseUrl = [...
javascript
chosen
[ { "from": "system", "value": "Throw error if 0 roads are found\n" }, { "from": "human", "value": "const getJSON = require('get-json');\nconst unique = require('array-unique');\n\n/** URL of the Overpass API being used */\nconst overpass = 'http://overpass-api.de/api/interpreter?data=';\n\n/**\n ...
javascript
chosen
[ { "from": "system", "value": "Check if app.options is available\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-power-select',\n\n included: function(appOrAddon) {\n var app = appOrAddon.app || appOrAddon;\n if (!app.__emberP...
javascript
chosen
[ { "from": "system", "value": "Add linkification to td elements.\n" }, { "from": "human", "value": "/*\nCopyright 2015 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the L...
javascript
chosen
[ { "from": "system", "value": "Set up knex and models\n" }, { "from": "human", "value": "\"use strict\"\nvar nunjucks = require('nunjucks');\nvar express = require('express');\nvar app = express();\nvar routes = require('./routes')(app);\n\napp.use(express.static(__dirname + '/static'));\n\nnunju...
javascript
chosen
[ { "from": "system", "value": "Add some logic to print out unset environment variables\n\nThe Trello calls won't be able to work unless they can get the key,\ntoken and board from environment variables. In case they haven't been\nset, the page will say so, so it's easier to figure out why it's not\nworking....
javascript
chosen
[ { "from": "system", "value": "Add `(fork)` to forked repos in CLI output\n\nFixes #4.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\nvar chalk = require('chalk');\nvar meow = require('meow');\nvar githubRepos = require('./');\n\nvar cli = meow({\n\thelp: [\n\t\t'Usage',...
javascript
chosen