conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add dev mode logging of GitHub API rate limits\n" }, { "from": "human", "value": "import Relay from 'react-relay';\n\nconst relayEnvironmentPerGithubHost = new Map();\n\nexport default class RelayNetworkLayerManager {\n static getEnvironmentForHost(host, token) {\n...
javascript
chosen
[ { "from": "system", "value": "Fix Sass issue with extends before mixins\n" }, { "from": "human", "value": "'use strict';\n\nvar helpers = require('../helpers');\n\nmodule.exports = {\n 'name': 'extends-before-mixins',\n 'defaults': {},\n 'detect': function (ast, parser) {\n var result = []...
javascript
chosen
[ { "from": "system", "value": "Simplify and fix ESLint errors.\n" }, { "from": "human", "value": "import { createStore, combineReducers, applyMiddleware, compose } from 'redux';\nimport thunk from 'redux-thunk';\nimport createLogger from 'redux-logger';\nimport initialReducers from './initialRedu...
javascript
chosen
[ { "from": "system", "value": "Add some links and things\n" }, { "from": "human", "value": " var app = angular.module('tokenKidApp', ['ngRoute']);\n\n// create the controller and inject Angular's $scope\napp.controller('mainController', function($scope) {\n\n // create a message to display in ...
javascript
chosen
[ { "from": "system", "value": "Write out grammar JSON to a file when compiling\n" }, { "from": "human", "value": "var api = require(\"../api\"),\n fs = require(\"fs-extra\"),\n path = require(\"path\"),\n mkdirp = require(\"mkdirp\"),\n templates = require(\"./templates\"),\n cwd =...
javascript
chosen
[ { "from": "system", "value": "Remove images tab for current version of Link HT\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('memexLinkerApp')\n .controller('NavbarCtrl', function ($scope, $location, Auth) {\n\n $scope.logo = 'http://icons.iconarchive.com/icons/icons8/io...
javascript
chosen
[ { "from": "system", "value": "Add a mock for require.context\n" }, { "from": "human", "value": "function importAll(r) {\n return r\n .keys()\n .map(k => ({ path: k, image: r(k) }))\n .reduce((prev, next) => {\n const key = next.path.replace(\"./\", \"\").replace(\".svg\", \"\");\n...
javascript
chosen
[ { "from": "system", "value": "Formatting: Replace double quotes with single quotes\n" }, { "from": "human", "value": "(function() {\n \"use strict\";\n\n angular.module(\"angular.jsgrid\", [])\n .directive(\"ngJsgrid\", function() {\n return {\n restrict: \"...
javascript
chosen
[ { "from": "system", "value": "Add some missing disabled features for Cassandra\n" }, { "from": "human", "value": "import mysql from './mysql';\nimport postgresql from './postgresql';\nimport sqlserver from './sqlserver';\nimport cassandra from './cassandra';\n\n\n/**\n * List of supported databa...
javascript
chosen
[ { "from": "system", "value": "Update Checking List for internal purposes" }, { "from": "human", "value": "[1,\"Before data cleaning: Importing the data\"],\n [2,\"Check for importing issues such as broken lines when importing .csv files\"],\n [2,\"Make sure you have unique IDs\"],\n [2,\"De-iden...
javascript
chosen
[ { "from": "system", "value": "Add backend function to reset type.\n" }, { "from": "human", "value": "Links = new Mongo.Collection(\"links\");\n\nMeteor.methods({\n addLink:function(link, description, type){\n // Insert a links into the collection\n Links.insert({\n description: descr...
javascript
chosen
[ { "from": "system", "value": "Add actions for filter events\n" }, { "from": "human", "value": "'use strict'\n\nexport const FETCH_EVENTS = 'FETCH_EVENTS'\nexport const EVENTS_SUCCESS = 'EVENTS_SUCCESS'\nexport const EVENTS_FAILED = 'EVENTS_FAILED'\n\nexport const FILL_FILTER_SELECTS = 'FILL_FILT...
javascript
chosen
[ { "from": "system", "value": "Set notification time to 5 seconds\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/roundcube-notifications-main';\nimport Notify from 'ember-notify';\n\nexport default Ember.Component.extend({\n layout: lay...
javascript
chosen
[ { "from": "system", "value": "Add missing index.html in webpack target\n" }, { "from": "human", "value": "const path = require('path');\nconst ls = require('ls');\nconst webpack = require('webpack');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\n\nconst plugins = [];\nconst entry =...
javascript
chosen
[ { "from": "system", "value": "Add route for top targets\n" }, { "from": "human", "value": "const requestsController = require('../../controllers/requests.js');\nconst requestHelper = require('../../helpers/requestHelper.js');\n\nmodule.exports = {\n '/:request/top/:size': {\n get: function g...
javascript
chosen
[ { "from": "system", "value": "Upgrade babel-compiler to the latest meteor-babel.\n" }, { "from": "human", "value": "Package.describe({\n name: \"babel-compiler\",\n summary: \"Parser/transpiler for ECMAScript 6+ syntax\",\n // Tracks the npm version below. Use wrap numbers to increment\n //...
javascript
chosen
[ { "from": "system", "value": "Use shortcut path to import the auth reducer\n" }, { "from": "human", "value": "import { combineReducers } from 'redux'\nimport auth from './auth'\n\nconst rootReducer = combineReducers({\n auth\n})\n\nexport default rootReducer\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "[fix] Hide trash folder after regression\n" }, { "from": "human", "value": "import { combineReducers } from 'redux'\n\nimport { folder, files } from './folder'\nimport ui from './ui'\n\nimport { TRASH_DIR_ID } from '../actions'\n\nconst filesApp = combineReducers({\...
javascript
chosen
[ { "from": "system", "value": "Revert \"Run both zepto and jQuery tests\"\n\nThis reverts commit e792e0e27236f601aa88c7c6cb78e3a383e99b44.\n" }, { "from": "human", "value": "// borrowed from https://github.com/keithamus/travis-ci-node-and-browser-qunit\nvar fs = require('fs'),\n page = new Web...
javascript
chosen
[ { "from": "system", "value": "Rewrite the main script according to the whole refactoring.\n" }, { "from": "human", "value": "\n( function( $, d, undefined )\n{\n \n d._ = window.console.debug.bind( window.console );\n \n d.init = function()\n {\n d.initFontSize();\n ...
javascript
chosen
[ { "from": "system", "value": "Remove useless default value from constant creator\n" }, { "from": "human", "value": "/**\n * Constant creator\n * @flow\n */\n\n/**\n * Like keymirror, but adds name as a value prefix\n * @param {string} [name=''] Constant name prefix\n * @param {Object} constants ...
javascript
chosen
[ { "from": "system", "value": "Fix AMD define to work with RequireJS\n" }, { "from": "human", "value": "\n// Handle node, amd, and global systems\nif (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = $rdf;\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Support for actions in profile\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { DrawerLabel } from '..'\nimport Avatar from 'material-ui/Avatar'\nimport styles from './Profile.css'\n\nconst avatarStyles = {\n\twidth: 200,\n\theig...
javascript
chosen
[ { "from": "system", "value": "Update form to input 'ends in minutes' and concensus percentage\n" }, { "from": "human", "value": "import React from 'react';\nimport {\n ScrollView,\n} from 'react-native';\nconst t = require('tcomb-form-native');\nconst Form = t.form.Form;\n\nconst NewPollScree...
javascript
chosen
[ { "from": "system", "value": "Add bigger delay to scroll component\n" }, { "from": "human", "value": "import { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\n\nconst isServer = typeof window === 'undefined';\n\nclass ScrollTo extends PureComponent {\n // eslint-disable-line...
javascript
chosen
[ { "from": "system", "value": "Use the updated file names for image components in import statements\n" }, { "from": "human", "value": "import ImgComponent from 'ember-cli-image/components/x-img';\nimport BackgroundImageComponent from 'ember-cli-image/components/background-image';\nimport LazyImag...
javascript
chosen
[ { "from": "system", "value": "Remove ID in CommentInput type\n" }, { "from": "human", "value": "import {\n GraphQLInputObjectType,\n GraphQLString,\n GraphQLID,\n GraphQLNonNull\n} from 'graphql';\n\nexport default new GraphQLInputObjectType({\n name: 'CommentInput',\n fields: {\n _id: ...
javascript
chosen
[ { "from": "system", "value": "Remove 'disable' flag from drivers of emissions data switch\n" }, { "from": "human", "value": "export const HISTORICAL_EMISSIONS = 'HISTORICAL_EMISSIONS';\nexport const FUTURE_PATHWAYS = 'FUTURE_PATHWAYS';\n\nexport const emissionTabs = [\n {\n name: 'HISTORICAL...
javascript
chosen
[ { "from": "system", "value": "Use regex instead to ignore files\n" }, { "from": "human", "value": "#!/usr/bin/env node\n/**\n * @fileOverview This sample code illustrates how one can read all collection files within a directory and run them\n * in parallel.\n */\nvar newman = require('../'), // ...
javascript
chosen
[ { "from": "system", "value": "Disable host on browsersync server\n" }, { "from": "human", "value": "var browserSync = require('browser-sync'),\r\n config = require('./config.json'),\r\n bs;\r\n\r\nprocess.on('message', function(message) {\r\n if (message.type === 'init') {\r\n bs = bro...
javascript
chosen
[ { "from": "system", "value": "Remove tmp layer after saving\n\nAdd default attributes also to already drawn features\n" }, { "from": "human", "value": "export default {\n template: require('./draw-layer-metadata.html'),\n bindings: {\n layer: '<',\n },\n controller: function ($scope, $tim...
javascript
chosen
[ { "from": "system", "value": "Fix delete project in admin list\n" }, { "from": "human", "value": "angular\n .module('app')\n .controller('projectListController', [\n '$scope',\n 'projectService',\n 'flash',\n 'MetaMachine',\n '$location',\n function($scope, projectAPI, notifi...
javascript
chosen
[ { "from": "system", "value": "Remove MongoDB functionality for now\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\nvar mongoose = require('mongoose');\nvar Scheme = mongoose.Schema;\nvar morgan = require('morgan');\nvar bodyParser = require('body-parse...
javascript
chosen
[ { "from": "system", "value": "Configure repo root as Jest context\n" }, { "from": "human", "value": "module.exports = {\n moduleNameMapper: {\n \"\\\\.(css|scss|svg)$\": \"<rootDir>/support/jest/fileMock.js\"\n },\n modulePaths: [\"node_modules\"],\n moduleFileExtensions: [\"js\", \"jsx\"...
javascript
chosen
[ { "from": "system", "value": "Improve logging of invalid JSON data.\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n define(\n [\n ],\n function () {\n return function (string) {\n try {\n return JSON.pa...
javascript
chosen
[ { "from": "system", "value": "Fix proxy urls for main uuid functions\n" }, { "from": "human", "value": "(function(){\n 'use strict';\n angular\n .module('SAKapp')\n .controller('UuidController', ['$scope', '$http', '$log', '$q', 'toaster', UuidController]);\n\n functi...
javascript
chosen
[ { "from": "system", "value": "Fix locale not updated (should not mutate global locale)\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport getDisplayName from '../utils/getDisplayName';\nimport { localeShape } from '../constants/PropTypes';\...
javascript
chosen
[ { "from": "system", "value": "Remove debug message about hiding toasts\n" }, { "from": "human", "value": "// var socket = io.connect(window.location.host);\nfunction Socket(){\n this.socket = io.connect(window.location.host);\n }\n\nSocket.prototype.makeMarkerFromTweet = function(map){\n this...
javascript
chosen
[ { "from": "system", "value": "Update to work with github's latest UI changes" }, { "from": "human", "value": "$(\"tr.file-diff-line.gi\").each(function (index, row) {\n var line = $(row).attr('data-line');\n var path = $(row).attr('data-path');\n\t// Fill in the path to the repo on your comput...
javascript
chosen
[ { "from": "system", "value": "Set default updateInterval to 2 minutes.\n\nSupercell's API only updates every 10 minutes.\n" }, { "from": "human", "value": "module.exports = {\n asyncLimit: 5,\n updateInterval: 90,\n clans: [\n {\n tag: '',\n channelId: ''\n }\n ],\n coc: {\n...
javascript
chosen
[ { "from": "system", "value": "ci: Use the todo app within the Quilt organization\n\nWe control https://github.com/quilt/node-todo, and it's the repo used by\nour demo repository.\n" }, { "from": "human", "value": "const quilt = require('@quilt/quilt');\nconst haproxy = require('@quilt/haproxy');...
javascript
chosen
[ { "from": "system", "value": "Add some enum types for actions\n" }, { "from": "human", "value": "import database from '../database'\n\n\nexport const actionTypes = {\n CREATE_VIDEO: 'CREATE_VIDEO',\n UPDATE_VIDEO: 'UPDATE_VIDEO',\n UPDATE_VIDEOS: 'UPDATE_VIDEOS',\n}\n\nexport const createVide...
javascript
chosen
[ { "from": "system", "value": "Remove path that came from template\n" }, { "from": "human", "value": "var express = require(\"express\"),\n app = express();\n\nvar bodyParser = require('body-parser');\napp.use(bodyParser.urlencoded({ extended: true }));\napp.use(bodyParser.json());\n\nvar port...
javascript
chosen
[ { "from": "system", "value": "Add object value check test\n" }, { "from": "human", "value": "import assert from 'assert'\nimport {contains, all} from 'ramda'\nimport {parseDepartmentHtml} from '../../app/parser'\nimport {courseData} from './courseData'\n\nconst titeData = parseDepartmentHtml(cou...
javascript
chosen
[ { "from": "system", "value": "Add script for project 2\n" }, { "from": "human", "value": "function toggleDiv(project1) {\n\n $(\"#\"+project1).toggle();\n\n}\n" }, { "from": "gpt", "value": "function toggleDiv(project1) {\n\n $(\"#\"+project1).toggle();\n\n}\n\nfunction toggleDiv...
javascript
chosen
[ { "from": "system", "value": "Fix a bug where two players couldn't connect at the same time.\n" }, { "from": "human", "value": "define(function (require) {\n\nvar HistoryBuffer = require(\"./historyBuffer\");\n\nreturn function EntityLagInducer(entity, initialState) {\n\tvar self = this;\n\tvar ...
javascript
chosen
[ { "from": "system", "value": "Update the hour list if the day start, end or interval changes\n" }, { "from": "human", "value": "'use strict';\n\nvar angular = require('angular');\n\nangular\n .module('mwl.calendar')\n .controller('MwlCalendarHourListCtrl', function($scope, moment, calendarConf...
javascript
chosen
[ { "from": "system", "value": "Adjust documentation and remove unnecessary code\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc function\n * @name docker-registry-frontend.controller:RepositoryDetailController\n * @description\n * # RepositoryController\n * Controller of the do...
javascript
chosen
[ { "from": "system", "value": "test(karma): Switch to use node_modules and fix reporters\n" }, { "from": "human", "value": "module.exports = function(config) {\n config.set({\n basePath: '',\n frameworks: ['jasmine'],\n files: [\n 'bower_components/angular/angular.js',\n 'bowe...
javascript
chosen
[ { "from": "system", "value": "Add Chrome support on Travis.\n" }, { "from": "human", "value": "// Karma configuration file, see link for more information\n// https://karma-runner.github.io/0.13/config/configuration-file.html\n\nmodule.exports = function (config) {\n config.set({\n basePath: ...
javascript
chosen
[ { "from": "system", "value": "Add custom Chrome launcher for travis.\n" }, { "from": "human", "value": "// Karma configuration\n// Generated on Fri Jul 15 2016 10:10:32 GMT-0700 (PDT)\n\nmodule.exports = function(config) {\n config.set({\n basePath: '',\n frameworks: ['jasmine'],\n fil...
javascript
chosen
[ { "from": "system", "value": "Fix wide button accessibility labels\n" }, { "from": "human", "value": "\nimport React, { PropTypes } from 'react';\n\nimport {\n View,\n TouchableOpacity,\n StyleSheet,\n Text,\n} from 'react-native';\n\nimport { globalStyles } from '../../styles';\n\nconst sty...
javascript
chosen
[ { "from": "system", "value": "Change adaddress, etc to gaddress, etc in address filter\n" }, { "from": "human", "value": "\n(function() {\n 'use strict';\n\n /**\n * Generate a human-readable address string from a single museum object\n *\n * Can get fancy here and prioritize o...
javascript
chosen
[ { "from": "system", "value": "Update: Use string templates rather than string concat\n" }, { "from": "human", "value": "export default href => {\n var link = document.createElement(\"a\")\n link.href = href\n return (link.protocol + \"//\" + link.host + link.pathname + link.search + link.hash...
javascript
chosen
[ { "from": "system", "value": "Add note on webhook notifications to help message\n" }, { "from": "human", "value": "import issues from './issues'\nimport webhooks from './webhooks'\n\nconst displayHelp = (bot, message) => bot.reply(message, `\n Here are some of the things I can do:\n - **list o...
javascript
chosen
[ { "from": "system", "value": "Make trackUser false for default\n" }, { "from": "human", "value": "import Raven from 'raven-js';\nimport RavenLoggerBase from './main';\n\nexport default class RavenLoggerClient extends RavenLoggerBase {\n constructor({ publicDSN, shouldCatchConsoleError, trackUse...
javascript
chosen
[ { "from": "system", "value": "Remove Http() baseURL and Router() onlyHash arguments\n" }, { "from": "human", "value": "import 'todomvc-common/base.css';\nimport 'todomvc-app-css/index.css';\nimport './styles.css';\nimport 'file?name=[name].[ext]!./index.html';\n\nimport React from 'react';\nimpo...
javascript
chosen
[ { "from": "system", "value": "Initialize scores and focus when start button is pressed\n" }, { "from": "human", "value": "'use strict';\n\nvar Games_x01 = function () {\n console.log('x01: start');\n\n var focusClass = 'focus';\n\n var dartsUi = window.dartsUi;\n\n var scoreIndex = 1;\n var...
javascript
chosen
[ { "from": "system", "value": "Fix NavListItem title property type declaration\n" }, { "from": "human", "value": "/**\n*\n* NavItem\n*\n*/\n\nimport React from 'react';\nimport { Link } from 'react-router';\nimport { ListItem } from 'material-ui/List';\nimport * as Colors from 'material-ui/styles...
javascript
chosen
[ { "from": "system", "value": "Refactor entry point to do setup\n" }, { "from": "human", "value": "'use strict';\n\n// Load settings\nconst settings = require('./libs/settings');\n\n// Run CLI and get arguments\nconst cli = require('./libs/cli'),\n options = cli.input();\n\n// Load required ...
javascript
chosen
[ { "from": "system", "value": "[eslint] Add es6 env for avoid some error\n" }, { "from": "human", "value": "module.exports = {\n 'env': {\n 'node': true,\n },\n 'extends': [\n 'eslint:recommended',\n ],\n 'parser': 'babel-eslint',\n 'rules': {\n 'comma-dangle': ['error', 'always-mu...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded initialization of gMap\n" }, { "from": "human", "value": "/**\n * @fileoverview Define the map component of the map module.\n */\n'use strict';\n\nangular.module('map').component('mapComponent', {\n templateUrl: 'map/map.template.html',\n contr...
javascript
chosen
[ { "from": "system", "value": "ESLint: Disable failing rules for now\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOptions: {\n ecmaVersion: 2018,\n sourceType: 'module',\n ecmaFeatures: {\n legacyDecorators: true,\n },\n...
javascript
chosen
[ { "from": "system", "value": "Set an id when an account registers\n" }, { "from": "human", "value": "\nvar mongo = require('./mongo');\n\nvar passport = require('passport');\nvar FacebookStrategy = require('passport-facebook').Strategy;\n\n\npassport.use(new FacebookStrategy({\n\n clientID: p...
javascript
chosen
[ { "from": "system", "value": "Store variables for signal status\n\n\nFormer-commit-id: e4d925bcfd4543eb9dc309091b0098b3c8e6ccd5" }, { "from": "human", "value": "/**\n * Get the network speed from zebedee/ping endpoint and output the network health\n **/\n\nfunction networkStatus(ping) {\n if...
javascript
chosen
[ { "from": "system", "value": "Revert \"fixed the bug where the server wouldn't die when project wasn't opened\"\n" }, { "from": "human", "value": "\"use strict\";\nlet StepNC = require('../../../../../STEPNode/build/Release/StepNC');\nlet fs = require(\"fs\");\n//Query for a json file that maps ...
javascript
chosen
[ { "from": "system", "value": "Tweak so it works in firefox as well\n" }, { "from": "human", "value": "'use strict';\n\n\n\n/**\n * Change aside margin to show it\n * Change content width do adjust to fit on the side of aside\n */\nvar showAside = (function() {\n $('aside-menu').setStyle('marg...
javascript
chosen
[ { "from": "system", "value": "Add complete huzzah list to story [skip ci]\n" }, { "from": "human", "value": "import React from 'react'\nimport { storiesOf } from '@storybook/react'\nimport { Centralize, Huzzah, Text } from '../src/index.js'\n\nconst stories = storiesOf('Huzzah', module)\n\nstori...
javascript
chosen
[ { "from": "system", "value": "Fix test bootstrap for new skinning approach\n\n" }, { "from": "human", "value": "/*\n * skinned-sdk.js\n *\n * Skins the react-sdk with a few stub components which we expect the\n * application to provide\n */\n\n/* this is a convenient place to ensure we load the ...
javascript
chosen
[ { "from": "system", "value": "Fix a strange mask problem" }, { "from": "human", "value": "/**\r\n * This class provides the modal Ext.Window support for all Authentication forms. It's\r\n * layout is structured to center any Authentication dialog within it's center\r\n */\r\nExt.define('Starter....
javascript
chosen
[ { "from": "system", "value": "Fix creating a new index\n\nFix when a index.collected file is not already present\n" }, { "from": "human", "value": "const Crypto = require('crypto')\nconst R = require('ramda')\nconst readIndex = require('./readIndex')\nconst hashDirectory = require('./hashDirecto...
javascript
chosen
[ { "from": "system", "value": "Fix bug : index out of bound on making cover img\n" }, { "from": "human", "value": "const fs = require('fs');\nconst mm = require('musicmetadata');\n// var iconv = require('iconv-lite');\n\nclass Music {\n\tconstructor(path = '', coverPath = ''){\n\t\tlet read_stre...
javascript
chosen
[ { "from": "system", "value": "Add more extensions to HTML" }, { "from": "human", "value": "'use babel'\n\nexport default {\n enableHtmlSupport: [\n {\n scopes: ['text.html.basic'],\n prefixes: [\n 'src=[\\'\"]',\n 'href=[\\'\"]'\n ],\n extensions: ['js', 'pn...
javascript
chosen
[ { "from": "system", "value": "Convert TransformQueue to ES class." }, { "from": "human", "value": "import { Class } from 'orbit/lib/objects';\nimport Evented from 'orbit/evented';\nimport ActionQueue from 'orbit/action-queue';\n\nexport default Class.extend({\n init() {\n Evented.extend(this...
javascript
chosen
[ { "from": "system", "value": "Add Promise polyfill for IE11\n" }, { "from": "human", "value": "// ES2015 APIs used by developer tools integration\nimport 'core-js/es6/map';\nimport 'core-js/fn/array/fill';\nimport 'core-js/fn/array/from';\nimport 'core-js/fn/object/assign';\n" }, { "from...
javascript
chosen
[ { "from": "system", "value": "Read the templates from the directory\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n(function() {\n \"use strict\";\n\n const fs = require('fs');\n const CONFIG_FILE = \"package.json\";\n\n (function() {\n let file = readFile(CONFIG_FILE);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Connect the web interface to Diffusion.\n" }, { "from": "human", "value": "\n(function() {\n var setup = false;\n function ready() {\n if (setup) {\n return;\n }\n\n // TODO: Init\n setup = true;\n }\n\n if (documen...
javascript
chosen
[ { "from": "system", "value": "Add promiseAnEvent (used by earlier commit, oops)\n" }, { "from": "human", "value": "/** @babel */\n\nimport log4js from 'log4js'\n\nconst logger = log4js.getLogger('pkg-groups-functions')\nlogger.level = 'debug'\n\n/**\n * Add a string to another string, unless the...
javascript
chosen
[ { "from": "system", "value": "Update cursor style for icon\n" }, { "from": "human", "value": "import React, {PropTypes} from 'react'\nimport OnClickOutside from 'react-onclickoutside'\n\nconst TemplateVariableManager = ({onClose}) => (\n <div className=\"template-variable-manager\">\n <div c...
javascript
chosen
[ { "from": "system", "value": "Make it clear which makeCouch we're using\n" }, { "from": "human", "value": "var vm = require('vm');\nvar fs = require('fs');\n\n// this is the context in which all of our test code will run\nvar initSandbox = {\n console: console,\n require: require,\n setTimeou...
javascript
chosen
[ { "from": "system", "value": "Add https for production calls\n" }, { "from": "human", "value": "export const DEVELOPMENT = 'http://api.tinkerware.io';\nexport const PRODUCTION = 'http://api.tinkerware.io';\n" }, { "from": "gpt", "value": "export const DEVELOPMENT = 'http://api.tinker...
javascript
chosen
[ { "from": "system", "value": "Add option for suffix when wrapping API\n" }, { "from": "human", "value": "module.exports = function promisifyNvim(nvim) {\n //promisify APIs\n var interfaces = {\n Nvim: nvim.constructor,\n Buffer: nvim.Buffer,\n Window: nvim.Window,\n Tabpage: nvim.T...
javascript
chosen
[ { "from": "system", "value": "Clear local storage if error exists\n" }, { "from": "human", "value": "(function() {\n function log(type, prefix, object) {\n const logObject = {\n type: type,\n prefix: prefix,\n url: location.href,\n agent: navigator.userAgent\n };\n ...
javascript
chosen
[ { "from": "system", "value": "Allow vscode install on windows\n" }, { "from": "human", "value": "var fs = require('fs');\nvar getHomePath = require('home-path');\nvar logHelper = require('../util/log-helper');\nvar path = require('path');\nvar process = require('process');\nvar symlinkOrReplaceF...
javascript
chosen
[ { "from": "system", "value": "Fix inferred file name extension\n" }, { "from": "human", "value": "import pageIcon from 'page-icon';\nimport path from 'path';\nimport fs from 'fs';\nimport tmp from 'tmp';\ntmp.setGracefulCleanup();\n\n/**\n *\n * @param {string} targetUrl\n * @param {string} outD...
javascript
chosen
[ { "from": "system", "value": "Add default handler for other routes that are not cached\n" }, { "from": "human", "value": "importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js');\n\nworkbox.core.skipWaiting();\nworkbox.precaching.precacheAndRoute([]);\nworkbox.pr...
javascript
chosen
[ { "from": "system", "value": "Add VariableNode constructor to ast for Row and Ind variables\n" }, { "from": "human", "value": "function KIFNode(kifExpressions) {\n this.type = 'KIFNode';\n this.expressions = this.expressions || [];\n this.expressions = this.expressions.concat(kifExpressions);...
javascript
chosen
[ { "from": "system", "value": "Use dotenv-webpack for env vars\n" }, { "from": "human", "value": "module.exports = {\n entry: [\n './src/index.js'\n ],\n node: { // https://github.com/webpack-contrib/css-loader/issues/447\n fs: 'empty'\n },\n output: {\n path: __dirname,\n public...
javascript
chosen
[ { "from": "system", "value": "Remove postcss from webpack because it doesn't work\n" }, { "from": "human", "value": "const { resolve } = require('path');\nconst webpack = require('webpack');\n\nmodule.exports = {\n entry: [\n 'react-hot-loader/patch',\n 'webpack-dev-server/client?http://l...
javascript
chosen
[ { "from": "system", "value": "Update grunt configuration for the embedded web server\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n 'use strict';\n\n grunt.loadNpmTasks('grunt-php');\n grunt.loadNpmTasks('grunt-contrib-less');\n grunt.loadNpmTasks('grunt-con...
javascript
chosen
[ { "from": "system", "value": "Add check to playerModel 'update()' to accept single object\n" }, { "from": "human", "value": "export class PlayerModelService {\n\tconstructor($log, $http, $localStorage, _, websocket) {\n\t\t'ngInject';\n\n\t\tthis.$log = $log;\n\t\tthis.$http = $http;\n\t\tthis.$...
javascript
chosen
[ { "from": "system", "value": "Update default pushTo option of grunt-bump\n" }, { "from": "human", "value": "/*global module:false*/\nmodule.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n // Task configuration.\n jshint: {\n options: {\n curly...
javascript
chosen
[ { "from": "system", "value": "Add a basic validation method\n" }, { "from": "human", "value": "var AddContactForm = function() {\n this.init();\n};\n\nAddContactForm.prototype = {\n el: '.js-addContact',\n\n init: function() {\n var $form = document.querySelector(this.el);\n $form.addEv...
javascript
chosen
[ { "from": "system", "value": "Add jshint to default grunt task\n" }, { "from": "human", "value": "/*global module*/\nmodule.exports = function (grunt) {\n 'use strict';\n\n grunt.loadNpmTasks('grunt-contrib-jshint');\n grunt.loadNpmTasks('grunt-mocha');\n\n var gruntConfig = {};\n ...
javascript
chosen
[ { "from": "system", "value": "Allow owncloud-sdk to be used in a web worker ....\n\nrefs https://github.com/webpack/webpack/issues/6642" }, { "from": "human", "value": "module.exports = {\n mode: 'production',\n entry: {\n files: [\n '@babel/polyfill',\n './src/index.js'\n ]\n ...
javascript
chosen
[ { "from": "system", "value": "Add source map and live reload\n" }, { "from": "human", "value": "var grunt = require('grunt');\nrequire('load-grunt-tasks')(grunt);\ngrunt.loadNpmTasks('grunt-contrib-uglify');\n\ngrunt.initConfig({\n '6to5': {\n options: {\n sourceMap: true,\n module...
javascript
chosen
[ { "from": "system", "value": "Add underscore.js' debounce function and apply it to the scroll tracking function\n" }, { "from": "human", "value": "var header_height = $('header').height() - 90,\n projects_height = $('.projects').height(),\n about_position = projects_height + he...
javascript
chosen
[ { "from": "system", "value": "Fix formToDictionary() special case for empty tree.species\n" }, { "from": "human", "value": "// Helper functions for fields defined by the field.html template\n\n\"use strict\";\n\nvar $ = require('jquery'),\n _ = require('underscore');\n\nexports.getField = fun...
javascript
chosen
[ { "from": "system", "value": "Update jsdoc to indicate optional param\n" }, { "from": "human", "value": "var exec = require('cordova/exec');\n\n/**\n * open\n *\n * @param {String} args File URI\n * @param {Function} success Optional success callback\n * @param {Function} error Optional error ca...
javascript
chosen
[ { "from": "system", "value": "Add then callback to render search-results template\n" }, { "from": "human", "value": "var Recipe = function(data){\n this.title = data.Title;\n this.stars = data.StarRating;\n this.imageUrl = data.ImageURL\n}\n\nfunction BigOvenRecipeSearchJson(query) {\n var a...
javascript
chosen