conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix public path to the files/scripts\n" }, { "from": "human", "value": "const webpack = require('webpack');\nconst merge = require('webpack-merge');\nconst UglifyJSPlugin = require('uglifyjs-webpack-plugin');\nconst common = require('./webpack.common.js');\n\nmodule...
javascript
chosen
[ { "from": "system", "value": "Remove JSX element left by mistake\n" }, { "from": "human", "value": "var React = require('react');\n\nvar Header = require('./header');\nvar Feed = require('./feed');\n\nvar App = React.createClass({\n\n getInitialState: function() {\n return { requests: ...
javascript
chosen
[ { "from": "system", "value": "Convert to new media type layout.\n" }, { "from": "human", "value": "Application.Services.factory(\"sidebarUtil\", sidebarUtilService);\n\nfunction sidebarUtilService() {\n return {\n projectSize: function(project) {\n if (!('projectSize' in pro...
javascript
chosen
[ { "from": "system", "value": "Remove empty line at EOF\n" }, { "from": "human", "value": "/**\n * main.js\n *\n * Only runs in modern browsers via feature detection\n * Requires support for querySelector, classList and addEventListener\n */\n\nif('querySelector' in document && 'classList' in doc...
javascript
chosen
[ { "from": "system", "value": "Use ES6 class to define ExampleReduxChartContainer\n" }, { "from": "human", "value": "import React from 'react';\nimport { connect } from 'react-redux';\nimport ExampleReduxChart from '../views/example-redux-chart';\nimport * as chartApi from '../../api/chart-api';\...
javascript
chosen
[ { "from": "system", "value": "Add hash to bundle filename\n" }, { "from": "human", "value": "var webpack = require(\"webpack\")\nvar HtmlWebpackPlugin = require('html-webpack-plugin')\n\n\nmodule.exports = {\n // devtool: \"eval\", // Transformed code\n devtool: \"source-map\", // Original cod...
javascript
chosen
[ { "from": "system", "value": "Use eval devtools in webpack\n" }, { "from": "human", "value": "var webpack = require(\"webpack\")\nvar HtmlWebpackPlugin = require('html-webpack-plugin')\n\n\nmodule.exports = {\n // devtool: \"eval\", // Transformed code\n devtool: \"source-map\", // Original co...
javascript
chosen
[ { "from": "system", "value": "Revert \"NoErrorsPlugin is not needed with hot/only-dev-server\"\n\nThis reverts commit 770f167bb66187231c45222a231afb25f5ea6230.\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n entry: [\n ...
javascript
chosen
[ { "from": "system", "value": "Fix typo extenstions -> extensions" }, { "from": "human", "value": "var webpack = require('webpack');\nvar path = require('path');\nvar loader = require('babel-loader');\n\nvar BUILD_DIR = path.resolve(__dirname, 'client/src/public');\nvar APP_DIR = path.resolve(__d...
javascript
chosen
[ { "from": "system", "value": "Compress more aggressively (thanks @jdalton)\n" }, { "from": "human", "value": "'use strict';\n\nvar webpack = require('webpack')\n\nvar env = process.env.NODE_ENV\nvar config = {\n module: {\n loaders: [\n { test: /\\.js$/, loaders: ['babel-loader'], exclu...
javascript
chosen
[ { "from": "system", "value": "Remove old reference to LoginPage\n" }, { "from": "human", "value": "import CustomerPage from './CustomerPage';\nimport CustomersPage from './CustomersPage';\nimport CustomerInvoicePage from './CustomerInvoicePage';\nimport CustomerInvoicesPage from './CustomerInvoi...
javascript
chosen
[ { "from": "system", "value": "Update expected number of nodes\n" }, { "from": "human", "value": "var acorn = require(\"acorn\"), assert = require(\"assert\"), idast = require(\"./idast\"), walk = require(\"acorn/util/walk\");\n\nvar mkAST = function() {\n return acorn.parse(\"(function(a) { var...
javascript
chosen
[ { "from": "system", "value": "Add response limit parameter to the request\n" }, { "from": "human", "value": "define(['app'], function(app) {\n\n return ['$scope', '$timeout', '$http', function($scope, $timeout, $http) {\n $scope.authors = [];\n\n $scope.search = {\n a...
javascript
chosen
[ { "from": "system", "value": "Fix an issue with Fiber (User.avatar)\n" }, { "from": "human", "value": "import { RocketChat } from 'meteor/rocketchat:lib';\nimport property from 'lodash.property';\n\nimport schema from '../../schemas/users/User-type.graphqls';\n\nconst resolver = {\n\tUser: {\n\t...
javascript
chosen
[ { "from": "system", "value": "Handle app boot without cache\n" }, { "from": "human", "value": "function runBlock( // eslint-disable-line max-params\r\n $rootScope, jwtHelper, $state, $location, APP_CONFIG, authService, localStorage\r\n) {\r\n 'ngInject';\r\n\r\n $rootScope.$on('$stateCh...
javascript
chosen
[ { "from": "system", "value": "Apply prefix for static files too\n" }, { "from": "human", "value": "var express = require('express');\nvar path = require('path');\n\nexports.registerHandlers = function(application, params) {\n params = params || {};\n\n var prefix = params.prefix || '';\n pref...
javascript
chosen
[ { "from": "system", "value": "Remove console.log used for debugging\n" }, { "from": "human", "value": "let configuration = require('../../configuration.js');\nlet jwt = require('jsonwebtoken');\n\nasync function signIn(email, password, userStore) {\n if (!await userStore.checkPassword(email, pa...
javascript
chosen
[ { "from": "system", "value": "Use alternative way for defining controller and controllerAs for directive\n" }, { "from": "human", "value": "// app.shoppingListDirective.js\n\n(function() {\n \"use strict\";\n\n angular.module(\"ShoppingListDirectiveApp\")\n .directive(\"shoppingList\", Shop...
javascript
chosen
[ { "from": "system", "value": "Fix typo (missing NOT operator)\n" }, { "from": "human", "value": "\n/**\n * Add or delete elements of a set using CSS selectors.\n *\n * @this {Set}\n * The set to be manipulate.\n * @param {String}\n * Action to apply on the set, either 'add' or 'delete'.\n * ...
javascript
chosen
[ { "from": "system", "value": "Define where to find the side stories\n" }, { "from": "human", "value": "module.exports = {\n stories: ['../**/*.stories.js'],\n addons: ['@storybook/addon-backgrounds', '@storybook/addon-knobs'],\n};\n" }, { "from": "gpt", "value": "module.exports = {...
javascript
chosen
[ { "from": "system", "value": "Use the base integer to determine the second\n" }, { "from": "human", "value": "function time () {\n // http://kevin.vanzonneveld.net\n // + original by: GeekFG (http://geekfg.blogspot.com)\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonnev...
javascript
chosen
[ { "from": "system", "value": "Move font load inside document.ready.\n" }, { "from": "human", "value": "WebFont.load({\n custom: {\n families: ['star-lit-night'],\n urls: ['/css/font.css']\n }\n});\n" }, { "from": "gpt", "value": "$(document).ready(function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add missing require statement in example\n" }, { "from": "human", "value": "'use strict';\n\n/**\n* Evaluate the natural logarithm of \\\\(1+x\\\\).\n*\n* @module @stdlib/math/base/special/log1p\n*\n* @example\n* var v = log1p( 4.0 );\n* // returns ~1.609\n*\n* v = ...
javascript
chosen
[ { "from": "system", "value": "FIX suppress diff replacer until proper diff highlighting can be done\n" }, { "from": "human", "value": "({\n replacer: function (key, value) {\n if (typeof value === \"number\") {\n return \"REPLACED\";\n }\n return value;\n }\...
javascript
chosen
[ { "from": "system", "value": "Clean up plugin task file\n" }, { "from": "human", "value": "/*\n * grunt-purifycss\n * https://github.com/purifycss/grunt-purify-css\n *\n * Copyright (c) 2015 Phoebe Li, Matthew Rourke, Kenny Tran\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nvar gl...
javascript
chosen
[ { "from": "system", "value": "Change button class for new post controls location\n" }, { "from": "human", "value": "import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport Button from 'flarum/components/Button';\nimport CommentPost from 'flarum/components/CommentPost';\n\n...
javascript
chosen
[ { "from": "system", "value": "Set up Travis test environment (cont. 2)\n\nHopefully turns off auto-watch when running the tests in\nTravis, which will hopefully let the tests complete.\n" }, { "from": "human", "value": "// Karma configuration file, see link for more information\n// https://karma...
javascript
chosen
[ { "from": "system", "value": "FIX Device group registrations did not observe active attributes\n" }, { "from": "human", "value": "/*\n * Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U\n *\n * This file is part of lightweightM2M-iotagent\n *\n * lightweightM2M-iotagent is free softwa...
javascript
chosen
[ { "from": "system", "value": "Add a shape to the test object in the render test\n" }, { "from": "human", "value": "var game = TameGame.game;\nvar sprites = TameGame.sprites;\nvar data = TameGame.data;\n\n// Load a sprite\nvar spriteIds = TameGame.loadTpJsonSpriteSheet(sprites...
javascript
chosen
[ { "from": "system", "value": "Add placeholder for input field\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nclass SearchBar extends Component {\n constructor(props) {\n super(props);\n\n this.state = { term: '' };\n }\n\n onInputChange(term) {\n this...
javascript
chosen
[ { "from": "system", "value": "Add program indicator attribute setters\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nimport Realm from 'realm';\n\n/**\n * A program indicator functions as a many-to-one join and grouping mechanism for ma...
javascript
chosen
[ { "from": "system", "value": "Align internal GUID_KEY with symbol function\n\nThese keys should generate strings with the same format.\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nvar id = 0;\n\nfunction symbol() {\n return `__ember${new Date().getTime()}_${id++}`;\n}\n\nfun...
javascript
chosen
[ { "from": "system", "value": "Make test pass. We have the test env setup properly." }, { "from": "human", "value": "var assert = require('assert');\n\ndescribe('test setup', function() {\n it('works', function() {\n assert.equal(1,2);\n });\n});" }, { "from": "gpt", "value": "va...
javascript
chosen
[ { "from": "system", "value": "Use the user service to persist or modify state\n" }, { "from": "human", "value": "'use strict';\n\nimport { userModel } from '../../../models/index';\n\nconst buildResponse = (statusCode, data, res) => {\n if (statusCode === 200) {\n return res.status(200).json...
javascript
chosen
[ { "from": "system", "value": "Allow subtitles to be blank.\n" }, { "from": "human", "value": "const React = require('react')\n\nconst Result = React.createClass({\n\n propTypes: {\n active: React.PropTypes.bool.isRequired,\n value: React.PropTypes.object.isRequired,\n activate: React.P...
javascript
chosen
[ { "from": "system", "value": "Comment out access control headers\n\nWhich are not necessary since we are using express to serve the app on the same domain" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\n\n// Serve assets in /public\nvar path = require('p...
javascript
chosen
[ { "from": "system", "value": "Fix a scoping issue when calling next().\n" }, { "from": "human", "value": "\nfunction handle( req, res, done )\n{\n var payload = req.flick.payload,\n repository = payload.repository.owner.name + '/' + payload.repository.name,\n index = 0;\n\n f...
javascript
chosen
[ { "from": "system", "value": "Make it into a simple library\n" }, { "from": "human", "value": "var mt = require('mersenne-twister')\n\nvar prng\nvar codes\nvar generator\n\nmain()\nfunction main() {\n seed = process.argv[2]\n setup(seed)\n\n console.log(getBuffer(10000))\n}\n\nfunction ...
javascript
chosen
[ { "from": "system", "value": "Add logic for generateType() and generateUpsertFields() functions\n" }, { "from": "human", "value": "'use strict'\n\nexports.generateAuth = function (options) {\n return options.user && options.pwd ? `-u ${options.user} -p ${options.pwd} --authenticationDatabase ${...
javascript
chosen
[ { "from": "system", "value": "Add background property to PreviewOpener\n" }, { "from": "human", "value": "/** @babel */\n\nimport Opener from '../opener'\nimport { isPdfFile, isPsFile } from '../werkzeug'\n\nexport default class PreviewOpener extends Opener {\n async open (filePath, texPath, li...
javascript
chosen
[ { "from": "system", "value": "interstellar: Fix reversed grid width/height segment counts.\n" }, { "from": "human", "value": "/*exported Grid*/\nvar Grid = (function() {\n 'use strict';\n\n function create( options, callback ) {\n options = options || {};\n\n var size = options.size || 5...
javascript
chosen
[ { "from": "system", "value": "Fix issue when setting value with Null\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Handlebars.makeBoundHelper(function (object, key, sub) {\n if (typeof sub !== 'string' && typeof sub !== 'number') sub= '';\n return Ember....
javascript
chosen
[ { "from": "system", "value": "Remove the cache table from the database\n" }, { "from": "human", "value": "'use strict';\n\nvar Promise = require('bluebird')\nvar treo = require('treo')\nvar treoPromise = require('treo/plugins/treo-promise')\n\nvar schema = treo.schema()\n\t.version(1)\n\t\t.addS...
javascript
chosen
[ { "from": "system", "value": "Allow pretender.js to run in dev mode\n" }, { "from": "human", "value": "'use strict';\n\nconst EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nmodule.exports = function(defaults) {\n let app = new EmberAddon(defaults, {});\n\n /*\n This build fi...
javascript
chosen
[ { "from": "system", "value": "Change popup content to user input values\n" }, { "from": "human", "value": "/**\n @module ember-flexberry-gis\n*/\n\nimport Ember from 'ember';\nimport BaseMapCommand from './base';\n\n/**\n Go to map-command.\n Moves map to a given geographic point.\n\n @class...
javascript
chosen
[ { "from": "system", "value": "Add $httpbackend test to test notesTabController" }, { "from": "human", "value": "/* \n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor....
javascript
chosen
[ { "from": "system", "value": "Move opt-in controls to above calling button\n" }, { "from": "human", "value": "$(document).on('can_embed_loaded', function () {\n console.log('Form loaded.');\n phoneField = $('#phone');\n zipField = $('#form-zip_code');\n emailField = $('#form-email');\n theF...
javascript
chosen
[ { "from": "system", "value": "Read what you're getting up front\n" }, { "from": "human", "value": "import Rx from 'rx';\nimport {h} from '@cycle/dom';\n\nexport function labeledSlider(responses) {\n function intent(DOM) {\n return {\n newValue: DOM.select('.slider').events('input')\n ...
javascript
chosen
[ { "from": "system", "value": "Add missing vendors to webpack\n" }, { "from": "human", "value": "var webpack = require('webpack');\n\nmodule.exports = {\n entry: {\n app: './src/js/app.jsx',\n vendors: ['react', 'react-dom', 'es6-promise-polyfill']\n },\n output: {\n path: './dist/js/...
javascript
chosen
[ { "from": "system", "value": "Fix gruntfile.js default build task.\n" }, { "from": "human", "value": "/// <binding BeforeBuild='bower, concat' ProjectOpened='bower:install' />\n/*\nThis file in the main entry point for defining grunt tasks and using grunt plugins.\nClick here to learn more. http...
javascript
chosen
[ { "from": "system", "value": "Make 'follow' default home page.\n" }, { "from": "human", "value": "/// <reference path=\"../typings/angularjs/angular.d.ts\"/>\nangular.module('MyModule', ['ngRoute']);\n\nangular.module('MyModule').config(function ($routeProvider) {\n $routeProvider.when(\"/main...
javascript
chosen
[ { "from": "system", "value": "Make global config visible from parse-dashboard when it's enabled\n" }, { "from": "human", "value": "import { version } from '../../package.json';\nimport PromiseRouter from '../PromiseRouter';\nimport * as middleware from \"../middlewares\";\n\nexport class F...
javascript
chosen
[ { "from": "system", "value": "Fix isArray check for news\n" }, { "from": "human", "value": "const AppSettings = require('../AppSettings');\nconst Entities = require('html-entities').AllHtmlEntities;\n\nconst entities = new Entities();\n\nconst NewsService = {\n\tFetchNews() {\n\t\treturn fetch(A...
javascript
chosen
[ { "from": "system", "value": "Refactor test to use LMLayer.asBlobURI().\n" }, { "from": "human", "value": "var assert = chai.assert;\n\ndescribe('LMLayerWorker', function () {\n describe('LMLayerWorkerCode', function() {\n it('should exist!', function() {\n assert.isFunction(LMLayerWork...
javascript
chosen
[ { "from": "system", "value": "Remove if(this.viewHeight){} since block is empty.\n" }, { "from": "human", "value": "class MCShowSampleComponentController {\n /*@ngInject*/\n constructor($stateParams, samplesService, toast, $mdDialog) {\n this.projectId = $stateParams.project_id;\n ...
javascript
chosen
[ { "from": "system", "value": "Use selectors to get the loggedIn state\n\n" }, { "from": "human", "value": "import React, {Component} from 'react';\nimport {connect} from 'react-redux';\nimport AppBarLayout from 'components/AppBar';\nimport Logo from './Logo';\nimport LoginActions from './LoginAc...
javascript
chosen
[ { "from": "system", "value": "Call frame scripts immediately. This is just temporary for testing purposes.\n" }, { "from": "human", "value": "function MovieClip() {\n this.currentFrame = 0;\n this.framesLoaded = 0;\n this.totalFrames = 0;\n this.trackAsMenu = false;\n this.scenes = [];\n t...
javascript
chosen
[ { "from": "system", "value": "Update faker to return results\n" }, { "from": "human", "value": "import faker from 'faker'\nimport { listFaker } from './utils'\n\nconst serviceFaker = (overrides = {}) => ({\n id: faker.datatype.uuid(),\n name: faker.name.jobArea(),\n disabled_on: faker.date.pa...
javascript
chosen
[ { "from": "system", "value": "Add option to forcefully delete task and scale app\n" }, { "from": "human", "value": "var qajaxWrapper = require(\"../helpers/qajaxWrapper\");\n\nvar config = require(\"../config/config\");\nvar AppDispatcher = require(\"../AppDispatcher\");\nvar TasksEvents = requi...
javascript
chosen
[ { "from": "system", "value": "Add comment about rebuilding the hierarchy\n" }, { "from": "human", "value": "const http = require('http');\nconst chokidar = require('chokidar');\n\nconst constructHierarchy = require('./roblox-tree.js');\n\nmodule.exports = function startServer(dir, port) {\n con...
javascript
chosen
[ { "from": "system", "value": "Update lets encrypt certificate location to correct relative path\n" }, { "from": "human", "value": "'use strict'\n\nlet xmlrpc = require('homematic-xmlrpc')\nlet sslRootCAs = require('ssl-root-cas/latest')\n .addFile(__dirname + '/../ca/lets-encrypt-x1-cross-signe...
javascript
chosen
[ { "from": "system", "value": "Use Discord as the imagehost\n" }, { "from": "human", "value": "//META{\"name\":\"agif\"}*//\n\nvar agif = function () {};\n\nagif.prototype.convert = function () {\n $(\".image canvas\").each(function() { \n var href = $(this).attr(\"href\"); \n if...
javascript
chosen
[ { "from": "system", "value": "Hide loading text after loading is complete\n" }, { "from": "human", "value": "$().ready(() => {\n loadContentSection().then(() =>{ \n $(\"#loader\").addClass(\"hide\");\n $(\"#real-body\").removeClass(\"hide\");\n $(\"#real-body\").addClass(\"body\");\n ...
javascript
chosen
[ { "from": "system", "value": "Remove test for canceling a search\n\nWhen no Device Manager instance is present this test takes a long time\nand can cause timeouts. We'll need to fake the HTTP requests if we want\nto do this sort of test reliably.\n" }, { "from": "human", "value": "const test = r...
javascript
chosen
[ { "from": "system", "value": "Add membership types, and profile visibility\n" }, { "from": "human", "value": "var keystone = require('keystone'),\n\tTypes = keystone.Field.Types;\n\n/**\n * User Model\n * ==========\n */\n\nvar User = new keystone.List('User');\n\nUser.add({\n\tname: { type: Typ...
javascript
chosen
[ { "from": "system", "value": "Create a new flop works with the db\n" }, { "from": "human", "value": "import request from 'superagent'\n\nmodule.exports = (dispatch, flopInfo) => {\n console.log(flopInfo);\n request\n .post('https://topoftheflops.herokuapp.com/api/v1/flops')\n .send(flopI...
javascript
chosen
[ { "from": "system", "value": "Remove focus from search field after search for better mobile experience\n" }, { "from": "human", "value": "import $ from 'jquery';\nimport _ from 'underscore';\nimport {View} from 'backbone';\nimport templates from '../models/templates';\n\nclass Header extends Vie...
javascript
chosen
[ { "from": "system", "value": "Add the reset password routes\n" }, { "from": "human", "value": "export default function(router, ENV) {\n\n var mountPath = ENV[\"yebo\"][\"mount\"];\n var signinPath = ENV[\"yebo\"][\"signinPath\"];\n var signupPath = ENV[\"yebo\"][\"signupPath\"];\n var ac...
javascript
chosen
[ { "from": "system", "value": "Fix a hard-coded api root in the image viewer.\n" }, { "from": "human", "value": "import { restRequest } from 'girder/rest';\nimport View from 'girder/views/View';\n\nvar ImageViewerWidget = View.extend({\n initialize: function (settings) {\n this.itemId =...
javascript
chosen
[ { "from": "system", "value": "Store previous games in localStorage\n" }, { "from": "human", "value": "import React from 'react';\nimport {render} from 'react-dom';\nimport { MemoryRouter, Switch, Route } from 'react-router';\nimport NewGame from './components/NewGame';\nimport Game from './compo...
javascript
chosen
[ { "from": "system", "value": "Add database migration/initialization on startup\n" }, { "from": "human", "value": "const project = require('../config/project.config')\nconst server = require('../server/main')\nconst debug = require('debug')('app:bin:dev-server')\nconst db = require('sqlite')\n\n/...
javascript
chosen
[ { "from": "system", "value": "Fix `binding` warning when using StoreWatchMixin with createClass\n\nFixes #140\n" }, { "from": "human", "value": "var _each = require(\"lodash/collection/forEach\");\n\nvar StoreWatchMixin = function() {\n var storeNames = Array.prototype.slice.call(arguments);\n ...
javascript
chosen
[ { "from": "system", "value": "Add defaults, change init to extend\n" }, { "from": "human", "value": "'use strict';\n\nvar Handlebars = require('handlebars');\nvar _ = require('lodash');\n\nmodule.exports = {\n\n /**\n * Initialise the Handlebars instance.\n * Register any cus...
javascript
chosen
[ { "from": "system", "value": "po: Append string into .pot file\n\nWhen more than one item was returned, then `potData` would be appended\nas array and not as string.\n" }, { "from": "human", "value": "// Extract the title from cockpit's manifest.json and append it to a .pot file\n// This assumes...
javascript
chosen
[ { "from": "system", "value": "Create new isEmpty utility method to check for empty objects/arrays\n" }, { "from": "human", "value": "export function getRepoById(repos, id){\n const repo = repos.find(repo => repo.id == id);\n\n if (repo){\n return repo;\n }else{\n return {};\n }\n}\n\ne...
javascript
chosen
[ { "from": "system", "value": "Fix error handler not firing\n" }, { "from": "human", "value": "'use strict';\n\n\nconst { start } = require('../chain');\nconst { sendError } = require('../../middleware');\n\nconst httpRequestHandler = async function (opts) {\n // Apply options\n const startFunc...
javascript
chosen
[ { "from": "system", "value": "Fix bug in matching regexp for request url\n" }, { "from": "human", "value": "var ClientRequest = require('http').ClientRequest,\n querystring = require('querystring'),\n url = require('url'),\n inherit = require('../utils').inherit;\n\nmo...
javascript
chosen
[ { "from": "system", "value": "Delete document ready on JS" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into bootstrap_sb_admin_base_v2.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/ja...
javascript
chosen
[ { "from": "system", "value": "Modify to server log output setting\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict'\nconst server = new (require('..').Server)()\nserver.run()\n" }, { "from": "gpt", "value": "#!/usr/bin/env node\n\n'use strict'\nconst server = new...
javascript
chosen
[ { "from": "system", "value": "Add demo content with basic styles.\n" }, { "from": "human", "value": "import React from 'react'\nexport default () => <marquee>Hello Next from Heroku!</marquee>" }, { "from": "gpt", "value": "import React from 'react'\nimport css from 'next/css'\n\nexpo...
javascript
chosen
[ { "from": "system", "value": "Make sure the task fails whenever an error is found in any file and not only the last one\n" }, { "from": "human", "value": "/*\n * grunt-puglint\n * https://github.com/mrmlnc/grunt-puglint\n */\n\n'use strict';\n\nvar PugLint = require('pug-lint');\nvar linter = ne...
javascript
chosen
[ { "from": "system", "value": "Read text from passed in array of strings\n" }, { "from": "human", "value": "export default function getListFieldText(data, listField) {\n if (typeof listField === 'string') {\n return buildStringFromData(data, listField)\n } else {\n if (typeof listField.fi...
javascript
chosen
[ { "from": "system", "value": "Add missing auth middleware for api routes\n" }, { "from": "human", "value": "const express = require('express')\nconst api = express.Router()\nconst csrf = require('csurf')\nconst rateLimit = require('express-rate-limit')\n\nif (process.env.NODE_ENV !== 'test') {\n...
javascript
chosen
[ { "from": "system", "value": "Fix missing foreign key references in InstrumentMapping/Sample join table.\n\nIn order to update the database:\n1) do `sequelize db:migrate:undo`\n2) do `sequelize db:migrate`\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = {\n up: (queryInterfa...
javascript
chosen
[ { "from": "system", "value": "Fix JS code style issues\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('worklogApp')\n .controller('MainController', ['$scope', function ($scope) {\n \t\n\t $scope.text = \"bingo!\";\n\t $scope.newTaskText = \"\";\n\n $scope.tasks = {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove the isActive field from the region model.\n" }, { "from": "human", "value": "var keystone = require('keystone'),\n\tTypes = keystone.Field.Types;\n\n// Create model. Additional options allow menu name to be used what auto-generating URLs\nvar Region = new key...
javascript
chosen
[ { "from": "system", "value": "Support ES5\nAdded isEmptyObject method\n" }, { "from": "human", "value": "import _ from 'underscore'\n\n_.mixin({\n offset: function (arr, offset, length) {\n let newArr = [];\n\n for (let i = offset; i < offset + length; i++) {\n if (!a...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix using cooldown from options rather than from object\n" }, { "from": "human", "value": "'use strict';\n\nconst BaseStep = require('./base-step');\nconst KiteAPI = require('kite-api');\nconst {retryPromise} = require('kite-connector/lib/utils');\nconst Metri...
javascript
chosen
[ { "from": "system", "value": "Change .meteor-now/build to .meteor-now\\build on windows\n" }, { "from": "human", "value": "import os from 'os';\n\nexport const getFolderName = (path, isWin = /^win/.test(process.platform)) => {\n const pathDelimiter = isWin ? '\\\\' : '/';\n const pathParts = p...
javascript
chosen
[ { "from": "system", "value": "Replace double quotes with single quotes\n" }, { "from": "human", "value": "/*\n * biojs-io-biom\n * https://github.com/iimog/biojs-io-biom\n *\n * Copyright (c) 2016 Markus J. Ankenbrand\n * Licensed under the MIT license.\n */\n\nexport const VERSION = \"0.1.0\";\...
javascript
chosen
[ { "from": "system", "value": "Remove subtree push from grunt push-master task.\n" }, { "from": "human", "value": "module.exports = function() {\n return {\n _defaults: {\n bg: false\n },\n\n /**\n * Clean the app distribution folder.\n */\n ...
javascript
chosen
[ { "from": "system", "value": "Remove static + add timestamp\n" }, { "from": "human", "value": "import upload from './upload';\n\nimport bodyParser from 'body-parser';\nimport express from 'express';\nimport logger from 'winston';\n\nimport path from 'path';\n\nconst app = express();\nexport defa...
javascript
chosen
[ { "from": "system", "value": "Add name to anonymous function for bunyan -- restify automatically uses the function name in the timers list, so this sets a name so it's not handler-0\n" }, { "from": "human", "value": "var cookie = require('cookie');\n\nmodule.exports = {\n\t/**\n\t * Parse functi...
javascript
chosen
[ { "from": "human", "value": "Add initial test for organizerdetails\n" }, { "from": "gpt", "value": "\nvar assert = require('assert');\nvar expect = require('expect.js');\n\nvar config = require('./fixture.json' );\n\ndescribe(\"Basic details endpoints\", function(){\n it(\"should respond with...
javascript
chosen
[ { "from": "system", "value": ":bug: Use defaultColors if config not provided\n\nReferences #9\n" }, { "from": "human", "value": "'use strict';\n\nconst foregroundColor = '#A1B0B8';\nconst borderColor = '#252525';\nconst oceanicColors = require('./colorschemes/oceanic.js');\nconst defaultColors =...
javascript
chosen
[ { "from": "system", "value": ":white_check_mark: Add tempName() to public functions\n" }, { "from": "human", "value": "// Copyright (c) 2017 The Regents of the University of Michigan.\n// All Rights Reserved. Licensed according to the terms of the Revised\n// BSD License. See LICENSE.txt for det...
javascript
chosen
[ { "from": "system", "value": "Fix turbolinks teardown process, even when the cache is disabled.\n" }, { "from": "human", "value": "function destroyVue() {\n this.$destroy();\n document.removeEventListener('turbolinks:before-cache', destroyVue.bind(this))\n}\n\nvar TurbolinksAdapter = {\n befo...
javascript
chosen
[ { "from": "system", "value": "Use chokidar instead of fs.watch because fs.watch doesn't watch recursively\n" }, { "from": "human", "value": "var fs = require('fs');\n\nif(Number(process.env.EXIT_ON_CHANGES_ENABLED)) {\n\tconsole.log(\"[exit-on-changes] EXIT_ON_CHANGES_ENABLED\");\n\tfs.watch('.'...
javascript
chosen
[ { "from": "system", "value": "Throw errors returned by defs.\n" }, { "from": "human", "value": "const Filter = require('broccoli-filter')\nconst defs = require('defs')\n\nfunction DefsFilter(inputTree, options) {\n if (!(this instanceof DefsFilter)) {\n return new DefsFilter(inputTree, optio...
javascript
chosen
[ { "from": "system", "value": "Create fallback for Array.isArray if used as a browser package" }, { "from": "human", "value": "var toString = Object.prototype.toString;\n\n/**\n * Get the native `typeof` a value.\n *\n * @param {*} `val`\n * @return {*} Native javascript type\n */\n\nmodule.expo...
javascript
chosen