conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use _.uniqueId() instead of Math.random() for dummy badges\n" }, { "from": "human", "value": "import { PROJECT_BADGE } from '~/badges/constants';\nimport { DUMMY_IMAGE_URL, TEST_HOST } from 'spec/test_constants';\n\nexport const createDummyBadge = () => {\n const i...
javascript
chosen
[ { "from": "system", "value": "Fix function propagation to child to avoid react bind warning in logs\n" }, { "from": "human", "value": "/** @jsx React.DOM */\n\nvar PersonContacts = React.createClass({\n getInitialState: function() {\n return {\n filterText:\"\"\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Fix unaesthetic bug where All Questions sidebar item is highlighted\neven when New Question sidebar item is selected and All Questions is not\n" }, { "from": "human", "value": "// @flow\n\nimport React, { Component } from \"react\";\nimport \"./AdminSidebar.css\";\n...
javascript
chosen
[ { "from": "system", "value": "Add African Studies to search\n" }, { "from": "human", "value": "module.exports = [].concat(\n require('./accounting'),\n require('./advertising'),\n require('./biomedical-engineering'),\n require('./chemical-engineering'),\n require('./chemistry'),\n require(...
javascript
chosen
[ { "from": "system", "value": "Improve branch coverage to get build green\n" }, { "from": "human", "value": "'use strict';\n\nvar Router = require('../src/js/framework/router'),\n WatchFace = require('../src/js/framework/watchFace'),\n NotificationHandler = require('../src/js/framework/watchNot...
javascript
chosen
[ { "from": "system", "value": ":art: Fix store path for Clock module\n" }, { "from": "human", "value": "import store, { getSettingsObject } from '../utils/store';\n\nexport const refresh = () =>\n store.state = {...store.state, ...getSettingsObject()};\n" }, { "from": "gpt", "value...
javascript
chosen
[ { "from": "system", "value": "Check for existance of element\n" }, { "from": "human", "value": "(function () {\n\n 'use strict';\n\n var suSift = {\n \n pick: '.su_basket--pick',\n drop: '.su_basket--drop',\n \n pickBasket: function () {\n \n var basket = document.quer...
javascript
chosen
[ { "from": "system", "value": "Fix eslint config file checks.\n" }, { "from": "human", "value": "'use strict';\n\n// Load modules\n\nconst Fs = require('fs');\nconst Path = require('path');\nconst Eslint = require('eslint');\nconst Hoek = require('hoek');\n\n// Declare internals\n\nconst internal...
javascript
chosen
[ { "from": "system", "value": "Throw an exception if env vars not set.\n" }, { "from": "human", "value": "\"use strict\";\r\n\r\nvar os = require(\"os\"),\r\n path = require(\"path\"),\r\n express = require(\"express\"),\r\n routes = require(\"./routes\");\r\n\r\nvar app = express(),\r\n...
javascript
chosen
[ { "from": "system", "value": "Refactor spaceCase to combine \"clean\" & \"replace\" into one regex\n" }, { "from": "human", "value": "const spaceCase = (a) => {\n return a\n .replace(/(_|-|\\.)/g, ' ')\n .replace(/([A-Z])/g, ' $1')\n .replace(/\\s+/g, ' ')\n .replace(/(^\\s|\\s$)/g,...
javascript
chosen
[ { "from": "system", "value": "Replace string class with constant\n" }, { "from": "human", "value": " /* global Event, assert, process, setup, suite, test */\n\nvar CANVAS_GRAB_CLASS = 'a-grab-cursor';\nvar GRABBING_CLASS = 'a-grabbing';\n\nsuite('look-controls', function () {\n setup(function (...
javascript
chosen
[ { "from": "system", "value": "Modify routes.js to take two additional arguments\n" }, { "from": "human", "value": "const express = require('express');\nconst path = require('path');\nconst app = express();\nconst db = require('../database/schemas.js');\nrequire('./routes.js')(app, db);\n\nconst ...
javascript
chosen
[ { "from": "system", "value": "Remove \"edX\" from the logout popup message\n\nNot using `settings.PLATFORM_NAME` because sharing it with this script would need too much platform changes for this small error.\r\n\r\nRemoving the word \"edX\" makes the statement more accurate for other forks. Generally there ...
javascript
chosen
[ { "from": "system", "value": "Create full video list item\n" }, { "from": "human", "value": "import React from 'react';\n\nconst VideoListItem = (props) => {\n console.log('Video list item props:' + props)\n return <li >video</li>\n};\n\nexport default VideoListItem;" }, { "from": ...
javascript
chosen
[ { "from": "system", "value": "Fix ui/main to call ui/ui correctly.\n" }, { "from": "human", "value": "define(['./client_secrets', 'ui/main'], function (secrets, ui) {\n var client_id = secrets.web.client_id,\n scopes = [\n 'https://www.googleapis.com/auth/drive'\n ],\...
javascript
chosen
[ { "from": "system", "value": "Simplify computation of photo width\n" }, { "from": "human", "value": "import { MAX_PHOTO_WIDTH_IN_PX } from '../constants';\n\nexport const getRestaurantId = restaurant => restaurant.place_id;\n\nexport const getRestaurantLocation = restaurant => restaurant.geometr...
javascript
chosen
[ { "from": "system", "value": "Remove trailing slash from comment blocks\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nvar COMMENT_START = /^\\s*\\/\\*\\*/,\n COMMENT_END = /^\\s*\\*\\//;\n\n/**\n * This service reads LESS files and extract jsdoc styles comments.\n * It doesn'...
javascript
chosen
[ { "from": "system", "value": "Add event listener to JS code\n" }, { "from": "human", "value": "var photos = document.getElementsByTagName(\"img\");\nartsyPhoto = photos[0];\nlaunchPhoto = photos[1];\n\nconsole.log(artsyPhoto);\nconsole.log(launchPhoto);\nartsyPhoto.style.border = \"10px dotted p...
javascript
chosen
[ { "from": "system", "value": "Fix up put webpack build\n" }, { "from": "human", "value": "const nodeExternals = require('webpack-node-externals');\nconst path = require('path');\n\nmodule.exports = {\n target: 'node',\n externals: [nodeExternals()],\n entry: {\n authorizerGithub: ['./boots...
javascript
chosen
[ { "from": "system", "value": "Fix webpack module resolving rule\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\nvar HtmlWebpackPlugin = require('html-webpack-plugin');\n\nmodule.exports = {\n context: __dirname,\n entry: './client-test/client....
javascript
chosen
[ { "from": "system", "value": "Add reference to memory to base role.\n" }, { "from": "human", "value": "'use strict';\n\nlet counts = require('counts');\n\nclass BaseRole {\n constructor(creep) {\n this.creep = creep;\n this.spawn = Game.spawns[creep.memory.spawnName];\n }\n\n...
javascript
chosen
[ { "from": "system", "value": "Use $uibModalInstance in login controller\n" }, { "from": "human", "value": "export default /*@ngInject*/class LoginController{\n constructor(user,$modalInstance){\n this.user = user;\n this.$modalInstance = $modalInstance;\n this.data = {};\n this.logi...
javascript
chosen
[ { "from": "system", "value": "Add reason why abernix/meteord:base is needed\n" }, { "from": "human", "value": "const mailUser = 'postmaster@blah.mailgun.org';\nconst mailPass = 'b4da55';\nconst mailServer = 'smtp.mailgun.org';\nconst mailPort = '587';\n\n\nmodule.exports = {\n servers: {\n o...
javascript
chosen
[ { "from": "system", "value": "Test for when objects touch\n" }, { "from": "human", "value": "collisions = TestCase(\"collisions\");\n\ncollisions.prototype.testMiss = function() {\n\tvar miss = nitch.collision.AABB({\n\t\twidth: 200,\n\t\theight: 100,\n\t\tx: 30,\n\t\ty: 50\t\n\t\t}, {\n\t\twidt...
javascript
chosen
[ { "from": "system", "value": "Remove initialiser for removed lightbox\n\nThis lightbox was used on people pages where the role had more than one\nassociated organisation. We are no longer showing these as a list, but\nas a sentence at the bottom of the role so this can go\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Add first basic test of Util.merge\n" }, { "from": "human", "value": "var Util = require('../lib/util'),\nnode_util = require('util'),\nvows = require('wompt_dependencies').vows;\n\nvar suite = vows.describe('Util module');\n\nsuite.addBatch({\n\t'Util.merge':{\n\t\...
javascript
chosen
[ { "from": "system", "value": "Fix typo in Room Maintainer\n" }, { "from": "human", "value": "module.exports = function RoomMaintainer() {\n return {\n updateRooms: function () {\n Object.keys(Game.Rooms).forEach(function (room) {\n this.maintainRoom(room);\n ...
javascript
chosen
[ { "from": "system", "value": "Make sure the URL returned by buildModuleUrl actually loads.\n" }, { "from": "human", "value": "/*global defineSuite */\ndefineSuite([\n 'Core/buildModuleUrl',\n 'ThirdParty/Uri'\n ], function(\n buildModuleUrl,\n Uri) {\n \"us...
javascript
chosen
[ { "from": "system", "value": "Include pathname in api url\n" }, { "from": "human", "value": "(function() {\r\n angular.module(\"lsaas\", [])\r\n .controller(\"lsaasController\", [\"$scope\", \"$window\", function($scope, $window) {\r\n $scope.placeholder = \"YOUR TEXT HERE\";\r\n ...
javascript
chosen
[ { "from": "system", "value": "Revert \"dont pass bdajax. get it from window\"\n\nThis reverts commit 05393ce7c10b99eca03f1c8fb5c8f1a3abcc32b1.\n" }, { "from": "human", "value": "/* jslint browser: true */\n/* global jQuery */\n(function($) {\n \"use strict\";\n\n $(document).ready(function...
javascript
chosen
[ { "from": "system", "value": "Fix webpack setup for production builds\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar path = require('path');\n\nvar BUILD_DIR = path.resolve(__dirname, 'public', 'dist');\nvar APP_DIR = path.resolve(__dirname, 'src');\nvar API_BASE_URL =...
javascript
chosen
[ { "from": "system", "value": "fix: Allow passing any renderable content for label\n\nfix #121\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport styleClassNames from './prop-types';\n\nconst ComponentCommon = () => (\n <h1>This component j...
javascript
chosen
[ { "from": "system", "value": "Apply all xhr instance properties and methods\n" }, { "from": "human", "value": "import { baseInterceptor } from './baseInterceptor';\nimport { nativeXHR } from '../helpers/nativeServices';\n\nexport const name = 'XMLHttpRequest';\nexport const Reference = nativeXHR...
javascript
chosen
[ { "from": "system", "value": "Fix syntax of generated ==\n" }, { "from": "human", "value": "const R = require('ramda')\n\nconst indentLines = require('./utils/indentLines')\nconst associatedNamesForCase = require('./utils/associatedNamesForCase')\n\n\nconst equatesForAssociatedNames = R.pipe(\n\...
javascript
chosen
[ { "from": "system", "value": "Update default image for borked images\n" }, { "from": "human", "value": "/**\n * Wait until the DOM is ready.\n *\n * @param {Function} fn\n */\nimport { flatMap, keyBy } from 'lodash';\n\nexport function ready(fn) {\n if (document.readyState !== 'loading'){\n ...
javascript
chosen
[ { "from": "system", "value": "Add option for providing path to grunt\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar chalk = require('chalk');\nvar spawn = require('child_process').spawn;\n\nvar isWindows = process.platform === 'win32';\n\nmodule.exports = fu...
javascript
chosen
[ { "from": "system", "value": "Add brace to shorthand IF statement and declare links variable.\n" }, { "from": "human", "value": "// Obtain ALL anchors on the page.\nlinks = document.links;\n\n// The previous/next urls if they exist.\nvar previous = findHref(\"prev\");\nvar next = findHref(\"next...
javascript
chosen
[ { "from": "system", "value": "Add test for applying `over` with `prop`\n" }, { "from": "human", "value": "/* @flow */\n\nimport chai from 'chai'\nimport { get, set } from '../lens'\nimport { prop } from '../es2015'\n\nconst expect = chai.expect\ndeclare var describe;\ndeclare var it;\n\ntype Obj...
javascript
chosen
[ { "from": "system", "value": "Include `bundled` in the test\n" }, { "from": "human", "value": "'use strict'\n\nvar assert = require('assert')\nvar dependenciesToArray = require('../')\n\nassert.deepEqual(dependenciesToArray({\n dependencies: {\n foo: '^1.0.0'\n }\n}), [\n { package: 'foo',...
javascript
chosen
[ { "from": "system", "value": "Set default load speed to 250 ms\n" }, { "from": "human", "value": "$(function(){\n $('.cd-slideshow').each(function(){\n var $this = this;\n var pageSpeed = ifDataExists($this, 'page-speed', 5000);\n var fadeSpeed = ifDataExists($this, 'fade-speed', 1000)...
javascript
chosen
[ { "from": "system", "value": "Make test data more unique to avoid overlap\n" }, { "from": "human", "value": "const DOMAIN = 'foo.bar';\n\nexport const UNKNOWN = {\n status: 999,\n statusText: 'Unknown - something unexpected happened.',\n};\nexport const ERR = new Error('Set sail for fail!');\n...
javascript
chosen
[ { "from": "system", "value": "Fix bugs from thrown exceptions\n\nIn the drag and drop functions, variables are checked if null before being worked on. This stops exceptions from being thrown and further bugs from happening.\n" }, { "from": "human", "value": "/* Source file for graphical function...
javascript
chosen
[ { "from": "system", "value": "Update bin/ for parameter validation.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/*\n * Module dependencies.\n */\n\nvar fs = require('fs');\nvar path = require('path');\nvar program = require('commander');\nvar web2splash = require('./../lib/web2spla...
javascript
chosen
[ { "from": "system", "value": "Add helper go get quality of movie\n" }, { "from": "human", "value": "import _ from 'lodash';\n\nexport function sanitizeTitle(title) {\n let result = title.toLowerCase();\n result = result.indexOf('2015') != -1 ? result.split('2015')[0] : result.split('2014')[0];...
javascript
chosen
[ { "from": "system", "value": "Fix vote selector after updating vote data structure\n" }, { "from": "human", "value": "import { getIssue } from './issues';\n\nexport const getOwnVoteForIssue = (issue, userId) => {\n // No issue? User haven't voted.\n if (!issue || !Object.keys(issue).length) re...
javascript
chosen
[ { "from": "system", "value": "Remove the need to leave holes in the filter array\n" }, { "from": "human", "value": "var _ = require('underscore');\nvar Backbone = require('backbone');\n\nmodule.exports = Backbone.Collection.extend({\n toJSON: function () {\n var json = {};\n var activeFil...
javascript
chosen
[ { "from": "system", "value": "Fix auto-unfold CWs when no regexp is set\n\nFixes #778\n" }, { "from": "human", "value": "export function autoUnfoldCW (settings, status) {\n if (!settings.getIn(['content_warnings', 'auto_unfold'])) {\n return false;\n }\n\n const rawRegex = settings.getIn([...
javascript
chosen
[ { "from": "system", "value": "Use right offest, not 0\n" }, { "from": "human", "value": "$(function () {\n var nav_offset = $('#navigation').offset().top;\n $(window).scroll(function () {\n $('#navigation').css('position', ($(window).scrollTop() - nav_offset > 0) ? 'fixed' : 'relati...
javascript
chosen
[ { "from": "system", "value": "Change search type to cross_fields and operator to and\n" }, { "from": "human", "value": "var module = angular.module('JGivenApp',['ngSanitize']);\n\nvar elasticSearchHost = 'localhost'\n\nmodule.controller(\n 'ApplicationController',\n ['$scope', '$http',\n ...
javascript
chosen
[ { "from": "system", "value": "Update file to use http\n" }, { "from": "human", "value": "/*jshint quotmark:double */\n\"use strict\";\n\nangular.module(\"constants\", [])\n\n.constant(\"API_URL\", \"https://secxbrl-test.beta.28.io/v1\")\n\n.constant(\"DEBUG\", true)\n\n.constant(\"HTML5\", true)...
javascript
chosen
[ { "from": "system", "value": "Add before each reset to format add\n" }, { "from": "human", "value": "'use strict';\n\n// Load chai\nconst chai = require('chai');\nconst expect = chai.expect;\n\n// Load our module\nconst format = require('../../../../app/lib/queue/format');\n\n// Describe the mod...
javascript
chosen
[ { "from": "system", "value": "Fix submit-on-change handling for selects\n\nI was under the false impression that it was necessary, and safe, to\nlisten to the click event as well as the change. In fact, that's not\nrequired and causes buggy behaviour in some browsers.\n" }, { "from": "human", "v...
javascript
chosen
[ { "from": "system", "value": "Handle invalid / absent credentials\n" }, { "from": "human", "value": "'use strict';\n\nvar Store = require('../core/Store');\nvar Dispatcher = require('../core/Dispatcher');\nvar ActionTypes = require('../constants/ActionTypes');\n\n/**\n * @typedef Credentials\n *...
javascript
chosen
[ { "from": "system", "value": "Update stateProvider state for user show\n" }, { "from": "human", "value": "(function(){\n'use strict';\n\nangular\n .module('secondLead', \n \t['ngDragDrop', \n \t'ui.bootstrap',\n \t'ui.router', \n \t'gridster',\n \t'restangular',\n 'angularUtils.directiv...
javascript
chosen
[ { "from": "system", "value": "Upd: Normalize behaviour of getVersionNumber on windows.\n\nThe windows version returns `2.2.9.0`, whereas the iOS and android version limit it to `2.2.9`." }, { "from": "human", "value": "AppVersionProxy = {\n getVersionNumber: function (successCallback, failCallb...
javascript
chosen
[ { "from": "system", "value": "Update i18n initializer in tests to use official moment methods\n" }, { "from": "human", "value": "import EmberObject from '@ember/object';\nimport moment from 'moment';\n\nexport default {\n name: 'setup-pikaday-i18n',\n initialize() {\n const i18n = EmberObje...
javascript
chosen
[ { "from": "system", "value": "Add owner to meta properties\n" }, { "from": "human", "value": "'use strict';\n\nvar primitiveSet = require('es5-ext/object/primitive-set');\n\nmodule.exports = primitiveSet('constructor', 'clear', 'database', 'delete',\n\t'entries', 'forEach', 'has', 'key', 'keys',...
javascript
chosen
[ { "from": "system", "value": "Use graceful-fs in place of fs\n\nChange generate-requires.js to use the graceful-fs module instead of fs. This is to avoid EMFILE errors on OSX because the maximum number of file descriptors have been reached.\n" }, { "from": "human", "value": "var fs = require('fs...
javascript
chosen
[ { "from": "system", "value": "Support Round Parameter in Linear Component\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport scale from '../../mixins/e3-scale';\nimport linear from '../../utils/shadow/scales/linear';\n\nexport default Ember.Component.extend(scale, {\n name: '...
javascript
chosen
[ { "from": "system", "value": "Fix issue observed in jenkins errors (missing comma)" }, { "from": "human", "value": "/* global UTILS */\n\n'use strict';\n\nangular.module('alienUiApp').factory('appEnvMngrService', ['applicationEnvironmentServices',\nfunction(applicationEnvironmentServices) {\n r...
javascript
chosen
[ { "from": "system", "value": "Add test with other option\n" }, { "from": "human", "value": "var should = require('should');\nvar exec = require('child_process').exec;\n\n// Expected Output\n// error: option `-e, --except <exception>' argument missing\n\nfunction shouldBeCommandFailed(error) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use Object.assign in Broccoli plugin\n" }, { "from": "human", "value": "'use strict';\n\nvar Filter = require('broccoli-filter'),\n objectAssign = require('object-assign'),\n postcss = require('postcss'),\n util = require('util');\n\nmodu...
javascript
chosen
[ { "from": "system", "value": "Replace static tasks with mongodb-backed tasks\n" }, { "from": "human", "value": "\"use strict\";\n\n/* global Meteor */\n/* global Template */\n\nif (Meteor.isClient) {\n\tTemplate.body.helpers({\n\t\ttasks: [\n\t\t\t{text: 'task 1'},\n\t\t\t{text: 'task 2'},\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Add a slight delay to bring up drag handle\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.core').directive('arethusaGridHandle', [\n function() {\n return {\n restrict: 'E',\n scope: true,\n link: function(scope, el...
javascript
chosen
[ { "from": "system", "value": "Use async patterns for max-xp command.\n" }, { "from": "human", "value": "const {Command} = require('./index.js');\nconst maxXpOptions = {\n\tdescription: 'Get your top 10 *max-xp* values.',\n\tpassRecord: true,\n\tsignatures: ['@BOTNAME max-xp']\n};\nconst unknownT...
javascript
chosen
[ { "from": "system", "value": "Use correct function when unubscribing, we were leaking eventlisteners\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n var app = this.app\n , _ = require('lodash')\n , debug = require('debug')('signalk-server:interfaces:ws')\...
javascript
chosen
[ { "from": "system", "value": "Fix some issues after changing the logo\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport GraphiQL from 'graphiql';\nimport fetch from 'isomorphic-fetch';\nimport Schema from './schema.js';\n\nGraphiQL.Logo = class Logo extends Com...
javascript
chosen
[ { "from": "system", "value": "Send message where there are no members present at the office\n" }, { "from": "human", "value": "// Description:\n// Check who's at the office\n//\n// Commands\n// @kontoret / @office - Reply with everyone at the office\n\nconst _ = require('lodash');\nconst pre...
javascript
chosen
[ { "from": "system", "value": "fix: Make prettier output of logs\n" }, { "from": "human", "value": "import moment from 'moment';\nimport React, { PropTypes } from 'react';\nimport { get, map } from 'lodash';\n\nimport './ProjectDetails.styl';\n\nconst ProjectDetails = ({ project }) => (\n <div c...
javascript
chosen
[ { "from": "system", "value": "Use temporary var to avoid array item lookup\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports.getValidUrl = (_urls) => {\n for (var i = 0, l = _urls.length; i < l; ++i) {\n if (_urls[i] && typeof _urls[i] === 'string' && (_urls[i].indexOf('amqp...
javascript
chosen
[ { "from": "system", "value": "Clean it up a little bit\n" }, { "from": "human", "value": "import { runInContext, createContext } from 'vm';\nimport { stripIndent } from 'common-tags';\nimport importFrom from 'import-from';\nimport Promise from 'bluebird';\n\nfunction createScriptBlock(node) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix dispatcher stopping bug when using <Listener> component" }, { "from": "human", "value": "const React = require(\"react\")\nconst {merge} = require(\"./util\")\n\nexport class Listener extends React.Component {\n constructor(props) {\n super(props)\n const...
javascript
chosen
[ { "from": "system", "value": "Change wireframe cube to resemble other cube samples\n" }, { "from": "human", "value": "(function() {\n\n window.samples.spinning_wireframe_cube = {\n\n initialize: function(canvas) {\n var scene = new THREE.Scene();\n\n var camera = new THREE.Perspect...
javascript
chosen
[ { "from": "system", "value": "Add Sequelize to Nodee inject\n" }, { "from": "human", "value": "export { default as Controller } from './base/controller';\nexport { default as Exception } from './base/exception';\nexport { default as DbDriver } from './base/db-driver';\nexport { default as Mongoo...
javascript
chosen
[ { "from": "system", "value": "Add email address and proxy policy to troupes\n" }, { "from": "human", "value": "define([\n \"jquery\",\n \"backbone\",\n \"backform\"\n], function( $, Backbone, Backform) {\n var Form = Backform.Form.extend({\n fields: [\n {name: \"nam...
javascript
chosen
[ { "from": "system", "value": "Add util to node namedExports\n" }, { "from": "human", "value": "export default {\n declarationKeyword: 'const',\n\n // As listed in https://github.com/nodejs/node/tree/master/lib\n //\n // Note that we do not include `process` in this list because that is\n //...
javascript
chosen
[ { "from": "system", "value": "Add ability to save entity\n" }, { "from": "human", "value": "import React, {PropTypes} from 'react';\n\nclass CmsApp extends React.Component {\n constructor(props) {\n super(props);\n this.props.actions.addEntity = this.props.actions.addEntity.bind(this);\n ...
javascript
chosen
[ { "from": "system", "value": "Add event query parameter when creating an opportunity.\n" }, { "from": "human", "value": "$(function() {\n populatePrefilled('interests');\n populatePrefilled('skills');\n});\n" }, { "from": "gpt", "value": "$(function() {\n populatePrefilled('intere...
javascript
chosen
[ { "from": "system", "value": "Remove commented code lines in js\n" }, { "from": "human", "value": "/*\n$(document).ready(function(){\n\n $(\".birthday\").hide();\n\n var $inputs = $('input[name=phone-p], input[name=phone-g], input[name=phone-m], input[name=email]');\n $inputs.on('input'...
javascript
chosen
[ { "from": "human", "value": "Correct work added in the right file\n" }, { "from": "gpt", "value": "//Question\n//Write a function once that accepts a callback as input and returns a function. When the returned function is called the first time, it should call the callback and return that output....
javascript
chosen
[ { "from": "system", "value": "Remove extra whitespace before authorname. General whitespace cleanup.\n" }, { "from": "human", "value": "// ==========================================================================\n// <%= controller_class_name %>\n// ============================================...
javascript
chosen
[ { "from": "system", "value": "Replace all spaces in generated component names\n" }, { "from": "human", "value": "'use strict';\nvar util = require('util');\nvar yeoman = require('yeoman-generator');\nvar fs = require('fs');\n\nvar ComponentGenerator = module.exports = function ComponentGenerator...
javascript
chosen
[ { "from": "system", "value": "Remove old \"copy source\" task reference.\n" }, { "from": "human", "value": "module.exports = {\n sass: {\n files: [\"scss/**/*.{scss,sass}\"],\n tasks: [\"scsslint:all\", \"copy:source\", \"sass:compile\"]\n },\n js: {\n files: [\"js/**/*.js\", \"tests...
javascript
chosen
[ { "from": "system", "value": "Change reference to api module in tests\n" }, { "from": "human", "value": "var assert = require('assert'),\n textmail = require('../lib/mailer.js');\n\ndescribe('textmail', function() {\n describe('@transport', function() {\n it('should have a transport...
javascript
chosen
[ { "from": "system", "value": "Remove test for PPTx. Working on this machine.\n" }, { "from": "human", "value": "'use strict';\n\nrequire('should');\n\nvar office = require('../lib/hydrater-office');\n\n\ndescribe('Test office results', function() {\n it('returns the correct informations for doc...
javascript
chosen
[ { "from": "system", "value": "Remove Ember Try scenario for Ember 1.13\n" }, { "from": "human", "value": "/*jshint node:true*/\nmodule.exports = {\n scenarios: [\n {\n name: 'default',\n bower: {\n dependencies: { }\n }\n },\n {\n name: 'ember-1.13',\n b...
javascript
chosen
[ { "from": "system", "value": "Clean up the text pasted into the medium editor\n" }, { "from": "human", "value": "$(function(){\n var $replyMessage = $('[data-reply-to-message]');\n\n var editor = new MediumEditor($replyMessage, {\n placeholder: $replyMessage.attr('placeholder')\n });\n\n ...
javascript
chosen
[ { "from": "system", "value": "Change default dataset for Fire Alerts widget to VIIRS instead of MODIS\n" }, { "from": "human", "value": "export default {\n period: 'week',\n weeks: 13,\n dataset: 'MODIS',\n layerStartDate: null,\n layerEndDate: null\n};\n" }, { "from": "gpt", "v...
javascript
chosen
[ { "from": "system", "value": "Remove ember 1.10 testing scenario\n" }, { "from": "human", "value": "/*jshint node:true*/\nfunction scenario(emberVersion) {\n return {\n name: 'ember-' + emberVersion,\n bower: {\n dependencies: {\n 'ember': '~' + emberVersion + '.0'\n },\n...
javascript
chosen
[ { "from": "system", "value": "Enable Redux DevTools in dev\n" }, { "from": "human", "value": "/* eslint global-require: 0 */\nimport { createStore, applyMiddleware } from 'redux';\nimport thunk from 'redux-thunk';\nimport rootReducer from '../modules/reducer';\nimport Immutable from 'immutable';...
javascript
chosen
[ { "from": "system", "value": "Add filter for tags autocomplete for creating a new bookmark\n" }, { "from": "human", "value": "(function(){\n 'use strict'\n\n const New = {\n templateUrl: 'pages/new/new.html',\n controllerAs: 'model',\n controller: function(BookmarkFactory, TagFactory,...
javascript
chosen
[ { "from": "system", "value": "Add PUT route to switch modules on/off.\n" }, { "from": "human", "value": "// Dependencies\nvar net = require('net'),\n express = require('express'),\n exec = require('child_process').exec;\n\n// mochad client\nvar client;\n\nfunction setupConnection() {\n ...
javascript
chosen
[ { "from": "system", "value": "feat(redux): Add cache to store initialisation\n" }, { "from": "human", "value": "import config from '-/config';\nimport configureStore from './configure';\nimport { loadState, saveState } from './localStorage';\nimport { invokeAfterUninterruptedDelay } from '~/util...
javascript
chosen
[ { "from": "system", "value": "Add changed use of currency\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nimport currency from 'currency.js';\n\nexport const selectPrescriptionSubTotal = ({ payment }) => {\n const { transaction } = paym...
javascript
chosen
[ { "from": "system", "value": ":new: Add a proper dispose to UI class\n" }, { "from": "human", "value": "'use babel'\n\nexport class LinterUI {\n static name = 'Linter'\n\n constructor(editors) {\n this.editors = editors\n }\n\n dispose() {\n\n }\n}\n" }, { "from": "gpt", "val...
javascript
chosen
[ { "from": "system", "value": "Add jsdocs back. Migrate to rex in string parser.\n" }, { "from": "human", "value": "var lilswf = function(){\n var window,\n undefined,\n self = this;\n self.raw = \"\",\n self.version = [],\n self.installed = self.isCool = fal...
javascript
chosen
[ { "from": "system", "value": "Use hash mode for router as server can't be changed for use with history mode.\n" }, { "from": "human", "value": "import Vue from 'vue';\nimport VueRouter from 'vue-router';\nimport RestaurantList from '../components/RestaurantList.vue'\n\nVue.use(VueRouter);\n\ncon...
javascript
chosen
[ { "from": "system", "value": "Support instantiation without new operator\n" }, { "from": "human", "value": "(function(win){\n 'use strict';\n\n var paramRe = /:([^\\/.\\\\]+)/g;\n\n function Router(){\n this.routes = [];\n }\n\n Router.prototype.route = function(path, fn){\...
javascript
chosen
[ { "from": "system", "value": "Remove setting response status code on permission validation\n" }, { "from": "human", "value": "const Factories = use('core/factories');\nconst Errors = use('core/errors');\n\nconst PermissionsFactory = Factories('Permission...
javascript
chosen
[ { "from": "system", "value": "Fix gulp task syntax error\n" }, { "from": "human", "value": "import gulp from 'gulp';\nimport loadPlugins from 'gulp-load-plugins';\nimport browserSync from 'browser-sync';\n\nconst $ = loadPlugins();\nconst bs = browserSync.create();\n\ngulp.task('serve:test', ['s...
javascript
chosen