conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Work around for unit test timeouts\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n return {\n options: {\n frameworks: ['jasmine'],\n files: [ //this files data is also updated in the watch handler, if update...
javascript
chosen
[ { "from": "system", "value": "Set API send authorization header\n" }, { "from": "human", "value": "import axios from 'axios'\n\nexport default () => {\n return axios.create({\n baseURL: 'http://127.0.0.1:8081'\n })\n}\n" }, { "from": "gpt", "value": "import axios from 'axios'\ni...
javascript
chosen
[ { "from": "system", "value": "Handle the case for no status in an archive\n" }, { "from": "human", "value": "import route from './async-route';\nimport { Router } from 'express';\nimport authMiddleware from '../middlewares/auth';\n\nconst router = Router();\n\nrouter.use(authMiddleware);\n\nrout...
javascript
chosen
[ { "from": "system", "value": "Fix option names from tags to tag\n" }, { "from": "human", "value": "module.exports = {\n \"Demo test Npmjs\" : function (browser) {\n browser\n .url(\"https://www.npmjs.com\")\n .waitForElementVisible('body', 1000)\n .setValue('input[type=search]...
javascript
chosen
[ { "from": "system", "value": "Update notification badge in all circumstances\n" }, { "from": "human", "value": "\nconst Marionette = require('backbone.marionette');\n\nmodule.exports = class NotificationBadgeView extends Marionette.View {\n template = Templates['nav/notification-badge'];\n\n m...
javascript
chosen
[ { "from": "system", "value": "Add required skills to display.\n" }, { "from": "human", "value": "window.onload = function onLoad() {\n getVolunteeringOpportunities();\n};\n\nasync function getVolunteeringOpportunities() {\n const response = await fetch('/event-volunteering-data');\n const...
javascript
chosen
[ { "from": "system", "value": "Resolve issue with e.target.tagName throwing errors in the editor\n" }, { "from": "human", "value": "module.exports = {\n id: 'tabBar',\n template: require('./index.html'),\n data: {},\n attached: function () {\n var el = this.$el;\n var in...
javascript
chosen
[ { "from": "system", "value": "Clock: Improve behavior on rack load\n" }, { "from": "human", "value": "export default class EventScheduler {\n constructor(audioContext) {\n this.audioContext = audioContext;\n this.running = false;\n this.timeoutID = null;\n }\n\n start(callback) {\n ...
javascript
chosen
[ { "from": "system", "value": "Make sure only '.js' files are considered as routes.\n" }, { "from": "human", "value": "\"use strict\";\nvar routes = module.exports = { };\n\nvar fs = require(\"fs\");\nvar path = require(\"path\");\n\n\nroutes.handlers = { };\nfs.readdirSync(__dirname).filter(func...
javascript
chosen
[ { "from": "system", "value": "[GJD] Add console logging to node backend to help with development\n" }, { "from": "human", "value": "/*jshint node:true, laxcomma:true */\nvar http = require('http');\n\nfunction HastaLaVista(startupTime, config, emitter){\n var self = this;\n this.config = confi...
javascript
chosen
[ { "from": "system", "value": "Tweak alert message on no resources.\n" }, { "from": "human", "value": "function info_set_location(slice_id, url)\n{\n $.getJSON(\"aggregates.php\", { slice_id: slice_id },\n function (responseTxt, statusTxt, xhr) {\n var json_agg = ...
javascript
chosen
[ { "from": "system", "value": "Update datetime parsing for iso8601\n" }, { "from": "human", "value": "export default function parseDateTime(datetime) {\n const [time, date] = datetime.split(' ');\n const [hour, minute, second] = time.split(':');\n const [day, month, year] = date.split('-');\n\...
javascript
chosen
[ { "from": "system", "value": "Use reference to current directory instead of __dirname.\n" }, { "from": "human", "value": "/*\n * grunt-load-options\n * https://github.com/chriszarate/grunt-load-options\n *\n * Copyright (c) 2013 Chris Zarate\n * Licensed under the MIT license.\n */\n\n'use stric...
javascript
chosen
[ { "from": "system", "value": "Add an intermediary build step to lib/\n" }, { "from": "human", "value": "'use strict'\n\nlet gulp = require('gulp')\nlet connect = require('gulp-connect')\nlet sourcemaps = require('gulp-sourcemaps')\nlet browserify = require('browserify')\nlet babelify = require('...
javascript
chosen
[ { "from": "system", "value": "Add new field for about link\n" }, { "from": "human", "value": "import DS from 'ember-data';\nimport OsfModel from 'ember-osf/models/osf-model';\n\nexport default OsfModel.extend({\n name: DS.attr('fixstring'),\n logoPath: DS.attr('string'),\n bannerPath: D...
javascript
chosen
[ { "from": "system", "value": "Move dependencies to after exports line\n\nThis prevents an issue with circular dependencies.\n" }, { "from": "human", "value": "var ContactModel = require('../model/Contacts');\nvar ContactView = require('../view/Contact');\nvar AddContactForm = require('../view/Ad...
javascript
chosen
[ { "from": "system", "value": "Add tests for path normalization\n\n.md to .html\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar assert = require('assert');\n\nvar summary = require('../').parse.summary;\n\n\nvar CONTENT = fs.readFileSync(path.join(__di...
javascript
chosen
[ { "from": "system", "value": "Add route handler for PUT /api/roadmaps/:roadmapID\n" }, { "from": "human", "value": "var Roadmap = require('./roadmapModel.js'),\n handleError = require('../../util.js').handleError;\n\nmodule.exports = {\n\n createRoadmap : function (req, res, next) {\n var...
javascript
chosen
[ { "from": "system", "value": "Update Space.eventSourcing.Snapshot to new format\n" }, { "from": "human", "value": "Space.Struct.extend(Space.eventSourcing, 'Snapshot', {\n\n mixin: [\n Space.messaging.Ejsonable\n ],\n\n fields() {\n return {\n id: Match.OneOf(String, Guid),\n ...
javascript
chosen
[ { "from": "system", "value": "Fix issue with post with no tag\n" }, { "from": "human", "value": "import needle from 'needle';\nimport { SiteConf, getDate } from 'base';\n\nexport const postsApiHandler = (req, res) => {\n needle('get', SiteConf.PostsApi)\n .then(resp => {\n const data =...
javascript
chosen
[ { "from": "system", "value": "Fix the “Line too long” warning" }, { "from": "human", "value": "import gulp from 'gulp';\nimport requireDir from 'require-dir';\nrequireDir('./gulp/tasks');\n\ngulp.task('default', ['replace-webpack-code', 'webpack-dev-server', 'views:dev', 'copy:dev', 'views:watch...
javascript
chosen
[ { "from": "system", "value": "Fix a typo in `registerLogin`.\n" }, { "from": "human", "value": "const db = require(\"./db\");\n\nexports.checkLogin = function (userId, secret) {\n return db.select(\n `SELECT secret FROM devices WHERE id = $1`,\n [userId]\n ).then((rows) => {\n if (! r...
javascript
chosen
[ { "from": "system", "value": "[fix] Prepend a refernce to the spark for `data` events\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * The server-side plugin for Primus which adds EventEmitter functionality.\n *\n * @param {Primus} primus The initialised Primus server.\n * @api public...
javascript
chosen
[ { "from": "system", "value": "Add a new method to generate a grid of characters\n\nThis will use the chunk method from lodash to split the entire array\ninto chunks of 4 characters and then generate a row with each chunk\n" }, { "from": "human", "value": "var Character = require('./character');...
javascript
chosen
[ { "from": "system", "value": "Switch password storage to localStorage so that it works across tabs.\n" }, { "from": "human", "value": "module.exports = {\n unlockCollection: function(id, effectivePassword) {\n sessionStorage.setItem(\"eff_\" + id, effectivePassword);\n },\n lockC...
javascript
chosen
[ { "from": "system", "value": "Change Windows to UNIX end of line\n" }, { "from": "human", "value": "'use strict'\r\n// Load .env file if it exists\r\nrequire('dotenv').config()\r\n\r\nconst config = require('./config/serverSettings')\r\nconst server = require('./server/server')\r\nconst log = re...
javascript
chosen
[ { "from": "system", "value": "Add Hello, world with Express\n" }, { "from": "human", "value": "var Connection = require('tedious').Connection;\n// Very important that the password never appears in git\nvar config = {\n userName: \"oxfordCSteam11Y16\",\n password: process.env.BTP_PASSWORD,\n s...
javascript
chosen
[ { "from": "system", "value": "Make client uuid anonymous if header is not set in GET requests to be safe\n" }, { "from": "human", "value": "function createRequireClientHeaders(opts) {\n return function requireClientHeaders(req, res, next) {\n // Enforce uuid header in other methods than GET\...
javascript
chosen
[ { "from": "system", "value": "Index page uses sockets to update itself\n\nNew boards will show up automatically on the index page.\n" }, { "from": "human", "value": "var app = angular.module('app', ['socket.io']);\napp.config(['$socketProvider', function ($socketProvider) {\n\t$socketProvider.se...
javascript
chosen
[ { "from": "system", "value": "Simplify the request to Vimeo. We can either make a user request or album request.\n" }, { "from": "human", "value": "// Define VimeoAjaxRequest\nvar VimeoAjaxRequest = (function () {\n var fetchVideoData = function(vimeo_id, callback) {\n Zepto.ajax(\n {...
javascript
chosen
[ { "from": "system", "value": "Remove unecessary imported component makeStyles\n" }, { "from": "human", "value": "import React from 'react'\nimport { Box, Grid, Typography, Card, CardContent } from '@material-ui/core'\nimport { makeStyles } from '@material-ui/core/styles'\nimport { Edit, Delete }...
javascript
chosen
[ { "from": "system", "value": "Add corrected locale support for languages\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\nimport moment from 'moment';\nimport french from 'moment/locale/fr';\nimport english from 'moment/locale/en-nz';\n\nim...
javascript
chosen
[ { "from": "system", "value": "Add an angular filter `isEmpty`\n" }, { "from": "human", "value": "/**\n * Created by Panda on 16/1/13.\n */\n\nvar app = angular.module('banshee.filters', []);\n\nmodule.exports = app.name;\n" }, { "from": "gpt", "value": "/**\n * Created by Panda on 16...
javascript
chosen
[ { "from": "system", "value": "Remove call to `getStatus` also\n" }, { "from": "human", "value": "var _ = require('underscore'),\n DBPull = require('../models/db_pull'),\n DBStatus = require('../models/db_status'),\n config = require('../config'),\n Signature = require('../models/sign...
javascript
chosen
[ { "from": "system", "value": "Remove useless argument passed in watch\n" }, { "from": "human", "value": "var Component = require('../core/Component');\n\nvar Loop = new Component('loop', {\n templateName: 'component/loop',\n data: { audio: null },\n methods: {\n play: function ()...
javascript
chosen
[ { "from": "system", "value": "Add fix for frost-guide that filters out nested folders\n" }, { "from": "human", "value": "import Ember from 'ember'\nimport svgs from 'ember-frost-core/svgs'\nimport _ from 'lodash/lodash'\n\nexport default Ember.Controller.extend({\n backgroundColors: [\n 'bg-...
javascript
chosen
[ { "from": "system", "value": "Use correct method name. [rev: matthew.gordon2]\n" }, { "from": "human", "value": "/**\n * @module js-utils/js/repeater\n */\ndefine([\n 'underscore'\n], function () {\n /**\n * @name module:js-utils/js/repeater.Repeater\n * @desc Wrapper around setTim...
javascript
chosen
[ { "from": "system", "value": "Remove password requirement; add support for cifs on linux\n" }, { "from": "human", "value": "const { exec } = require('child_process');\nconst mkdirp = require('./mkdir-promise');\n\nconst fileExists = (err) => /file exists/i.test(err.message);\n\nconst mountShare ...
javascript
chosen
[ { "from": "system", "value": "Fix spelling error for carousel image\n" }, { "from": "human", "value": "app.controller('HomeController', ['$http', function($http) {\n console.log('HomeController running');\n var self = this;\n\n self.dataArray = [\n {\n src: '../assets/images/c...
javascript
chosen
[ { "from": "system", "value": "Make Juans requested PR changes.\n" }, { "from": "human", "value": "$().ready(function() {\n $('#location-checkbox').change(function() {\n if(this.checked) {\n setCookie('location', 'true', 1);\n } else {\n eraseCookie('location');\n }\n });\n ...
javascript
chosen
[ { "from": "system", "value": "Add relations between Commets and Users.\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\n\nvar commentSchema = mongoose.Schema({\n\ttext: String,\n\tauthor: String\n});\n\nmodule.exports = mongoose.model('Comment', commentSchema);\n" }, {...
javascript
chosen
[ { "from": "system", "value": "Make ChooseLanguageScreen use data from Redux\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { Card, Thumbnail, Container, Content, List } from 'native-base';\nimport chooseLangu...
javascript
chosen
[ { "from": "human", "value": "Add header component which displays h1 and show-fav button\n" }, { "from": "gpt", "value": "import React from 'react';\nimport Button from '../Button/Button'\n\nconst Header = () => {\n return (\n <header>\n <div></div>\n <h1 className=\"header-title\">...
javascript
chosen
[ { "from": "system", "value": "Use object-assign polyfill to create new objects for state\n" }, { "from": "human", "value": "const initialState = {\n jwt: null,\n authenticated: false,\n supportsWebSockets: false,\n supportsGetUserMedia: false,\n hasDocumentCaptured: false,\n hasFaceCapture...
javascript
chosen
[ { "from": "system", "value": "Add tests for user sign up\n" }, { "from": "human", "value": "import app from '../config/server'\nimport supertest from 'supertest'\n\nconst request = supertest.agent(app.listen())\n\ndescribe('Users', () => {\n describe('GET /users', () => {\n it('should respon...
javascript
chosen
[ { "from": "system", "value": "Add unit tests for utils.checkIsXMLFile()\n" }, { "from": "human", "value": "/* eslint-disable no-unused-expressions */\n\nconst { expect } = require('chai');\nconst { describe, it } = require('mocha');\nconst utils = require('../lib/utils');\n\ndescribe('containsOb...
javascript
chosen
[ { "from": "system", "value": "Refactor addUser function for readability.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(app) {\n app.controller('CreateGameController', ['$rootScope', 'UserService', 'FriendService', 'GameService', function($rs, UserService, FriendS...
javascript
chosen
[ { "from": "system", "value": "Rollback of Replace calls to goog.define with assignments to the result of goog.define.\n\nPiperOrigin-RevId: 239630421\n" }, { "from": "human", "value": "/*\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you...
javascript
chosen
[ { "from": "system", "value": "Update the docs for normalizeModelName so they explain the intent of the function\n" }, { "from": "human", "value": "import Ember from 'ember';\n\n/**\n All modelNames are dasherized internally. Changing this function may\n require changes to other normalization h...
javascript
chosen
[ { "from": "system", "value": "Tidy up source converter formatting\n" }, { "from": "human", "value": "define(\n 'source-converter',\n [\n 'marked',\n 'to-markdown'\n ],\n function (\n marked,\n toMarkdownConverter\n ) {\n\n 'use strict';\n\n return (function() {\n var toHTML =...
javascript
chosen
[ { "from": "system", "value": "feat(Display): Add hiding and expansion to Display\n" }, { "from": "human", "value": "// @flow\nimport React from 'react';\n\nimport { List as ImmutableList, Map as ImmutableMap } from 'immutable';\n\nimport { transforms, displayOrder } from '../../transforms';\n\ni...
javascript
chosen
[ { "from": "system", "value": "Add resetting state when brand link is clickced\n\n" }, { "from": "human", "value": "import React from 'react';\nimport './Header.scss';\n\nexport const Header = () => (\n <nav className='navbar navbar-inverse container-fluid'>\n <a className='brand-title navbar...
javascript
chosen
[ { "from": "system", "value": "Add some basic testing of /event/add\n" }, { "from": "human", "value": "'use strict';\n\nvar chai = require('chai');\nvar expect = chai.expect;\nchai.use(require('chai-as-promised'));\n\nvar Browser = require('zombie');\nvar browser = new Browser({\n\tsite: 'http://...
javascript
chosen
[ { "from": "system", "value": "Allow admins to access xeroaccounts (for now)\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\nvar ObjectId = mongoose.Schema.Types.ObjectId;\nvar Location = require('./location_model');\n\nvar XeroAc...
javascript
chosen
[ { "from": "system", "value": "Fix file paths in the grunt config\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n grunt.initConfig({\n pkg : grunt.file.readJSON('package.json'),\n\n uglify : {\n build : {\n files : {\n ...
javascript
chosen
[ { "from": "system", "value": "Change DLOG to new loader format" }, { "from": "human", "value": "define(['mac/roman'], function(macintoshRoman) {\n\n 'use strict';\n \n return function(resource) {\n var dv = new DataView(resource.data.buffer, resource.data.byteOffset, resource.data.byteLeng...
javascript
chosen
[ { "from": "system", "value": "Change FREF to new loader format" }, { "from": "human", "value": "define(['mac/roman'], function(macintoshRoman) {\n\n 'use strict';\n \n return function(resource) {\n if (resource.data.length !== 7) {\n console.error('FREF resource expected to be 7 bytes...
javascript
chosen
[ { "from": "system", "value": "Change to courses page in stead of lecture 1 when logging in\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n \n angular\n .module('lecturer')\n .controller('LoginCtrl', LoginController);\n\n /* @ngInject */\n function ...
javascript
chosen
[ { "from": "system", "value": "Add gauge Helper so card disappears\n" }, { "from": "human", "value": "/*global define*/\n\ndefine([\n 'jquery',\n 'underscore',\n 'backbone',\n 'templates',\n 'dygraphs',\n 'marionette'\n], function($, _, Backbone, JST, Dyg...
javascript
chosen
[ { "from": "system", "value": "Fix mock for testing FirebaseAuthenticationUI component\n" }, { "from": "human", "value": "/* eslint-env jest */\n\nconst firebaseApp = jest.genMockFromModule('firebase')\n\n// By default, return no user.\nvar firebaseUser = null\n\nfirebaseApp.auth = jest.fn(() => ...
javascript
chosen
[ { "from": "system", "value": "Fix clicking on right-triangle in install button has no effect.\n" }, { "from": "human", "value": "Template.MasterLayout.events({\n\n 'click [data-action=\"install-app\"]': function(evt, tmp) {\n\n if (!$(evt.target).attr('href')) {\n evt.preventDefault();\...
javascript
chosen
[ { "from": "system", "value": "Add comments in Service functions\n" }, { "from": "human", "value": "(function ($) {\n 'use strict';\n\n /**\n * Panda Base Events Service\n * @type {void|Object|*}\n */\n Panda.Events = $.extend(Panda.Events || {}, {\n init: function () ...
javascript
chosen
[ { "from": "system", "value": "Remove winston log in uncaught exception handler" }, { "from": "human", "value": "// index\n// ========\n// Pulls in everything needed for use via npm.\n\n'use strict';\n\nvar winston = require('winston');\nvar LastDitch = require('./last_ditch.js');\n\nvar singleto...
javascript
chosen
[ { "from": "system", "value": "Enable insert image in wysiwyg editor\n" }, { "from": "human", "value": "'use strict';\n\nCKEDITOR.editorConfig = function(config) {\n config.toolbar =\n [\n {\n name: 'styles',\n items : [ 'Format' ]\n },\n {\n name: 'basicstyles',\n ...
javascript
chosen
[ { "from": "system", "value": "Refactor languageSettings and add Hebrew\n\nAllow to set a language setting specifically.\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.core').service('languageSettings', [\n 'documentStore',\n function(documentStore) {\n var se...
javascript
chosen
[ { "from": "system", "value": "Fix blueprints to include perfect-scrollbar\n" }, { "from": "human", "value": "module.exports = {\n afterInstall: function () {\n const packagesToRemove = [\n 'ember-frost-button',\n 'ember-frost-checkbox',\n 'ember-frost-css-core',\n 'ember-...
javascript
chosen
[ { "from": "system", "value": "Fix JS string extraction for ngettext\n\nThe definition for ngettext in extract-translatable-strings had incorrect argument positions, and as a result strings translated with ngettext were missed from the .po file.\n" }, { "from": "human", "value": "const { GettextE...
javascript
chosen
[ { "from": "system", "value": "Throw an error if a check is missing a test or description\n" }, { "from": "human", "value": "'use strict';\nconst fs = require('fs');\nconst _ = require('lodash');\nconst legalityChecks = fs.readdirSync(`${__dirname}/checks`)\n .filter(filename => filename.endsWit...
javascript
chosen
[ { "from": "system", "value": "Fix apiUrl issue when deployed to azure\n" }, { "from": "human", "value": "// Samesound Angular Application.\n// Defines the main module of the application.\n\n'use strict';\n\nvar samesoundApp = angular\n .module('samesoundApp', ['ngResource', 'ngRoute', 'ui.ro...
javascript
chosen
[ { "from": "system", "value": "Remove SideMenu from app root\n" }, { "from": "human", "value": "/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n */\n'use strict';\nimport React, {\n AppRegistry,\n Component,\n StyleSheet,\n Text,\n View\n} from 'react-native';\n...
javascript
chosen
[ { "from": "system", "value": "Fix bug with http causing test failure\n" }, { "from": "human", "value": "import HomeModule from './home';\n\ndescribe('HomeModule', function() {\n let element, scope;\n\n beforeEach(angular.mock.module('app.home'));\n\n beforeEach(angular.mock.inject(($rootScope...
javascript
chosen
[ { "from": "system", "value": "Drop fireEvent since we are supporting IE10\n" }, { "from": "human", "value": "var forEachEls = require(\"../foreach-els\")\n\nmodule.exports = function(els, events) {\n events = (typeof events === \"string\" ? events.split(\" \") : events)\n\n events.forEach(func...
javascript
chosen
[ { "from": "system", "value": "Remove JSONP callback function once done\n" }, { "from": "human", "value": "var _paramanders$elm_twitch_chat$Native_Jsonp = function() {\n\n function jsonp(url, callbackName)\n {\n\n return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) {\n ...
javascript
chosen
[ { "from": "system", "value": "Improve quiz's test to not show answers in string diffs.\n" }, { "from": "human", "value": "import assert from 'assert';\nimport Answers from '../../src/es6/04-Quiz.js';\n\ndescribe(\"04 - Quiz\", () => {\n it(\"Question #1\", () => {\n assert.equal(Answers.ans...
javascript
chosen
[ { "from": "system", "value": "Add default task to gulp file 🤷\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n babel = require('babelify'),\n browserify = require('browserify'),\n buffer = require('vinyl-buffer'),\n source = require('vinyl-source-stream'),\n sourcemaps = re...
javascript
chosen
[ { "from": "system", "value": "Fix Content-Security-Policy warnings in 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 locationTy...
javascript
chosen
[ { "from": "system", "value": "Fix bug with delete on IE8\n" }, { "from": "human", "value": "\n easyXDM = window.easyXDM.noConflict();\n delete window['easyXDM'];\n\n return easyXDM;\n});" }, { "from": "gpt", "value": "\n easyXDM = window.easyXDM.noConflict();\n return easyXDM;\n...
javascript
chosen
[ { "from": "system", "value": "Rollback remove expired OR closed alerts\n" }, { "from": "human", "value": "// To remove expired alerts from the alerta database run this script from cron like so: \n// * * * * * /usr/bin/mongo --quiet monitoring /opt/alerta/sbin/removeExpiredAlerts.js\nnow = new Da...
javascript
chosen
[ { "from": "system", "value": "Add a couple missing commas\n" }, { "from": "human", "value": "var crypto = require('crypto')\nvar fs = require('fs')\nvar path = require('path')\n\nvar fingerprintPath = path.resolve(__dirname, '..', '..', 'node_modules', '.atom-ci-fingerprint')\n\nmodule.exports =...
javascript
chosen
[ { "from": "system", "value": "Replace argument name window -> exports\n" }, { "from": "human", "value": "(function (window) {\n\t'use strict';\n\n\tvar HearingTest = Object.create(null);\n\tvar context = new window.AudioContext();\n\n\tHearingTest.init = function init(frequency) {\n\t\tfrequency...
javascript
chosen
[ { "from": "system", "value": "Change forEach to use map instead\n" }, { "from": "human", "value": "const fse = require(\"fs-extra\");\n\nconst findUpdatedFiles = (\n sourceFilesArtifacts,\n sourceFilesArtifactsUpdatedTimes\n) => {\n let updatedFiles = [];\n // Stat all the source files, gett...
javascript
chosen
[ { "from": "system", "value": "Use logger for db connection\n" }, { "from": "human", "value": "const mongoose = require('mongoose');\nconst logger = require('../logging');\n\nconst DB_URL = process.env.SDF_DATABASE_URL;\nconst DB_NAME = process.env.SDF_DATABASE_NAME || 'sdf';\n\nconst DB_CONN_STR...
javascript
chosen
[ { "from": "system", "value": "Rename buffer to fd in FileReader\n" }, { "from": "human", "value": "'use strict';\n\nconst fs = require('fs');\n\nconst AbstractReader = require('./abstract-reader');\n\nclass FileReader extends AbstractReader {\n\n constructor(fd) {\n super();\n t...
javascript
chosen
[ { "from": "system", "value": "Add serializable state middleware by default\n" }, { "from": "human", "value": "import { createStore, compose, applyMiddleware, combineReducers } from 'redux'\nimport { composeWithDevTools } from 'redux-devtools-extension'\nimport thunk from 'redux-thunk'\nimport im...
javascript
chosen
[ { "from": "system", "value": "Fix babel-runtime/regenerator import in tools runtime setup.\n\nFixes #7181.\n" }, { "from": "human", "value": "// Install ES2015-complaint polyfills for Object, Array, String, Function,\n// Symbol, Map, and Set, patching the native implementations if available.\nre...
javascript
chosen
[ { "from": "system", "value": "Fix / improve session handling on logout.\n" }, { "from": "human", "value": "let auth = require('./auth');\nlet express = require('express');\nlet router = express.Router();\nlet passport = require('passport');\n\n\nrouter.post('/login', function(req, res, next) {\n...
javascript
chosen
[ { "from": "system", "value": "Use barbe to render dynamic fields.\n" }, { "from": "human", "value": "\"use strict\";\n\nconst typpy = require(\"typpy\")\n , iterateObject = require(\"iterate-object\")\n ;\n\n/**\n * Err\n * Create a custom error object.\n *\n * @name Err\n * @function\n * ...
javascript
chosen
[ { "from": "system", "value": "Return full error object when a request fails\n\nWe're not guaranteed to get an error response, so we have to return the\nfull error object.\n" }, { "from": "human", "value": "function Sites( api ) {\n\tthis.api = api;\n}\n\nSites.prototype.query = function( args ) ...
javascript
chosen
[ { "from": "system", "value": "Set default log level to warn\n" }, { "from": "human", "value": "var winston = require('winston'),\n path = require('path');\n\nvar logLevel = 'debug';\n\nvar sharedLogger = function(filename) {\n return new winston.Logger({\n transports: [\n new wins...
javascript
chosen
[ { "from": "system", "value": "Make sure we return the filename when finished.\n" }, { "from": "human", "value": "'use strict';\nconst path = require('path');\nconst extract = require('tar').Extract;\nconst zlib = require('zlib');\nconst fs = require('fs');\n\nmodule.exports = function unzipAndEx...
javascript
chosen
[ { "from": "system", "value": "Change reference to head within reverse()\n\nAs it's a class function and this refers to the instance of the LinkedList class, it will have its own head state." }, { "from": "human", "value": "Class Node {\n constructor(d) {\n this.data = d;\n this.next = nul...
javascript
chosen
[ { "from": "system", "value": "Change question back to regular\n" }, { "from": "human", "value": "/**\n * Module dependencies.\n */\nvar mongoose = require('mongoose'),\n async = require('async'),\n Question = mongoose.model('Question'),\n _ = require('underscore');\n\n\n/**\n * Find que...
javascript
chosen
[ { "from": "system", "value": "Disable Parallax3D on navigation page\n" }, { "from": "human", "value": "import NavigationBase from '../navigation/anim-base';\n\nexport default class AboutNavigationAnimation extends NavigationBase {\n constructor() {\n super();\n this.hash = 'about';\n /...
javascript
chosen
[ { "from": "system", "value": "Refactor run configuration into decorator\n" }, { "from": "human", "value": "angular.module('resourceSolver', [])\n.provider('resourceSolver', function ResourceSolver() {\n var baseUrl = '';\n\n this.setBaseUrl = function(url) {\n baseUrl = url;\n };\n\n this...
javascript
chosen
[ { "from": "system", "value": "Fix support for `batch` event\n" }, { "from": "human", "value": "'use strict';\n\nvar memoize = require('memoizee/lib/primitive')\n , Fragment = require('dbjs-fragment')\n , objFragment = require('dbjs-fragment/object-family')\n\n , getId = function (ob...
javascript
chosen
[ { "from": "system", "value": "Change requested by pull request reviewers 2.\n" }, { "from": "human", "value": "const net = require('net');\nconst JsonSocket = require('json-socket');\n\n\n// Object containing clients list and relative sockets\nconst clients = {};\n\n// Server eventEmitter\nconst...
javascript
chosen
[ { "from": "system", "value": "Add increment and restart actions\n" }, { "from": "human", "value": "export const ADD_ACCEPT_NAME = 'ADD_ACCEPT_NAME';\nexport const ADD_REJECT_NAME = 'ADD_REJECT_NAME';\n\nexport function addAcceptName(name) {\n return {\n type: ADD_ACCEPT_NAME,\n payload: n...
javascript
chosen
[ { "from": "system", "value": "Refactor code using es6 syntax\n" }, { "from": "human", "value": "import passport from 'passport';\nimport passportLocal from 'passport-local';\nimport user from '../models';\n\nconst LocalStrategy = passportLocal.Strategy;\n\npassport.serializeUser((user, done) => ...
javascript
chosen
[ { "from": "system", "value": "Move class up to parent svg element\n" }, { "from": "human", "value": "import PropTypes from 'prop-types'\nimport React from 'react'\nimport icons from './icons'\n\nconst Icon = props => {\n const { size, icon, className, ...restProps } = props\n\n return (\n <...
javascript
chosen
[ { "from": "system", "value": "Update how we call getAll to properly parse out an array of keys using\nr.args() rather than doing getAll.apply(this, items) (which doesn't work).\n" }, { "from": "human", "value": "/**\n * @fileOverview\n * @name files.js\n * @author V. Glenn Tarcea <glenn.tarcea@g...
javascript
chosen