conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix default not being used in getSettings" }, { "from": "human", "value": "// Requires\nvar Q = require('q');\nvar _ = require('underscore');\nvar fs = require('fs');\nvar path = require('path');\n\nfunction setup(options, imports, register) {\n var workspace = i...
javascript
chosen
[ { "from": "system", "value": "Add - Simplest code to turn the Given into concrete actions (HTTP request to check that a POST resource exists)\n" }, { "from": "human", "value": "/*\nWe use the output messages from the cucumber runner to create Step Definitions:\nthe glue between features written ...
javascript
chosen
[ { "from": "system", "value": "Update webpack to allow require('ipc') in render process\n" }, { "from": "human", "value": "module.exports = {\n entry: './src/entry.js',\n output: {\n path: __dirname + '/dist',\n filename: 'bundle.js'\n },\n devtool: 'source-map',\n module: {\n loade...
javascript
chosen
[ { "from": "system", "value": "Revert \"Let new-login communicate with acc for now, instead of production\"\n\nThis reverts commit 307a313a3a6056a56408ab558b156575f6d8fd08.\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n angular\n .module('dpShared')\n .f...
javascript
chosen
[ { "from": "system", "value": "Fix projects search dropdown keyboard navigation\n" }, { "from": "human", "value": "$(document).ready(function() {\n $(function() {\n $('#search-form').on('submit', function() {\n var $sel = $('#projects > ul > li.is-selected')\n if ($sel.length > 0) {...
javascript
chosen
[ { "from": "system", "value": "Exclude initial proto from benchmark\n\nThanks @ebryn and @kselden\n" }, { "from": "human", "value": "/*globals App:true Ember before after bench*/\n\nvar view;\n\nbefore(function() {\n var view;\n window.App = Ember.Namespace.create();\n\n App.View = Ember.View....
javascript
chosen
[ { "from": "system", "value": "Add request payload data to state\n" }, { "from": "human", "value": "export default function(state = null, action) {\n\treturn state;\n}" }, { "from": "gpt", "value": "import { FETCH_WEATHER } from \"../actions/index\";\n\nexport default function(state =...
javascript
chosen
[ { "from": "system", "value": "Add search remote method to City model\n" }, { "from": "human", "value": "module.exports = function(City) {\n\n};\n" }, { "from": "gpt", "value": "module.exports = function(City) {\n City.search = function(query, callback) {\n // TODO: sanitize query...
javascript
chosen
[ { "from": "system", "value": "Add Alexa skill events to account linking sample project\n" }, { "from": "human", "value": "'use strict';\n\nconst _ = require('lodash');\n\nexports.register = function register(skill) {\n skill.onIntent('LaunchIntent', (alexaEvent) => {\n if (_.get(alexaEvent, ...
javascript
chosen
[ { "from": "system", "value": "Fix React double inclusion in the examples\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar initGulpTasks = require('react-component-gulp-tasks');\n\n/**\n * Tasks are added by the react-component-gulp-tasks package\n *\n * See https://github.com/...
javascript
chosen
[ { "from": "system", "value": "Change the schema of model.\n\nAn example is given below:\n\nvar data = {\n title: 'event 1',\n description: 'the first event',\n startDate: '2014-01-02',\n endDate: '2014-01-05',\n deadline: '2014-01-01',\n duration: '2',\n participants: [\n {...
javascript
chosen
[ { "from": "system", "value": "Fix naming of writeFile tests\n" }, { "from": "human", "value": "var path = require('path'),\n fs = require('fs'),\n crypto = require('crypto');\n\ndescribe(\"readFile functionality\", function() {\n var _this = this;\n require('./harness.js')(_this);\n ...
javascript
chosen
[ { "from": "system", "value": "Fix baseURL for github pages.\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'katana',\n environment: environment,\n baseURL: '/',\n locationType: 'auto',\n EmberEN...
javascript
chosen
[ { "from": "system", "value": "Add users route, get all users in db.\n" }, { "from": "human", "value": "var User = require('../models/user');\nvar config = require('../config');\nvar express = require('express');\nvar router = express.Router();\nvar secret = config.secret;\n\nrouter.post('/...
javascript
chosen
[ { "from": "system", "value": "Reformat code and add comment about clearRect dimensions.\n" }, { "from": "human", "value": "// TODO: it might be better to make a ContextProvider class, since you\n// can always find the canvas through context.canvas. This saves code and \n// speed by not having to...
javascript
chosen
[ { "from": "system", "value": "Revert to pure JS code\n" }, { "from": "human", "value": "$(document).ready(function(){\n var changeColor = function() {\n console.log('change');\n this.setAttribute('color', 'green');\n };\n\n $('a-box').hover(changeColor());\n});" }, { ...
javascript
chosen
[ { "from": "system", "value": "Fix example tour corpus for DeReKo\n\nChange-Id: I2d377259f78a3152c639c7322ceb7a1984ad7b89\n" }, { "from": "human", "value": "/**\n * Corpus specific localization, here for DeReKo (http://www1.ids-mannheim.de/kl/projekte/korpora.html)\n * \n * @author Helge Stallkam...
javascript
chosen
[ { "from": "system", "value": "Disable test not working on GitHub workflow\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2014-2021 Bjoern Kimminich.\n * SPDX-License-Identifier: MIT\n */\n\nconst frisby = require('frisby')\nconst Joi = frisby.Joi\n\nconst URL = 'http://localhost:3000'\n...
javascript
chosen
[ { "from": "system", "value": "Update comment about server-side ES6\n" }, { "from": "human", "value": "/**\n* To run the server on the command line or on your hosting provider.\n*/\n\n/**\n * Enable ES6 - this will make it automatically transpile required files. See: http://babeljs.io/docs/usage/...
javascript
chosen
[ { "from": "system", "value": "Update Home Route index test\n" }, { "from": "human", "value": "import HomeRoute from 'routes/Home'\n\ndescribe('(Route) Home', () => {\n let _component\n\n beforeEach(() => {\n _component = HomeRoute.component()\n })\n\n it('Should return a route configurati...
javascript
chosen
[ { "from": "system", "value": "Switch to cheap-module-eval-sourcemap for source maps\n" }, { "from": "human", "value": "const WebpackMerge = require('webpack-merge');\nconst CommonConfig = require('./webpack.common.js');\n\nmodule.exports = WebpackMerge(CommonConfig, {\n entry: {\n 'app': [\n...
javascript
chosen
[ { "from": "system", "value": "Add show modal button to SideMenu\n" }, { "from": "human", "value": "import React from 'react';\nimport {StyleSheet, View, Text} from 'react-native';\n\nclass MyClass extends React.Component {\n\n render() {\n return (\n <View style={styles.container}>\n\n ...
javascript
chosen
[ { "from": "system", "value": "Fix error if relation empty\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar inflection = require('inflection');\n\nmodule.exports = function Deserializer (data, serverRelations) {\n\n var clientRelations = data.data.relationships;\n var result =...
javascript
chosen
[ { "from": "system", "value": "Add fallback in update method\n" }, { "from": "human", "value": "myApp.service('breadCrumbService', function($location) {\n\n this.crumbs = [\n ];\n\n this.current = {\n path: './',\n display:'Inventories'\n };\n\n this.update = function...
javascript
chosen
[ { "from": "system", "value": "Update some popover in BCBProcess\n" }, { "from": "human", "value": "\nclass BCBProcess extends CommonProcess {\n constructor() {\n super({\n name: `${Project.NAME} Process`\n });\n \n this.initProcess();\n }\n \n initProcess() {\n this.initP...
javascript
chosen
[ { "from": "system", "value": "Replace current url if spreadsheet ID is missing\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './containers/App';\nimport './index.css';\n\nconst spreadsheetId = window.location.hash.substring(1) |...
javascript
chosen
[ { "from": "system", "value": "Make sure encode chunk size is in multiples of three bytes\n" }, { "from": "human", "value": "'use strict';\n\nconst applyDefaultOpts = opts => Object.assign({}, {\n\tencoding: 'utf8',\n\tchunkSize: 3\n}, opts);\n\nconst b64 = () => {\n\n};\n\nb64.encode = (input, o...
javascript
chosen
[ { "from": "system", "value": "Fix middleware and proxy creation\n" }, { "from": "human", "value": "import clsify from 'cls-middleware';\nimport {createNamespace} from 'continuation-local-storage';\n\nconst DEFAULT_NAME = 'cls-isoflux';\nconst APP = 'app';\n\nexport default class Isoflux {\n con...
javascript
chosen
[ { "from": "system", "value": "Use CommonJS until Babel ES3 transforms are fixed\n\nOur current presets didn't include ES3 transforms by default, so IE8 support is broken. Normally we would have fixed it by adding a few plugins:\n\n* babel-plugin-transform-es3-member-expression-literals\n* babel-plugin-trans...
javascript
chosen
[ { "from": "system", "value": "Add more react-friendly support for className attributes\n" }, { "from": "human", "value": "import PropTypes from 'proptypes';\nimport { render, h, Component } from 'preact';\n\nlet createElement = h;\n\n/** @TODO subclass preact's Component to do basic proptype che...
javascript
chosen
[ { "from": "system", "value": "Use es6 default for assiging to console.log\n" }, { "from": "human", "value": "'use strict'\n\nimport {cyan} from 'chalk'\n\nexport function createLogger (name, logger) {\n const prefix = `[${cyan(name)}]`\n function bind (logger) {\n return logger.bind(console...
javascript
chosen
[ { "from": "system", "value": "Support the 'optimize' option of buildParser() to specify 'speed' or 'size' preference\n" }, { "from": "human", "value": "import pegjs from 'pegjs';\nimport loaderUtils from 'loader-utils';\n\nexport default function loader(source) {\n if (this.cacheable) {\n th...
javascript
chosen
[ { "from": "system", "value": "Call hasOwnProperty when iterating on dataset\n" }, { "from": "human", "value": "import primitive from 'brique/string_utils';\n\nfunction data(el, namespace) {\n var options = {};\n var set = el.dataset;\n\n for (var key in set) {\n var k = key;\n if (names...
javascript
chosen
[ { "from": "system", "value": "Fix to avoid reset on browsers - hack\n" }, { "from": "human", "value": "function greedyJumbotron(jumbotron) {\n var HEIGHT_CHANGE_TOLERANCE = 100; // Approximately URL bar height in Chrome on tablet\n\n var viewportHeight = screen.height;\n\n window.onresi...
javascript
chosen
[ { "from": "system", "value": "Add global keydown event handler\n\nAuto focus to `textarea.input-message` when not focused on any input\nareas.\n" }, { "from": "human", "value": "window.fireGlobalEvent = (eventName, params) => {\n\twindow.dispatchEvent(new CustomEvent(eventName, {detail: params})...
javascript
chosen
[ { "from": "system", "value": "Fix server erros if data contains ampersand\n" }, { "from": "human", "value": "/*\n\nCode to set up the log collection and to send it back to the server.\n\n*/\n// Set up global vAnnotate object if it doesn't exist already\n(function(window){\n {{{serializeLogRes...
javascript
chosen
[ { "from": "system", "value": "Add UMD minified build in rollup\n" }, { "from": "human", "value": "import resolve from 'rollup-plugin-node-resolve';\nimport commonjs from 'rollup-plugin-commonjs';\nimport pkg from './package.json';\n\nexport default [\n\t// browser-friendly UMD build\n\t{\n\t\tin...
javascript
chosen
[ { "from": "system", "value": "Refactor `requireLowerCaseAttributes` to handle new token structure\n" }, { "from": "human", "value": "var utils = require('../utils')\n\nmodule.exports = function () {}\n\nmodule.exports.prototype =\n { name: 'requireLowerCaseAttributes'\n\n , configure: function...
javascript
chosen
[ { "from": "system", "value": "Fix implicitly anonymous AMD export\n" }, { "from": "human", "value": "import babel from 'rollup-plugin-babel';\n\nexport default {\n entry: 'dist-es2015/index.js',\n dest: 'dist/dynamic-typed-array.js',\n moduleName: 'DynamicTypedArray',\n format: 'umd',\n sou...
javascript
chosen
[ { "from": "system", "value": "Move Rollup.js babel plugin before commonjs\n" }, { "from": "human", "value": "// https://github.com/rollup/rollup-starter-project\nimport resolve from 'rollup-plugin-node-resolve';\nimport commonjs from 'rollup-plugin-commonjs';\nimport babel from 'rollup-plugin-ba...
javascript
chosen
[ { "from": "system", "value": "Configure knex + mysql database creation & connection\n" }, { "from": "human", "value": "var env = require('./../../env/env-config.js');\n\nvar knex = require('knex')({\n client: 'mysql',\n connection: {\n host: '127.0.0.1',\n user: env.DB_USER,\n passwor...
javascript
chosen
[ { "from": "system", "value": "Add autofocus to search input field\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\n\nimport './index.css';\n\nconst Search = React.createClass({\n propTypes: {\n onChange: PropTypes.func.isRequired,\n },\n\n render() {\n retur...
javascript
chosen
[ { "from": "system", "value": "Add note on error handling\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n\n openConfirmRemove: false,\n\n actions: {\n cancel () {\n this.cleanErrors();\n \n this.get('organization').rol...
javascript
chosen
[ { "from": "system", "value": "Remove dead code in the JS app\n" }, { "from": "human", "value": "// It seems that not much documentation exists for the JQuery\n// mini-Web-app that is the Wordpress admin menu editor. However,\n// insofar as Polylang's business in that mini-Web-app is similar\n// ...
javascript
chosen
[ { "from": "system", "value": "Check for minified code that isn't NODE_ENV=production\n" }, { "from": "human", "value": "import resourceReducer from './resource-reducer';\nimport actionTypes from './action-types';\nimport requestStatuses from './utils/request-statuses';\nimport setResourceMeta fr...
javascript
chosen
[ { "from": "system", "value": "Fix issue of blank responses for web ethic parsing.\n" }, { "from": "human", "value": "module.exports = function(question, callback) { \n\n\n\tvar apiai = require('apiai');\n\tvar app = apiai(\"76ccb7c7acea4a6884834f6687475222\", \"8b3e68f16ac6430cb8c40d49c315aa7a\"...
javascript
chosen
[ { "from": "system", "value": "Update finFirstAvailableYear to return the current year if no schedules\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar findMissingNumberBinarySearch = require('./findMissingNumberBinarySearch')\n\n// Takes a list of schedules and finds the first o...
javascript
chosen
[ { "from": "system", "value": "Define StyleLintPlugin in webpack base config.\n" }, { "from": "human", "value": "import path from 'path';\nimport webpack from 'webpack';\n\nconst paths = {\n ASSETS: path.resolve(__dirname, './assets'),\n SRC: path.resolve(__dirname),\n COMPONENTS: path.resolve...
javascript
chosen
[ { "from": "system", "value": "Return null for injected prestations\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nvar periods = require('./periods');\nvar PRESTATIONS = require('../prestations');\n\n\nmodule.exports = function reverseMap(openFiscaFamille, date, injectedRessourc...
javascript
chosen
[ { "from": "system", "value": "Store the notification id when fetching notifications\n" }, { "from": "human", "value": "import { takeLatest, put, call } from 'redux-saga/effects';\n\nimport {\n REQUEST_FEED_NOTIFICATIONS_SUCCESS,\n REQUEST_FEED_NOTIFICATIONS,\n REQUEST_FEED_NOTIFICATIONS_FAILU...
javascript
chosen
[ { "from": "system", "value": "Change required library with minified one\n" }, { "from": "human", "value": "let should = require('should');\nlet expect = require('chai').expect;\nlet jsdom = require('jsdom');\nlet {JSDOM} = jsdom;\nlet Shell;\ndescribe('Shell', () => {\n let {document} = (new ...
javascript
chosen
[ { "from": "system", "value": "Update workingOn initial state so it matches empty state\n" }, { "from": "human", "value": "export const initialState = {\n user: {\n isAuthenticated: false,\n email: '',\n userType: '',\n isAdmin: false\n },\n global: {\n ...
javascript
chosen
[ { "from": "system", "value": "Adjust markup and add a scrollable container with ref\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport Box from '../box';\nimport cx from 'classnames';\nimport theme from './theme.css';\n\n...
javascript
chosen
[ { "from": "system", "value": "Update the search container when terms change.\n\n[Fixes #126799709](https://www.pivotaltracker.com/story/show/126799709)\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport Promotion from '../assets/Promotion'\nimport SearchControl f...
javascript
chosen
[ { "from": "system", "value": "Resolve ES6-modules in multi-fulfiller roles\n" }, { "from": "human", "value": "import {PropTypes} from 'react'\nimport {getUnfulfilledRoleComponent} from './components/UnfulfilledRole'\n\nfunction Sanity({roles}) {\n function getRole(roleName) {\n const fulfill...
javascript
chosen
[ { "from": "system", "value": "Add test case for favicon.ico requests\n" }, { "from": "human", "value": "require('babel-polyfill');\n\nimport test from 'tape';\nimport Server from './server';\nimport requestPromise from 'request-promise';\n\ntest('Basic server operation', async t => {\n // arran...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded event for search box\n\n* PHP handles page transition and router catches it\n" }, { "from": "human", "value": "import $ from 'jquery';\nimport * as Backbone from 'backbone';\nimport Events from '../helpers/backbone-events';\n\nclass SearchBoxView ext...
javascript
chosen
[ { "from": "system", "value": "Add ES6 import to source file.\n" }, { "from": "human", "value": "var TimeSegments = {\n\n // Segment an array of events by scale\n segment(events, scale, options) {\n scale = scale || 'weeks';\n options = options || {};\n _.defaults(options, {\n sta...
javascript
chosen
[ { "from": "system", "value": "Change fields to align with schema design\n" }, { "from": "human", "value": "module.exports = [\n {\n name: 'Apples',\n notes: 'Fresh fresh apples',\n need_to_restock: false,\n user_id: null\n },\n {\n name: 'Pears',\n notes: 'I like pears',\n ...
javascript
chosen
[ { "from": "system", "value": "Update script to utilize new method names\n\nThis is a result of updating the script's dependencies in a previous\ncommit.\n" }, { "from": "human", "value": "var fs = require('fs'),\n plist = require('plist'),\n CSON = require('cson');\n\n// Read grammar f...
javascript
chosen
[ { "from": "system", "value": "Fix TypeError in category generator\n\nAvoid 'TypeError: Cannot read property 'per_page' of undefined' when the\n_config.yml does not declare `category_generator`.\n\nBuilt from c0d49fc745425ea989b9ee162b0d525d6f4c5bcf.\n" }, { "from": "human", "value": "var paginat...
javascript
chosen
[ { "from": "system", "value": "Remove uneccessary event reference from anonymous callback\n" }, { "from": "human", "value": "import '@material/mwc-dialog';\nimport '@material/mwc-button';\nimport '@material/mwc-textfield';\n\nimport '../shared/demo-header';\n\naddEventListener('load', function() ...
javascript
chosen
[ { "from": "system", "value": "Change constants from sentence to story\n" }, { "from": "human", "value": "import { createAsyncAction } from '../../lib/reduxHelpers';\nimport * as api from '../../lib/serverApi/topics';\n\nexport const FETCH_TOPIC_SPLIT_STORY_COUNT = 'FETCH_TOPIC_SENTENCE_COUNT';\n...
javascript
chosen
[ { "from": "system", "value": "Fix bug which caused shots to be fired at the wrong board\n\nPostgres (SQL) makes no promises regarding what order rows are stored /\nreturned, so we need to sort them if we are to make the assumption that\nthe 'first board' belongs to player 1.\n" }, { "from": "human",...
javascript
chosen
[ { "from": "system", "value": "Fix registering (and add really bad error feedback)\n" }, { "from": "human", "value": "define([\n 'jquery',\n 'knockout',\n 'knockout.validation',\n 'app',\n 'models/user',\n 'models/user_session'\n], function (\n $,\n ko,\n validation,\n ...
javascript
chosen
[ { "from": "system", "value": "Include only what's necessary to test locally\n" }, { "from": "human", "value": "// ==UserScript==\n// @author Robert Slifka (GitHub @rslifka)\n// @connect docs.google.com\n// @connect rslifka.github.io\n// @copyright 2017-2018, Robert Slifka (https:/...
javascript
chosen
[ { "from": "system", "value": "Fix typing of readFile function\n" }, { "from": "human", "value": "// @flow\n\n/**\n * This module exists to promisify all the fs functionality\n */\n\nimport fs from 'fs';\n// Polyfill for Node 8's util.promisify\nimport promisify from 'util.promisify';\n\nimport t...
javascript
chosen
[ { "from": "system", "value": "Add (currently failing) test for checking reactiveness of queries\n" }, { "from": "human", "value": "var expect = require('expect.js');\nvar _ = require('lodash');\nvar sampleData = require('./lib/sampleData');\nvar fruits = sampleData.f...
javascript
chosen
[ { "from": "system", "value": "Fix fetch in new object not being writable\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n function fetchPonyfill(options) {\n var Promise = options && options.Promise || self.Promise;\n var XMLHttpRequest = options && options.XMLHttpRe...
javascript
chosen
[ { "from": "system", "value": "Set circle to follow the marker\n" }, { "from": "human", "value": "$(document).ready(function () {\n\n var center = new google.maps.LatLng(35.681298, 139.766247);\n \n var mapOptions = {\n zoom: 12,\n center: center\n };\n\n var map = new google.maps.Map(...
javascript
chosen
[ { "from": "system", "value": "Set content type of api response to JSON.\n" }, { "from": "human", "value": "var helpers = require('./helpers');\nvar db = helpers.db;\n\n/* /users */\nexports.getAllUsers = function(req, res) {\n helpers.getRequestingUser(req, function(err, user) {\n \n if (...
javascript
chosen
[ { "from": "system", "value": "Make attributes -> attr calls easier to follow\n" }, { "from": "human", "value": "import injectAttr from \"./runtime/attr\";\nimport injectForOwn from \"./runtime/for-own\";\nimport toFunctionCall from \"./ast/to-function-call\";\nimport iDOMMethod from \"./idom-met...
javascript
chosen
[ { "from": "system", "value": "Add Documentation for the Request's 'encode(...)'/'decode(...)' Functions\n\nAdd in-code documentation for the request's 'encode(...)' and 'decode(...)' functions.\n" }, { "from": "human", "value": "/**\n * @flow\n */\n\ntype ReqData = Object; //TODO\ntype DecodedPa...
javascript
chosen
[ { "from": "system", "value": "Add location action updates for saving and resetting\n" }, { "from": "human", "value": "import { generateUUID } from 'react-native-database';\nimport { selectNewLocationId } from '../../selectors/Entities/location';\n\nexport const LOCATION_ACTIONS = {\n CREATE: 'L...
javascript
chosen
[ { "from": "system", "value": "Call function to return url\n" }, { "from": "human", "value": "const { renameCompanyList } = require('../repos')\nconst urls = require('../../../lib/urls')\n// istanbul ignore next: Covered by functional tests\nasync function handleEditCompanyList (req, res, next) {...
javascript
chosen
[ { "from": "system", "value": "Make Secure component use JASpinner\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport { Spinner } from 'native-base';\nimport { connect } from 'react-redux';\nimport AuthenticationScreen from '../authentication-screen';\...
javascript
chosen
[ { "from": "system", "value": "Refactor + remove AMD from boilerplate\n" }, { "from": "human", "value": "/* globals define */\nvar charming = function() {\n\n 'use strict';\n\n return function(elem, opts) {\n\n opts = opts || {};\n var tagName = opts.tagName || 'span',\n classPrefi...
javascript
chosen
[ { "from": "system", "value": "Choose a more unique name to avoid collisions\n" }, { "from": "human", "value": "/**\n * Ember responsive initializer\n *\n * Supports auto injecting media service app-wide.\n * Generated by the ember-responsive addon.\n */\nexport function initialize(application) {...
javascript
chosen
[ { "from": "system", "value": "Use ES6 class syntax for BackgroundGenerator\n\nWhy not. Move PATTERNS to private var rather than prototype property\nsince it shouldn't be modified or accessed.\n" }, { "from": "human", "value": "function BackgroundGenerator() {\n this.hue = Math.floor(Math.random...
javascript
chosen
[ { "from": "system", "value": "Fix wrong function name. Again.\n" }, { "from": "human", "value": "/*\n#\n# i2mx.js - v0.1-Alpha\n# Apache v2 License\n#\n*/\n\n// Create img2musicXML (abbreviated as i2mx) namespace\nvar i2mx = i2mx || { };\n\n// Create JsCheckup class (@TODO: Move to inside namesp...
javascript
chosen
[ { "from": "system", "value": "Update userId validation message to say 'userId' instead of 'feedSlug'\n" }, { "from": "human", "value": "var errors = require('./errors');\nvar validRe = /^[\\w-]+$/;\n\nfunction validateFeedId(feedId) {\n /*\n \t * Validate that the feedId matches the spec user:...
javascript
chosen
[ { "from": "system", "value": "Fix javascript on non-500 pages\n" }, { "from": "human", "value": "// Place all the behaviors and hooks related to the matching controller here.\n// All this logic will automatically be available in application.js.\n\nvar toggler = function() {\n var display = {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug where Quick Post generated wrong markup for code blocks\n" }, { "from": "human", "value": "'use strict';\n\n// Node modules\nconst He = require('he');\nconst Marked = require('marked');\nconst Striptags = require('striptags');\nconst Trim = require('trim');\...
javascript
chosen
[ { "from": "system", "value": "Fix the same bug for release templates\n" }, { "from": "human", "value": "'use strict';\n\nconst { get } = require('lodash') ;\nconst ERROR_TEMPLATES = require('./errors');\nconst releaseMsg = require('./release');\n\nmodule.exports = (config) => {\n return (releas...
javascript
chosen
[ { "from": "system", "value": "Add bootstrap-js and bootstrap-fonts tasks\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar less = require('gulp-less');\nvar cleanCSS = require('gulp-clean-css');\nvar sourcemaps = require('gulp-sourcemaps');\n\ngulp.task('default', ['less', 'wat...
javascript
chosen
[ { "from": "system", "value": "Fix bug in word count example" }, { "from": "human", "value": "\"use strict\";\n\n//# aims to be similiar to this \"official\" word count example\n//# https://github.com/apache/kafka/blob/0.10.0/streams/examples/src/main/java/org/apache/kafka/streams/examples/wordco...
javascript
chosen
[ { "from": "system", "value": "Add react-dom to the devDependency list for React Native projects\n" }, { "from": "human", "value": "const mergeDirs = require('merge-dirs').default;\nconst helpers = require('../../lib/helpers');\nconst path = require('path');\nconst shell = require('shelljs');\nco...
javascript
chosen
[ { "from": "system", "value": "Validate that memory database is not used in production\n" }, { "from": "human", "value": "'use strict';\n\nconst database = require('./data.json');\n\n// Starts connection\nconst connect = function () {\n return database;\n};\n\nmodule.exports = {\n connect,\n};\...
javascript
chosen
[ { "from": "system", "value": "Bring prebuilt and install versions of Electron into line\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n babel = require('gulp-babel'),\n runSequence = require('run-sequence'),\n rename = require('gulp-rename'),\n electron = require('gulp-atom...
javascript
chosen
[ { "from": "system", "value": "Fix for Gulp default task hangs" }, { "from": "human", "value": "var gulp = require('gulp');\nvar rename = require('gulp-rename');\nvar loopbackAngular = require('gulp-loopback-sdk-angular');\n\ngulp.task('default', function() {\n return gulp.src('./server/server.j...
javascript
chosen
[ { "from": "system", "value": "Return 1 in gulp when the build failed\n" }, { "from": "human", "value": "'use strict';\r\n\r\nvar source = require('vinyl-source-stream')\r\nvar streamify = require('gulp-streamify')\r\nvar browserify = require('browserify')\r\nvar babelify = require('babelify')\r\...
javascript
chosen
[ { "from": "system", "value": "Fix string template format in header breadcrumb" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport { Link } from 'react-router';\nimport Caret from '../Caret';\n\nclass Breadcrumb extends Component {\n render() {\n cons...
javascript
chosen
[ { "from": "system", "value": "Remove lodash from MemberOfRestrictions source" }, { "from": "human", "value": "var _ = require('lodash');\n\nvar MemberOfRestriction = module.exports = function(dsl, source_path) {\n this.dsl = dsl;\n this.source_path = source_path;\n};\n\nMemberOfRestriction...
javascript
chosen
[ { "from": "system", "value": "Use router to navigate to buildset\n" }, { "from": "human", "value": "zeus.simpleModule('apps.projects.views', function (views, Marionette, $) {\n\n views.ProjectLayout = Marionette.Layout.extend({\n template: \"#project-layout-template\",\n\n regio...
javascript
chosen
[ { "from": "system", "value": "Return $http request from playerModel instead of deferred\n" }, { "from": "human", "value": "export class PlayerModelService {\n\tconstructor($log, $http, $localStorage, $q, _, playersApi) {\n\t\t'ngInject';\n\n\t\tthis.$log = $log;\n\t\tthis.$http = $http;\n\t\tthi...
javascript
chosen
[ { "from": "system", "value": "Change `bind('click', ...` to `on('click', ...`\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n angular\n .module('semantic.ui.elements.checkbox', [])\n\n .directive('smCheckbox', smCheckbox);\n\n function smCheckbox() {\n return {\n...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix certain links not opening correctly\n" }, { "from": "human", "value": "import React, { useState } from 'react';\nimport { IconExternalLinkSmallOutline } from '@teamleader/ui-icons';\n\nimport Box from '../../box';\nimport Link from '../../link';\n\nimport ...
javascript
chosen
[ { "from": "system", "value": "Implement database original url lookup\n" }, { "from": "human", "value": "const add = (URL, originalURL, shortURL) => {\n const tempURL = new URL({originalURL, shortURL});\n tempURL.save((err, permURL) => {\n if(err) {\n console.err(err);\n } else {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix state editFramecontroller goes to after save is successful.\n\nFixes #6\n" }, { "from": "human", "value": "/**\n * Controller responsible for editing a specific frame in a specific game.\n */\nvar EditFrameController = function($state, $stateParams, MatchService...
javascript
chosen
[ { "from": "system", "value": "Create AssignmentPattern instead of using .defaults field\n" }, { "from": "human", "value": "/**\n * Adapter for handling of parameter together with its default value\n */\nexport default class Parameter {\n constructor(fn, param) {\n this.fn = fn;\n this.par...
javascript
chosen