conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add a new line character\n" }, { "from": "human", "value": "var http = require('http');\nvar os = require('os');\n\nvar handler = function(request, response) {\n response.writeHead(200);\n response.end(\"You've hit \" + os.hostname());\n}\n\nvar www = http.cre...
javascript
chosen
[ { "from": "system", "value": "Clean up tick rm usage and add help\n" }, { "from": "human", "value": "export default rm\n\nimport Entry from '../entry'\nimport PouchDB from 'pouchdb'\nimport {write} from './output'\nimport chalk from 'chalk'\nimport conf from '../config'\n\nlet db = new PouchDB(c...
javascript
chosen
[ { "from": "system", "value": "Disable the SCAYT and context menu CKEditor plugins so we can use the native browser / OS spell-checker instead." }, { "from": "human", "value": "/*\r\nCopyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r\nFor licensing, see LICENSE.html or...
javascript
chosen
[ { "from": "system", "value": "Fix template chooser on save error.\n" }, { "from": "human", "value": ";$(function() {\n 'use strict';\n\n if ($('.inline-template').length > 1) {\n $('.inline-template').hide();\n $('#id_template_chooser').change(function() {\n let te...
javascript
chosen
[ { "from": "system", "value": "Add delegator for keys() in arethusaLocalStorage\n" }, { "from": "human", "value": "\"use strict\";\n\n/**\n * @ngdoc service\n * @name arethusa.core.arethusaLocalStorage\n *\n * @description\n * Arethusa's API to communicate with `localStorage`. All values stored a...
javascript
chosen
[ { "from": "system", "value": "fix: Rename variable because the template and the class has the same name\n" }, { "from": "human", "value": "import CompleteBlock from './completeBlock.html';\nimport './completeBlock.scss';\n\nclass CompleteBlock {\n\tstatic detailsComponent() {\n\t\treturn {\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Use Windows on Sauce to avoid unsupported platform combinations\n" }, { "from": "human", "value": "exports.config = {\n specs: ['ui/**/*.spec.js'],\n sauceUser: process.env.SAUCE_USERNAME,\n sauceKey: process.env.SAUCE_ACCESS_KEY,\n baseUrl: 'http://loca...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect extraction of error code\n" }, { "from": "human", "value": "export function asyncHandler(handler) {\n return function(req, res, next) {\n if (!handler) {\n throw new Error(`Invalid handler ${handler}, it must be a function.`);\n }\n\n ha...
javascript
chosen
[ { "from": "system", "value": "Fix issue with PhantomJS and Function.prototype.bind support\n" }, { "from": "human", "value": "//= require jquery\n//= require jquery_ujs\n//= require jquery.remotipart\n//= require select2\n//= require cocoon\n//= require dropzone\n//= require govuk/selection-butt...
javascript
chosen
[ { "from": "system", "value": "Remove require_self and back to require ./wookmark...\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, ...
javascript
chosen
[ { "from": "system", "value": "Remove loading of scrollify, not using\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/java...
javascript
chosen
[ { "from": "system", "value": "Set fontFamily on <Text> tests to guarantee consistent regardless of environment (hopefully fix failures in CI)\n" }, { "from": "human", "value": "import ReactDOM from 'react-dom';\nimport React from 'react';\nimport { shallow, render } from 'enzyme';\nimport { expe...
javascript
chosen
[ { "from": "system", "value": "Element: Remove the ‘isNestedObject’ helper, no longer used.\n" }, { "from": "human", "value": "import TYPES from 'types';\n\nfunction isMember(element) {\n if (element.element) {\n return element.element === TYPES.MEMBER;\n }\n\n return element === TYPES.MEMB...
javascript
chosen
[ { "from": "system", "value": "Improve robustness of cancellation detection.\n" }, { "from": "human", "value": "var initialized = false;\nvar options = {};\n\nPebble.addEventListener(\"ready\", function() {\n console.log(\"ready called!\");\n initialized = true;\n});\n\nPebble.addEventListener(...
javascript
chosen
[ { "from": "system", "value": "fix(transformers): Revert Enable async entity transforms\n\nThis reverts commit 6dcad860e5fc67fabcebeee762aad42d06e029e9." }, { "from": "human", "value": "import Promise from 'bluebird'\nimport { omit, defaults } from 'lodash/object'\nimport { partialRight } from 'l...
javascript
chosen
[ { "from": "system", "value": "Nearest: Return early if full colour\n" }, { "from": "human", "value": "// @flow\n\nimport { RANGE } from \"constants/controlTypes\";\n\nimport type { ColorRGBA } from \"types\";\n\nconst optionTypes = {\n levels: { type: RANGE, range: [1, 256], default: 2 }\n};\n\...
javascript
chosen
[ { "from": "system", "value": "Chore: Update message when package-lock.json should be updated\n\nNo need to remove lock file anymore." }, { "from": "human", "value": "import { danger, warn } from 'danger';\n\nconst packageChanged = danger.git.modified_files.includes('package.json');\nconst lockfi...
javascript
chosen
[ { "from": "system", "value": "Use `fs.access` instead of `fs.existsSync`\n" }, { "from": "human", "value": "'use strict'\n\nvar github = require('octonode')\nvar client = github.client()\nvar evRepo = client.repo('nodejs/evangelism')\n\nvar https = require('https')\nvar path = require('path')\nv...
javascript
chosen
[ { "from": "system", "value": "Fix no exit to the powershell in windows\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar childProcess = require('child_process');\n\n/**\n * play\n * To run the process to match the platform.\n * @param {string} filepath\n * @param {fu...
javascript
chosen
[ { "from": "system", "value": "Fix toast not showing player name\n" }, { "from": "human", "value": "class ResultController {\n constructor(SocketService, GameService, toastr, _, GameFactory) {\n 'ngInject';\n\n this._ = _;\n this.GameService = GameService;\n this.players = GameServic...
javascript
chosen
[ { "from": "human", "value": "Add cliffton-server object & some base functionality\n" }, { "from": "gpt", "value": "//@Authors: Oliver Barnwell(ob6160) Harry Dalton(Hoolean)\n\n//Requires\nvar net = require(\"net\");\nvar util = require(\"util\");\nvar EventEmitter = require(\"event\").EventEmitt...
javascript
chosen
[ { "from": "system", "value": "Use PORT env var for heroku demo\n" }, { "from": "human", "value": "require('./lib/seed')()\nconst { compose } = require('ramda')\nconst http = require('http')\nconst util = require('util')\n\nconst { logger, methods, mount, parseJson,\n redirect, routes, sta...
javascript
chosen
[ { "from": "system", "value": "Allow elements within SVG to overflow\n" }, { "from": "human", "value": " function chart(selection) {\n\n // Merging the various user params\n vars.user_vars = vistk.utils.merge(vars.user_vars, vars._user_vars);\n\n // Merging with current charts parameter...
javascript
chosen
[ { "from": "system", "value": "Use keypath.str property to prevent coercion erros" }, { "from": "human", "value": "import { isArray } from 'utils/is';\nimport { getKeypath, normalise } from 'shared/keypaths';\nimport runloop from 'global/runloop';\nimport getNewIndices from 'shared/getNewIndices'...
javascript
chosen
[ { "from": "system", "value": "Add default selected state to toolbar selections.\n" }, { "from": "human", "value": "import SelectStateItemsCollection from '../collections/SelectStateItemsCollection';\nimport meta from '../meta';\n\nexport default Backbone.Model.extend({\n initialize() {\n ...
javascript
chosen
[ { "from": "system", "value": "Replace config load callback wrapper\n" }, { "from": "human", "value": "'use strict';\n\nconst readConfig = require('restore-server-config');\n\n// singleton\nlet config;\n\n/**\n * Loads the configuration and stores it in the config singleton.\n * @param {string} b...
javascript
chosen
[ { "from": "system", "value": "Add checkbox event listeners after document load.\n" }, { "from": "human", "value": "//= require jquery\n//= require leaflet\n//= require leaflet-ajax\n//= require leaflet-routing-machine\n//= require osmtogeojson\n//= require maps\n\n\n$(\"#agua\").change(function ...
javascript
chosen
[ { "from": "system", "value": "Set default thumbs width to 250\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2014 Giovanni Capuano <webmaster@giovannicapuano.net>\n * Released under the MIT License\n * http://opensource.org/licenses/MIT\n */\n \nvar config = {};\n\n// Images configurati...
javascript
chosen
[ { "from": "system", "value": "Use the Link component from react-router in combination with our custom styled Link\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport Link from '../../components/link';\n\nclass LinkTest extends PureComponent {\n handleClick =...
javascript
chosen
[ { "from": "system", "value": "Update tests for Thumbnail component\n" }, { "from": "human", "value": "import React from 'react';\nimport shallowRender from '../utils/shallowRender';\n\nimport Thumbnail from '../../src/components/Thumbnail';\njest.unmock('../../src/components/Thumbnail');\n\ndesc...
javascript
chosen
[ { "from": "system", "value": "ELECTRON: Change wallet path for lite wallet\n" }, { "from": "human", "value": "import { app } from \"electron\";\n\nconst isDevelopment = process.env.NODE_ENV !== \"production\";\nimport os from \"os\";\nimport path from \"path\";\n\nlet walletPath = \"\";\n\nif (p...
javascript
chosen
[ { "from": "system", "value": "Remove form submit prevention logging\n" }, { "from": "human", "value": "function resetPage() {\n // Prevent default behaviour of all form submits throught Florence\n $(document).on('submit', 'form', function(e) {\n e.preventDefault();\n console....
javascript
chosen
[ { "from": "system", "value": "Use sceneRecord.get to get current route\n" }, { "from": "human", "value": "/* @flow */\n\nimport React from \"react-native\";\nimport routeMapper from \"../routes/routeMapper\";\nimport Colors from \"../../Colors.json\";\n\nconst {\n\tNavigationCard,\n\tStyleSheet,...
javascript
chosen
[ { "from": "system", "value": "Change calculateReserves minimum value to zero\n" }, { "from": "human", "value": "import {\n fromPairs,\n isEmpty,\n head,\n last,\n max,\n mapObjIndexed,\n sortBy,\n toPairs,\n} from 'ramda'\n\nexport function calculateReserves (cumulative, ...
javascript
chosen
[ { "from": "system", "value": "[WEB-1338] Add relative position to default container styles\n" }, { "from": "human", "value": "export default ({ borders, colors, radii, space }) => {\n const defaultStyles = {\n mx: 'auto',\n bg: colors.white,\n width: ['100%', '85%'],\n mb: `${space[...
javascript
chosen
[ { "from": "system", "value": "Rename ninja to youth to reduce confusion\n" }, { "from": "human", "value": "'use strict';\n\nfunction ticketTypes (args, callback) {\n var ticketTypes = [\n {name: 'ninja', title: 'Ninja', tooltip: 'Select Ninja to create tickets for attendees under 13 or over ...
javascript
chosen
[ { "from": "system", "value": "FIX - Removed unused dependencies\n" }, { "from": "human", "value": "/* global malarkey:false, moment:false */\n\nimport { config } from './index.config';\nimport { routerConfig } from './index.route';\nimport { themeConfig } from './index.theme';\nimport { runBlock...
javascript
chosen
[ { "from": "system", "value": "Add blacklist pages store state\n" }, { "from": "human", "value": "import AsyncStorage from '@react-native-community/async-storage';\nimport { persistStore, persistReducer } from 'redux-persist';\nimport { applyMiddleware, createStore } from 'redux';\nimport thunk f...
javascript
chosen
[ { "from": "system", "value": "Implement throttling on event listener\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Make a web element pannable.\n */\n\nmodule.exports = {\n\tinit: (elem, containerElem) => {\n\t\tvar container = containerElem ?\n\t\t\tcontainerElem : elem.parentElem...
javascript
chosen
[ { "from": "system", "value": "Add angular analytics as dependency" }, { "from": "human", "value": "'use strict';\n/* globals window, angular */\n\nangular.module('vlui', [\n 'LocalStorageModule',\n 'ui.select',\n ])\n .constant('_', window._)\n // datalib, vegalite, vega\n .constant('dl', ...
javascript
chosen
[ { "from": "system", "value": "Make return type more specific.\n" }, { "from": "human", "value": "/* @flow */\n\nimport matches from 'matches-selector-ng';\n\nconst proto = global.Element && global.Element.prototype;\nconst vendor = proto && proto.closest;\n\nexport default function closest(eleme...
javascript
chosen
[ { "from": "system", "value": "Remove circle and rectangle tools\n" }, { "from": "human", "value": "define(['backbone', 'backbone.marionette', 'communicator', 'leaflet', 'leaflet.draw'],\n function(Backbone, Marionette, Communicator, L, LeafletDraw) {\n\n return Marionette.Object.extend({\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix MediaEvent plugin of immersive project for new scene media\n\n" }, { "from": "human", "value": "var ForgePlugins = ForgePlugins || {};\n\nForgePlugins.MediaEvents = function()\n{\n this._video = null;\n};\n\nForgePlugins.MediaEvents.prototype =\n{\n boot: ...
javascript
chosen
[ { "from": "system", "value": "Fix collapsing of rule explanations\n" }, { "from": "human", "value": "/**\n * This file is covered by the AGPLv3 license, which can be found at the LICENSE file in the root of this project.\n * @copyright 2020 subtitulamos.tv\n */\n\nimport \"../css/rules.scss\";\n...
javascript
chosen
[ { "from": "system", "value": "Clone `defaults` object to avoid member assignment\n\nFixes urbica/galton#183\n" }, { "from": "human", "value": "const defaults = require('./defaults.js');\n\nconst parseBoolean = boolean => boolean === 'true';\n\nconst parseIntervals = (intervals) => {\n if (Array...
javascript
chosen
[ { "from": "system", "value": "Load and persist config on phone app\n" }, { "from": "human", "value": "var initialized = false;\n\nPebble.addEventListener(\"ready\", function() {\n console.log(\"ready called!\");\n initialized = true;\n});\n\nPebble.addEventListener(\"showConfiguration\", funct...
javascript
chosen
[ { "from": "system", "value": "Add a link to the import-subscribers page in the sidebar\n" }, { "from": "human", "value": "import React from 'react';\n\nimport SideLink from '../common/SideLink';\nimport { Link } from 'react-router';\n\nconst Sidebar = (props) => { // eslint-disable-line no-unus...
javascript
chosen
[ { "from": "system", "value": "Refactor open and close function to be the same thing, exported to be called from the command files.\n" }, { "from": "human", "value": "//TODO: Implement helper functions for:\n// open/close, lock/unlock, and other player and NPC interactions with doors.\n" }, {...
javascript
chosen
[ { "from": "system", "value": "Allow using keyboard to move between pages as well\n" }, { "from": "human", "value": "var store = null;\n\n$(function() {\n $(document).on(\"dragstart\", \"img\", false);\n\n $(\"#page-back\").click(function() {\n utils.page(utils.page() - 1);\n });\n $(\"#pa...
javascript
chosen
[ { "from": "system", "value": "Remove handling of failed send error\n" }, { "from": "human", "value": "// let messanger = require('./mailer/transport')();\n\nmodule.exports = function(_db, messanger){\n\n if(!SlickSources[_db]) return {start: () => false};\n\n let _req = {db:SlickSources[_d...
javascript
chosen
[ { "from": "system", "value": "Change onError behaviour; export safeSetTimeout\n" }, { "from": "human", "value": "//\n// Error handling\n//\nexport var onError\n\nexport function catchFunctionErrors(delegate) {\n return onError ? function () {\n try {\n return delegate.apply(...
javascript
chosen
[ { "from": "system", "value": "Fix an IE11 js bug in tab toggling\n" }, { "from": "human", "value": "function initTabs() {\n $(\".sub-nav.with-tabs dl a\").on(\"click\", function(e) {\n e.preventDefault();\n var anchor = e.target\n var dl = anchor.closest(\"dl\");\n var dd = anchor.c...
javascript
chosen
[ { "from": "system", "value": "Remove upload view from sourcecollectionview\n" }, { "from": "human", "value": "AV.SourceCollectionView = Backbone.View.extend({\n el: '#list_container',\n initialize: function() {\n this.listenTo(this.collection, 'all', this.render);\n console.l...
javascript
chosen
[ { "from": "system", "value": "Return the submit event in callback\n" }, { "from": "human", "value": "/** @jsx dom */\nimport dom from 'magic-virtual-element';\nimport formSerialize from 'form-serialize';\n\nexport const propTypes = {\n\tonSubmit: {\n\t\ttype: 'function'\n\t},\n\ttransform: {\n\t...
javascript
chosen
[ { "from": "system", "value": "Include the baseApp when running onAppend function\n" }, { "from": "human", "value": "(function () {\n\n\n module.exports = function (onCreate, onAppend) {\n var baseApp;\n\n return {\n /**\n * Array of properties to be copied...
javascript
chosen
[ { "from": "system", "value": "Remove the .js from requires.\n" }, { "from": "human", "value": "var Laminate = {};\n\nLaminate.Badge = require('./components/badge.js');\nLaminate.Button = require('./components/button.js');\nLaminate.Card = require('./components/card.js');\nLaminate.Content = requ...
javascript
chosen
[ { "from": "system", "value": "Rename div variable to right_now\n" }, { "from": "human", "value": "window.onload = initializeData()\n\nfunction initializeData() {\n var div = document.getElementById(\"right_now\");\n var date = new Date();\n div.textContent = date.getFullYear() + '-' + date.ge...
javascript
chosen
[ { "from": "system", "value": "Fix big number format configuration\n" }, { "from": "human", "value": "// @flow\nimport { observable, computed } from 'mobx';\nimport BigNumber from 'bignumber.js';\nimport Store from './lib/Store';\nimport CachedRequest from './lib/CachedRequest';\n\nexport default...
javascript
chosen
[ { "from": "system", "value": "test(ie11): Add browser spec for ie11. Doesn't seem that internet_explorer_latest works.\n" }, { "from": "human", "value": "const base = require('skatejs-build/karma.conf');\nmodule.exports = function (config) {\n base(config);\n\n // Remove all explicit IE defini...
javascript
chosen
[ { "from": "system", "value": "Add test output to Karma\n" }, { "from": "human", "value": "module.exports = function (config) {\n config.set({\n frameworks: ['jasmine', 'browserify'],\n preprocessors: {\n 'dist/lion.js': ['browserify', 'coverage'],\n 'test/**/*.js': ['browserify'...
javascript
chosen
[ { "from": "system", "value": "Fix Function.bind polyfill to work properly on PhantomJS.\n" }, { "from": "human", "value": "if (!Function.prototype.bind) {\n Function.prototype.bind = function(oThis) {\n if (typeof this !== 'function') {\n // closest thing possible to the ECMAScript 5\n ...
javascript
chosen
[ { "from": "system", "value": "Fix cave combat to reflect new battle sizes. 9x9\n" }, { "from": "human", "value": "eburp.registerMap(\"caveCombat\",{\n name: \"Cave Combat\",\n width: 9,\n height: 9,\n map: \"\\\nC'''''''C\\\nC'''''''C\\\nC'''''''C\\\nC'''''''C\\\nC'''''''C\\\nC'''''''C\...
javascript
chosen
[ { "from": "system", "value": "Replace pre function with start game function\n" }, { "from": "human", "value": "/**\n * Module dependencies.\n */\nconst Score = require('./score');\nconst mongoose = require('mongoose');\nconst Schema = mongoose.Schema;\n\n// create a schema\nconst gameSch...
javascript
chosen
[ { "from": "system", "value": "Use underscore on client in github-oauth\n\n`_` is being used in github_client.js, but not specified in the package\n" }, { "from": "human", "value": "Package.describe({\n summary: 'GitHub OAuth flow',\n version: '1.2.0'\n});\n\nPackage.onUse(function (api) {\n a...
javascript
chosen
[ { "from": "system", "value": "Add experience and non-null constraints to User model.\n" }, { "from": "human", "value": "module.exports = function(sequelize, DataTypes) {\n var User = sequelize.define('User', {\n username: {type: DataTypes.STRING, unique: true},\n password: DataT...
javascript
chosen
[ { "from": "system", "value": "Fix typo on add new layer button\n" }, { "from": "human", "value": "export default {\n 'opacity-label': {\n 'tooltip': 'Видимость слоя'\n },\n 'attributes-button': {\n 'tooltip': 'Показать панель атрибутов слоя'\n },\n 'bounds-button': {\n 'tooltip': '...
javascript
chosen
[ { "from": "system", "value": "Remove the app variable for styling\n" }, { "from": "human", "value": "(function(){\n var app = angular.module('color', []);\n\n app.config(['$httpProvider', function($httpProvider) {\n $httpProvider.defaults.useXDomain = true;\n delete $httpProvider.default...
javascript
chosen
[ { "from": "system", "value": "Switch browserify back to debugging mode.\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\n\nvar config = require('./_config.js');\nvar paths = config.paths;\nvar $ = config.plugins;\n\nvar istanbul = require('browserify-istanbul');\n...
javascript
chosen
[ { "from": "system", "value": "Fix for double attempt at circle on iOS.\n" }, { "from": "human", "value": "// @flow\nimport React from 'react';\nimport { Image, View } from 'react-native';\n\nimport theme from '../../theme';\n\ntype Props = {\n size?: number,\n source: string,\n style?: Object...
javascript
chosen
[ { "from": "system", "value": "Fix naming and remove unnecessary []\n" }, { "from": "human", "value": "import React from 'react';\nimport { Link } from 'react-router';\nimport Tooltip from 'app/components/Tooltip';\nimport { FlexRow, FlexColumn, FlexItem } from 'app/components/FlexBox';\n\nconst ...
javascript
chosen
[ { "from": "system", "value": "Update zero data column width on desktop.\n" }, { "from": "human", "value": "/**\n * Admin Bar Clicks component.\n *\n * Site Kit by Google, Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this ...
javascript
chosen
[ { "from": "system", "value": "Move code to the job queue implementation\n" }, { "from": "human", "value": "var request = require('request');\nvar model = require('../models/index');\n\n/* Sets a like in the Like table for a given artist and user (by Facebook ID number) */\nexports.likeArtist = f...
javascript
chosen
[ { "from": "system", "value": "Remove vertical padding from details card\n" }, { "from": "human", "value": "import React from \"react-native\";\nimport PeopleListContainer from \"../containers/PeopleListContainer\";\nimport Card from \"./Card\";\nimport CardTitle from \"./CardTitle\";\nimport Dis...
javascript
chosen
[ { "from": "system", "value": "Use jQuery.scrollTop to support IE.\n" }, { "from": "human", "value": "$(function () {\n $('.frilinks .fri').each(function (n, e) {\n e = $(e);\n var hr = e.find('a').attr('href');\n if (!hr)\n return;\n e.css({cursor: 'poin...
javascript
chosen
[ { "from": "system", "value": "Remove unload objects as this leads to errors\n" }, { "from": "human", "value": "(function() {\n\n var app;\n \n var getApplication = function() {\n return app;\n };\n \n var shutDown = function() {\n lowland.ObjectManager.dispose();\n };\n \n var sta...
javascript
chosen
[ { "from": "system", "value": "Document library renamed to Document Wiki\n" }, { "from": "human", "value": "xcomponents.appVersion = '0.1';\nxcomponents.menuOptions = [\n \n { label : 'Data objects', url : '/', icon : 'fa-dashboard' }\n \n ];\n\nxcomponents.models['dataObject'] = {\n n...
javascript
chosen
[ { "from": "system", "value": "Use the oerpub image plugin instead.\n" }, { "from": "human", "value": "/**\n * Used to initialize the Aloha settings for this application.\n *\n * Author: Michael Mulich\n * Copyright (c) 2012 Rice University\n *\n * This software is subject to the provisions of th...
javascript
chosen
[ { "from": "system", "value": "Sort content items by DEC _id\n" }, { "from": "human", "value": "'use strict';\n\nconst _ = require('lodash');\nconst Bluebird = require('bluebird');\nconst mongoose = require('mongoose');\nconst mongooseDelete = require('mongoose-delete');\...
javascript
chosen
[ { "from": "system", "value": "Add styling classes to the embedded product page script\n" }, { "from": "human", "value": "/* global $ */\n\n$(() => {\n \"use strict\";\n\n var $qanda = $(\".js-q-and-a\");\n var url = \"http://localhost:8000/5614e8bded37eded3f16a9e6\";\n\n fetch(url).then((res...
javascript
chosen
[ { "from": "system", "value": "Fix App import pointing to old place\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Provider } from 'react-redux'\nimport { createStore } from 'redux'\nimport './index.css';\nimport App from './App';\nimpor...
javascript
chosen
[ { "from": "system", "value": "chore(examples): Check for request data prior to setting user\n\nIf outside of request scope (or the process domain is otherwise null,\nthen skip setting request data)" }, { "from": "human", "value": "const bugsnag = require(\"./bugsnag\");\n\nfunction attemptLogin(...
javascript
chosen
[ { "from": "system", "value": "Disable logging to file by default\n" }, { "from": "human", "value": "module.exports = {\n notice: {\n 'logFile': './logs/ark-desktop.log',\n 'level': 1,\n 'defaultHideDelay': 5000\n }\n};" }, { "from": "gpt", "value": "module.exports = {\n n...
javascript
chosen
[ { "from": "system", "value": "Disable html5Mode if hostname is s3-website\n" }, { "from": "human", "value": "'use strict';\n'format es6';\n\nexport class Config {\n /**\n *\n * @param {Boolean} isLocalhost\n * @param {String} ngRewrite\n * @param {Object} $locationProvider\n */\n con...
javascript
chosen
[ { "from": "system", "value": "Add basic spec for getAccentColor\n" }, { "from": "human", "value": "const assert = require('assert')\nconst {remote} = require('electron')\nconst {systemPreferences} = remote\n\ndescribe('systemPreferences module', function () {\n if (process.platform !== 'darwin'...
javascript
chosen
[ { "from": "system", "value": "Fix dot escaping for jQuery and use $()[0]\n" }, { "from": "human", "value": "/* Can't use $.toggle() as we are using a custom `display` that is `none`\n when the page first loads */\nfunction toggle (name, mode) {\n var id = name + '-' + mode\n var e = document...
javascript
chosen
[ { "from": "system", "value": "Allow log container to be full height\n\nWhen viewing deployment logs in the dashboard, the logs are typically very long, but the log window is limited to 600px heigh. Given there is nothing else on the deployment page other than the logs, would be good if the height wasn't li...
javascript
chosen
[ { "from": "system", "value": "Use our own Monospaced component instead of applying monospace class from ui-typography\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\nimport omit from 'lodash.omit...
javascript
chosen
[ { "from": "system", "value": "Update function help interact with User\n" }, { "from": "human", "value": "(function () {\n var User = require('../database/mongodb').Users,\n jwt = require('jwt-simple'),\n async = require('async'),\n crypto = require('crypto');\n\n funct...
javascript
chosen
[ { "from": "system", "value": "Remove reliance on function prototype extension.\n" }, { "from": "human", "value": "import Ember from \"ember\";\nimport Snippets from \"../snippets\";\n\n/* global require */\nvar Highlight = require('highlight.js');\n\nexport default Ember.Component.extend({\n ta...
javascript
chosen
[ { "from": "system", "value": "Remove var command declaration (failing jshint test)\n" }, { "from": "human", "value": "'use strict';\n\nvar Command = require('../models/command');\nvar lookupCommand = require('../cli/lookup-command');\nvar string = require('../utilities/string');\n\nmodule.export...
javascript
chosen
[ { "from": "system", "value": "Break line to avoid having a line that's too long.\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nmodule.exports = function() {\n var content = fs.readFileSync(path.resolve(__dirname, '../templates/help.t...
javascript
chosen
[ { "from": "system", "value": "Add router stub and clean up IndexRoute" }, { "from": "human", "value": "App = Ember.Application.create({});\n\nApp.IndexRoute = Ember.Route.extend({\n setupController: function(controller) {\n controller.set('content', ['red', 'yellow', 'blue']);\n }\n});" }...
javascript
chosen
[ { "from": "system", "value": "Speed up by having separate thunk forcings\n" }, { "from": "human", "value": "// Runtime\n\n////////////////////////////////////////////////////////////////////////////////\n// Thunks\n\n// A thunk object\nfunction $(value)\n{\n this.forced = false;\n this.value =...
javascript
chosen
[ { "from": "system", "value": "Fix PropTypes for local dev server\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport Helmet from 'react-helmet';\nimport { ServerStyleSheet } from 'styled-components';\n\nconst HTML = props => {\n const head ...
javascript
chosen
[ { "from": "system", "value": "Use history option for vue-router\n" }, { "from": "human", "value": "import Vue from 'vue';\nimport VueRouter from 'vue-router';\nimport App from './App';\n\nVue.use(VueRouter);\n\nconst Main = Vue.extend({});\nconst router = new VueRouter();\n\nrouter.map({\n '/':...
javascript
chosen
[ { "from": "system", "value": "Improve time generation for logging\n" }, { "from": "human", "value": "const moment = require(\"moment\");\n\nlet ctx;\n\ntry {\n const chalk = require(\"chalk\");\n\n ctx = new chalk.constructor({enabled:true});\n} catch (err) {\n // silent\n}\n\nfunction ...
javascript
chosen
[ { "from": "system", "value": "Create component using statelless component\n" }, { "from": "human", "value": "var React = require('react');\nvar ReactDOM = require('react-dom');\n\nvar ProfilePic = React.createClass({\n render: function() {\n return (\n <img src={'https://pho...
javascript
chosen
[ { "from": "system", "value": "Use const and remove useless lines\n" }, { "from": "human", "value": "var assert = require('assert')\nvar AWS = require('aws-sdk')\n\n/**\n * Create s3 client\n * @param {Object} config AWS configuration\n * @returns {Object} s3 client and helpers\n */\nmodule.expor...
javascript
chosen
[ { "from": "system", "value": "Fix up gjshint errors in output manager\n" }, { "from": "human", "value": "'use strict';\n\nvar OutputManager = (function () {\n\n var outputs = [];\n var active = [];\n var display = undefined;\n\n var addOutput = function(o) {\n outputs.push(o);\n };\n\n ...
javascript
chosen
[ { "from": "system", "value": "Set German month names for date editor.\n" }, { "from": "human", "value": "// Overwriting Backbone.Marionette.Renderer to use JST\nBackbone.Marionette.Renderer.render = function(template, data) {\n if (!JST[template]) throw \"Template '\" + template + \"' not found...
javascript
chosen