conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Rename renderLI method to renderLink.\n" }, { "from": "human", "value": "function Tag(attributes) {\n this.id = attributes.id\n this.name = attributes.name\n}\n\nTag.renderLI = function (tag) {\n return `<li><a href=\"/tags/${tag.id}\">${tag.name}</a></li>`\n}\n"...
javascript
chosen
[ { "from": "system", "value": "Refactor methods and add event callbacks.\n" }, { "from": "human", "value": "(function(name, definition) {\n if (typeof module != 'undefined') module.exports = definition();\n else if (typeof define == 'function' && typeof define.amd == 'object') define(defini...
javascript
chosen
[ { "from": "system", "value": "Use object shorthand for properties\n" }, { "from": "human", "value": "// Test the Server class\n\nvar Socket = require('../../')\nvar Server = require('../../server')\nvar test = require('tape')\n\ntest('socket server', function (t) {\n t.plan(3)\n\n var port = 6...
javascript
chosen
[ { "from": "system", "value": "Handle scenario where subscription confirmation would fail if the env was invalid\n" }, { "from": "human", "value": "'use strict';\n\nvar config = require('config');\nconst BASE_URL = config.get('apiGateway.externalUrl');\nconst logger = require('logger');\n\nclass ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Bump patch version of accounts-oauth\"\n\nThis reverts commit d14a4867f19147c40efa0d09fc1d623f7373424c.\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Common code for OAuth-based login services\",\n version: \"1.3.1\",\n});\n\nPackage....
javascript
chosen
[ { "from": "system", "value": "Fix babel rename option warning\n" }, { "from": "human", "value": "module.exports = {\n loose: true,\n modules: 'amdStrict',\n moduleIds: true,\n whitelist: [\n 'es6.modules',\n 'es6.templateLiterals',\n 'es6.parameters.rest',\n 'es6.arrowFunctions',...
javascript
chosen
[ { "from": "system", "value": "Convert spaces to tabs in existing test\n\nAs per the current style\n" }, { "from": "human", "value": "describe(\"Core Bliss\", function () {\n \"use strict\";\n\n beforeEach(function () {\n fixture.setBase('tests/fixtures');\n this.fixture = fixture.load('c...
javascript
chosen
[ { "from": "system", "value": "Fix broken 'more' link after the post has been created\n" }, { "from": "human", "value": "import Article from 'scripts/models/article';\nimport FormBehavior from 'scripts/views/behaviors/form';\nimport Session from 'scripts/facades/session';\nimport template from 't...
javascript
chosen
[ { "from": "system", "value": "Handle select/unselect of a single row" }, { "from": "human", "value": "/**\n * Handling of BUIC listings.\n *\n * @mixin\n * @namespace Bolt.buic.listing\n *\n * @param {Object} bolt - The Bolt module.\n * @param {Object} $ - jQuery.\n */\n(function (bolt, $) {\n ...
javascript
chosen
[ { "from": "system", "value": "Change karma browser to PhantomJS\n" }, { "from": "human", "value": "// Karma configuration\n// http://karma-runner.github.io/0.10/config/configuration-file.html\n\nmodule.exports = function(config) {\n config.set({\n // base path, that will be used to resolve f...
javascript
chosen
[ { "from": "system", "value": "Use isFinite instead of Number.isFinite for improved browser support\n" }, { "from": "human", "value": "/**\n * Comma number formatter\n * @param {Number} number Number to format\n * @param {String} [separator=','] Value used to separate numbers\n * @returns {String...
javascript
chosen
[ { "from": "system", "value": "Move hide class to collection to remove margin-top spaces on hidden collections\n\nSRFCMSAL-2500\n" }, { "from": "human", "value": "export function init() {\n\n let triggers = document.querySelectorAll('.js-filter-bar-trigger');\n for (let i = 0; i < triggers....
javascript
chosen
[ { "from": "system", "value": "Install into directory that has the module name." }, { "from": "human", "value": "var bower = require('bower');\nvar mybowerConfig = require('./mybower.json');\n\nfor (var module in mybowerConfig) {\n if (mybowerConfig[module].local === true) continue;\n bower...
javascript
chosen
[ { "from": "system", "value": "Make clicking on avatar open new tab as well\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst Avatar = ({ url, user_url }) => {\n return (\n <div className='avatar'>\n <a href={user_url}>\n <...
javascript
chosen
[ { "from": "system", "value": "Switch to files array format" }, { "from": "human", "value": "/*\n * SASS: Compile Sass to CSS\n */\nmodule.exports = {\n /*\n * TARGET: Build Bolts css file\n */\n boltCss: {\n options: {\n outputStyle: 'compressed',\n in...
javascript
chosen
[ { "from": "system", "value": "Use path.join instead of path.concat\n" }, { "from": "human", "value": "'use strict'\n\nconst path = require('path')\nconst nconf = require('nconf')\n\nconst defaults = {\n\n port: 5000,\n\n mongo: {\n url: 'mongodb://localhost/link-analyzer',\n },\n\n redis:...
javascript
chosen
[ { "from": "system", "value": "Replace Chrome with Firefox for travis\n" }, { "from": "human", "value": "var webpackConf = require('./webpack.config.js');\nmodule.exports = function(config) {\n config.set({\n files: [\n // Each file acts as entry point for the webpack configuration\n ...
javascript
chosen
[ { "from": "system", "value": "Update to DOMBars 0.3 convention.\n" }, { "from": "human", "value": "var test = require('tape');\nvar DOMBars = require('dombars/runtime');\n\ntest('generate a template', function (t) {\n t.plan(1);\n\n var div = document.createElement('div');\n\n // Register ...
javascript
chosen
[ { "from": "system", "value": "Correct path to openveo-api while generating documentation\n\nYuidoc needs the path to the openveo-api documentation to establish links between openveo-publish documentation and openveo-api.\n" }, { "from": "human", "value": "module.exports = {\n\n // Publish doc\n...
javascript
chosen
[ { "from": "system", "value": "Disable eslint when bundle with docs\n" }, { "from": "human", "value": "import ProductionConfig from './rollup.production'\n\n// development mode just rewrite from production config.\nexport default Object.assign({}, ProductionConfig, {\n output: {\n ...Producti...
javascript
chosen
[ { "from": "system", "value": "Disable inputs correctly upon form load\n" }, { "from": "human", "value": "(function ($) {\n $(document).ready(function () {\n $.each($('select[name*=url]'), function (i, e) {\n console.log(e);\n e.onchange = function () {\n ...
javascript
chosen
[ { "from": "system", "value": "Add extra spaces to make the log output aligned\n" }, { "from": "human", "value": "// facade for logger.\n// use concrete implementation of logger here.\n\nvar colors = require('colors');\nvar logger = require('tracer').colorConsole(\n {\n format : \"{{timestamp...
javascript
chosen
[ { "from": "system", "value": "Add button to trigger native exception\n" }, { "from": "human", "value": "import React from 'react';\nimport { Text, View, StyleSheet } from 'react-native';\nimport { Button } from 'react-native-elements';\n\nfunction triggerException() {\n this.bogusFunction();\n}...
javascript
chosen
[ { "from": "system", "value": "Set WebSocket address based on hostname\n" }, { "from": "human", "value": "var paladinws = new PaladinWebSocket(\"ws://localhost:1234/api\");\n\nvar width = $(document).width();\nvar height = $(document).height();\n\n// Disable the scroll bar\ndocument.documentEleme...
javascript
chosen
[ { "from": "system", "value": "Make server respond with the list of dishes\n" }, { "from": "human", "value": "var db = require('./db');\nvar bluebird = require('bluebird'); //promise library, will have to think more about it\nvar helpers = require('./helpers.js')\n\n\nmodule.exports = {\n '/': {...
javascript
chosen
[ { "from": "system", "value": "Disable jscs check for camel case property name" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/md-btn-dropdown';\nimport MaterializeButton from './md-btn';\n\nconst { run: { scheduleOnce }, computed } = Ember...
javascript
chosen
[ { "from": "system", "value": "Fix path error for teris demo\n" }, { "from": "human", "value": "G.extend.menu('Test/Shape', function() {\n var game = G.game;\n game.assets.load('Assets/prefab/Shape.bin', function(prefab) {\n var shape = game.add.clone(prefab, game.world.find('UIRoot/...
javascript
chosen
[ { "from": "system", "value": "Edit knex user seed and content structure\n" }, { "from": "human", "value": "\nexports.seed = function(knex, Promise) {\n // Deletes ALL existing entries\n return knex('users').del()\n .then(function () {\n // Inserts seed entries\n return knex('users...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"Set back to login code\"\"\n\nThis reverts commit 868ce70c6234c1fbd01928d6f0fa3d751a38884c.\n" }, { "from": "human", "value": "function ApplicationTabGroup(Window) {\n\t//create module instance\n\tvar self = Ti.UI.createTabGroup();\n\t\n\t//load co...
javascript
chosen
[ { "from": "system", "value": "Hide the sidebar by default.\n" }, { "from": "human", "value": "import {Experiment, ExperimentStep} from './experiment.model';\n\nangular.module('materialscommons').component('mcExperiment', {\n templateUrl: 'app/project/experiments/experiment/mc-experiment.html'...
javascript
chosen
[ { "from": "system", "value": "Add graphs grid lines color\n" }, { "from": "human", "value": "Template.graphImage.helpers({\n url: function () {\n return graphUrl(this, {\n format: 'svg',\n bgcolor: 'white',\n fgcolor: 'black'\n });\n }\n});\n"...
javascript
chosen
[ { "from": "system", "value": "Clear 'state' when leaving a game, so that the game board doesnt stick on\n" }, { "from": "human", "value": "import _ from 'underscore';\n\nfunction games(state = {\n games: []\n}, action) {\n switch(action.type) {\n case 'START_NEWGAME':\n r...
javascript
chosen
[ { "from": "system", "value": "Remove Ember 2.1 deprecation warning\n\nUpdates the initializer to remove the deprecation warning in Ember 2.1 caused by having two arguments (container, application) in the initialize function. This uses the backwards compatible safe method described in the deprecation pages (...
javascript
chosen
[ { "from": "system", "value": "Fix links in decktree on deck edit without new revision\n" }, { "from": "human", "value": "import UserProfileStore from '../stores/UserProfileStore';\nimport {navigateAction} from 'fluxible-router';\nimport striptags from 'striptags';\n\nexport default function save...
javascript
chosen
[ { "from": "system", "value": "Stop the socket from warning (for now)\n\nIt was constantly giving an \"Ignoring unmatched topic \"authorized:lobby\"\nwarning to the console.\n" }, { "from": "human", "value": "/* This javascript was taken from the PhoenixGuardian Project */\n\nimport {Socket} from...
javascript
chosen
[ { "from": "system", "value": "Add pages in subdirectories and JS sourcemap to srcdir task\n" }, { "from": "human", "value": "// Clean up deployment directory\nmodule.exports = function(grunt) {\n grunt.config('clean', {\n deploy: [\n 'dist'\n ],\n srcdir: [\n ...
javascript
chosen
[ { "from": "system", "value": "Remove initial digits from names. Fix getListenerCount\n" }, { "from": "human", "value": "'use strict';\n\n//https://github.com/parshap/node-sanitize-filename\nfunction sanitizeName(name=''){\n function toCamelCase(str) {\n // Lower cases the string\n ...
javascript
chosen
[ { "from": "system", "value": "Update for string.fromcodepoint v1.0.0 API\n" }, { "from": "human", "value": "import 'browser-polyfills';\nimport 'string.fromcodepoint';\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\n\n// polyfill requestIdleCallback\nwindow.requestIdleCallback = w...
javascript
chosen
[ { "from": "system", "value": "Send back more info on multiple checkboxes action\n" }, { "from": "human", "value": "import Ember from 'ember'\nconst { computed, get, set } = Ember\n\nexport default Ember.Component.extend({\n tagName: 'fieldset',\n classNames: ['check-boxes', 'group-element-wrap...
javascript
chosen
[ { "from": "system", "value": "Handle void on protocol methods for swift.\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2017 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfoam.CLASS({\n package: 'foam.swift',\n name: 'ProtocolM...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary table headers in tags page\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react'\nimport { Table } from 'semantic-ui-react'\n\nimport TagTableRow from './TagTableRow'\n\nconst propTypes = {\n dispatch: PropTypes.f...
javascript
chosen
[ { "from": "system", "value": "Reduce line length to below 80 chars\n" }, { "from": "human", "value": "'use strict';\n\nconst assign = require('lodash.assign');\nconst ResultList = require('./result-list');\n\nconst requiredDefaults = {\n page: 1,\n per_page: 20,\n url: 'https://pixabay.com/ap...
javascript
chosen
[ { "from": "system", "value": "fix: Fix global name and add preact to the list of externals.\n\n#1150\n" }, { "from": "human", "value": "const browsers = require('./test/browsers');\n\nmodule.exports = {\n type: 'web-module',\n npm: {\n cjs: false,\n esModules: true,\n umd: true\n },\...
javascript
chosen
[ { "from": "system", "value": "Update list of HTML5 tags shived by html5shiv" }, { "from": "human", "value": "module.exports = function(options){\n var page = options.page;\n var next = options.next;\n\n page.evaluate(\n function () {\n var tags = [\n 'article',\n 'aside'...
javascript
chosen
[ { "from": "system", "value": "Fix Hydra's disregard of the alphabet\n" }, { "from": "human", "value": "const path = require('path');\n\nmodule.exports = {\n Client: require('./client/Client'),\n Shard: require('./sharding/Shard'),\n ShardingManager: require('./sharding/ShardingManager'),\n C...
javascript
chosen
[ { "from": "system", "value": "Move time selector to top right corner of the page\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport NativeSelect from '@material-ui/core/NativeSelect'\n\nclass TimeSelect extends React.Component {\n render =...
javascript
chosen
[ { "from": "system", "value": "Add .is, .params, .getName utilities\n" }, { "from": "human", "value": "/**\n * A namespace for utilities\n * @namespace\n */\nCurrentRoute = {};\n" }, { "from": "gpt", "value": "/**\n * A namespace for utilities\n * @namespace\n */\nCurrentRoute = {};\n...
javascript
chosen
[ { "from": "system", "value": "Allow to create reading with specific time\n" }, { "from": "human", "value": "'use strict';\n\n// Load modules\nvar Boom = require('boom');\nvar Joi = require('joi');\nvar Reading = require('../models/reading');\n\n/**\n * GET /readings\n * Get readings\n *\n */\nex...
javascript
chosen
[ { "from": "system", "value": "Remove outdated blacklist add code\n\n- attempted to call remote function that doesn't exist anymore\n" }, { "from": "human", "value": "import { createAction } from 'redux-act'\n\nimport { remoteFunction } from 'src/util/webextensionRPC'\n\nexport const setSiteInput...
javascript
chosen
[ { "from": "system", "value": "Align changed file count in status bar\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport Octicon from './octicon';\n\nexport default class ChangedFilesCountView extends React.Component {\n static propTypes = ...
javascript
chosen
[ { "from": "system", "value": "Allow setting args in nextTile\n" }, { "from": "human", "value": "import { nextCoord } from './utils';\n\nexport function tile() {\n return pixelToTile({\n x: this.x,\n y: this.y,\n });\n}\n\nexport function nextTile() {\n return nextCoord(this.tile, this.f...
javascript
chosen
[ { "from": "system", "value": "Make this work the same way as the others.\n" }, { "from": "human", "value": "Tertius.SettingsManager = {\n settings: {\n fontSize: \"100\",\n ruby: \"1\"\n },\n load: function(cb) {\n Tertius.DataStorage.loadJSON(\"settings\", Tertius.SettingsManager, c...
javascript
chosen
[ { "from": "system", "value": "fix: Improve error handling of getPage\n\nIt should capture errors better now.\n" }, { "from": "human", "value": "import React from \"react\";\nimport ReactDOMServer from \"react-dom/server\";\nimport { Route, StaticRouter } from \"react-router\";\nimport config fro...
javascript
chosen
[ { "from": "system", "value": "Set title to color to inherit\n\nSince dev tools are just an HTML page, inherit the console's default color.\r\nThis fixes unreadable text in Chrome DevTools when the Dark theme is selected." }, { "from": "human", "value": "export default {\n level: `log`,\n logge...
javascript
chosen
[ { "from": "system", "value": "Remove eslinting from es5 based file used in PhantomJS\n" }, { "from": "human", "value": "/* eslint-disable no-console, import/no-unresolved, no-undef, prefer-template */\nconst system = require('system');\n\nconsole.log('Script: ' + system.args[0]);\nconsole.log('U...
javascript
chosen
[ { "from": "system", "value": "Implement IO Handler Function Fully\n" }, { "from": "human", "value": "var diskette = require('diskette')\n\nmodule.exports =\n{\n readFromFile: function()\n {\n //read\n },\n writeInFile: function()\n {\n //write\n }\n};\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Use preferred library.type for webpack\n" }, { "from": "human", "value": "module.exports = {\n mode: 'production',\n output: {\n filename: 'd3-funnel.js',\n libraryTarget: 'umd',\n library: 'D3Funnel',\n },\n externals: {\n //...
javascript
chosen
[ { "from": "system", "value": "Change name to accounting. It's shorter.\n" }, { "from": "human", "value": "module.exports = {\n name: 'ember-cli-accounting'\n};\n" }, { "from": "gpt", "value": "module.exports = {\n name: 'accounting'\n};\n\n// module.exports = {\n// name: 'account...
javascript
chosen
[ { "from": "system", "value": "Return empty string if file extension don't match" }, { "from": "human", "value": "\n'use strict';\n\nvar path = require('path');\nvar fs = require('fs');\nvar through = require('through2');\nvar glob = require('glob');\n\nmodule.exports = function() {\n\n var pr...
javascript
chosen
[ { "from": "system", "value": "Simplify loop to only the asserted case\n\nThis prevents needing to use `continue` and explicitly defines the case\nwhere the class should be added." }, { "from": "human", "value": "function classNames() {\n\tvar args = arguments;\n\tvar classes = [];\n\n\tfor (var ...
javascript
chosen
[ { "from": "system", "value": "Use .trim() before parsing msg\n" }, { "from": "human", "value": "\nconst Discord = require('discord.js');\nconst config = require('./config.json');\nconst commands = require('./commands.js');\n\nconst client = new Discord.Client();\n\nclient.on('ready', () => {\n ...
javascript
chosen
[ { "from": "system", "value": "Allow files to be exlcuded\n" }, { "from": "human", "value": "/*jslint node:true */\nvar RequireAll = (function () {\n 'use strict';\n \n var fs = require('fs'),\n\n exclude = function (excludeRegexp, name) {\n return excludeRegexp && name...
javascript
chosen
[ { "from": "system", "value": "Use default logger when not in dev\n" }, { "from": "human", "value": "\"use strict\";\n\nvar express = require(\"express\"),\n helpers = require(\"./src/helpers\");\n\nmodule.exports = function () {\n\n var app = express();\n\n app.use( express.compress() );\n\...
javascript
chosen
[ { "from": "system", "value": "Add port and ip from heroku env variables.\n" }, { "from": "human", "value": "const express = require('express');\nconst bodyParser = require('body-parser');\nconst path = require('path');\nconst fx = require(\"./fx\");\nconst app = expr...
javascript
chosen
[ { "from": "system", "value": "Fix silly error on my part\n" }, { "from": "human", "value": "'use strict';\n\nvar coffee = require('coffee-script');\n\nexports.name = 'coffee-script';\nexports.outputFormat = 'js';\n\nexports.render = function (str, options) {\n return coffee.render(str, options)...
javascript
chosen
[ { "from": "system", "value": "Throw if passed non-function as first param\n" }, { "from": "human", "value": "var placeholder = {},\n endOfArgs = {},\n slice = Array.prototype.slice.call.bind(Array.prototype.slice);\n\nfunction shuv(fn){\n var outerArgs = slice(arguments, 1);\n\n retu...
javascript
chosen
[ { "from": "system", "value": "Add weather module; sort in alpha-order\n" }, { "from": "human", "value": "module.exports = {\n displayname : 'Core Modules',\n description : 'Core Fritbot functions.',\n children : [\n require('./src/rooms'),\n require('./src/sayhi'),\n ...
javascript
chosen
[ { "from": "system", "value": "Add challenge to basic auth for staging server\n" }, { "from": "human", "value": "const express = require('express'),\n basicAuth = require('express-basic-auth'),\n app = express();\n\n// Add authentication only if the ENV variable is present\n// The format must b...
javascript
chosen
[ { "from": "system", "value": "Revert \"Use commonjs for now\"\n\nThis reverts commit b725e743c11515ea6da44ad0a6219a671d3c8bd7.\n" }, { "from": "human", "value": "// use commonjs for now\nlet $ = require( 'jquery' );\n\nmodule.exports = function plugit( pluginName, pluginClass ) {\n\tlet dataName...
javascript
chosen
[ { "from": "system", "value": "Use columnify to format data before printing.\n\nInstead of concatenating with `\\t` as delimiter, use the columnify\npackage. This ensures consistent column widths.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst columnify = require('columnify');\nc...
javascript
chosen
[ { "from": "system", "value": "Add login and ping functionality\n" }, { "from": "human", "value": "console.log(\"Hello world!\")" }, { "from": "gpt", "value": "\nconst fs = require('fs')\nconst Discord = require('discord.js');\nconst client = new Discord.Client();\n\nconst token = fs....
javascript
chosen
[ { "from": "system", "value": "Update for new express versions\n" }, { "from": "human", "value": "var express = require(\"express\")\nvar app = express()\n\nvar dotenv = require('dotenv');\ndotenv.load();\n\nvar port = process.env.PORT || 3000\n\napp.configure(function() {\n app.use(express.stat...
javascript
chosen
[ { "from": "system", "value": "Add a nicer error message when bailey is not installed\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar path = require('path');\nvar fs = require('fs');\nvar resolve = require('resolve');\n\nresolve('bailey', { basedir: process.cwd() }, function(err, ba...
javascript
chosen
[ { "from": "system", "value": "Replace all indent with tab.\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = (pluginContext) => {\n const shell = pluginContext.shell\n\n function search (query, res) {\n const query_trim = query.trim()\n\n if (query_trim.length === 0) {\...
javascript
chosen
[ { "from": "system", "value": "Add ember-legacy-views deprecation to ignored\n\nCreated #1461 to handle this\n" }, { "from": "human", "value": "window.deprecationWorkflow = window.deprecationWorkflow || {};\nwindow.deprecationWorkflow.config = {\n workflow: [\n { handler: \"silence\", matchId...
javascript
chosen
[ { "from": "system", "value": "Add OPTIONS to CORS allowed methods\n" }, { "from": "human", "value": "/**\n * Adds CORS headers to the response\n *\n * ####Example:\n *\n * app.all('/api*', keystone.middleware.cors);\n *\n * @param {app.request} req\n * @param {app.response} res\n * @param {f...
javascript
chosen
[ { "from": "system", "value": "Test file contents are now Buffers.\n" }, { "from": "human", "value": "/* jshint node: true */\n/* global describe, it */\n\n'use strict';\n\nvar expect = require('chai').expect,\n gutil = require('gulp-util'),\n csso = require('./index');\n\nvar basestyle ...
javascript
chosen
[ { "from": "system", "value": "Add a constructor for a component of the load-button\n" }, { "from": "human", "value": "(function(app) {\n 'use strict';\n\n var jCore = require('jcore');\n var helper = app.helper || require('../helper.js');\n var dom = app.dom || require('../dom.js');\n var S...
javascript
chosen
[ { "from": "system", "value": "Clean url when user comes from homepage with an empty search\n" }, { "from": "human", "value": "'use strict';\n\n/**\n *\n * @param {type} app\n * @returns {undefined}\n */\n\n(function(app) {\n\n /**\n * Defines the home page controller.\n */\n function HomeC...
javascript
chosen
[ { "from": "system", "value": "Add proper handling for empty string case for RegExp transformation\n" }, { "from": "human", "value": "\"use strict\";\n\nfunction transformWildcardToPattern(wildcardString) {\n var length = wildcardString.length;\n var character;\n var pattern = '';\n for (var ...
javascript
chosen
[ { "from": "system", "value": "Fix bug introduced by new export style.\n" }, { "from": "human", "value": "\n// Import framework for use in our examples.\nimport framework from '../framework/index.js';\n\n// Expose all framework components to the JSX in our examples.\nObject.keys(framework).forEac...
javascript
chosen
[ { "from": "system", "value": "Add support for replace with new actions\n" }, { "from": "human", "value": "(() => {\n 'use strict';\n\n angular\n .module('atlas')\n .factory('stateToUrlMiddleware', stateToUrlMiddlewareFactory);\n\n stateToUrlMiddlewareFactory.$inject = ['st...
javascript
chosen
[ { "from": "system", "value": "Add tests for hover on popup\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\n\nmoduleForComponent('ui-popup', 'Integration | Component | ui popup', {\n integration: true\n});...
javascript
chosen
[ { "from": "system", "value": "Add TODO note on reusability\n" }, { "from": "human", "value": "'use strict';\n\nvar request = require('request');\n\nvar opts = {\n uri: 'https://api.github.com' + '/users/' + process.argv[2] + '/events',\n json: true,\n method: 'GET',\n headers: {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix map tiles (thanks Colin)" }, { "from": "human", "value": "define(['leaflet'],\nfunction (leaflet) {\n\n /**\n * @constructor\n */\n function MapView(mapDivId)\n {\n this.map = leaflet.map(mapDivId);\n leaflet.tileLayer(\n ...
javascript
chosen
[ { "from": "system", "value": "Include radix in parseInt call\n\nThe default is not guaranteed to be 10.\n" }, { "from": "human", "value": "(function () {\n \"use strict\";\n $(document).ready(function() {\n if ($('select').is('#active_filter')){\n var page_size = parseInt...
javascript
chosen
[ { "from": "system", "value": "Use ReactDOM.hydrate instead of render\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\nimport AppContainer from 'react-hot-loader/lib/AppContainer'\nimport injectTapEventPlugin from 'react-tap-event-plugin'\nimport Coo...
javascript
chosen
[ { "from": "system", "value": "Enable auth on production DB\n" }, { "from": "human", "value": "module.exports = {\n\turl: 'mongodb://localhost/gokibitz'\n};\n" }, { "from": "gpt", "value": "module.exports = {\n\t// Your MONGO_URI URL needs to be set in your `.env` file at project root...
javascript
chosen
[ { "from": "system", "value": "Add support for mock config flag.\n" }, { "from": "human", "value": "var StatsD = require('node-statsd').StatsD;\nexports = module.exports = function(settings, logger) {\n\tvar config = settings.get('statsd') || {};\n\tif (! config.host) {throw new Error('StatsD hos...
javascript
chosen
[ { "from": "system", "value": "Fix read middleware to align with proper endpoint\n" }, { "from": "human", "value": "'use strict';\n\nconst validator = require('../util/validator');\nconst serverErrors = require('../util/server-errors');\nconst sendJson = require('../util/send-json');\n\nmodule.ex...
javascript
chosen
[ { "from": "system", "value": "Create route for new meal form\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport './App.css';\nimport Nav from './components/Nav'\nimport Home from './components/Home'\nimport HouseholdsContainer from './components/HouseholdsContai...
javascript
chosen
[ { "from": "system", "value": "Clean up the form structure\n" }, { "from": "human", "value": "import React, { Component } from 'react'\n\nexport default class App extends Component {\n state = {\n listSize: 7776,\n passwordSize: 6\n }\n\n static bits (size) {\n return Math.floor(Math....
javascript
chosen
[ { "from": "system", "value": "Clear error on successful login\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2017 Bonnie Schulkin. All Rights Reserved.\n *\n * This file is part of BoxCharter.\n *\n * BoxCharter is free software: you can redistribute it and/or modify it under\n * the te...
javascript
chosen
[ { "from": "system", "value": "Add schedule entry http requests\n" }, { "from": "human", "value": "import fetch from 'isomorphic-fetch';\nimport { checkStatus, parseJSON } from './utils';\nrequire('es6-promise').polyfill();\n\nexport const fetchTickets = projectId => {\n const headers = {\n A...
javascript
chosen
[ { "from": "system", "value": "Include skip-link-focus-fix.js in bundled js.\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/asse...
javascript
chosen
[ { "from": "system", "value": "Fix react multi child error of FunctionsList\n\nIf an error occured in func edit page and then switch back to func list,\nwill cause an react multi child error\n" }, { "from": "human", "value": "/**\n*\n* FunctionsList\n*\n*/\n\nimport React, { PropTypes } from 'rea...
javascript
chosen
[ { "from": "system", "value": "Reimplement combine strings, much easier to precompute paths.\n" }, { "from": "human", "value": "var combineTwoStrings = function (str1, str2, str3) {\n var pos1 = 0,\n pos2 = 0;\n \n if (str1 + str2 === str3) { return true; }\n \n for (var i = 0; i < ...
javascript
chosen
[ { "from": "system", "value": "Check form for confirm field and use it if it exists.\n" }, { "from": "human", "value": "jQuery(function(){\n\n\tjQuery('button.link').click(function(){\n\t\twindow.location.href = $(this).find('span.href').text();\n\t});\n\n\tjQuery('form.destroy_link_to').submit(f...
javascript
chosen
[ { "from": "system", "value": "Add a little console.log to use the hmdaData or else jshint complains about the param never being used\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc function\n * @name hmdaPilotApp.controller:selectFile\n * @description\n * # Select File\n * Con...
javascript
chosen
[ { "from": "system", "value": "Fix form submission to handle CORS errors.\n" }, { "from": "human", "value": "$(function() {\n\n var form = $('form');\n var inputs = form.find(':input');\n var required = inputs.filter('[required]');\n var submit = inputs.filter('[type=submit]');\n var confirm...
javascript
chosen