conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Save _preactDom on every rendererCallback\n" }, { "from": "human", "value": "import { h, render } from 'preact';\n\nimport { HTMLElement, sym } from './util';\nimport { withProps } from './with-props';\nimport { withRender } from './with-render';\nimport { withUniqu...
javascript
chosen
[ { "from": "system", "value": "Fix missing dependency on spec, scenario passes\n" }, { "from": "human", "value": "'use strict'\n\nconst bluebird = require('bluebird')\nconst path = require('path')\nconst writeFile = bluebird.promisify(require('fs').writeFile)\n\nmodule.exports = function () {\n ...
javascript
chosen
[ { "from": "system", "value": "Add route to check invite\n" }, { "from": "human", "value": "export const createInvitation = ({ Email, Type } = {}) => ({\n method: 'post',\n url: 'invites',\n data: { Email, Type }\n});\n" }, { "from": "gpt", "value": "export const createInvita...
javascript
chosen
[ { "from": "system", "value": "Add cacheable flag to webpack loader.\n" }, { "from": "human", "value": "// This loader replaces each require(*.coffee) by require(./noco-loader.js!*.coffee)\n// and compile the result to JS.\n// Its purpose is to avoid adding any code in the webpack.config.js of th...
javascript
chosen
[ { "from": "system", "value": "Update selectors in Capsule CRM integration\n\nUpdate the class selectors used in the Capsule integration to reflect\nchanges in Capsule.\n" }, { "from": "human", "value": "/*jslint indent: 2 */\n/*global $: false, document: false, togglbutton: false*/\n\n'use stric...
javascript
chosen
[ { "from": "system", "value": "Add API endpoint to get current user info\n" }, { "from": "human", "value": "'use strict';\n\nconst main = require('../app/controllers/main');\nconst api = require('../app/controllers/api');\nconst auth = require('../app/controllers/auth');\n\n/**\n * Expose routes\...
javascript
chosen
[ { "from": "system", "value": "Print more information about PatchErrors in tests.\n" }, { "from": "human", "value": "import stripSharedIndent from '../../src/utils/stripSharedIndent.js';\nimport { convert } from '../../dist/decaffeinate.cjs.js';\nimport { strictEqual } from 'assert';\n\nexport de...
javascript
chosen
[ { "from": "system", "value": "Add localization key and sound" }, { "from": "human", "value": "var AWS = require('aws-sdk');\n\n// Hardcoding keys on production is bad for your general health\nAWS.config.update({accessKeyId: 'YOURACCESSKEYHERE', secretAccessKey: 'YOURSECRET', region: 'YOURREGION'...
javascript
chosen
[ { "from": "system", "value": "Convert QueryEvaluator to ES class." }, { "from": "human", "value": "import { Class } from '../lib/objects';\nimport { isQueryExpression } from './expression';\nimport QueryContext from './context';\n\nexport default Class.extend({\n target: null,\n\n operators: n...
javascript
chosen
[ { "from": "system", "value": "Add missing Tetris Attack combo scores\n" }, { "from": "human", "value": "module.exports.scoring = {\n tetrisAttack: {\n combo: [20, 30, 50, 60, 70, 80, 100, 140, 170],\n chain: [50, 80, 150, 300, 400, 500, 700, 900, 1100, 1300, 1500, 1800],\n },\n puzzleLe...
javascript
chosen
[ { "from": "system", "value": "Change version tag to include v\n\nAs discussed in imagemin/gifsicle-bin#55, some imagemin bin packages prepend their version\ntags with v and some don't. This PR changes the behavior of this package to prepend tags\nwith`v`, as do the majority of packages. This reduces the pro...
javascript
chosen
[ { "from": "system", "value": "Handle worker with no options\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar mubsub = require('mubsub');\n\nvar monq = module.exports = {};\n\nmonq.Job = require('./job');\nmonq.Queue = require('./queue');\nmonq.Worker = require('./worke...
javascript
chosen
[ { "from": "system", "value": "[change] Remove need to set up properties.\n" }, { "from": "human", "value": "'use strict';\n\nconst events = require('events');\nconst utils = require('util');\nconst base = require('./base.js');\nconst protos = require('./proto.js');\nconst statics = require('./st...
javascript
chosen
[ { "from": "system", "value": "Make the example test less erratic\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar helper = require('./support/helper')\nvar assert = require('assert')\n\nogConsoleLog = console.log\nvar result = helper.run('example/test/lib/**/*.js'),\n log = h...
javascript
chosen
[ { "from": "system", "value": "Add test for various $ root cases" }, { "from": "human", "value": "var $ = require('../../lib/jquery');\n\ndescribe('$', function() {\n describe('#param', function() {\n it('should return params', function() {\n var inst = $({navigator: {userAgent: ''}}, ''...
javascript
chosen
[ { "from": "system", "value": "Resolve style errors on submit block\n" }, { "from": "human", "value": "module.exports = {\n className: 'submit',\n template: require('./index.html'),\n data: {\n name: 'Submit',\n icon: '/images/blocks_submit.png',\n attributes: {\n ...
javascript
chosen
[ { "from": "system", "value": "Check that GA is defined\n" }, { "from": "human", "value": "$(document).ready(function () {\n\t$(\"table.sortable\").stupidtable();\n\n\t$(document).on(\"click\", \"table tr\", function (evt) {\n\t\tvar url = $(this).attr(\"data-url\"),\n\t\t\ttype = $(this).attr(\...
javascript
chosen
[ { "from": "system", "value": "Fix opening of contract preview dialog\n" }, { "from": "human", "value": "export default class ExpertUtilsService {\n constructor($uibModal) {\n this.$uibModal = $uibModal;\n }\n\n showRequest(expertRequest) {\n return this.$uibModal.open({\n component...
javascript
chosen
[ { "from": "system", "value": "Tweak Engine effect and coloration.\n" }, { "from": "human", "value": "import THREE from 'three.js';\n\nconst geometry = new THREE.CylinderGeometry( 0, 0.05, 0.3, 3 );\n\ngeometry.rotateX( Math.PI / 2 );\ngeometry.computeFaceNormals();\ngeometry.computeVertexNormals...
javascript
chosen
[ { "from": "system", "value": "Views: Improve sorting options in To Read view\n" }, { "from": "human", "value": "BookShelf.LaterList = function(params) {\n\n return BookShelf.BookList($.extend(params, {\n status: BookShelf.db.bookStatus.later,\n filter: function(book) {\n ...
javascript
chosen
[ { "from": "system", "value": "Change failure to an alert message.\n" }, { "from": "human", "value": "$(document).ready( function () {\n $(\".upvote\").click( function(event) {\n var responseId = $(this).data(\"id\");\n event.preventDefault();\n $.ajax({\n url: '/response/up_vote',...
javascript
chosen
[ { "from": "system", "value": "Add comment to explain disabled eslint rule\n" }, { "from": "human", "value": "/* eslint react/prop-types: 0 */\nimport { compose, createStore, applyMiddleware, combineReducers } from 'redux';\nimport thunkMiddleware from 'redux-thunk';\nimport loggerMiddleware from...
javascript
chosen
[ { "from": "system", "value": "Add documentation for ticker widget\n" }, { "from": "human", "value": "Dashboard.TickerWidget = Dashboard.Widget.extend({\n sourceData: \"\",\n\n templateName: 'ticker_widget',\n classNames: ['widget', 'widget-ticker'],\n\n widgetView: function() {\n var widg...
javascript
chosen
[ { "from": "system", "value": "Fix: Add the GRENADE SPLASH kill mode\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('quakeStatsApp').\n filter('WeaponsFilter', function () {\n var resultToName = {\n\t\t\t1: 'SHOTGUN',\n\t\t\t2: 'GAUNTLET',\n\t\t\t3: 'MACHINEGUN',\n\t...
javascript
chosen
[ { "from": "system", "value": "Add author, doc, notes to backdrop test\n" }, { "from": "human", "value": "/*!\n{\n \"name\": \"Backdrop Filter\",\n \"property\": \"backdropfilter\",\n \"tags\": [\"css\"]\n}\n!*/\ndefine(['Modernizr', 'testAllProps'], function(Modernizr, testAllProps) {\n Mode...
javascript
chosen
[ { "from": "system", "value": "Fix error if no argument is passed to constructor" }, { "from": "human", "value": "const lru = require('lru-cache');\n\nmodule.exports = class LruCache {\n constructor({ maxItems }) {\n this.cache = lru(maxItems);\n }\n\n get(key) {\n return Promise.resolve...
javascript
chosen
[ { "from": "system", "value": "Fix for new version of slack\n\nchange span.message_content to div.messagee_content" }, { "from": "human", "value": "$(function() {\n\t// https://github.com/naugtur/insertionQuery\n\tvar anime_watch = function(selector, callback) {\n\t\tvar guid = selector.replace(/...
javascript
chosen
[ { "from": "system", "value": "Remove the dummy header from home page." }, { "from": "human", "value": "// @flow\nimport React, { Component } from 'react';\nimport {connect} from 'react-redux'\nimport path from 'path'\nimport Catalog from '../components/Catalog';\nimport FileAdder from '../compon...
javascript
chosen
[ { "from": "system", "value": ":new: Add basic commands and welcome message to\n not in a motion app directory\n\n Usage: motion run [options]\n\n Options:\n\n -h, --help output usage information\n -d, --debug [what] output extra information for debugging\n -p, --port [number] specify...
javascript
chosen
[ { "from": "system", "value": "Test showing that the server properly redirects after a logout.\n" }, { "from": "human", "value": "/**\n * See http://mochajs.org/ for documentation.\n */\nvar expect = require('expect.js'),\n request = require('supertest');\n\ndescribe('/', function() {\n it('...
javascript
chosen
[ { "from": "system", "value": "Make sure variables don't pollute the global namespace.\n" }, { "from": "human", "value": "$(function () {\n var isElementOnScreen = function($el, scrollTop) {\n // Get very bottom of element\n elementBottom = $el.offset().top + $el.outerHeight();\n // Get...
javascript
chosen
[ { "from": "system", "value": "Add tests folder to lint task\n" }, { "from": "human", "value": "'use strict';\nvar path = require('path');\nvar argv = require('yargs').default('browser', true).argv;\nvar pkg = require('../package.json');\n\nvar dest = 'build';\nvar src = 'src';\n\nvar ENVIRONMENT...
javascript
chosen
[ { "from": "system", "value": "Fix the findService function, add debug logs\n" }, { "from": "human", "value": "import Bacon from 'baconjs'\nimport R from 'ramda'\nimport clone from 'clone'\nimport slug from 'slug'\nimport serviceTemplate from '../../service.json'\n\nexport default function create...
javascript
chosen
[ { "from": "system", "value": "Update bootcode threshold to 2.5 MB\n" }, { "from": "human", "value": "const fs = require('fs'),\n path = require('path'),\n expect = require('chai').expect,\n\n CACHE_DIR = path.join(__dirname, '/../../.cache'),\n THRESHOLD = 3.7 * 1024 * 1024; // 3.7 M...
javascript
chosen
[ { "from": "system", "value": "Add AddModal in filter form\n" }, { "from": "human", "value": "import React from 'react';\nimport * as GifActions from '../../actions/GifActions';\n\n\nclass GifFilter extends React.Component {\n constructor(props) {\n super(props);\n\n this.handleF...
javascript
chosen
[ { "from": "system", "value": "Make spacing consistent with vertical spacing between panels\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactList from 'react-list';\nimport {\n Col,\n ListGroup,\n Panel,\n} from 'react-bootstrap';\n\nexport function renderResults(titl...
javascript
chosen
[ { "from": "system", "value": "Write out the content of each file in a closure with module and exports defined\n" }, { "from": "human", "value": "var http = require('http'),\n\tfs = require('fs'),\n\tutil = require('./util')\n\n// require.paths.unshift('.')\n\nvar modules = {},\n\tport = 1234,\n\...
javascript
chosen
[ { "from": "system", "value": "Test modified to be correct Javascript." }, { "from": "human", "value": "var Foo = {\n value : function() { return this.x + this.y; }\n};\n\nvar a = { prototype: Foo, x: 1, y: 2 };\nvar b = new Foo(); \nb.x = 2;\nb.y = 3;\n\nvar result1 = a.value();\nvar result2 = b...
javascript
chosen
[ { "from": "system", "value": "Set base URL for dummy app production\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 ...
javascript
chosen
[ { "from": "system", "value": "Call module.runSetters() after any meteor/tools modules load.\n" }, { "from": "human", "value": "// Install ES2015-complaint polyfills for Object, Array, String, Function,\n// Symbol, Map, Set, and Promise, patching the native implementations when\n// they are avail...
javascript
chosen
[ { "from": "system", "value": "Handle cases where no book can be found" }, { "from": "human", "value": "var BookLookup = { }\n\nBookLookup.find_by_isbn = function(isbn, callback) {\n $.getJSON('/books/isbn/'+ encodeURI(isbn), callback);\n}\n\nBookLookup.find_and_render = function(isbn) {\n if (...
javascript
chosen
[ { "from": "system", "value": "Use courses query to load a users courses\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport DS from 'ember-data';\n\nexport default Ember.Component.extend({\n currentUser: Ember.inject.service(),\n tagName: 'div',\n classNames: ['dashboard-blo...
javascript
chosen
[ { "from": "system", "value": "Fix form validator (lot cleaner)\n" }, { "from": "human", "value": "////////////////////////////\n// Form Validator factory //\n////////////////////////////\n\n'use strict';\n\npay.factory('FormValidator', [function () {\n return function (form, imageSelector, im...
javascript
chosen
[ { "from": "system", "value": "Invaders: Fix addX to addY since it deals with the vertical coordinate\n" }, { "from": "human", "value": "this.speed = 30;\nthis.life = 3000;\n\nthis.update = function(time)\n{\n if(this.Scene.paused)\n return;\n \n var addX = this.speed*(time/1000)\...
javascript
chosen
[ { "from": "system", "value": "Fix id source and ajax url\n" }, { "from": "human", "value": "!function($) {\n\n 'use strict';\n\n /**\n * Soooooooo dirty ;_;\n * add the \"detach from post\" link\n */\n $(document).on('click', '.attachments-browser .attachment', function() {\n var htm...
javascript
chosen
[ { "from": "system", "value": "Load first project if only one project\n" }, { "from": "human", "value": "App.Router.map(function () {\n this.resource('projects', {path: '/'}, function(){\n this.resource('project', {path: '/project/:project_id'}, function(){\n this.resource('investigation...
javascript
chosen
[ { "from": "system", "value": "Add a space into the material filter search string\n\nWithout this space the end of the session title is forced onto the start\nof the instructor names. This leads to a search for 'dean' returning\nresults of suicideAngela which is incorrect.\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Check CLI parameters and print debug info\n" }, { "from": "human", "value": "var type = process.argv[2]\nvar port = parseInt(process.argv[3], 10)\n\nvar seneca = require('seneca')()\nseneca\n .use(function () {\n this.add({ a: 1 }, function (args, done) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add default 'size' and 'start' parameters\n" }, { "from": "human", "value": "(function(){\n 'use strict';\n\n angular.module('events')\n .service('eventService', ['$q', '$http', '$filter', 'ApiUrl', EventService]);\n\n /**\n * Events DataService\n * E...
javascript
chosen
[ { "from": "system", "value": "Make the user in the profile update a copy\n" }, { "from": "human", "value": "{\n angular\n .module('meganote.users')\n .directive('userProfile', [\n\n 'CurrentUser',\n 'UsersService',\n\n (CurrentUser, UsersService) => {\n\n class UserP...
javascript
chosen
[ { "from": "system", "value": "Use a lodash filter instead\n\n- Map doesn't work the way I expected.\n" }, { "from": "human", "value": "/* global define */\n(function() {\n 'use strict';\n define(['lodash', 'moment'], function(_, moment) {\n\n var ToolController = function($q, $timeo...
javascript
chosen
[ { "from": "system", "value": "Rename numberRequired to minLength on ArrayInputView template\n\nRename numberRequired to minLength so it works with ampersand-array-input-view >= 2.0.0\r\n\r\nhttps://github.com/AmpersandJS/ampersand-array-input-view/commit/8806fb08a206380f2097274a4ee4d978da029b4c#diff-8d634bc...
javascript
chosen
[ { "from": "system", "value": "fix(fun): Fix kaamelott command, add character option\n" }, { "from": "human", "value": "const utils = require('./../../services/utils');\nconst { Command } = require('./../../services/commands');\nconst request = require('request');\n\n// @see http://kaamelott.unde...
javascript
chosen
[ { "from": "system", "value": "Modify enrollment API response to include seat key\n" }, { "from": "human", "value": "import Bot from '../utils/bot.js';\nimport queue from '../utils/asyncQueue.js';\n\n// get seat info for a given class from cuny servers\nexport default function enrollmentRequest(r...
javascript
chosen
[ { "from": "system", "value": "Remove unused saver window event checking\n" }, { "from": "human", "value": "var firstMouseMove = false;\n\n/**\n * send a message that the user has done something and we should close\n the screensaver\n */\nvar exitScreenSaver = function(e) {\n var ipcRenderer;\...
javascript
chosen
[ { "from": "human", "value": "Add document data file for document tests\n" }, { "from": "gpt", "value": "module.exports = {\n document1: {\n title: 'document 1',\n content: 'document 1 contents',\n access: 'public'\n },\n document2: {\n title: 'document 2',\n content: 'document ...
javascript
chosen
[ { "from": "system", "value": "Replace '.' with '-' in Appveyor links\n\nThey apparently replace both '.' and '_' in URLs. Fixes #1220.\n" }, { "from": "human", "value": "import Component from '@ember/component';\nimport { computed } from '@ember/object';\nimport { alias } from '@ember/object/com...
javascript
chosen
[ { "from": "system", "value": "Fix argument handling in gh-path helper.\n\nNo Issue\n- Make helper behave as stated in description when variable\n number of arguments are passed in.\n- Handle leading and trailing slashes when creating output\n url partial.\n" }, { "from": "human", "value": "// ...
javascript
chosen
[ { "from": "system", "value": "Add photos and icon to Projects Schema\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar mongoose = require('mongoose'),\n\tSchema = mongoose.Schema;\n\n/**\n * Project Schema\n */\nvar ProjectSchema = new Schema({\n\tname: {...
javascript
chosen
[ { "from": "system", "value": "Fix bug in Condorcet counting that threw off pair counts.\n\nPrevious version failed to properly account for ballots that did not\ninclude _all_ candidates. This throws the count off substantially for\nelections where many voters do not return total orders.\n" }, { "fro...
javascript
chosen
[ { "from": "system", "value": "Change default exercise to be shown on github\n" }, { "from": "human", "value": "export default [{\n id: 'orbitrack',\n name: 'Orbitrack',\n results: ['calories'],\n params: ['calories']\n}, {\n id: 'pushups',\n name: 'Push ups',\n results: ['number'],\n par...
javascript
chosen
[ { "from": "system", "value": "Add debug.log ignores for 5.2.\n" }, { "from": "human", "value": "/**\n * @since 1.81.0\n *\n * @type {Object} WordPress debug log entries to ignore, keyed by WordPress version.\n */\nexport const logIgnoreList = {};\n" }, { "from": "gpt", "value": "/**\...
javascript
chosen
[ { "from": "system", "value": "Add a differntiating class to publication status [published, scheduled, notpublished]\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n tagName: 'span',\n classNames: ['status'],\n item: null,\n isPublishe...
javascript
chosen
[ { "from": "system", "value": "Fix create topics v0 response protocol test\n" }, { "from": "human", "value": "const { decode, parse } = require('./response')\n\ndescribe('Protocol > Requests > CreateTopics > v0', () => {\n test('response', async () => {\n const data = await decode(Buffer.from...
javascript
chosen
[ { "from": "system", "value": "Add anon param to script tag\n" }, { "from": "human", "value": "if (document.location.hostname == \"localhost\") {\n var baseurl = \"\";\n} else {\n var baseurl = \"https://noconfidencevote.openup.org.za\";\n}\n\nvar agent = navigator.userAgent.toLowerCase();\...
javascript
chosen
[ { "from": "system", "value": "Fix some things, break others\n" }, { "from": "human", "value": "(function(ext) {\n // Cleanup function when the extension is unloaded\n ext._shutdown = function() {};\n\n // Status reporting code\n // Use this to report missing hardware, plugin or unsup...
javascript
chosen
[ { "from": "system", "value": "Switch the special folder view to Marionette.ItemView\n" }, { "from": "human", "value": "var SpecialFolderView = Backbone.View.extend({\n\ttagName: \"li\",\n\ttemplate: _.template($('#tmpl-special-folder').html(), null, {variable:'folder'}),\n\tevents: {\n\t\t'click...
javascript
chosen
[ { "from": "system", "value": "GUACAMOLE-197: Remove remaining JavaScript debug code.\n" }, { "from": "human", "value": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional...
javascript
chosen
[ { "from": "system", "value": "Test: Change allowed globals when linting\n\nMove away from specify() and setImmediate().\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n\n jshint: {\n ...
javascript
chosen
[ { "from": "system", "value": "web: Fix minification of javascript source file\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n var dejsx = require('grunt-react').browserify;\n\n grunt.loadNpmTasks('grunt-sass');\n grunt.loadNpmTasks('grunt-contrib-watch');\n grunt.lo...
javascript
chosen
[ { "from": "system", "value": "Break the build upon Sass compilation errors if running in a CI environment.\n" }, { "from": "human", "value": "var gulp = require(\"gulp\");\nvar CFG = require(\"./utils/config.js\");\nvar $ = require(\"gulp-load-plugins\")();\nvar path = require(\"path\");\nvar pk...
javascript
chosen
[ { "from": "system", "value": "Support setting custom error page for lazy view loader\n" }, { "from": "human", "value": "import { Component } from 'react';\n\n// TODO use custom loading view & load failed view.\nclass ViewLoader extends Component {\n constructor() {\n super();\n this.state...
javascript
chosen
[ { "from": "system", "value": "Fix fitfunc takes genes rather than a chromosome\n" }, { "from": "human", "value": "/* global, GF */\n\n/** \n * Conceptual sample of how to use Genev\n */\n\n// Sample GENE_STRUCTURE\nvar chromosome = { // all of these will hold double values from 0 to 1\n\tweight1...
javascript
chosen
[ { "from": "system", "value": "chromium: Move the login detection setup in a function\n" }, { "from": "human", "value": "console.log(\"goa: GOA content script for GMail loading\");\n\nfunction detectLoginInfo() {\n console.log(\"goa: Scraping for login info\");\n var selector = '//*[@role=\"nav...
javascript
chosen
[ { "from": "system", "value": "Enforce parens around all ES6 arrow functions" }, { "from": "human", "value": "module.exports = {\n \"extends\": \"chiton/configurations/default\",\n \"env\": {\n \"es6\": true\n },\n \"ecmaFeatures\": {\n \"modules\": true\n },\n \"rules\": {\n \"arr...
javascript
chosen
[ { "from": "system", "value": "Add throw error message button\n" }, { "from": "human", "value": "import React from 'react';\nimport Link from 'gatsby-link';\nimport PropTypes from 'prop-types';\n\nimport ExternalLink from '../../components/ExternalLink';\nimport { demoList } from '../../../data/c...
javascript
chosen
[ { "from": "system", "value": "Make it slightly more possible to see the yeti.\n" }, { "from": "human", "value": "var yetiEnding = function(skier, yeti, skierImg) {\n if (skier.distance > 10000 && Math.random() > 0.9995) {\n yeti.aggressive = true;\n }\n\n if (yeti.aggressive) {\n yeti.a...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary line in code\n" }, { "from": "human", "value": "import Application from '../app';\nimport config from '../config/environment';\nimport { setApplication } from '@ember/test-helpers';\nimport { start } from 'ember-qunit';\nimport { registerDeprecati...
javascript
chosen
[ { "from": "system", "value": "Fix the invalid route group\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n beforeModel() {\n if ( ! this.get('session.isAuthenticated')) {\n return this.transitionTo('public.login');\n ...
javascript
chosen
[ { "from": "system", "value": "Create default email along default username&password\n" }, { "from": "human", "value": "if (Meteor.users.find().count() === 0) {\n Accounts.createUser({\n username: 'admin',\n password: 'admin'\n });\n}\n" }, { "from": "gpt", "value": "if (Meteor...
javascript
chosen
[ { "from": "system", "value": "Improve header collapse by using outerHeight\n" }, { "from": "human", "value": "if (typeof jQuery === 'undefined') {\n throw new Error('Custom JS requires jQuery...');\n}\n\n+function ($) {\n 'use strict';\n $(document).ready(function () {\n var outer = $('#af...
javascript
chosen
[ { "from": "system", "value": "Remove the alert message on addition of string\n" }, { "from": "human", "value": "var Trie = require('trie');\n\ntrie = new Trie();\n\ntrie.add('bat');\ntrie.add('bad');\n\nvar searchInput = document.getElementById('search-input');\nvar searchResults = document.getE...
javascript
chosen
[ { "from": "system", "value": "Fix connection string for production.\n" }, { "from": "human", "value": "let path = require('path');\nlet rootPath = path.normalize(__dirname + '/../../');\n\nmodule.exports = {\n development: {\n rootPath: rootPath,\n db: 'mongodb://localhost:27017...
javascript
chosen
[ { "from": "system", "value": "Change browserHistory to hashHistory for gh-pages\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport { Provider } from 'react-redux'\nimport { Router, browserHistory } from 'react-router'\n\nconst Root = ({ store, routes }) => (\n <...
javascript
chosen
[ { "from": "system", "value": "Add 'background-size' to wrapper styles\n" }, { "from": "human", "value": "module.exports = {\n stylePrefix: 'comp-',\n\n wrapperId: 'wrapper',\n\n wrapperName: 'Body',\n\n // Default wrapper configuration\n wrapper: {\n style: {margin: 0},\n removable: f...
javascript
chosen
[ { "from": "system", "value": "Remove setting version on the azureMobile context object as redundant\n" }, { "from": "human", "value": "// ----------------------------------------------------------------------------\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// ---------------...
javascript
chosen
[ { "from": "system", "value": "Add extra space before and after dash matchers\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar stdin = process.openStdin();\n\nvar async = require('async');\nvar cheerio = require('cheerio');\nvar request = require('request');\n\n\nmai...
javascript
chosen
[ { "from": "system", "value": "Fix prettier config to remove unecessary diff\n" }, { "from": "human", "value": "const { readBsConfig, readBsConfigSync } = require('../')\n\ntest('Read bsconfig from process.cwd()', () => {\n expect(readBsConfig()).rejects.toBeDefined()\n})\n\ntest('Read bsconfig ...
javascript
chosen
[ { "from": "system", "value": "Use index template for the front page.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport config from './config/environment';\n\nvar Router = Ember.Router.extend({\n location: config.locationType\n});\n\nexport default Router.map(function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Include the weekly report description.\n\n" }, { "from": "human", "value": "function latest_report_look_up() {\n\n // TEMPORARY HACK\n //mediacloud.org is password protected so we can't pull from it directly\n // instead we pull from 'https://blogs.law.harv...
javascript
chosen
[ { "from": "system", "value": "Use describe instead of describe.only\n" }, { "from": "human", "value": "goog.provide('ol.test.coordinate');\n\ndescribe.only('ol.coordinate', function() {\n\n describe('#closestOnSegment', function() {\n it('can handle points where the foot of the perpendicular...
javascript
chosen
[ { "from": "system", "value": "Drop uncritical dependencies to enable alt runtimes\n\nNode is still supported, and IoT.js can be ported.\n\nRelated links:\n\nhttps://engineering.upside.com/you-dont-need-lodash-3323ca2cfb4c\n\nhttps://github.com/rzr/webthing-iotjs\n\nChange-Id: I58c8c5b728ea6cd457e6618c952c0b...
javascript
chosen
[ { "from": "system", "value": "Make isValid documentation more detailed\n" }, { "from": "human", "value": "/**\n * Is the given date valid?\n * @param {Date|String|Number} date to check\n * @returns {Boolean} date is valid\n */\nvar isValid = function(date) {\n if (date instanceof Date) {\n r...
javascript
chosen
[ { "from": "system", "value": "Throw when no user agent supplied during server-side rendering\n" }, { "from": "human", "value": "/**\n * Based on https://github.com/jsstyles/css-vendor, but without having to\n * convert between different cases all the time.\n *\n * @flow\n */\n\nimport InlineStyl...
javascript
chosen
[ { "from": "system", "value": "Handle edge cases for auto resize module directive\n" }, { "from": "human", "value": "angular.module('DashboardGraphs')\n .directive('autoSizeModule', ['$window', function($window) {\n\n // Adjusts the size of the module so that all modules\n // fit into a si...
javascript
chosen
[ { "from": "system", "value": "Move methods to module scope\n\n" }, { "from": "human", "value": "import {\n PositionalAudio,\n AudioListener,\n AudioLoader\n} from 'three';\n\nexport default class PositionalAudioModule {\n constructor(params = {}) {\n this.params = Object.assign({\n l...
javascript
chosen
[ { "from": "system", "value": "Correct streaming endpoint for list users\n" }, { "from": "human", "value": "YUI.add(\"stream-users\", function(Y) {\n \"use strict\";\n \n var tristis = Y.namespace(\"Tristis\"),\n streams = Y.namespace(\"Tristis.Streams\"),\n Users;\n \n ...
javascript
chosen
[ { "from": "system", "value": "Use an object to avoid global state.\n" }, { "from": "human", "value": "var session = require(\"zed/session\");\nvar config = require(\"zed/config\");\nvar stuff = {};\n\nmodule.exports = function (options, callback) {\n stuff.path = options.path;\n stuff.fina...
javascript
chosen
[ { "from": "system", "value": "Update menu accelerators for cross platform compatibility.\nSimple update to be able to use the development menu accelerators on Windows and Linux and to remove the accelerator warnings on these platforms:\n[584:0617/135533:WARNING:accelerator_util.cc(185)] Invalid accelerator ...
javascript
chosen
[ { "from": "system", "value": "Fix weird docsite chapter ordering\n" }, { "from": "human", "value": "import React from 'react'\nimport Link from 'gatsby-link'\nimport { getModuleName } from '../components/Headers'\nimport { startCase, kebabCase, flatMap, last } from 'lodash'\nimport { Paper, Menu...
javascript
chosen