conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add mongoose debugging and move models to context\n\n" }, { "from": "human", "value": "import express from \"express\"\nimport graphqlHTTP from \"express-graphql\"\nimport { graphqlExpress, graphiqlExpress } from \"graphql-server-express\"\nimport bodyParser from \"...
javascript
chosen
[ { "from": "human", "value": "Create an index object that points to a JSON file\n" }, { "from": "gpt", "value": "var fs = require('fs');\n\nfunction Index(){\n\t'use strict'\n\t\n\tthis.createIndex = function(filePath){\n\t\tfs.readFile(filePath , function doneReading(err, fileContents){\n\t\t\t\...
javascript
chosen
[ { "from": "system", "value": "Use String.prototype.startsWith() instead of includes() for checking the content type\n" }, { "from": "human", "value": "\"use strict\";\n\nvar Response = function(error, res) {\n res = res || {};\n this.raw = res.body;\n this.headers = res.headers;\n th...
javascript
chosen
[ { "from": "system", "value": "Allow passing of self rather than just globally uses it" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n function fetchPonyfill(options) {\n var Promise = options && options.Promise || self.Promise;\n var XMLHttpRequest = options && option...
javascript
chosen
[ { "from": "system", "value": "Add listTables part into updateUserList\n" }, { "from": "human", "value": "var log4js = require('log4js');\nvar logger = log4js.getLogger('BOT-LOG');\n\nfunction updateUserList(dyDb, userId){\n\n}\n\nmodule.exports = {\n\tupdateUserList:updateUserList\n}\n" }, {...
javascript
chosen
[ { "from": "system", "value": "Sort posts by submitted timestamp.\n" }, { "from": "human", "value": "Template.postsList.helpers({\n posts: function() {\n return Posts.find();\n }\n});" }, { "from": "gpt", "value": "Template.postsList.helpers({\n posts: function() {\n return P...
javascript
chosen
[ { "from": "system", "value": "Make use of ecma 6 template\n" }, { "from": "human", "value": "let Vue = require('../../node_modules/vue/dist/vue.min');\n\nlet template = '<div style=\"border-radius: 4px; margin:5px; color: #31708f;background-color: #d9edf7; border: 1px solid #bce8f1;text-align: c...
javascript
chosen
[ { "from": "system", "value": "docs(date): Add documentation to the date module\n" }, { "from": "human", "value": "import str from '../src/jsturbo-string'\n\nfunction toStringDMY (date) {\n return [\n str.pad(date.getDate().toString(), 2),\n str.pad((date.getMonth() + 1).toString(), 2),\n ...
javascript
chosen
[ { "from": "system", "value": "Fix wrong wording and spelling\n" }, { "from": "human", "value": "export default {\n today: 'I dag',\n now: 'Nu',\n backToToday: 'Tilbage til i dag',\n ok: 'Ok',\n clear: 'Annuler',\n month: 'Måned',\n year: 'År',\n timeSelect: 'Vælg tidspunkt',\n dateSelec...
javascript
chosen
[ { "from": "system", "value": "Add BiwaScheme to browser module exports\n" }, { "from": "human", "value": "import BiwaScheme from \"./main.js\";\nBiwaScheme.on_node = false;\n\nimport Console from \"./platforms/browser/console.js\"\nBiwaScheme.Console = Console;\n\nimport { current_input, current...
javascript
chosen
[ { "from": "system", "value": "Remove indent with spaces option\n" }, { "from": "human", "value": "var mumuki = mumuki || {};\n\n(function (mumuki) {\n\n function CodeMirrorBuilder(textarea) {\n this.textarea = textarea;\n this.$textarea = $(textarea);\n }\n\n CodeMirrorBuilder.prototype...
javascript
chosen
[ { "from": "system", "value": "Remove settings from the routes for the moment" }, { "from": "human", "value": "import App from '../containers/App'\n\nfunction createRedirect(from, to) {\n return {\n path: from,\n onEnter(nextState, replaceState) {\n replaceState(nextState, to)\n },...
javascript
chosen
[ { "from": "system", "value": "Select first network interface IP for localAddress display\n" }, { "from": "human", "value": "var express = require('express');\nvar os = require('os');\n\nvar router = express.Router();\nvar ifaces = os.networkInterfaces();\nvar localAddress = '';\nvar environment ...
javascript
chosen
[ { "from": "system", "value": "Update to set register user after logged in\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('lightweight').controller('CheckoutAsGuestController',\n ['$scope', '$rootScope', '$location', '$state', '$timeout', '$stateParams', '$window', 'Global'...
javascript
chosen
[ { "from": "system", "value": "Remove copy & paste issues\n" }, { "from": "human", "value": "import { reaction, runInAction } from 'mobx';\nimport { SettingsWSStore } from './store';\nimport state, { resetState } from './state';\n\nconst debug = require('debug')('Franz:feature:settingsWS');\n\nle...
javascript
chosen
[ { "from": "system", "value": "Test that all methods have a name and description\n" }, { "from": "human", "value": "'use strict';\n\nrequire('../examples/demo-only-stuff/docs');\nvar expect = require('chai').expect;\nvar sinon = require('sinon');\nvar stub = sinon.stub;\nvar utils = require('./he...
javascript
chosen
[ { "from": "system", "value": "Add support for port changing\n" }, { "from": "human", "value": "const DB = require('./Persistence/database');\nrequire('dotenv').config();\nconst App = require('./app');\n\nDB.init().then((db) => {\n App(db).listen(3000);\n});\n" }, { "from": "gpt", "v...
javascript
chosen
[ { "from": "system", "value": "Increase test timeout further because bcrypt's entire purpose in life is to be slow\n" }, { "from": "human", "value": "const Passwords = require('../passwords');\n\ndescribe('Passwords', () => {\n let originalTimeout;\n beforeEach(() => {\n // Increase timeout ...
javascript
chosen
[ { "from": "system", "value": "Disable html5 mode for the toolbar angular module\n\nWhen the current url contains a query string parameter with plus signs (like `?flash_msg=Edit+of+Cloud+Provider+\"Amazon\"+was+cancelled+by+the+user`), clicking on the toolbar would first mangle the url to use `%20` instead o...
javascript
chosen
[ { "from": "system", "value": "Fix grunt task on watch\n" }, { "from": "human", "value": "const path = require('path');\nconst fs = require('fs');\nconst sass = require('node-sass');\nconst { promisify } = require('util');\nconst mkdirp = require('mkdirp');\nconst renderAsPromised = promisify(sas...
javascript
chosen
[ { "from": "system", "value": "Make box-2 stay align with box-4\n\nSigned-off-by: Fabio Teixeira <a90b0aa793b4509973a022e6fee8cf8a263dd84e@gmail.com>\nSigned-off-by: Thiago Ribeiro <25630c3dd4509f5915a846461794b51273be2039@hotmail.com>\n" }, { "from": "human", "value": "$(document).ready(function...
javascript
chosen
[ { "from": "system", "value": "Set up dests for helper funcs in doors.js\n" }, { "from": "human", "value": "const expect = require('chai').expect;\nconst Room = require('../../src/rooms').Room;\nconst Doors = require('../../src/doors').Doors;\nconst Mocks = require('../mocks/mocks.js');\n\nconst ...
javascript
chosen
[ { "from": "system", "value": "Update the preferences to reflect the folder select state\n" }, { "from": "human", "value": "pref(\"extensions.torbirdy.protected\", false);\npref(\"extensions.torbirdy.proxy\", 0);\npref(\"extensions.torbirdy.first_run\", true);\npref(\"extensions.torbirdy.warn\", ...
javascript
chosen
[ { "from": "system", "value": "Set the base url of the dummy app\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'dummy',\n environment: environment,\n baseURL: '/',\n locationType: 'auto',\n Embe...
javascript
chosen
[ { "from": "system", "value": "Create setPassword validPassword and generateJWT methods on User model\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\n\nvar UserSchema = new mongoose.Schema({\n\tfname: String,\n\tlname: String,\n\tusername: String,\n\tpassword: String,\n\ts...
javascript
chosen
[ { "from": "system", "value": "Add userid to geotagging callback\n" }, { "from": "human", "value": "'use strict';\n\nvar request = require('request');\nvar Q = require('q');\nvar config = require('../config');\n\nconst plugins = require('../../plugins');\nconst geoTagController = plugins.getFirst...
javascript
chosen
[ { "from": "system", "value": "Add other test: Must to go for route / when doing GET /exit\n" }, { "from": "human", "value": "'use strict';\n\nvar app = require('../../app');\nvar should = require('should');\nvar request = require('supertest')(app);\n\ndescribe('No controller home', function...
javascript
chosen
[ { "from": "system", "value": "Fix: Remove conditional use of es6-weak-map\n" }, { "from": "human", "value": "'use strict';\n\nvar WM = require('es6-weak-map');\nvar hasNativeWeakMap = require('es6-weak-map/is-native-implemented');\n\n// WeakMap for storing metadata\nvar metadata = hasNativeWeakM...
javascript
chosen
[ { "from": "system", "value": "Add icon for amount of buyers.\n" }, { "from": "human", "value": "var Templates = {};\n\nTemplates.ItemListingTemplate = _.template('\\\n\t<div class=\"item media\">\\\n\t\t<img class=\"pull-left\" src=\"<%= imageUrl %>\" />\\\n\t\t<div class=\"media-body\">\\\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Switch to the npm library\n" }, { "from": "human", "value": "//var thinky = require('thinky');\nvar thinky = require('/home/michel/projects/thinky/lib/index.js');\nvar config = require('./config');\n\n// Initialize thinky\n// The most important thing is to initializ...
javascript
chosen
[ { "from": "system", "value": "Remove testing code for going to materials commons.\n" }, { "from": "human", "value": "\nfunction HomeController($scope) {\n\n}\n\nfunction ProjectsController($scope, Restangular) {\n var allProjects = Restangular.all('projects');\n allProjects.getList().then(...
javascript
chosen
[ { "from": "system", "value": "Create a dummy chart data object so the chart data loads async\n" }, { "from": "human", "value": "App.ChartEditController = App.AuthenticationController.extend({\n actions: {\n registerQuery: function() {\n console.log('registering a query');\n var cha...
javascript
chosen
[ { "from": "system", "value": "Add a wrapper method for retrieving the current API user\n\nThe API route for this already existed, but there was no wrapper method.\n" }, { "from": "human", "value": "module.exports = function(conn) {\n return {\n list: function(businessId, callback) {\n c...
javascript
chosen
[ { "from": "system", "value": "Delete existing permission prior to inserting new set\n" }, { "from": "human", "value": "Meteor.methods({\n addSingleUserPermissions(userId, groupIds) {\n if (groupIds.length > 0) {\n groupIds.forEach(groupId => {\n Permissions.insert({ userId, group...
javascript
chosen
[ { "from": "system", "value": "Remove DefaultProps.js From Form Component\n\nRemove defaultProps.js from Form component layout prop as it is no\nlonger in defaultProps.js\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\nimport DefaultProps from '../d...
javascript
chosen
[ { "from": "system", "value": "Use ActiveModelAdapter instead of RESTAdapter\n" }, { "from": "human", "value": "//= require \"lib/moment.min\"\n//= require \"lib/jquery-2.0.3\"\n//= require \"lib/handlebars-v1.1.2\"\n//= require \"lib/ember\"\n//= require \"lib/ember-data\"\n//= require_self\n//=...
javascript
chosen
[ { "from": "system", "value": "Fix the social connection links\n" }, { "from": "human", "value": "import { createElement as ce } from 'react';\n\nconst connectTypes = require('../../../../json/ConnectionTypes.json');\n\nconst ConnectionLinks = ({ name: memberName, connections }) => (\n ce('div',...
javascript
chosen
[ { "from": "system", "value": "Rename function for generating query string.\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('lodash');\nvar fs = require('fs');\nvar path = require('path');\nvar api = require('../api');\n\nfunction arrayToQueryString(args) {\n var searchString...
javascript
chosen
[ { "from": "system", "value": "Update tests for using element.removeClass instead of $animate" }, { "from": "human", "value": "'use strict';\n\nvar angular = require('angular');\nvar expect = require('chai').use(require('sinon-chai')).expect;\nvar sinon = require('sinon');\nvar sap = requi...
javascript
chosen
[ { "from": "system", "value": "Remove mongoose debug mode from test\n\nSigned-off-by: Ian Macalinao <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@ian.pw>\n" }, { "from": "human", "value": "var async = require(\"async\");\nvar bay6 = require(\"../lib/\");\nvar expect = require(\"chai\").expect;\nvar m...
javascript
chosen
[ { "from": "system", "value": "Remove event listener in game win to avoid multiplication\n" }, { "from": "human", "value": "const $ = require('jquery');\n\nfunction DisplayMessage(){\n}\n\nDisplayMessage.prototype.showWinMessage = function(){\n var div = $('#post-game');\n div.empty()\n .sh...
javascript
chosen
[ { "from": "system", "value": "Revert \"support * selectors\", it appears this bug was already fixed but not released\n" }, { "from": "human", "value": "'use strict';\n\nfunction Helpers() {\n}\n\nHelpers.prototype = {\n getClassesFromSelector: function (selector) {\n if (!selector) {\n...
javascript
chosen
[ { "from": "system", "value": "Add log of server time" }, { "from": "human", "value": "var express = require('express'),\n schedule = require('node-schedule'),\n cacheService = require('./cache-service.js')(),\n app = express(),\n dataCache = {\n news: null,\n weather: ...
javascript
chosen
[ { "from": "system", "value": "Update to async; fix problem with missing findLocalProj\n" }, { "from": "human", "value": "#!/usr/bin/node\n\nvar convert = require('../'),\n fs = require('fs'),\n geojson = JSON.parse(fs.readFileSync(process.argv[2])),\n mtl = process.argv[3],\n mtllibs...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Add access control allow origin middlewar\n" }, { "from": "human", "value": "express = require('express')\nexpressValidator = require('express-validator')\n\nmodule.exports = (function(){\n function configure(app) {\n app.set('port', process.env.PORT |...
javascript
chosen
[ { "from": "system", "value": "Copy `hasExports` setting from bpack when bundle is reset\n\nBrowserify copies this setting manually in b.reset:\n\nhttps://github.com/substack/node-browserify/blob/a18657c6f363272ce3c7722528c8ec5f325d0eaf/index.js#L732\n\nSince we replace the bpack instance the `hasExports` va...
javascript
chosen
[ { "from": "system", "value": "Update jQuery and BS to latest version for tests\n" }, { "from": "human", "value": "/**\n * Jasmine test to check success callback\n */\ndescribe('stan-loader-ok', function() {\n\n\t// Declare status var\n\tvar status;\n\n\t// Activate async\n\tbeforeEach(function(d...
javascript
chosen
[ { "from": "system", "value": "Fix \"Wrap only the function expression in parens\"\n" }, { "from": "human", "value": "module.exports = HtmlFile;\n\nfunction HtmlFile(path) {\n this.path = path;\n}\n\nHtmlFile.prototype.querySelectorAll = function(ph, style, cb) {\n var _this = this;\n return n...
javascript
chosen
[ { "from": "system", "value": "Revert \"Make renderer polymorphically call updateEmptyListContent\"\n\nThis reverts commit ff82e198ca173fdbb5837982c3795af1dec3a15d.\n" }, { "from": "human", "value": "/*\n * Copyright (C) 2013 salesforce.com, inc.\n *\n * Licensed under the Apache License, Version...
javascript
chosen
[ { "from": "system", "value": "Add more tests to set and get values from Redis\n" }, { "from": "human", "value": "var Assert = require('assert');\nvar CacheAllTheThings = require('../');\n\ndescribe('CacheAllTheThings', function() {\n\n it('When asked to boot a Redis instance, it shou...
javascript
chosen
[ { "from": "system", "value": "Remove media query that accounds for status bar\n\nTesting if the necessary space will be added by the mobile browser automatically\nTODO: verify no additional padding required." }, { "from": "human", "value": "//@flow\n\nimport styled, { css } from \"styled-compone...
javascript
chosen
[ { "from": "system", "value": "Add log shortcuts instead of having to specify the log level if a parameter is added\n" }, { "from": "human", "value": "const {Initializer, api} = require('actionhero');\nconst r = require('@lib/r');\n\nmodule.exports = class ApiInitializer extends Initializer {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix message sorting in renderer having issues with varying message key lengths\n" }, { "from": "human", "value": "var STATE = (function(){\n var FILE;\n var MSGS;\n \n var selectedChannel;\n \n return {\n uploadFile: function(file){\n FILE = file;\n ...
javascript
chosen
[ { "from": "system", "value": "Use NODE_ENV (with --production) to run production import(...) tests.\n" }, { "from": "human", "value": "var selftest = require('../tool-testing/selftest.js');\nvar Sandbox = selftest.Sandbox;\n\nselftest.define(\"dynamic import(...) in development\", function () {\...
javascript
chosen
[ { "from": "system", "value": "Disable duplicate Rsync progress output\n" }, { "from": "human", "value": "'use strict';\nconst fs = require('fs');\nconst gulp = require('gulp');\nconst rsync = require('gulp-rsync');\n\n// 'gulp deploy' -- reads rsync credentials file and incrementally uploads...
javascript
chosen
[ { "from": "system", "value": "Switch inline style attribute binding to jQuery CSS DOM Manip for CSP\n" }, { "from": "human", "value": "import Ember from \"ember\";\nexport default Ember.Component.extend({\n classNames: ['liquid-child'],\n attributeBindings: ['style'],\n style: Ember.computed(...
javascript
chosen
[ { "from": "system", "value": "Transform all tests for the trigger\n" }, { "from": "human", "value": "import Trigger from 'ember-basic-dropdown/components/basic-dropdown/trigger';\n\nexport default Trigger.extend({\n didOpen: false,\n\n didReceiveAttrs() {\n let dropdown = this.get('dropdown...
javascript
chosen
[ { "from": "system", "value": "FIX: Normalize TSV end-of-line without stripping all whitespace\n\n(cherry picked from commit 786cfbb5847f5508720416cc7846fa1fcadc36bc)\n" }, { "from": "human", "value": "/*\n * TSV\n * Module for parsing TSV (and eventually other formats)\n */\n\nconst trimSplit = ...
javascript
chosen
[ { "from": "system", "value": "Add logging to worker process, keep consistent with server logging via bunyan\n" }, { "from": "human", "value": "/**\n * A worker will listen for jobs on the job queue, and execute them.\n */\nvar async = require('async');\n\nfunction bootstrapWorker (api, config, n...
javascript
chosen
[ { "from": "system", "value": "Allow users from phishing website to continue\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('ddsApp').controller('HomepageCtrl', function($scope, $state, droitsDescription, $timeout, ABTestingService, phishingExpressions) {\n [ 'prestationsNa...
javascript
chosen
[ { "from": "system", "value": "Improve user edit modal, now it saves the last name and bio\n" }, { "from": "human", "value": "/*****************************************************************************/\n/* UserProfileEdit: Event Handlers */\n/**************************************************...
javascript
chosen
[ { "from": "system", "value": "Reimplement basic server as express app\n" }, { "from": "human", "value": "'use strict';\n\nvar http = require('http'),\n spotify = require('spotify-node-applescript');\n\nvar cb = function(request, response) {\n\n debugger;\n\n response.writeHead(200, {'Conten...
javascript
chosen
[ { "from": "system", "value": "Add base url and user id to metrics test\n" }, { "from": "human", "value": "import * as Metrics from 'new-dashboard/core/metrics';\nimport store from 'new-dashboard/store';\n\ndescribe('Internal Metrics Tracker', () => {\n describe('sendMetric', () => {\n before...
javascript
chosen
[ { "from": "system", "value": "Update Crosswalk plugin to 1.6.0\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Makes your Cordova application use the Crosswalk WebView \\\ninstead of the System WebView on Android\",\n version: '1.4.1-rc.1',\n documentation: null\n});\n\nCor...
javascript
chosen
[ { "from": "system", "value": "Change openness users icon by unlock icon\n" }, { "from": "human", "value": "import React from 'react'\nimport PieChart from '../../Charts/PieChart/PieChart'\nimport BarChart from '../../Charts/BarChart/BarChart'\nimport Percent from '../../Statistics/Percent/Percen...
javascript
chosen
[ { "from": "system", "value": "Remove unused (moved) FFI function\n" }, { "from": "human", "value": "\"use strict\";\n\n// module Data.Ord\n\nexports.ordArrayImpl = function (f) {\n return function (xs) {\n return function (ys) {\n var i = 0;\n var xlen = xs.length;\n var ylen ...
javascript
chosen
[ { "from": "system", "value": "Allow Image block to access remove method\n" }, { "from": "human", "value": "import {Entity} from 'draft-js';\n\nexport default (config) => (contentBlock, getEditorState, updateEditorState) => {\n const type = contentBlock.getType();\n if (type === 'image') {\n ...
javascript
chosen
[ { "from": "system", "value": "Upgrade the file cordova dependency to 1.3.3\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Update the client when new client code is available\",\n version: '1.1.4'\n});\n\nCordova.depends({\n 'org.apache.cordova.file': '1.3.2',\n 'org.apach...
javascript
chosen
[ { "from": "system", "value": "Store file upload loading state.\n" }, { "from": "human", "value": "import { types } from './storage.actions';\n\nconst initialState = {\n file: null,\n url: null,\n};\n\nexport default function storageReducer(state=initialState, action={}) {\n switch (action.typ...
javascript
chosen
[ { "from": "system", "value": "Verify if a integer number is even or odd - refactor\n" }, { "from": "human", "value": "// Modules\nvar prompt = require( 'prompt' );\n\n// // Create a variable x and assign value 3 to it\n// var x = 3;\n\n// // Bind x to value 9\n// x *= x; // or x = x * x;\n// con...
javascript
chosen
[ { "from": "system", "value": "Remove arrow-body-style. Is too confusing\n" }, { "from": "human", "value": "module.exports = {\n parserOptions: {\n ecmaVersion: 2017,\n sourceType: 'module',\n ecmaFeatures: {\n experimentalObjectRestSpread: true\n }\n },\n rules: {\n 'arrow...
javascript
chosen
[ { "from": "system", "value": "Create default settings upon first installation\n" }, { "from": "human", "value": "function runAlarm() {\n chrome.tabs.create({\n url: \"http://example.com\"\n });\n}\nchrome.alarms.onAlarm.addListener(function(alarm) {\n console.log(alarm);\n chr...
javascript
chosen
[ { "from": "system", "value": "Document workaround for `got` `FormData` bug\n\nSee: https://github.com/sindresorhus/got/pull/466\n" }, { "from": "human", "value": "/* eslint-env node */\n\nconst FormData = require('form-data');\nconst got = require('got');\n\n\nconst BASE_URL = 'https://debuglogs...
javascript
chosen
[ { "from": "system", "value": "Add notice in callback example\n" }, { "from": "human", "value": "const request = require('request')\n\nfunction getLuke(cb) {\n const lukeInfo = {\n name: 'Luke',\n }\n\n request('https://swapi.co/api/people/1', (error, response, body) => {\n if ...
javascript
chosen
[ { "from": "system", "value": "Add multipart case for upper case boundaries\n" }, { "from": "human", "value": "var suite = require('suite.js');\n\nvar convertTag = require('../lib/convert_tag');\n\nsuite(convertTag, [\n 'foo', 'foo',\n 'self help', 'self_help',\n 'self-help', 'self__help...
javascript
chosen
[ { "from": "system", "value": "Stop watchnig so many files, fixes errors\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n jshint: {\n options: {\n jshintrc: '.jshin...
javascript
chosen
[ { "from": "system", "value": "Add cssmin to Grunt task ‘build’\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\tgrunt.initConfig({\n\t\tbowerPkg: grunt.file.readJSON('bower.json'),\n\t\tkarma: {\n\t\t\tunit: {\n\t\t\t\tconfigFile: 'karma.conf.js',\n\t\t\t\tsingleRun: true...
javascript
chosen
[ { "from": "system", "value": "Add csslint and docco to the default grunt task\n" }, { "from": "human", "value": "/*global module:false*/\nmodule.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n // Task configuration.\n csslint: {\n src: ['public/**/*....
javascript
chosen
[ { "from": "system", "value": "Apply standard 11.x code style\n" }, { "from": "human", "value": "/* jslint node: true */\n'use strict'\n\nmodule.exports = function (grunt) {\n // Project configuration.\n grunt.initConfig({\n nodeunit: {\n files: ['test/**/*_test.js']\n }\n })\n\n ...
javascript
chosen
[ { "from": "system", "value": "[Stitching] Enable type name conflict logging.\n" }, { "from": "human", "value": "import { mergeSchemas, introspectSchema, makeRemoteExecutableSchema } from \"graphql-tools\"\nimport { createHttpLink } from \"apollo-link-http\"\nimport fetch from \"node-fetch\"\n\ni...
javascript
chosen
[ { "from": "system", "value": "Add basic http authentication for all http requests on testserver\n" }, { "from": "human", "value": "\"use strict\";\n\n// Load the libraries and modules\n\nvar assets = require(__dirname + '/data/assets.json');\nvar config = {\n npm: __dirname + '/node_modules/'...
javascript
chosen
[ { "from": "system", "value": "Update error function to arrow function\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\nconst express = require('express');\nconst compression = require('compression');\nconst bodyParser = require('body-parser');\nco...
javascript
chosen
[ { "from": "system", "value": "Remove the unnecessary render on start up\n" }, { "from": "human", "value": "const { configureStore } = require('../store');\nconst readline = require('readline');\nconst draw = require('./draw');\nconst { keys } = require('./input');\nconst actions = require('../ac...
javascript
chosen
[ { "from": "system", "value": "Set env=development when task:serve is dispatched\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar argv = require(\"yargs\").argv;\nvar main = require('../');\n\nvar task = argv._[0];\nvar options = {};\n\nif(task === \"try\"){\n options.env = \"develo...
javascript
chosen
[ { "from": "system", "value": "Add valueAttr to the application module\n" }, { "from": "human", "value": "define([\n 'extensions/collections/collection'\n],\nfunction (Collection) {\n return {\n requiresSvg: true,\n collectionClass: Collection,\n\n collectionOptions: function () {\n ...
javascript
chosen
[ { "from": "system", "value": "Include scope in controller when adding post\n" }, { "from": "human", "value": "var r = require('rethinkdb');\n\nmodule.exports = function messageCreator(pool) {\n return function(message) {\n return pool.runQuery(r.table('messages').insert({\n body: messag...
javascript
chosen
[ { "from": "system", "value": "Fix error logging to actually output useful data\n" }, { "from": "human", "value": "import { basename, extname, join, dirname, relative, resolve } from 'path'\nimport { default as put } from 'output-file-sync'\nimport { parallel } from 'async'\n\nconst keys = Object...
javascript
chosen
[ { "from": "system", "value": "Correct to the right property\n" }, { "from": "human", "value": "module.exports = {\n assetsDir: 'styleguide/',\n css: {\n modules: true\n }\n};\n" }, { "from": "gpt", "value": "module.exports = {\n css: {\n modules: true\n },\n publicPath: '...
javascript
chosen
[ { "from": "system", "value": "Add placeholder menu item hover style\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport ListItem from '@material-ui/core/ListItem'\nimport ListItemText from '@material-ui/core/ListItemText'\nimport NavLink from ...
javascript
chosen
[ { "from": "system", "value": "Implement new version of react-mdl's DataTable including TableHeader component.\n\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport { Link } from 'react-router';\nimport { DataTable, FABButton, Icon } from 'react-mdl';\n\nimport Pa...
javascript
chosen
[ { "from": "system", "value": "Check time after alarm disabled\n" }, { "from": "human", "value": "import Entity from '../Entity.js';\nimport printMessage from '../printMessage.js';\nimport action from '../action.js';\nimport time from '../time.js';\n\nexport class AlarmClock extends Entity {\n c...
javascript
chosen
[ { "from": "system", "value": "Add method to promisify chmod function\n" }, { "from": "human", "value": "const fs = require('fs')\n\nfunction fileExist(filename = '') {\n try {\n fs.accessSync(filename)\n } catch (e) {\n return false\n }\n\n return true\n}\n\nfunction writeFile(filename...
javascript
chosen
[ { "from": "system", "value": "Make InstanceLaunchFooter functionally disabled instead of just visually\n" }, { "from": "human", "value": "import React from 'react';\n\nexport default React.createClass({\n propTypes: {\n backIsDisabled: React.PropTypes.bool.isRequired,\n launchIs...
javascript
chosen
[ { "from": "system", "value": "Remove redundant error message assertion\n" }, { "from": "human", "value": "const { client } = require('nightwatch-cucumber')\nconst { defineSupportCode } = require('cucumber')\n\ndefineSupportCode(({ Then }) => {\n const Messages = client.page.Messages()\n\n Then...
javascript
chosen
[ { "from": "system", "value": "Set correct base controller for content type\n" }, { "from": "human", "value": "angular.module('umbraco').controller('Our.Umbraco.Nexu.BaseDeleteController',\n ['$scope', '$controller', 'Our.Umbraco.Nexu.Resource',\n function ($scope, $controller, nexuRes...
javascript
chosen
[ { "from": "system", "value": "Use `open` to find Marked.app, because of path problems finding the `mark` command." }, { "from": "human", "value": "/* globals atom:false */\n\n'use strict';\n\nexports.provideBuilder = function () {\n return {\n niceName: 'Markdown',\n\n isEligable: functio...
javascript
chosen
[ { "from": "system", "value": "Use action button if it exists\n" }, { "from": "human", "value": "import React, {PropTypes} from 'react'\nimport styles from '../styles/DeskTool.css'\nimport PaneResolver from 'config:desk-tool/pane-resolver'\n\nDeskTool.propTypes = {\n location: PropTypes.shape({\...
javascript
chosen
[ { "from": "system", "value": "Enable more core “Errors” rules" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n 'rules': {\n // Enforce trailing commas in multiline object literals\n 'comma-dangle': [2, 'always-multiline'],\n },\n};\n" }, { "from"...
javascript
chosen
[ { "from": "system", "value": "Add section 2.4 code to search recipe descriptions\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar JsonDB = require('node-json-db');\nvar _ = require('lodash');\n\n// Recipes listing\nrouter.get('/', function...
javascript
chosen
[ { "from": "system", "value": "Use shelljs instead of rimraf\n" }, { "from": "human", "value": "module.exports = function(grunt, config, parameters, done) {\n\n\tfunction endForError(e) {\n\t\tprocess.stderr.write(e.message || e);\n\t\tdone(false);\n\t}\n\n\ttry {\n\t\tvar rimraf = require('rimra...
javascript
chosen