conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "refactor: Use stellorc lib for storing prefs\n" }, { "from": "human", "value": "\n'use strict';\n\nvar fs = require('fs')\n , _find = require('lodash.find')\n , prompt = require('inquirer').prompt\n , defaults = require('../conf/cli-defaults')();\n\n/**\n * Initi...
javascript
chosen
[ { "from": "system", "value": "Add test specs for async bootstrap\n" }, { "from": "human", "value": "\nvar testPages = [\n 'specs/util'\n\n , 'specs/config'\n , 'specs/module'\n , 'specs/package'\n , 'specs/extensible'\n , 'specs/extensible/plugin-debug'\n\n , 'specs/misc/data-api'\n , 's...
javascript
chosen
[ { "from": "system", "value": "Join can have the channel name as a param or the trailing.\n" }, { "from": "human", "value": "\nmodule.exports = function () {\n\treturn function (irc) {\n\t\tirc.join = function (channels, fn) {\n\t\t\tif (!Array.isArray(channels)) {\n\t\t\t\tchannels = [channels];...
javascript
chosen
[ { "from": "system", "value": "Fix case of file description displayed in task bar\n" }, { "from": "human", "value": "const packager = require('electron-packager')\nconst path = require('path')\n\nconst options = {\n dir: '.',\n name: 'todu',\n out: 'dist/',\n overwrite: true,\n icon: path.re...
javascript
chosen
[ { "from": "system", "value": "Replace SignUpForm component with SignUpPage container\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Router, Route, Switch } from 'react-router-dom';\nimport { hot } from 'react-hot-loader';\n\nimport SignUpForm from './SignU...
javascript
chosen
[ { "from": "system", "value": "Add MixPanel page view tracking for the student profile page\n" }, { "from": "human", "value": "$(function() {\n // only run if the correct page\n if (!($('body').hasClass('students') && $('body').hasClass('show'))) return;\n\n // imports\n var createEl = window...
javascript
chosen
[ { "from": "system", "value": "Use object spread instead of duplicating\n" }, { "from": "human", "value": "export const initialState = {\n loading: false,\n loaded: false,\n error: false,\n data: {}\n};\n\nconst setLoading = (state, loading) => ({ ...state, loading });\nconst setError = (stat...
javascript
chosen
[ { "from": "system", "value": "Make window be shown after ready-to-show\n" }, { "from": "human", "value": "// @flow\nimport { BrowserWindow } from 'electron'\n\nimport type { BrowserWindowOptions, BrowserWindowEvents, WebContentsEvents } from 'electron'\n\nexport default class Window {\n constru...
javascript
chosen
[ { "from": "system", "value": "Fix typos in record_format hash\n" }, { "from": "human", "value": "// Main Module for searchthedocs demo\ndefine(function (require) {\n var _ = require('underscore'),\n $ = require('jquery'),\n SearchTheDocsView = require('searchthedocs/src/searchthedocs');\n...
javascript
chosen
[ { "from": "system", "value": ":new: Print through the new console UI\n" }, { "from": "human", "value": "'use strict'\n\nimport FS from 'fs'\nimport promisify from 'sb-promisify'\nimport open from 'open'\nimport chalk from 'chalk'\nimport { exec } from 'sb-exec'\nimport { CLI } from './cli'\nimpo...
javascript
chosen
[ { "from": "system", "value": "Revert \"fix bootstrap glyphicon path\"\n\nThis reverts commit c064944321b712331d909eb2894617d4864cf0e8.\n" }, { "from": "human", "value": "/* jshint node: true */\nvar EmberApp = require('ember-cli/lib/broccoli/ember-app');\nvar mergeTrees = require('broccoli-merge...
javascript
chosen
[ { "from": "system", "value": "Remove redundant VERSION from test sandbox.\n\nThis is no longer needed due to\n22b744b7e60122bee5abb82642ecb4feefa873d0.\n" }, { "from": "human", "value": "process.env.TZ = \"America/Los_Angeles\";\n\nvar smash = require(\"smash\"),\n jsdom = require(\"jsdom\"),...
javascript
chosen
[ { "from": "system", "value": "Test .set(key, value) returns a Promise\n" }, { "from": "human", "value": "import test from 'ava';\nimport Keyv from '../';\n\ntest('Keyv is a function', t => {\n\tt.is(typeof Keyv, 'function');\n});\n\ntest('Keyv cannot be invoked without \\'new\\'', t => {\n\tt.th...
javascript
chosen
[ { "from": "system", "value": "Fix tests for block style buttons\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\n\nmoduleForComponent('validated-button', 'Integration | Component | validated button', {\n i...
javascript
chosen
[ { "from": "system", "value": "Fix e2e tests after default region change\n\nThe tests expected the region selection popup to appear, but right now\nwe default to the Tallinn region instead, in which case, to select the\nTartu region, the test must select that region from the dropdown.\n" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Add lodash to globals in rollup\n" }, { "from": "human", "value": "export default {\n entry: 'lib/src/index.js',\n dest: 'lib/apollo.umd.js',\n format: 'umd',\n sourceMap: true,\n moduleName: 'apollo',\n globals: {\n 'lodash': '_'\n }\n};\n" }, { "...
javascript
chosen
[ { "from": "system", "value": "Use window.jQuery instead of window.$ in browser\n\nFixed #876\n" }, { "from": "human", "value": "const babel = require('rollup-plugin-babel');\nconst commonjs = require('rollup-plugin-commonjs');\nconst nodeResolve = require('rollup-plugin-node-resolve');\n\nmodule...
javascript
chosen
[ { "from": "system", "value": "Add test for Entity extending EventEmitter\n" }, { "from": "human", "value": "/* global SceneScroller, mocha, it, describe, assert, expect, beforeEach */\n\n'use strict';\n\ndescribe('Entity', () => {\n\n // Constructor\n describe('Constructor', () => {\n\n it(...
javascript
chosen
[ { "from": "system", "value": "Set port to env variable or 8080.\n" }, { "from": "human", "value": "var express = require('express');\nvar favicon = require('serve-favicon');\nvar path = require('path');\nvar logger = require('morgan');\nvar cookieParser = require('cookie-parser');\nvar bodyParse...
javascript
chosen
[ { "from": "system", "value": "Check for local vars and use them if they exist\n" }, { "from": "human", "value": "var GitHubApi = require(\"github\");\nvar ENV = require('./environments.js');\n\nvar github = new GitHubApi({\n version: \"3.0.0\",\n debug: true\n});\n\ngithub.authenticate({\n ty...
javascript
chosen
[ { "from": "system", "value": "Stop further execution when error occurs\n" }, { "from": "human", "value": "WebApp.connectHandlers.use(\"/package\", function (request, response) {\n var pkgName = request.url.split('/')[1];\n\n Meteor.call('getPackageParams', pkgName, {graph: true}, function (err...
javascript
chosen
[ { "from": "system", "value": "Test with headless Chrome by default\n" }, { "from": "human", "value": "/*\nCopyright 2017 The BioBricks Foundation\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain...
javascript
chosen
[ { "from": "system", "value": "Add default settings for pagerduty.\n" }, { "from": "human", "value": "exports.settings = {\n twilio: {\n user: '', // Twilio Account key\n key: '', // Twilio auth token\n from: '', // Twilio phone number\n to: [''] // List of phone numbers twilio is ab...
javascript
chosen
[ { "from": "system", "value": "Make webaudiofont quiet in test output\n" }, { "from": "human", "value": "import { configure } from 'enzyme';\nimport Adapter from 'enzyme-adapter-react-16';\nimport 'raf/polyfill';\n\nconfigure({ adapter: new Adapter() });\n\njest.mock('webAudioWrapper');\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Fix Transform tool CMD modifier on OSX\n" }, { "from": "human", "value": "(function () {\n var ns = $.namespace('pskl.tools.transform');\n\n ns.AbstractTransformTool = function () {};\n\n pskl.utils.inherit(ns.AbstractTransformTool, pskl.tools.Tool);\n\n ns.Abst...
javascript
chosen
[ { "from": "system", "value": "Reset email form value on success\n\ncloses #3663\n- Set value of email input as nil string\n" }, { "from": "human", "value": "/* jshint unused: false */\r\nimport ajax from 'ghost/utils/ajax';\r\nimport ValidationEngine from 'ghost/mixins/validation-engine';\r\n\r\...
javascript
chosen
[ { "from": "system", "value": "Add window.onload; correctly detect description\n" }, { "from": "human", "value": "/*jslint indent: 2 */\n/*global $: false, document: false, togglbutton: false*/\n'use strict';\n\nvar list = $(\"#gqItemList\").children;\nconsole.log(list.length);\nvar ids = []\nfor...
javascript
chosen
[ { "from": "system", "value": "Add a fallback to params if no query\n" }, { "from": "human", "value": "var fs = require('fs'),\n path = require('path'),\n settings = require('../settings'),\n mongoose = require('mongoose');\n\nexports.index = function(req, res){\n var id = req.query.i...
javascript
chosen
[ { "from": "system", "value": "Select previous item with k key\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Rightmove Enhancement Suite\n// @namespace https://github.com/chigley/\n// @description Keyboard shortcuts\n// @include http://www.rightmove.co.uk/*\n// @vers...
javascript
chosen
[ { "from": "system", "value": "Add tests for it extender\n" }, { "from": "human", "value": "var random = require('./randoms');\n\ndescribe('dot_compiler', function() {\n\n var fixt = {\n word: random.word(),\n qwer: '{\"a\":1}',\n dotted: '{{= \"asdf\" }}',\n dotted_w_params: '{{= it...
javascript
chosen
[ { "from": "system", "value": "Expand the article content in full view mode\n" }, { "from": "human", "value": "/*jslint browser:true */\n\nfunction decorate() {\n\t\"use strict\";\n\tvar ad, nav, content, header, body,\n\t\tnavWidth, contentWidth,\n\t\tcssNode,\n\t\tMutationObserver, observer;\n\...
javascript
chosen
[ { "from": "system", "value": "Document deletion UI behavior fixed\n\nThe deleted document now disappears in the UI\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('pie')\n.controller('ProfileController', function ($scope, $location, $resource, authService, $http, apiBaseUrl) {...
javascript
chosen
[ { "from": "system", "value": "Stop Requiring Dev Packages in Production\n\nMoved dev required packages to dev if block to prevent errors when\ndeploying to production.\n\nCloses #9\n" }, { "from": "human", "value": "const path = require('path')\nconst express = require('express')\nconst webpack ...
javascript
chosen
[ { "from": "system", "value": "Use 0px string instead of number 0 for CSS\n" }, { "from": "human", "value": "define(\n 'ephox.dragster.detect.Blocker',\n\n [\n 'ephox.dragster.style.Styles',\n 'ephox.highway.Merger',\n 'ephox.sugar.api.Class',\n 'ephox.sugar.api.Css',\n 'ephox.su...
javascript
chosen
[ { "from": "system", "value": "Check search text before submitting post search event.\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n Well, InputGroup, FormControl, Button, Glyphicon\n} from 'react-bootstrap';\n\n\nclass SearchPostsW...
javascript
chosen
[ { "from": "system", "value": "Add 'og' before last element in location list.\n" }, { "from": "human", "value": "class Job extends React.Component {\n constructor() {\n super();\n }\n\n render() {\n let data = this.props.jobData;\n\n return (\n <article className=\"row\">\n ...
javascript
chosen
[ { "from": "system", "value": "Fix header style for empty cover images\n" }, { "from": "human", "value": "HB.AnimeController = Ember.ObjectController.extend(HB.HasCurrentUser, {\n coverImageStyle: function() {\n return \"background-image: url('\" + this.get('model.coverImage') + \"'); backgro...
javascript
chosen
[ { "from": "system", "value": "Make autoupdate depend on reload, which makes sense\n\nSince it actually calls reload\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Update the client when new client code is available\",\n version: '1.2.2-plugins.0'\n});\n\nCordova.depends({\n...
javascript
chosen
[ { "from": "system", "value": "Add some javascript for perseus-editors\n" }, { "from": "human", "value": "define(function(require) {\n\n// For legacy reasons, Perseus assumes that some modules (such as knumber) are\n// executed immediately when the exercise content bundle is loaded, so we load\n/...
javascript
chosen
[ { "from": "system", "value": "Include Webpack path info in unminified build\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar rename = require('gulp-rename');\nvar webpack = require('webpack');\nvar webpackStream = require('webpack-stream');\nvar uglify = require('gulp-uglify')...
javascript
chosen
[ { "from": "system", "value": "Use gulp for Jekyll build and for BrowserSync\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar browserSync = require('browser-sync').create();\n\n// BrowserSync static server\ngulp.task('browsersync', function() {\n browserSync.init({\n ...
javascript
chosen
[ { "from": "system", "value": "Include all (!!) the API Type constructors..\nAdd some API methods\n" }, { "from": "human", "value": "// telegram.link\n// Copyright 2014 Enrico Stara 'enrico.stara@gmail.com'\n// Released under the MIT License\n// http://telegram.link\n\n// Import ...
javascript
chosen
[ { "from": "system", "value": "Disable Harmony Symbols & Proxies, they're completely broken\n" }, { "from": "human", "value": "'use strict';\n\nvar findup = require('findup-sync');\nvar spawnSync = require('child_process').spawnSync;\nvar gruntPath = findup('node_modules/{.,}bin/grunt', {cwd: __d...
javascript
chosen
[ { "from": "system", "value": "Make \"clean\" command work again\n" }, { "from": "human", "value": "const fs = require('fs')\nconst path = require('path')\n\nexports.exists = function (path) {\n try {\n fs.statSync(path)\n return true\n } catch (err) {\n return false\n }\n}\n\nexports...
javascript
chosen
[ { "from": "system", "value": "Test page connecting to DB\n" }, { "from": "human", "value": "var express = require(\"express\");\nvar app = express();\napp.use(express.logger());\n\napp.get('/', function(request, response) {\n response.send('Hello World!');\n});\n\nvar port = process.env.PORT ||...
javascript
chosen
[ { "from": "system", "value": "Set docgen to the end\n" }, { "from": "human", "value": "import packageJson from '../../package.json';\n\nexport default {\n packageJson,\n defaultConfigName: 'create-react-app',\n frameworkPresets: [\n require.resolve('./framework-preset-react.js'),\n requ...
javascript
chosen
[ { "from": "system", "value": "Add signin route on server\n" }, { "from": "human", "value": "var userController = require('../users/userController.js');\nvar helpers = require('./helpers.js'); // our custom middleware\n\nmodule.exports = function (app, express) {\n app.get('/api/users/profile', ...
javascript
chosen
[ { "from": "system", "value": "Add readTemplateSync() to open a mustache template\n\nWe'll be opening a template for the summary email stuff too, so we'll\nwant to reuse this use of fs.readFileSync().\n" }, { "from": "human", "value": "var _ = require('underscore'),\n fs = require('fs'),\n path...
javascript
chosen
[ { "from": "system", "value": "Improve behaviour of sortable lists\n\nUse the position of the pointer instead of the position of the dragged\nitem to determine where the item will be dropped. Depending on where\nan item is grabbed, it was previously impossible (or very hard) to drop\nit at the start/end of a...
javascript
chosen
[ { "from": "system", "value": "Add popup to markers with filename and timestamp\n" }, { "from": "human", "value": "// Map centered in NowSecure HQ by default\nvar map = L.map('map').setView([40.2001925,-89.0876265], 3);\n\nL.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {\n attribution:...
javascript
chosen
[ { "from": "system", "value": "Add test for moveGameObjects method\n" }, { "from": "human", "value": "let Game = require('./game');\n\ndescribe('Game', function () {\n let game;\n\n beforeEach(function () {\n game = new Game();\n });\n\n it('should instantiate', function () {\n...
javascript
chosen
[ { "from": "system", "value": "Fix finding page by route\n" }, { "from": "human", "value": "/*\n * Copyright 2017 Alexander Pustovalov\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain ...
javascript
chosen
[ { "from": "system", "value": "Disable more interaction with the map\n" }, { "from": "human", "value": "import api from '../api';\nimport style from './style';\n\nexport default () => {\n let map = new google.maps.Map(document.getElementsByClassName('map')[0], {\n center: {lat: -34.397,...
javascript
chosen
[ { "from": "system", "value": "Format whitespace to tab indentation.\n" }, { "from": "human", "value": "var express = require('express'),\n router = express.Router();\n\nmodule.exports = function (app) {\n app.use('/', router);\n};\n\nrouter.get('/', function (req, res) {\n res.render('.....
javascript
chosen
[ { "from": "system", "value": "Fix incorrect use of filter()\n" }, { "from": "human", "value": "import { getHostAddress, isSameHostAddress } from './helpers';\n\nexport function getCurrentHost (hosts) {\n const currentHostAddress = getHostAddress();\n const hostId = hosts.filter(hostId => curre...
javascript
chosen
[ { "from": "system", "value": "Update dependencies for Meteor 1.6.1\n" }, { "from": "human", "value": "//jshint esversion: 6\nPackage.describe({\n name: 'elmarti:video-chat',\n version: '2.1.1',\n summary: 'Simple WebRTC Video Chat for your app.',\n git: 'https://github.com/elmarti/me...
javascript
chosen
[ { "from": "system", "value": "Implement user/role functionality and edit\n\nAdding maleOrFemale and birth in userSchema." }, { "from": "human", "value": "const mongoose = require('mongoose');\r\n\r\nconst encryption = require('./../utilities/encryption');\r\n\r\nlet userSchema = mongoose.Schema(...
javascript
chosen
[ { "from": "system", "value": "Update for plug-in : photo.net\n" }, { "from": "human", "value": "var hoverZoomPlugins = hoverZoomPlugins || [];\nhoverZoomPlugins.push({\n name:'photo.net',\n version:'0.1',\n prepareImgLinks:function (callback) {\n var res = []; \n \n h...
javascript
chosen
[ { "from": "system", "value": "Remove giphy since it doesn't work\n" }, { "from": "human", "value": "'use strict';\n\nvar mongoose = require('mongoose');\nvar slack = require('./slack.js');\n\nvar Rejection = mongoose.model('Rejection');\n\nexports.help = help;\nexports.reject = reject;\n\nfuncti...
javascript
chosen
[ { "from": "system", "value": "Fix eslint strict mode option\n" }, { "from": "human", "value": "'use strict'\n\nconst { env, platform } = process\n\nmodule.exports = {\n extends: [\n 'eslint:recommended',\n 'eslint-config-airbnb-base',\n 'plugin:prettier/recommended',\n ],\n\n env: {\...
javascript
chosen
[ { "from": "system", "value": ":sparkles: Allow nested input in labels without htmlFor\n" }, { "from": "human", "value": "module.exports = {\n extends: ['fyndiq', 'plugin:jest/recommended'],\n plugins: ['jest'],\n rules: {\n // This rules causes issues because of nested packages.json, disab...
javascript
chosen
[ { "from": "system", "value": "Deal with HAL response in client\n" }, { "from": "human", "value": "\"use strict\";\n\nimport endpoint from \"./endpoint\";\nimport Project from \"./project\";\nimport * as requests from \"./requests\";\n\n/**\n * Abstract representation of projects.\n */\nexport de...
javascript
chosen
[ { "from": "system", "value": "Switch libraryTarget from var to umd\n" }, { "from": "human", "value": "module.exports = {\n context: __dirname,\n entry: './src/index.jsx',\n output: {\n path: './build',\n filename: 'index.js',\n library: 'CalendarHeatmap',\n libraryTarget: 'var'\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug that was causing dataId error\n" }, { "from": "human", "value": "import React from 'react';\nimport addons from '@kadira/storybook-addons';\nimport {setAddon} from '@kadira/storybook';\n\nimport MarkdownPanel from './MarkdownPanel';\n\nconst ADDON_ID = 'stor...
javascript
chosen
[ { "from": "system", "value": "Configure webpack to lint automatically\n" }, { "from": "human", "value": "const path = require('path')\n\n// commonjs module\nmodule.exports = {\n context: __dirname,\n entry: './js/ClientApp.js',\n devtool: 'eval',\n output: {\n path: path.join(__dirname, '...
javascript
chosen
[ { "from": "system", "value": "Add a css loader to import global style from external components\n" }, { "from": "human", "value": "var rucksack = require('rucksack-css')\nvar webpack = require('webpack')\nvar path = require('path')\n\nmodule.exports = {\n context: path.join(__dirname, './client'...
javascript
chosen
[ { "from": "system", "value": "Fix package.json location in getVersion\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar http = require('http'),\n docopt = require('docopt').docopt,\n rosters = {};\n\nvar doc =\n\"Usage:\\n\\\n main.js [--roster ROSTER]\\n\\\n main.js -h | --h...
javascript
chosen
[ { "from": "system", "value": "Set default opacity to 1.0\n" }, { "from": "human", "value": "// Run after the DOM loads\n$(function () {\n 'use strict';\n\n var map = geo.map({\n node: '#map',\n center: {\n x: -122.445,\n y: 37.8\n },\n zoom: 6\n });\n\n $.ajax('https://...
javascript
chosen
[ { "from": "system", "value": "ember/config: Disable finger-printing in production mode\n" }, { "from": "human", "value": "/*jshint node:true*/\n/* global require, module */\nvar EmberApp = require('ember-cli/lib/broccoli/ember-app');\n\nmodule.exports = function(defaults) {\n var app = new Embe...
javascript
chosen
[ { "from": "system", "value": "Revert \"increase retries on sqlite connection\"\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2014-2020 Bjoern Kimminich.\n * SPDX-License-Identifier: MIT\n */\n\n/* jslint node: true */\nconst fs = require('fs')\nconst path = require('path')\nconst seque...
javascript
chosen
[ { "from": "system", "value": "Fix failing CLI unit test\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar helpers = require('yeoman-generator').test;\nvar assert = require('yeoman-generator').assert;\n\ndescribe('simple node package generator', function(){\n b...
javascript
chosen
[ { "from": "system", "value": "Allow dropdown sections to be identified by class and name\n\nThis also allows a single dropdown to change the state of multiple sections\n" }, { "from": "human", "value": "/*\n * Javacript for the Dropdown sections\n */\n\n/* jshint browser: true */\n/* jshint -W09...
javascript
chosen
[ { "from": "system", "value": "Change tabs to 4 spaces\n" }, { "from": "human", "value": "function dechex(number) {\n // http://kevin.vanzonneveld.net\n // + original by: Philippe Baumann\n // + bugfixed by: Onno Marsman\n // + improved by: pilus\n // * example 1: dechex(...
javascript
chosen
[ { "from": "system", "value": "Update the blueprints ember-cli-font-awesome dep version\n\nThat version removes the extra, un-needed *.scss files that were\naccidentally imported into the styles tree. Also, look at moving to\nversion 2.0 when this addon can support ember 2.3+ (issue created).\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Reset form on modal close\n" }, { "from": "human", "value": "$(document).on('hidden.bs.modal', '.modal', function () {\n $('.panel', this).remove();\n});\n" }, { "from": "gpt", "value": "$(document).on('hidden.bs.modal', '.modal', function () {\n $('.p...
javascript
chosen
[ { "from": "system", "value": "Correct bug in var declarations" }, { "from": "human", "value": "(function($) {\n return $.fn.noiseGen = function(options) {\n var defaultOptions = {\n width: 32,\n height: 32,\n opacity: 0.2,\n fallbackImage: false,\n depth: 60\n },\...
javascript
chosen
[ { "from": "system", "value": "Put condition to check undefined inverse functions\n\nFor some reason no-op for options.inverse isn't working." }, { "from": "human", "value": "/* jshint ignore:start */\n\nimport Ember from 'ember';\n\nvar feature_flags = EMBER_CLI_CONDITIONAL_COMPILE_INJECTIONS;\n...
javascript
chosen
[ { "from": "system", "value": "Fix and improve jQuery test helpers\n" }, { "from": "human", "value": "// http://stackoverflow.com/questions/30223265/how-to-use-jquery-with-jsdom5/30223890#30223890\n\nimport {jsdom} from 'jsdom';\nconst document = jsdom('<html></html>', {});\nconst window = docume...
javascript
chosen
[ { "from": "system", "value": "Fix - process effects in onAuth\n" }, { "from": "human", "value": "'use strict';\n\n// module Web.Firebase.Authentication.Eff\n\nexports._onAuth = function (callback, firebase) {\n return function() {\n return firebase.onAuth(callback);\n };\n};\n\nexports._aut...
javascript
chosen
[ { "from": "system", "value": "Add check valid users solution\n" }, { "from": "human", "value": "function checkUsersValid(goodUsers) {\n return function allUsersValid(submittedUsers) {\n // SOLUTION GOES HERE\n };\n}\n" }, { "from": "gpt", "value": "function checkUsersVa...
javascript
chosen
[ { "from": "system", "value": "Test refactored to get better error location." }, { "from": "human", "value": "// test for ternary\n\nresult = (true?3:4)==3 && (false?5:6)==6;\n" }, { "from": "gpt", "value": "// test for ternary\n\nassert ((true?3:4) == 3, \"First check\");\nassert ((f...
javascript
chosen
[ { "from": "system", "value": "Use shorthand to create an object\n" }, { "from": "human", "value": "\"use strict\";\n\nlet name = \"Brook\";\nlet totalReplies = 249;\nlet avatar = \"/user/avatars/brook-user-1.jpg\";\n\nlet user = ;\n\naddUserToSidebar(user);" }, { "from": "gpt", "valu...
javascript
chosen
[ { "from": "system", "value": "Disable test command (no tests)\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n 'use strict';\n\n grunt.config.init({\n pkg: grunt.file.readJSON('package.json')\n });\n\n grunt.loadNpmTasks('grunt-contrib-clean');\n grunt.config('clea...
javascript
chosen
[ { "from": "system", "value": "Add clean and copy tasks for Grunt.\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\n\tgrunt.initConfig({\n\n\t\tpkg: grunt.file.readJSON('package.json')\n\t});\n\n\tgrunt.registerTask('default', []);\n};" }, { "from": "gpt", "va...
javascript
chosen
[ { "from": "system", "value": "Use built in public suffix list in Firefox-based browsers\n" }, { "from": "human", "value": "#ifndef __DOMAIN_MANAGER__\n#define __DOMAIN_MANAGER__\n\n\n#include \"lib/common.js\"\n#include \"data/suffix-list.js\"\n\n\nrndphrase.DomainManager = {\n get_reg_domain...
javascript
chosen
[ { "from": "system", "value": "Set Session variable for image and image._id\n" }, { "from": "human", "value": "Template.createBetForm.helpers({\n photo: function(){\n return Session.get(\"photo\");\n }\n})\n\nTemplate.createBetForm.events({\n \"submit .create-bet\" : function(event){\n e...
javascript
chosen
[ { "from": "system", "value": "Add option to disable host check in DevServer\n" }, { "from": "human", "value": "const url = require('url');\r\nconst webpack = require('webpack');\r\nconst BrowserSyncPlugin = require('browsersync-webpack-plugin');\r\n\r\nmodule.exports = (config) => {\r\n /**\r\n...
javascript
chosen
[ { "from": "system", "value": "Change ATXT to new loader format" }, { "from": "human", "value": "define(['mac/roman'], function(macintoshRoman) {\n\n 'use strict';\n \n return function(resource) {\n \n var text = macintoshRoman(resource.data, 0, resource.data.length);\n debugger;\n \n ...
javascript
chosen
[ { "from": "system", "value": "Remove extra space from parameters\n" }, { "from": "human", "value": "function LevelPalette( numberColor, boardColors ) {\n this.numberColor = numberColor;\n this.boardColors = boardColors;\n}\n" }, { "from": "gpt", "value": "function LevelPalette(...
javascript
chosen
[ { "from": "system", "value": "Fix running locatePluginDir tests on windows\n" }, { "from": "human", "value": "import modules, { locatePluginDir } from '../load-plugins';\nimport { expect } from 'chai';\n\ndescribe('load-plugins', () => {\n it('should load included plugins', () => {\n expect(...
javascript
chosen
[ { "from": "system", "value": "Allow multiple origins to be provided to the cors middleware, array or coma separated\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies\n */\nconst cors = require('@koa/cors');\n\nconst defaults = {\n origin: '*',\n maxAge: 31536000,\...
javascript
chosen
[ { "from": "system", "value": "Fix place deletion view logic\n" }, { "from": "human", "value": "class ManageController {\n constructor($scope, toastr, _, PlaceFactory) {\n 'ngInject';\n\n $scope.headers = [\n 'ID',\n 'Name',\n 'Country',\n 'Image',\n 'Enabled',\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug with profile loading\n" }, { "from": "human", "value": "app.controller('SearchController', ['$http', '$mdDialog', 'BioFactory', function($http, $mdDialog, BioFactory) {\n console.log('SearchController running');\n var self = this;\n\n self.mentors = [];\n...
javascript
chosen
[ { "from": "system", "value": "Change warning message for scoring data" }, { "from": "human", "value": "// Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0.\n\nvar React = require('react');\n\nvar S...
javascript
chosen
[ { "from": "system", "value": "Add random js for 1 2 3\n" }, { "from": "human", "value": "function y(){\nvar a=prompt(\"Jouer\");\nvar b = Math.floor((Math.random() * 3) + 1);\n" }, { "from": "gpt", "value": "function y(){\nvar a=prompt(\"Jouer\");\nvar b = Math.floor((Math.random() ...
javascript
chosen
[ { "from": "system", "value": "Add mmenu action to burger button" }, { "from": "human", "value": "$(document).ready(function() {\n\n BVB.init();\n\n $(document).on(\"click\", \"#menu a\", function() {\n href = $(this).attr(\"href\");\n window.location.hash = href;\n });\n\n $(document)....
javascript
chosen
[ { "from": "system", "value": "Speed up authorization checks for superadmins\n\nResults in an 88.24% shorter mean duration and 93.75% shorter median\nduration of calls to AuthService.check for users that meet the\nconditions.\n\nThis AuthService decorator was working already, but there are other\nusers that ...
javascript
chosen
[ { "from": "system", "value": "Use local variable for clipboard created by ClipboardJS instead of ref\n" }, { "from": "human", "value": "import React from 'react';\nimport ClipboardJS from 'clipboard';\nimport 'balloon-css/balloon.css';\n\nexport default class CopyButton extends React.PureCompone...
javascript
chosen
[ { "from": "system", "value": "Element: Add a new helper ‘hasSamples.’\n" }, { "from": "human", "value": "import TYPES from 'types';\n\nfunction isMember(element) {\n if (element.element) {\n return element.element === TYPES.MEMBER;\n }\n\n return element === TYPES.MEMBER;\n}\n\nfunction ge...
javascript
chosen
[ { "from": "system", "value": "Change router import to module init\n" }, { "from": "human", "value": "import Koa from 'koa'\nimport bodyParser from 'koa-bodyparser'\nimport convert from 'koa-convert'\nimport logger from 'koa-logger'\nimport mongoose from 'mongoose'\nimport session from 'koa-gener...
javascript
chosen