conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Increment slide number for slide titles when adding new ones\n" }, { "from": "human", "value": "define([\n \"backbone\",\n \"underscore\",\n \"jquery\",\n \"text!/src/html/templates/presentation.html\"\n], function (Backbone, _, $, presentationTemplate) ...
javascript
chosen
[ { "from": "system", "value": "Add Windows Phone to 'mobile' variable" }, { "from": "human", "value": "VK = {};\n\nVK.requestCredential = function (options, credentialRequestCompleteCallback) {\n\n if (!credentialRequestCompleteCallback && typeof options === 'function') {\n credentialRe...
javascript
chosen
[ { "from": "system", "value": "fix(date): Set the default date format\n" }, { "from": "human", "value": "/**\n * This is the default configuration file for the Superdesk application. By default,\n * the app will use the file with the name \"superdesk.config.js\" found in the current\n * working d...
javascript
chosen
[ { "from": "system", "value": "Add async attribute to JS\n" }, { "from": "human", "value": "var components = require('./components');\nvar javascript = require('../tasks/javascript');\nvar extend = require('extend');\n\n/**\n * Helper function for rendering a page\n * Abstracted out here to reduc...
javascript
chosen
[ { "from": "system", "value": "Add gulp clean task to VS clean step.\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n paths = require('./paths.config.js');\n\n// require gulp tasks from all gulp files\nrequire('require-dir')('./gulp');\n\n// watch for file changes and run linte...
javascript
chosen
[ { "from": "system", "value": "Format : change tabs to spaces\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst babel = require('gulp-babel');\nconst del = require('del');\nconst exec = require('child_process').exec;\nconst nodemon = require('gulp-nodemon');\nconst flow = re...
javascript
chosen
[ { "from": "system", "value": "Add an Images build task\n\nCopies images from assets/ to /public/images\n" }, { "from": "human", "value": "'use strict'\n\nconst paths = require('./config/paths.json')\nconst gulp = require('gulp')\nconst cssnano = require('gulp-cssnano')\nconst del = require('del'...
javascript
chosen
[ { "from": "system", "value": ":art: Refactor & remove workaround for extends-before-declaration rule\n" }, { "from": "human", "value": "'use strict';\n\nvar helpers = require('../helpers');\n\nmodule.exports = {\n 'name': 'extends-before-declarations',\n 'defaults': {},\n 'detect': function (...
javascript
chosen
[ { "from": "system", "value": "Make localStream visible on step-01\n" }, { "from": "human", "value": "'use strict';\n\n// On this codelab, you will be streaming only video (video: true).\nconst mediaStreamConstraints = {\n video: true,\n};\n\n// Video element where stream will be placed.\nconst ...
javascript
chosen
[ { "from": "system", "value": "Use new Date().getTimezoneOffset() instead of moment\n" }, { "from": "human", "value": "//= require moment\n//= require_self\n\nnoosfero.timezone = {\n\n setCookie: function() {\n var offset = moment.parseZone(Date.now()).utcOffset()/60\n $.cookie(\"browser.t...
javascript
chosen
[ { "from": "system", "value": "Change the server name to be heroku app instead of localhost\n" }, { "from": "human", "value": "'use strict';\n\n(function () {\n var app = angular.module('dailyMummApp',\n ['ngCookies',\n 'ngResource'...
javascript
chosen
[ { "from": "system", "value": "Update selectors to match to Google Music UI\n" }, { "from": "human", "value": "\"use strict\";\n\nvar $ = require(\"jquery\");\nvar Plugin = require(\"../modules/Plugin\");\nvar Utils = require(\"../modules/Utilities\");\nvar google = Object.create(Plugin);\n...
javascript
chosen
[ { "from": "system", "value": "Add formatting for date value.\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n define(function () {\n return [\n {\n key: 'Title',\n labelText: 'Title'\n },\n {\n ...
javascript
chosen
[ { "from": "system", "value": "Handle empty path to configuration\n\ndefault to PORT = 4444 if `config.db.PORT` is not a valid path\n" }, { "from": "human", "value": "const command = {\n command: \"serve\",\n description: \"Start Truffle's GraphQL UI playground\",\n builder: {},\n help: {\n ...
javascript
chosen
[ { "from": "system", "value": "Check if nteract was launched from a terminal\n\nIf nteract was launched from a terminal there is no need to use\nshellEnv.\n" }, { "from": "human", "value": "import shellEnv from \"shell-env\";\n\nimport { Observable } from \"rxjs/Observable\";\nimport \"rxjs/add/o...
javascript
chosen
[ { "from": "system", "value": "Use \"const\" instead of \"var\" as suggested by codacy.\n" }, { "from": "human", "value": "//\n// IssueLink is a named function that will add issue links\n// @param {Object} message - The message object\n//\n\nfunction IssueLink(message) {\n\tif (_.trim(message.htm...
javascript
chosen
[ { "from": "system", "value": "Use <base> for relative URLs in preview\n" }, { "from": "human", "value": "\"use strict\";\n\n(function () {\n\n$(function () {\n\n});\n\nviews.preview = {\n\topenPath: openPath,\n\tclosePath: closePath\n};\n\nfunction openPath (path) {\n\tvar file = new ProjectFile...
javascript
chosen
[ { "from": "system", "value": "Enable ending pg pool, and some tidying\n" }, { "from": "human", "value": "'use strict';\n\nconst _ = require('lodash');\nconst pg = require('pg');\n\nfunction transaction(client) {\n return {\n commit() {\n return client.query('COMMIT;').then(() => {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix message watching in NotifierCtrl\n" }, { "from": "human", "value": "'use strict';\nangular.module('arethusa.core').controller('NotifierCtrl', [\n '$scope',\n 'notifier',\n function ($scope, notifier) {\n $scope.$watch('notifier.messages', function (newVal,...
javascript
chosen
[ { "from": "system", "value": "Add `asProperty` and `asPlain` options\n" }, { "from": "human", "value": "'use strict';\n\nvar value = require('es5-ext/object/valid-value')\n , esniff = require('./')\n\n , next = esniff.next\n , resume = esniff.resume\n , collectNest = esniff.collectNest;\n\n...
javascript
chosen
[ { "from": "system", "value": "History: Fix problem with space bar not causing the menu to appear.\n\nWhen a history entry's dropdown menu is focused, hitting the space\nbar should cause the menu to appear.\n\nBUG=268334\n\nReview URL: https://chromiumcodereview.appspot.com/22464009\n\ngit-svn-id: de016e52bd...
javascript
chosen
[ { "from": "system", "value": "Fix tests.\nTest selectors were not marked to be removed in test, breaking the\nbuild.\n" }, { "from": "human", "value": "/*jshint node:true*/\n/* global require, module */\nvar EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\nvar StripTestSelectorsTrans...
javascript
chosen
[ { "from": "system", "value": "Comment out some debugging output.\n" }, { "from": "human", "value": "foam.CLASS({\n package: 'foam.build',\n name: 'ClassLoaderContext',\n exports: [\n 'aref',\n 'acreate'\n ],\n methods: [\n {\n class: 'ContextMethod',\n name: 'aref',\n ...
javascript
chosen
[ { "from": "system", "value": "Remove bump task from gulp file\n" }, { "from": "human", "value": "/*globals require, __dirname */\n/* jshint node:true */\n'use strict';\n\nvar gulp = require('gulp');\nvar jshint = require('gulp-jshint');\nvar karma = require('karma').server;\nvar bump = require('...
javascript
chosen
[ { "from": "system", "value": "build: Copy only required files to bower dist\n\n* Prevents the images from being copied also.\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar gutil = require('gulp-util');\nvar exec = require('gulp-exec');\n\nvar less = require('gulp-less');\nva...
javascript
chosen
[ { "from": "system", "value": "Change build taskname to 'build'\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar babel = require('gulp-babel');\nvar del = require('del');\nvar eslint = require('gulp-eslint');\n\n// CONSTANTS =====================================================...
javascript
chosen
[ { "from": "system", "value": "Make it clear that user has entered Task 2\n" }, { "from": "human", "value": "(function() {\n\nvar debug = false;\n\nfunction displayTask1Modal() {\n vex.dialog.alert({\n message: 'Good job! You\\'re now inside Badguy\\'s server.<br><br>The key to the previous c...
javascript
chosen
[ { "from": "system", "value": "Support one-level nesting of arrays to createMiddlewareServer\n" }, { "from": "human", "value": "/*globals module, require*/\n\nvar stack = require('stack'),\n http = require('http'),\n _hs = http.createServer;\n\nhttp.createServer = function createServer () {...
javascript
chosen
[ { "from": "system", "value": "Remove `files` key from BrowserSync config, to prevent double reload\n" }, { "from": "human", "value": "let argv = require('yargs').argv;\nlet bin = require('./bin');\nlet command = require('node-cmd');\n\nlet AfterWebpack = require('on-build-webpack');\nlet Browser...
javascript
chosen
[ { "from": "system", "value": "Use the interface api for the api\n" }, { "from": "human", "value": "import config from './src/constants.js';\nimport Map from './src/Map.js';\n\nconfig.themesUrl = 'https://geomapfish-demo-2-4.camptocamp.com/themes?version=2&background=background';\n\nconst lib = {...
javascript
chosen
[ { "from": "system", "value": "Fix login page for first time visitor.\n" }, { "from": "human", "value": "/* eslint-disable fp/no-mutation */\n/* eslint-disable no-param-reassign */\nimport { CALL_API } from 'redux-api-middleware';\nimport { SERVER_URL } from './../constants/Api';\nimport localSto...
javascript
chosen
[ { "from": "system", "value": "Fix import path of board.\n" }, { "from": "human", "value": "import React from 'react';\nimport Board from './board';\n\nconst App = () => {\n return (\n <div>\n <h1>hello</h1>\n <Board />\n </div>\n );\n};\n\nexport default App;\n" }, { "f...
javascript
chosen
[ { "from": "system", "value": "Revert \"add missing worker-php for ace editor\"\n" }, { "from": "human", "value": "//= require jquery\n//= require jquery_ujs\n//= require turbolinks\n//= require foundation\n\n//= require ace/ace\n//= require ace/mode-ruby\n//= require ace/mode-golang\n//= require...
javascript
chosen
[ { "from": "system", "value": "Fix tests for menu toggling\n" }, { "from": "human", "value": "import { expect } from 'chai'\nimport store from '../../src/store'\nimport {\n TOGGLE_SIDEBAR,\n TOGGLE_USER_MENU\n} from '../../src/store/mutation-types'\n\n\ndescribe('main', () => {\n\n describe('a...
javascript
chosen
[ { "from": "system", "value": "Refactor the one file converter.\n" }, { "from": "human", "value": "import fs from 'fs';\nimport path from 'path';\nimport promisify from 'es6-promisify';\nimport {\n InvalidFile,\n InvalidJsonString\n} from './errors';\n\nexport function convertOneFile(fileName, ...
javascript
chosen
[ { "from": "system", "value": "Improve tag styling in flight profiles\n" }, { "from": "human", "value": "import styled from 'styled-components'\n\nexport const Container = styled.div`\n padding: 0 1rem 0 2rem;\n overflow-y: hidden;\n`\n\nexport const TagList = styled.ul`\n background-color: #f...
javascript
chosen
[ { "from": "system", "value": "Remove countdownjs (countup) from dates in the past\n" }, { "from": "human", "value": "$(document).ready(function() {\r\n $('.date').each(function() {\r\n var _this = $(this)\r\n countdown(Date.parse($(this).data('launch-date')), function(ts) {\r\n _this...
javascript
chosen
[ { "from": "system", "value": "Use currentApp on header components\n" }, { "from": "human", "value": "import React from 'react';\nimport { MainLogo, SupportDropdown, UserDropdown } from 'react-components';\nimport { APPS } from 'proton-shared/lib/constants';\n\nconst PrivateHeader = () => {\n ...
javascript
chosen
[ { "from": "system", "value": "Make sure commit finishes before tagging" }, { "from": "human", "value": "var request = require('request'),\n\tfs = require('fs'),\n\tpath = require('path'),\n\texec = require('child_process').exec,\n\tversion = require('../package.json').version;\n\nvar urlStub = '...
javascript
chosen
[ { "from": "system", "value": "Delete zombie code from socket testing\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\nvar server = require('http').createServer(app); \nvar io = require('socket.io').listen(server);\n//var models = require(\"./models\");...
javascript
chosen
[ { "from": "system", "value": "Check if signature is blank before adding to message\n\nIf the signature is blank, then nothing should be added to the message.\n" }, { "from": "human", "value": "function changeTitle () {\n\tvar subject = document.getElementById('mail_subject').value;\n\t\n\tif ((s...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary IIFE from Y class\n" }, { "from": "human", "value": "const http = require('http');\nconst jsdom = require('jsdom');\nconst jQuery = require('jquery');\nconst Router = require('./router/index');\nconst body = require('./body/index');\n\n/**\n * The...
javascript
chosen
[ { "from": "system", "value": "Change direction on game click\n" }, { "from": "human", "value": "function Level(game, level) {\n\tthis.game = game;\n\tthis.level = level;\n\tthis.interval = undefined;\n\tthis.period = 4;\n\tthis.intervalTime = 10;\n\tthis.velocity = 2 * Math.PI / (1000 * this.per...
javascript
chosen
[ { "from": "system", "value": "Disable sitemap plugin for website as it does not work anymore\n" }, { "from": "human", "value": "/*\n * Yet Another UserAgent Analyzer\n * Copyright (C) 2013-2021 Niels Basjes\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not...
javascript
chosen
[ { "from": "system", "value": ":checkered_flag: Fix version parsing of file(1)\n" }, { "from": "human", "value": "\nlet spawn = require('./spawn')\n\nlet self = {\n platform: function () {\n return process.platform\n },\n\n arch: function () {\n return process.arch\n },\n\n process_typ...
javascript
chosen
[ { "from": "system", "value": "Fix bug when encoding is `null`\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar fromString = require( '@stdlib/buffer/from-string' );\n\n\n// MAIN //\n\n/**\n* Re-decodes a UTF-8 string according to a specified encoding.\n*\n* @private\n* @p...
javascript
chosen
[ { "from": "system", "value": "Add to controller and code clean up\n" }, { "from": "human", "value": "(function(){\n var newsFeedApp = angular.module('newsFeedApp', []);\n \n newsFeedApp.controller('NewsController', ['$http', function($http) {\n var newsController = this;\n newsControll...
javascript
chosen
[ { "from": "system", "value": "Add comment to traverseDOM function\n" }, { "from": "human", "value": "const Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.3.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} ...
javascript
chosen
[ { "from": "system", "value": "Update to use ClinGen curation app and test curation app Google Analytics codes\n" }, { "from": "human", "value": "'use strict';\n\n// Minimal inline IE8 html5 compatibility\nrequire('shivie8');\n\n// Read and clear stats cookie\nvar cookie = require('cookie-monster...
javascript
chosen
[ { "from": "system", "value": "Fix the Model name Employee to QBEmployee\n" }, { "from": "human", "value": "module.exports = function(server) {\n // Install a `/` route that returns server status\n var router = server.loopback.Router();\n router.get('/status', server.loopback.status());\n ser...
javascript
chosen
[ { "from": "system", "value": "Update prefix to include reactive info\n" }, { "from": "human", "value": "var test = require('tape');\nvar connections = require('./helpers/connect-reactive')(test, 'stream:added tests');\nvar media = require('rtc-media');\nvar localStream;\n\nrequire('cog/logger')....
javascript
chosen
[ { "from": "system", "value": "Fix very 1st startup when user has no data: there is no _rev to dereference.\n" }, { "from": "human", "value": "/*! Task Slayer | (c) 2014 Eric Mountain | https://github.com/EricMountain/TaskSlayer */\n\n// LocalStorage layer\n\ndefine([\"angular\"],\n function()...
javascript
chosen
[ { "from": "system", "value": "Change debug mode to be based on environment variable\n" }, { "from": "human", "value": "\n// Check if we're in debug mode\nvar genxDir = (typeof v8debug !== 'undefined') ? '../build/Debug/genx' : '../build/Release/genx',\n EventEmitter = require('events').EventE...
javascript
chosen
[ { "from": "system", "value": "Update example, pass in stream to subscribe to locally.\n" }, { "from": "human", "value": "// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from 'vue';\nimport Vu...
javascript
chosen
[ { "from": "system", "value": "Add new routes for components and serve them up to client side\n" }, { "from": "human", "value": "require('dotenv').config();\nconst bodyParser = require('body-parser');\nconst metadata = require('../package.json');\nconst compression = require('compression');\ncons...
javascript
chosen
[ { "from": "system", "value": "Correct the description of a helper function.\n" }, { "from": "human", "value": "/**\n * Replaces existential operators with a defined check.\n *\n * @param {Object} node\n * @param {MagicString} patcher\n */\nexport default function patchExistentialOperator(node, p...
javascript
chosen
[ { "from": "system", "value": "Use cb instead of res.json\n" }, { "from": "human", "value": "function getUser(login, cb) {\n checkPrivilege(req.session.user.login, function(err, privilege) {\n users.find({\n following: req.session.user.login\n }, function(err, following) {\n user...
javascript
chosen
[ { "from": "system", "value": "Remove copyright and simplify text" }, { "from": "human", "value": "import React from 'react';\nimport './scss/footer.scss';\n\nconst Footer = () => {\n return (\n <footer>\n <p>© 2016 Michael Kohler - Data accurate from 2013 onwards, before some are missin...
javascript
chosen
[ { "from": "system", "value": "Add NEX navigator.* API support to the shim\n" }, { "from": "human", "value": "!(function( global ) {\n\n var Opera = function() {};\n\n Opera.prototype.REVISION = '1';\n\n Opera.prototype.version = function() {\n return this.REVISION;\n };\n\n Opera.prototy...
javascript
chosen
[ { "from": "system", "value": "Fix truncated result from pako\n\nI still don't know how to correctly call pako. Looks like it was truncating to 16k only if I passed a Uint8Array. Now I'm passing a Buffer and it works, although the docs don't tell anything about Buffers being passed as input.\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Add encrypt key list item\n" }, { "from": "human", "value": "'use strict';\n\nimport React, { Component } from 'react';\nimport ReactCSS from 'reactcss';\n\nimport EncryptKeyListItem from './EncryptKeyListItem';\n\nclass EncryptKeyList extends Component {\n classes...
javascript
chosen
[ { "from": "system", "value": ":pencil: Fix example code on Github Pages\n" }, { "from": "human", "value": "$(document).ready(function() {\n var settings = {\n showForks: true,\n extraDetails: \"../responses/my-extra-details.json\"\n };\n \n $(\"body\").CMDResume(\"https...
javascript
chosen
[ { "from": "system", "value": "Remove logo spin from reducers; fix page scroll constant typo\n" }, { "from": "human", "value": "import initialState from './initialState';\nimport { \n LOGO_SPIN_STARTED, \n LOGO_SPIN_ENDED, \n PAGE_SCROLL_STARTED, \n SCROLL_ENDED,\n APP_INIT,\n S...
javascript
chosen
[ { "from": "system", "value": "Change Project model's consortium ID prop name.\n" }, { "from": "human", "value": "'use strict';\n\nconst PouchDocument = require('./pouch-document');\nconst joi = require('joi');\nconst util = require('util');\n\n/**\n * @class Project\n * @extends PouchDocument\n ...
javascript
chosen
[ { "from": "system", "value": "Add ability to display an array of error messages\n" }, { "from": "human", "value": "import React from 'react'\n\nexport const InputField2 = ({ input, meta, side, label, type, description, disabled, errorStyle }) => {\n return (\n <div className={side}>\n <...
javascript
chosen
[ { "from": "system", "value": "Fix typo in substringTo documentation\n" }, { "from": "human", "value": "import substring from \"./substring\";\n\n/**\n * The leading substring of a String ending before the nth character:\n *\n * @static\n * @memberOf R\n * @category string\n * @param {Number} ind...
javascript
chosen
[ { "from": "system", "value": "Append named exports to the generated esm bundle\n" }, { "from": "human", "value": "import commonjs from \"rollup-plugin-commonjs\";\nimport nodeResolve from \"rollup-plugin-node-resolve\";\nimport builtins from \"rollup-plugin-node-builtins\";\nimport globals from ...
javascript
chosen
[ { "from": "system", "value": "Fix catching server response error\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst {Object: EmberObject} = Ember;\n\nfunction serverResponseError(res) {\n if (res && ((res.errors && res.errors.length && res.errors[0].status) || res.isAdapterE...
javascript
chosen
[ { "from": "system", "value": "Tidy up server side error/confirmation messages\n" }, { "from": "human", "value": "const models = require('../models/index')\nconst insecurity = require('../lib/insecurity')\n\nmodule.exports.upgradeToDeluxe = function upgradeToDeluxe () {\n return async (req, res,...
javascript
chosen
[ { "from": "system", "value": "Use shorter localIdentName for css-loader\n" }, { "from": "human", "value": "var path = require('path')\nvar ExtractTextPlugin = require('extract-text-webpack-plugin')\n\nvar DIST = path.join(__dirname, 'dist')\nvar SRC = path.join(__dirname, 'src')\n\nfunction styl...
javascript
chosen
[ { "from": "system", "value": "Remove left over code from an earlier refactoring.\n\nPiperOrigin-RevId: 141498921\n" }, { "from": "human", "value": "/**\n * @param {*} obj\n * @return {Object}\n * @public\n */\nJs.cast = function(obj) {\n // TODO(goktug): Shouldn't be required when we move to * ...
javascript
chosen
[ { "from": "system", "value": "Clean up and add artwork sorts\n" }, { "from": "human", "value": "import artsy from '../lib/artsy';\nimport Artwork from './artwork';\nimport {\n GraphQLObjectType,\n GraphQLBoolean,\n GraphQLString,\n GraphQLNonNull,\n GraphQLList,\n GraphQLInt\n} from 'graph...
javascript
chosen
[ { "from": "system", "value": "Call the method from the willTransition method\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport ResetScrollMixin from '../mixins/reset-scroll';\nimport Analytics from '../mixins/analytics';\n\n/**\n * @module ember-preprints\n * @submodule route...
javascript
chosen
[ { "from": "system", "value": "Change 13 to 6 for minor extensions\n" }, { "from": "human", "value": "define([\n 'jquery',\n 'underscore',\n 'backbone',\n 'chordNamer'\n], function ($, _, Backbone, chordNamer) {\n\n var ChordView = Backbone.View.extend({\n el: $('#chord-description'),\n\n...
javascript
chosen
[ { "from": "system", "value": "Add Linux specific definition for shortcut preview\n" }, { "from": "human", "value": "import { LIVE_API, DEV_API, LOCAL_API } from './config';\n\nexport const isDevMode = Boolean(process.execPath.match(/[\\\\/]electron/));\nexport const useLiveAPI = process.env.LIVE...
javascript
chosen
[ { "from": "system", "value": "Add sliders for numerical values" }, { "from": "human", "value": "import React from 'react';\n\nconst Authoring = (props) => {\n let handleChange = function(evt) {\n props.onChange(evt.target.dataset.prop, evt.target.value);\n }\n\n let handleCheckboxChange = ...
javascript
chosen
[ { "from": "system", "value": "Add missing copyright to a test file\n" }, { "from": "human", "value": "(function () {\r\n /(오)/ ;\r\n})();\r\n" }, { "from": "gpt", "value": "//-------------------------------------------------------------------------------------------------------...
javascript
chosen
[ { "from": "system", "value": "Use `REDIS_URL` automatically if present\n" }, { "from": "human", "value": "'use strict'\n\nvar env = process.env.NODE_ENV || 'development'\n\nif (env === 'development') require('dotenv').config()\n\nvar conf = module.exports = {\n env: env,\n server: {\n port:...
javascript
chosen
[ { "from": "system", "value": "Use path instead of concatenation\n" }, { "from": "human", "value": "\"use strict\";\n\nvar assert = require(\"assert\");\nvar File = require(\"vinyl\");\nvar pegjs = require(\"./\");\n\nit(\"should generate a parser\", function(cb) {\n var stream = pegjs();\n\n s...
javascript
chosen
[ { "from": "system", "value": "Convert Number Range to ES6\n" }, { "from": "human", "value": "'use strict';\n\nfunction NumberRange( min, max, n ) {\n\tif ( n === void 0 ) {\n\t\tn = 2;\n\t}\n\n\t// throw 'The min and max must be numbers' if isNaN(@min) or ! _.isNumber(@min) or isNaN(@max) or ! _...
javascript
chosen
[ { "from": "system", "value": "Call _super in beforeModel hook\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst {\n Route,\n inject: {\n service\n }\n} = Ember;\n\nexport default Route.extend({\n logger: service(),\n smt: service(),\n\n beforeModel() {\n // See a...
javascript
chosen
[ { "from": "system", "value": "Change error log to debug\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst {\n Logger,\n run\n} = Ember;\n\nexport default Ember.Route.extend({\n beforeModel() {\n return this.get(\"session\").fetch().catch((error) => {\n Logger.erro...
javascript
chosen
[ { "from": "system", "value": "Make video a little bit smaller\n" }, { "from": "human", "value": "import PropTypes from 'prop-types'\nimport React, { Component } from 'react'\nimport YouTube from 'react-youtube'\n\nimport config from '../../../config'\nimport { StaticPage } from '../components'\n...
javascript
chosen
[ { "from": "system", "value": "Call to contructor method should begin with capital letter\n" }, { "from": "human", "value": "var client = require('./carbon'),\n metric = require('./metric');\n\nfunction GraphiteClient (properties) {\n this._carbon = properties.carbon;\n}\n\nGraphiteClient.c...
javascript
chosen
[ { "from": "system", "value": "Revert \"Fixed da bug. Right?\"\n\nThis reverts commit 09c6aba54f7b73ab35b02b9f6b75462a3b3579a1.\n" }, { "from": "human", "value": "// Auto-create new intput-groups\n$(\".js-lists\").on(\"focus\", \".disabled\", function () {\n\tvar disabledRow = $(\".input-group.di...
javascript
chosen
[ { "from": "system", "value": "Fix Orbit namespace reference to LocalStorageSource\n" }, { "from": "human", "value": "import Orbit from './orbit/core';\nimport eq from './orbit/lib/eq';\nimport clone from './orbit/lib/clone';\nimport diffs from './orbit/lib/diffs';\nimport Cache from './orbit/cac...
javascript
chosen
[ { "from": "system", "value": "Disable Nunjucks engine when page is being rendered using Twig\n" }, { "from": "human", "value": "'use strict';\n\nvar Twig = require('twig'),\n twig = Twig.twig;\nTwig.cache(false);\n\n// pretty the json output, convenient for debugging\nTwig.extendFilter(\"json\"...
javascript
chosen
[ { "from": "system", "value": "Remove bootswatchlet to improve load performance.\n" }, { "from": "human", "value": "// For any third party dependencies, like jQuery, place them in the lib folder.\n\n// Configure loading modules from the lib directory,\n// except for 'app' ones, which are in a sib...
javascript
chosen
[ { "from": "system", "value": "Add support to server side rendering.\n\n" }, { "from": "human", "value": "import { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDom from 'react-dom';\n\nconst useCreatePortal = typeof ReactDom.createPortal === 'function';\n\nclass Por...
javascript
chosen
[ { "from": "system", "value": "Fix scope access in index acceptance test 🔨\n\nThis somehow only just started causing problems in ember-cli >= 2.8.0\n" }, { "from": "human", "value": "import { test } from 'qunit';\nimport moduleForAcceptance from '../../tests/helpers/module-for-acceptance';\n\nmo...
javascript
chosen
[ { "from": "system", "value": "Add global loading state for modal\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { getClasses } from '../../helpers/component';\n\nconst Content = ({ children, className, onSubmit, onReset, autoComplete,...
javascript
chosen
[ { "from": "system", "value": "Add more helpful error message for failure to load extension\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2016 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compli...
javascript
chosen
[ { "from": "system", "value": "Deal with empty names properly.\n" }, { "from": "human", "value": "// @flow\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { red500 } from 'material-ui/styles/colors';\n\nimport { ListItem } from 'material-ui/List';\nimport Avatar from 'm...
javascript
chosen
[ { "from": "system", "value": "Update Sass function to print better error messages.\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar sass = require('node-sass');\n\nmodule.exports = function(grunt) {\n function writeFile(path, contents) {\n if(grunt...
javascript
chosen
[ { "from": "human", "value": "Implement Delete Subcampaign Model REST\n" }, { "from": "gpt", "value": "var writeSubcampaignModelLogic = require('../../logic/subcampaign/writeSubcampaignModelLogic')\nvar subcampaignModelCheckerLogic = require('../../logic/subcampaign/subcampaignModelCheckerLogic')...
javascript
chosen
[ { "from": "system", "value": "Revert \"remove obsolete browser electron distinction\"\n\nThis reverts commit 1709ee9ea51c1838cac5b13c803c186ff0f26c4e.\n" }, { "from": "human", "value": "(function(global) {\n config.map['papaparse'] = '@node/papaparse';\n System.config(config);\n})(this);" ...
javascript
chosen
[ { "from": "system", "value": "Add more fields to UserEntity\n" }, { "from": "human", "value": "// @flow\n\nimport { createSelector } from 'reselect';\nimport { User } from '../actions/ActionTypes';\nimport createEntityReducer from 'app/utils/createEntityReducer';\n\nexport type UserEntity = {\n...
javascript
chosen
[ { "from": "system", "value": "Call the function back so that Gulp knows when the task completed.\n" }, { "from": "human", "value": "var gulp = require(\"gulp\");\nvar CFG = require(\"./utils/config.js\");\nvar $ = require(\"gulp-load-plugins\")();\nvar exec = require(\"child_process\").exec;\nva...
javascript
chosen
[ { "from": "system", "value": "Add in old logic for serving random scripts with predictable output.\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\nvar server = require('http').createServer(app);\n\napp.get('/hello', function(req, res){\n res.send('bon...
javascript
chosen
[ { "from": "system", "value": "Add events usage example, with an example of switching the view\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n setupController: function(controller) {\n controller.set('viewName', 'reflectui-examples');\n ...
javascript
chosen