conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Comment devtool evals in Webpack (Source maps weren't working)\n" }, { "from": "human", "value": "var path = require('path');\nvar ExtractTextPlugin = require('extract-text-webpack-plugin');\n\nmodule.exports = {\n devtool: 'eval',\n debug: true,\n e...
javascript
chosen
[ { "from": "system", "value": "Update webpack file template for latest version\n\nWebpack 4 has some syntax changes, mainly using rules key instead of plugin." }, { "from": "human", "value": "module.exports = {\n entry: [\n ${1:'./app/main.js'}\n ],\n output: {\n path: __di...
javascript
chosen
[ { "from": "system", "value": "Test code and buy properties\n" }, { "from": "human", "value": "import { expect } from 'chai';\n\nimport NBG from '../src/banks/NBG';\nimport CreditAgricole from '../src/banks/CreditAgricole';\nimport CBE from '../src/banks/CBE';\n\nconst { describe, it } = global;\...
javascript
chosen
[ { "from": "system", "value": "Load all files for coverage reporting\n" }, { "from": "human", "value": "require('babel-polyfill');\n\n// require all test files matching 'lib/**/tests/*-test'\nconst requireTest = require.context('../lib/', true, /(.*?)\\/tests\\/(.*?)-test/);\nrequireTest.keys().f...
javascript
chosen
[ { "from": "system", "value": "Remove unused constants from initial state.\n" }, { "from": "human", "value": "import { List, Map, fromJS } from 'immutable';\nimport moment from 'moment';\n\nexport const initialTask = fromJS({\n waypoints: [\n {\n name: 'Bicester Airfield',\n positio...
javascript
chosen
[ { "from": "system", "value": "Remove , use bridge instead\n" }, { "from": "human", "value": "'use strict';\n\nangular\n .module('irma')\n .factory('resultsManager', resultsManager);\n\nresultsManager.$inject = ['$http', '$q', '$log', 'Result'];\n\nfunction resultsManager($http, $q, $log, Resul...
javascript
chosen
[ { "from": "system", "value": "Use searchRoute property instead of function\n" }, { "from": "human", "value": "angular.module('OpiferEntityPicker', ['ui.bootstrap.typeahead'])\n\n .directive('entityPicker', function() {\n\n var tpl =\n '<input type=\"text\" ng-model=\"search\...
javascript
chosen
[ { "from": "system", "value": "DPRO-435: Comment out console.log for IE compatibility\n" }, { "from": "human", "value": "/*\n * Querying the ALM API.\n */\n(function ($) {\n\n function validateDOI(doi) {\n if (doi == null) {\n throw new Error('DOI is null.');\n }\n\n doi = encodeUR...
javascript
chosen
[ { "from": "system", "value": "Include child-compilation errors when handling test errors\n\nwhen `stats.hasErrors()` returns true, we might have errors in `info.errors`, or\nwe might have them in, say, `info.children[0].errors`\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = ...
javascript
chosen
[ { "from": "system", "value": "Use dropdown list for test data.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport Popover from 'material-ui/Popover';\nimport { faintBlack, cyan500 } from 'material-ui/styles/colors';\nimport ActionHelpOutline from 'material-ui/sv...
javascript
chosen
[ { "from": "system", "value": "Add Mentions Post MessageTypes to whitelist\n\nfixes VICe-1925\n\nTest Plan\n1. With an LTI enabled on discussions, pull down the change\n2. Validate that Discussions has Redesign and Mentions FF enabled\n3. Trigger a discussion with @ and navigate with up and down arrows\n4. N...
javascript
chosen
[ { "from": "system", "value": "Add empty default value for model actions\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from \"react-redux\";\nimport {FormGroup, InputGroup, TextArea} from \"@blueprintjs/core\";\nimport { updateModel } from \"../....
javascript
chosen
[ { "from": "system", "value": "Simplify the cassandra client setup\n\n- The connection is now maintained implicitly. There is no need to handle\n reconnecting manually.\n- We can use promisifyAll instead of doing this manually.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar cass = req...
javascript
chosen
[ { "from": "system", "value": "Fix prompt arrow on backspace\n\n" }, { "from": "human", "value": "/**\n * Chat interface\n * really really simple, but im not sure what else to add for now?\n **/\n\nconst Callback = require('events');\nconst readline = require('readline');\n\nclass QuestionCallbac...
javascript
chosen
[ { "from": "system", "value": "Remove @visibility JsDoc annotations from js/ts/css/gss files.\n\nRELNOTES: n/a\nPiperOrigin-RevId: 310968210\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @file...
javascript
chosen
[ { "from": "system", "value": "Change to more logical method name\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport axios from 'axios';\nimport Modal from './modal';\n\nexport default class QrModal extends Component {\n\n constructor(props) {\n super(props);...
javascript
chosen
[ { "from": "system", "value": "Handle incoming contract proposal updates\n" }, { "from": "human", "value": "import { Map, fromJS } from 'immutable';\n\nimport {\n SERVER_DATA_PORTFOLIO,\n SERVER_DATA_PROPOSAL_OPEN_CONTRACT,\n DETAILS_FOR_CONTRACT,\n} from '../_constants/ActionTypes';\n\n...
javascript
chosen
[ { "from": "system", "value": "Store date when viewing a month\n" }, { "from": "human", "value": "var calendar;\n$(document).ready(function() {\n var calendar_container = document.getElementById('calendar');\n if (!calendar_container) { return }\n\n calendar = new FullCalendar.Calendar(calenda...
javascript
chosen
[ { "from": "system", "value": "Add test for base64 encoded fonts\n" }, { "from": "human", "value": "import checkFontFormat from '../checkFontFormat'\n\ndescribe('Checking the font format', () => {\n it('should return the correct format', () => {\n expect(checkFontFormat('foo.ttf')).toEqual('t...
javascript
chosen
[ { "from": "system", "value": "Make things fail, so it becomes a kata." }, { "from": "human", "value": "// 15: destructuring - rename\n// To do: make all tests pass, leave the assert lines unchanged!\n\ndescribe('rename variables while destructuring', () => {\n\n it('rename object key', () => {\...
javascript
chosen
[ { "from": "system", "value": "Clear input value after submission\n" }, { "from": "human", "value": "function getCurrentUserEmail() {\n var currentUser = Meteor.user();\n var emailsArray = currentUser.emails;\n var firstEmail = emailsArray[0];\n return firstEmail.address;\n}\n\nTempla...
javascript
chosen
[ { "from": "system", "value": "Disable implicit import by default\n\nThis way we can override settings: https://github.com/LearnBoost/stylus/issues/1392" }, { "from": "human", "value": "module.exports = function(opts) {\n var implicit = (opts && opts.implicit == false) ? false : true;\n return ...
javascript
chosen
[ { "from": "system", "value": "Add default bounds value if missing\n" }, { "from": "human", "value": "import DS from \"ember-data\";\n\nexport default DS.RESTSerializer.extend({\n serialize: function(section) {\n var bounds = section.get('bounds'), \n json = {\n title: section...
javascript
chosen
[ { "from": "system", "value": "Update code to use promises\n" }, { "from": "human", "value": "/**\n * @file cat command\n * @author Sankarsan Kampa (a.k.a k3rn31p4nic)\n * @license GPL-3.0\n */\n\nconst request = xrequire('request-promise-native');\n\nexports.exec = async (Bastion, message) => {\...
javascript
chosen
[ { "from": "system", "value": "FIX ember docs generation if the component parameter is missing (for whatever reason)\n" }, { "from": "human", "value": "/* eslint-disable no-underscore-dangle */\n/* global window */\n\nexport const setJSONDoc = jsondoc => {\n window.__EMBER_GENERATED_DOC_JSON__ =...
javascript
chosen
[ { "from": "system", "value": "Remove dangling comma in array [test file]" }, { "from": "human", "value": "module.exports = {\n plugins: ['ghost'],\n extends: [\n 'plugin:ghost/test',\n ]\n};\n" }, { "from": "gpt", "value": "module.exports = {\n plugins: ['ghost'],\...
javascript
chosen
[ { "from": "system", "value": "Align validation. Only allow one response. Fix variable name, Include hash key in row insertion\n" }, { "from": "human", "value": "'use strict';\n\nconst AWS = require('aws-sdk');\n\nconst dynamoDb = new AWS.DynamoDB.DocumentClient();\n\nconst validateResponses = fu...
javascript
chosen
[ { "from": "system", "value": "Make links work in ProductCarousel\n" }, { "from": "human", "value": "/**\n *\n * ProductCarousel.js\n *\n */\n\nimport React from 'react';\nimport 'style!css!./ProductCarousel.css';\n\nclass ProductCarousel extends React.Component {\n constructor(props) {\n sup...
javascript
chosen
[ { "from": "system", "value": "Test (basics): Require target being in the tracked pool\n" }, { "from": "human", "value": "/**\n * Basics\n */\ndescribe('Basics', () => {\n beforeEach(beforeEachHook);\n afterEach(afterEachHook);\n\n /**\n * Absolute tracking\n */\n it('absolute tracking', ...
javascript
chosen
[ { "from": "system", "value": "Reset commandbar input after pressing return\n" }, { "from": "human", "value": "import React from 'react';\nimport './CommandBar.css';\n\nexport default class CommandBar extends React.Component {\n onTextChange(eventArgs) {\n const { onCommandChange } = this.pro...
javascript
chosen
[ { "from": "system", "value": "Fix homepage scrolling. Can’t test on phone just now, but it should be fine.\n" }, { "from": "human", "value": "Template.home.rendered = function() {\n // Probably erroneous way to clear the previous Famous canvas.\n // But it works.\n var mainContext = Engine.cr...
javascript
chosen
[ { "from": "system", "value": "Fix webpack 5 library type\n" }, { "from": "human", "value": "/* eslint-disable @typescript-eslint/no-var-requires */\n\"use strict\";\nvar resolve = require(\"path\").resolve;\nvar webpack = require(\"webpack\");\n\nmodule.exports = {\n mode: \"production\",\n en...
javascript
chosen
[ { "from": "system", "value": "Fix babel loader to specify react as a preset\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n devtool: 'eval',\n entry: [\n 'webpack-dev-server/client?http://localhost:3000',\n 'webpac...
javascript
chosen
[ { "from": "system", "value": "Add blank (g, fb)RentRollTemplate js functions\n" }, { "from": "human", "value": "/*jslint browser: true*/\n/*globals $, FB, gapi, fbLogin, setSettings, gGetEmail*/\n\n\"use strict\";\n\nfunction populateRentRoll(email) {\n if (email === '') {\n console.lo...
javascript
chosen
[ { "from": "system", "value": "Add links to idvidual inventory scenes\n" }, { "from": "human", "value": "import React from 'react'\nimport InventoryContainer from '../containers/InventoryContainer'\nimport ShadowBox from '../Components/ShadowBox'\nimport FlexDiv from '../Components/FlexDiv'\n\nco...
javascript
chosen
[ { "from": "system", "value": "Update example to reflect configuration changes\n" }, { "from": "human", "value": "/*jslint browser: true, undef: true *//*global Ext*/\nExt.define('JarvusAceDemo.view.editor.Panel', {\n extend: 'Ext.Panel',\n xtype: 'editor-panel',\n\n requires: [\n ...
javascript
chosen
[ { "from": "system", "value": "Send messages from stdin to campfire room.\n" }, { "from": "human", "value": "var request = require('request'),\n RoomStream = require('../room-stream');\n\nmodule.exports = function (room) {\n console.log(\"Joining room \" + room + \"...\");\n\n request.ge...
javascript
chosen
[ { "from": "system", "value": "Set scrolling duration to 0\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport ChatMessage from './ChatMessage';\nimport Scroll from 'react-scroll';\n\nclass ChatMessageList extends Component {\n getMessages = () => {\n re...
javascript
chosen
[ { "from": "system", "value": "Add avatars for in nearby giveaway sidebar\n" }, { "from": "human", "value": "import React from 'react';\nimport { List, ListItem } from 'material-ui/List';\nimport Divider from 'material-ui/Divider';\nimport Subheader from 'material-ui/Subheader';\nimport Avatar fr...
javascript
chosen
[ { "from": "system", "value": "Remove hot reloading and dev server for production deployment.\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n devtool: 'cheap-module-source-map',\n entry: [\n 'webpack-dev-server/client?...
javascript
chosen
[ { "from": "system", "value": "Change jQuery for songbook references to use clean urls.\n" }, { "from": "human", "value": "(function ($) {\n\n $(function() {\n /**\n * Adds links to songbook references on song pages.\n */\n $( \"div.field-name-field-songbook-refer...
javascript
chosen
[ { "from": "system", "value": "Remove arrow function to fix the build\n\nevents.js:165\n throw err;\n ^\n\nError: Uncaught, unspecified \"error\" event. (SyntaxError: Unexpected\ntoken: operator (>) while parsing file: [...]/lib/api/com.js\n(line: 27, col: 53, pos: 695)\n\nError\n at new JS_Pars...
javascript
chosen
[ { "from": "system", "value": "Use module.exports instead of exports\n" }, { "from": "human", "value": "'use strict';\n/**\n * winston transport support\n */\n\nvar sender = require('./sender');\nvar util = require('util');\nvar winston = require('winston');\nvar Transport = winston.Transport;\nv...
javascript
chosen
[ { "from": "system", "value": "Add @api private on private EC2 methods\n" }, { "from": "human", "value": "var AWS = require('../core');\n\nAWS.EC2 = AWS.Service.defineService('ec2', ['2013-06-15*', '2013-07-15*', '2013-08-15*', '2013-10-01*', '2013-10-15'], {\n setupRequestListeners: function se...
javascript
chosen
[ { "from": "system", "value": "Add support for abbreviating share numbers larger than 9999\n" }, { "from": "human", "value": "(function($){\n \"use strict\";\n\n var url = \"http://devitconf.org/\";\n\n var devit = {\n\n init: function () {\n devit.getSocialCounts();\n devit.setCu...
javascript
chosen
[ { "from": "system", "value": "Add key property to paths list items\n" }, { "from": "human", "value": " var rb = require('react-bootstrap');\nvar React = require('react');\nvar _ = require('lodash');\n\nvar Table = rb.Table,\n tr = rb.tr,\n td =rb.td,\n form = rb.form,\n Input = rb.I...
javascript
chosen
[ { "from": "system", "value": "Correct mixin name missed in refactor\n\nFixes #3\n" }, { "from": "human", "value": "define(function (require) {\n 'use strict';\n\n /**\n * with-observe uses RXJS to implement its observer/observable\n * patterns.\n * https://github.com/Reactive-E...
javascript
chosen
[ { "from": "system", "value": "Add support for actions to remote dropdown\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n\n tagName: 'div',\n classNames: ['ui', 'search', 'selection', 'dropdown', 'fluid'],\n\n value: null,\n text: nul...
javascript
chosen
[ { "from": "system", "value": "Fix jest run when using Less files with Antd" }, { "from": "human", "value": "const root = __dirname + '/../../../..';\n\nrequire('@babel/register')({\n root,\n cwd: root,\n configFile: root + '/packages/server/babel.config.js',\n extensions: ['.js', '.jsx', '.t...
javascript
chosen
[ { "from": "system", "value": "Support inheritance from Tier Shift\nThe initialization script of Tier Shift was calling `getTemplate`, which poisoned the dex entries with the `cached` flag\n" }, { "from": "human", "value": "exports.BattleScripts = {\n\tinit: function () {\n\t\tfor (var i in this....
javascript
chosen
[ { "from": "system", "value": "Add mfa status icon as an inline message.\n" }, { "from": "human", "value": "'use strict';\n\nconst assert = require('assert');\n\nfunction getMessage(service, accounts, mfaStatus) {\n return (\n mfaStatus\n ? `Users who enabled MFA on \\`${service}\\` are ${...
javascript
chosen
[ { "from": "system", "value": "Make ubiquity work with at other paths than the base path\n" }, { "from": "human", "value": "exports.addClassName = function(element, className) {\n\tif (!(' ' + element.className + ' ').match(' ' + className + ' ')) {\n\t\telement.className += className + ' ';\n\t}...
javascript
chosen
[ { "from": "system", "value": "Use absolute paths for config\n" }, { "from": "human", "value": "var habitat = require('habitat');\n\n// Local environment in .env overwrites everything else\nhabitat.load('.env');\n\nvar environment = habitat.get('NODE_ENV', '').toLowerCase();\n\nif (environment ==...
javascript
chosen
[ { "from": "system", "value": "[DASH-2360] Add missing : in hosting link\n" }, { "from": "human", "value": "import React from 'react';\nimport { FontIcon } from 'material-ui';\nimport { colors as Colors } from 'material-ui/styles';\nimport Truncate from '../Truncate';\n\nconst LinkWithIcon = ({ u...
javascript
chosen
[ { "from": "system", "value": ":bug: Remove tempary fix. Need to actually fix this\n" }, { "from": "human", "value": "(function($) {\n $(document).ready(function() {\n\n /**\n * Site section navigation\n */\n\n var navLink = $('.nav__link'),\n navLinkAc...
javascript
chosen
[ { "from": "system", "value": "Add blank line as a separator\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/utils/is-nan' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar nan = require( './nan.js' );\n\n\n// MAIN //\n\n/*...
javascript
chosen
[ { "from": "system", "value": "Add addon namespace to require so module can be found in embroider\n\nFixes: embroider-build/embroider#857\n" }, { "from": "human", "value": "import Application from '@ember/application';\nimport Engine from '@ember/engine';\nimport require from 'require';\nimport {...
javascript
chosen
[ { "from": "system", "value": "Switch Calc to extend View instead of AbstractView\n" }, { "from": "human", "value": "// Experimental Animated Views\n\nFOAModel({\n name: 'ALabel',\n\n extendsModel: 'AbstractView',\n\n properties: [\n {\n name: 'data'\n },\n {\n name: 'classN...
javascript
chosen
[ { "from": "system", "value": "Change once to on for m:job.created listener\n" }, { "from": "human", "value": "minerva.views.JobsPanel = minerva.View.extend({\n\n initialize: function () {\n var columnEnum = girder.views.jobs_JobListWidget.prototype.columnEnum;\n var columns = co...
javascript
chosen
[ { "from": "system", "value": "Fix SSL CA files lookup crash on OSX\n" }, { "from": "human", "value": "\"use strict\";\n\nconst casList = [\n \"addtrustexternalcaroot.crt\",\n \"comodorsaaddtrustca.crt\",\n \"comodorsadomainvalidationsecureserverca.crt\"\n];\nconst cas = require(\"ssl-root-cas...
javascript
chosen
[ { "from": "system", "value": "Change parameter name in parseEmoji to text.\n" }, { "from": "human", "value": "import app from '../app';\nimport { formatCurrency, convertAndFormatCurrency } from './currency';\nimport {\n isHiRez, isLargeWidth, isSmallHeight, getAvatarBgImage,\n} from './responsi...
javascript
chosen
[ { "from": "system", "value": "Add timestamp properties to Publisher resource\n" }, { "from": "human", "value": "const mongoose = require('mongoose');\n\nconst PublisherSchema = new mongoose.Schema({\n name: {\n type: String,\n required: true,\n minlength: 2,\n maxlength: 256\n },\n...
javascript
chosen
[ { "from": "system", "value": "Change permissions model to not require id\n" }, { "from": "human", "value": "/**\n* Permissions.js\n*\n* @description :: TODO: You might write a short summary of how this model works and what it represents here.\n* @docs :: http://sailsjs.org/#!documentation...
javascript
chosen
[ { "from": "system", "value": "Change theme colors to pink+blue\n" }, { "from": "human", "value": "export default function materialConfig($mdThemingProvider) {\n 'ngInject';\n $mdThemingProvider.theme('default')\n .primaryPalette('brown')\n .accentPalette('orange');\n}" }, { "from...
javascript
chosen
[ { "from": "system", "value": "Add a commented-out section for impersonation\n" }, { "from": "human", "value": "import { Accounts } from 'meteor/accounts-base';\nimport { Bans } from './collection.js';\nimport { ForwardedWhitelist } from '../../modules/forwarded_whitelist.js';\n// Check during lo...
javascript
chosen
[ { "from": "system", "value": ":wrench: Use cssnext instead of custom packages\n" }, { "from": "human", "value": "const path = require('path')\nconst webpack = require('webpack')\n\nmodule.exports = {\n module: {\n rules: [{\n test: /\\.less$/,\n use: [\n 'style-loader',\n ...
javascript
chosen
[ { "from": "system", "value": "Set the result count to 50\n" }, { "from": "human", "value": "// @flow\n\nmodule.exports = {\n BASE_URL: 'https://api.twitter.com/1.1/',\n SEARCH_HASH_TAG: \"search/tweets.json?q=%40\",\n};\n" }, { "from": "gpt", "value": "// @flow\n\nmodule.export...
javascript
chosen
[ { "from": "system", "value": "Add sub-context parsing and linking\n" }, { "from": "human", "value": "// Returns the contexts (short description with bolded matched words) of the\n// search results. This is only a function to allow the implementation to be\n// changed if Google ever changes the f...
javascript
chosen
[ { "from": "system", "value": "Remove automatic static optimization opt-out\n" }, { "from": "human", "value": "import { MDXProvider } from '@mdx-js/react';\nimport components from '../utils/mdx-components';\nimport App, { Container } from 'next/app';\nimport React from 'react';\n\nexport default ...
javascript
chosen
[ { "from": "system", "value": "Add TODO item to logger.\n" }, { "from": "human", "value": "exports = module.exports = function() {\n \n return function() {\n return require('morgan')('common');\n };\n};\n\nexports['@implements'] = 'http://i.bixbyjs.org/http/middleware/logging';\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Remove geometry in SQL Select if option passed in request.\n" }, { "from": "human", "value": "const aggregates = require('./aggregates')\nconst createGeometryClause = require('./geometry').createClause\nconst createFieldsClause = require('./fields').createClause\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix trailing slash redirect breaking browser back button\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n redirect() {\n this.transitionTo('crate.version', '');\n }\n});\n" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Fix missing model on model.\n" }, { "from": "human", "value": "define([\n \"underscore\",\n \"backbone\",\n \"app/config\",\n \"app/models/note\",\n \"backbone.localStorage\" // Patches Backbone.\n], function (_, Backbone, config, NoteModel) {\n \"use strict\"...
javascript
chosen
[ { "from": "system", "value": "Fix development API IP address\n" }, { "from": "human", "value": "var svcMod = angular.module( \"linksWeb.service-env\", [] );\n\n\nsvcMod.factory( 'ENV', function () {\n return {\n apiRoot: \"http://192.168.13.81/v1\"\n };\n} );\n" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Make smooth scroll update hash.\n" }, { "from": "human", "value": "/**\n * Initialize smooth-scroll plugin.\n */\n\nvar jQuery = require('jquery')\n , config = { easing: 'swing' };\n\nrequire('jquery-smooth-scroll');\n\nif (jQuery.fn.smoothScroll) jQuery('a[href^=\...
javascript
chosen
[ { "from": "system", "value": "Fix geo location on mobile\n" }, { "from": "human", "value": "'use strict';\n\nvar GeolocationService = function ($rootScope, DeviceReadyService, $q) {\n return {\n getCurrentPosition: function(onSuccess, onError, options) {\n return DeviceReady...
javascript
chosen
[ { "from": "system", "value": "Update source as following update Electron\n" }, { "from": "human", "value": "'use strict';\nconst ipc = require('ipc');\n\nipc.on('shortcut-pressed', shortcut => {\n\tdocument.querySelector('#shortcut-title').textContent = shortcut;\n});\n\nipc.on('shortcut-status'...
javascript
chosen
[ { "from": "system", "value": "Use config to load available id providers\n" }, { "from": "human", "value": "\"use strict\";\n\nvar db = require('../../models');\nvar config = require('../../config');\nvar authHelper = require('../../lib/auth-helper');\n\nmodule.exports = function(app) {\n var lo...
javascript
chosen
[ { "from": "system", "value": "Fix illegal use of this before super()\n" }, { "from": "human", "value": "class LinkButton extends Phaser.Button {\n\n constructor (game, x, key, url = null) {\n super(game, x, 47, 'graphics', this._openPopup, this);\n this.setFrames(`button-link-${key}-over`...
javascript
chosen
[ { "from": "system", "value": "GUACAMOLE-526: Remove debug console.log() from toArrayFilter()." }, { "from": "human", "value": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for add...
javascript
chosen
[ { "from": "system", "value": "Use model attributes instead of instance variables" }, { "from": "human", "value": "cdb.windshaft.filters.BoundingBoxFilter = cdb.core.Model.extend({\n\n initialize: function(bounds) {\n this.setBounds(bounds);\n },\n\n setBounds: function(bounds) {\n this....
javascript
chosen
[ { "from": "system", "value": "TASKS: Disable advanced optimisations when minifying CSS\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar paths = require('./_paths');\nvar minifyCss = require('gulp-minify-css');\nvar rename = require('gulp-rename');\n\ngulp.task...
javascript
chosen
[ { "from": "system", "value": "Check if grid dimensions are positive\n" }, { "from": "human", "value": "import React from 'react';\n\nimport SquareRow from './SquareRow';\n\nimport './Grid.css';\n\nconst Grid = ({\n size,\n }) => {\n const [height, width] = size.s...
javascript
chosen
[ { "from": "system", "value": "Simplify text input to functional component and to use connect\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Control from './Control';\n\nclass TextInput extends Control {\n static propTypes = {\n cl...
javascript
chosen
[ { "from": "system", "value": "Update copy based on PR feedback\n" }, { "from": "human", "value": "import fs from 'fs-extra';\nimport path from 'path';\nimport Snapcraft from 'electron-installer-snap/snapcraft';\n\nimport asyncOra from '../util/ora-handler';\n\n/**\n * `forgeConfig.snapStore`:\n ...
javascript
chosen
[ { "from": "system", "value": "Replace matrix rows when stream too tall.\n\nClean JS very much so.\n" }, { "from": "human", "value": "$(document).ready(function() {\n var matrixSettings = {\n id : $('#matrix-id').text(),\n decay : 60000\n };\n \n $('h1, p, li, form input, table').hid...
javascript
chosen
[ { "from": "system", "value": "Fix data source for employees page\n" }, { "from": "human", "value": "define(function(require) {\n\n var BasePageView = require('./BasePageView'),\n TimeSelectorView = require('app/ui/views/TimeSelectorView'),\n BarChartView = require('app/ui/views/BarCha...
javascript
chosen
[ { "from": "system", "value": "Put back changes in observer after unsuccessful commit.\n" }, { "from": "human", "value": "/**\n * Topic observer pattern base class\n */\nexport class TopicObserver {\n\n constructor() {\n this.observers = { __all__: [] };\n }\n\n observe(fn, topic)...
javascript
chosen
[ { "from": "system", "value": "Switch back to getting AS creds from file\n" }, { "from": "human", "value": "const $ = jQuery = require(\"jquery\")\r\nconst localforage = require(\"localforage\")\r\nconst moment = require(\"moment\")\r\nconst path = require(\"path\")\r\n\r\nconst Audiosearch = req...
javascript
chosen
[ { "from": "system", "value": "Sort latest entries by activeAt\n" }, { "from": "human", "value": "const getManyComplete = require('./getManyComplete');\n\nmodule.exports = (range, callback) => {\n // Get latest entries with their attachments and urls completed.\n //\n // Parameters:\n // ra...
javascript
chosen
[ { "from": "system", "value": "Use a new updating strategy.\n" }, { "from": "human", "value": "import { Component } from 'substance'\n\nexport default class SelectInput extends Component {\n render($$) {\n const label = this.props.label\n const value = this.props.value\n const options =...
javascript
chosen
[ { "from": "system", "value": "Use /package instead of /image in url\n" }, { "from": "human", "value": "var config = { width: 300, height: 100, background: '#dedede', stroke: 'red' };\n\nvar serve = function(request, response) {\n var url_parts = request.url.split('/');\n\n var url = `https://a...
javascript
chosen
[ { "from": "system", "value": "Move function out of module.exports to leave space\n" }, { "from": "human", "value": "module.exports = {\n\tsetUpListeners: function(socket) {\n\t\tsocket.on('get:subscriptions', function() {\n\t\t\tsocket.emit('got:subscriptions', ['OWSLA', 'Dirtybird']);\n\t\t});\...
javascript
chosen
[ { "from": "system", "value": "Fix display of the action when loaded a saved FAL\n" }, { "from": "human", "value": "CRM.$(function ($) {\n displayActionEntity();\n $('#action_type').change(function () {\n displayActionEntity();\n });\n\n});\n\n/**\n * Set up the display of the action_entity...
javascript
chosen
[ { "from": "system", "value": "Allow email sink to use SES configured automatically from env vars\n" }, { "from": "human", "value": "const log = require('@cardstack/logger')('cardstack/email');\nconst nodemailer = require('nodemailer');\n\nmodule.exports = class EmailMessenger {\n static create(...
javascript
chosen
[ { "from": "system", "value": "Add debug code to list how many object entities there are for each type, along with number of fields\n" }, { "from": "human", "value": "\n\nvar ObjectEditor = {\n Data: {\n Units: require('../WEdata/data/Units.json'),\n Items: require('../WEdata/dat...
javascript
chosen
[ { "from": "system", "value": "Update on the mission page in controller folder" }, { "from": "human", "value": "const nodemailer = require('nodemailer');\nconst transporter = nodemailer.createTransport({\n service: 'SendGrid',\n auth: {\n user: process.env.SENDGRID_USER,\n pass: process.e...
javascript
chosen
[ { "from": "system", "value": "Use the last device instead of the first device until we have multiple device support.\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n...
javascript
chosen
[ { "from": "system", "value": "Fix test using new asynchronous API\n" }, { "from": "human", "value": "var fs = require('fs');\nvar expect = require('chai').expect;\n\nvar updateLicense = require('../lib/update-license');\n\ndescribe(\"update-license\", function() {\n it(\"updates 2015 to 2015-20...
javascript
chosen
[ { "from": "system", "value": "Remove useless promise in test suite\n" }, { "from": "human", "value": "/*global browser:false, element:false, by:false */\n'use strict';\n\nvar Synonyms = require('./synonyms');\n\nvar Taxonomy = function(id){\n this.id = id;\n};\n\nTaxonomy.prototype.getSynonym...
javascript
chosen