conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Handle example action in example reducer\n" }, { "from": "human", "value": "const initialState = {\n example: \"\",\n};\n\nconst exampleReducer = (state = initialState, action) =>\n state;\n\nexport default exampleReducer;\n" }, { "from": "gpt", "value...
javascript
chosen
[ { "from": "system", "value": "Fix ESLint error thrown due to infinite scrolling tweaks\n" }, { "from": "human", "value": "var approachingBottomOfPage, loadNextPageAt, nextPage, nextPageFnRunning, viewMore, ready;\n\nnextPageFnRunning = false;\nloadNextPageAt = 3000;\n\napproachingBottomOfPage = ...
javascript
chosen
[ { "from": "system", "value": "Replace sneaky extra cleanCell with .trim\n" }, { "from": "human", "value": "(function(){\n\n var performance_levels = [\"W\", \"NI\", \"P\", \"A\"];\n\n compareMcasLevel = function(a, b) {\n var clean_a = $.trim(a);\n var clean_b = $.trim(b);\n var a_ind...
javascript
chosen
[ { "from": "system", "value": "Check element before performing calculations\n" }, { "from": "human", "value": "import Ember from \"ember\";\n\nexport default Ember.Mixin.create({\n windowResized: function() {\n this.calcPageRectangle();\n },\n didInsertElement: function() {\n Ember.$(win...
javascript
chosen
[ { "from": "system", "value": "Add defaults for shop buffer\n" }, { "from": "human", "value": "ReactionCore.Schemas.RentalShop = new SimpleSchema([\n ReactionCore.Schemas.Shop, {\n rentalShippingBuffer: {\n type: Number,\n optional: true\n },\n rentalReturnBuffer: {\n typ...
javascript
chosen
[ { "from": "system", "value": "Fix linting in generated test\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\n\nmoduleForComponent('canvas-block-filter', 'Integration | Component | canvas block filter', {\n ...
javascript
chosen
[ { "from": "system", "value": "Convert `Simple` to ES6 class\n" }, { "from": "human", "value": "'use strict';\nvar fs = require('fs-extra');\nvar path = require('path');\n\nmodule.exports = Simple;\nfunction Simple(attrs) {\n this._internal = '';\n this.outputFile = attrs.outputFile;\n this.ba...
javascript
chosen
[ { "from": "system", "value": "Disable scroll on number fields\n" }, { "from": "human", "value": "(function(){\n 'use strict';\n\n angular.module('cla.controllers')\n .controller('LayoutCtrl',\n ['$rootScope', '$scope', '$window', 'History', 'user', 'hotkeys', 'localStorageService',\n ...
javascript
chosen
[ { "from": "system", "value": "IMPROVE (bugsnag): Stop bugsnag to send AJAX errors for user errors\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n angular\n .module('gisto')\n .factory('bugsnagHttpInterceptor', bugsnagHttpInterceptor);\n\n bugsnagHttpI...
javascript
chosen
[ { "from": "system", "value": "JENA-865: Include prefixes in example query\n" }, { "from": "human", "value": "/** Standalone configuration for qonsole on index page */\n\ndefine( [], function() {\n return {\n prefixes: {\n \"rdf\": \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n ...
javascript
chosen
[ { "from": "system", "value": "Set up Brackets so it loads its own src code by\ndefault (if outside of appshell, it still uses\nhardcoded dummy data instead)." }, { "from": "human", "value": "/*\n * Copyright 2011 Adobe Systems Incorporated. All Rights Reserved.\n */\n\n// Define core brackets na...
javascript
chosen
[ { "from": "system", "value": "Add title bar event listener\n\n" }, { "from": "human", "value": "const settings = require('electron-settings')\r\nvar alpha = document.getElementById('alpha');\r\n\r\n// Listen for checkbox click\r\nalpha.addEventListener('click', function(event) {\r\n if (event...
javascript
chosen
[ { "from": "system", "value": "Fix editor dirty confirm leave.\n\nUse $window instead of window. Use the jQuery element of $window to\nbind listeners. Fix final location after modal confirm while properly\nretaining browser history.\n" }, { "from": "human", "value": "'use strict';\n\nangular.modu...
javascript
chosen
[ { "from": "system", "value": "Add support check for hrefNormalized IE bug\n" }, { "from": "human", "value": "var div = require('./div');\n\nmodule.exports = {\n classList: !!div.classList,\n currentStyle: !!div.currentStyle,\n matchesSelector: div.matches ||\n div...
javascript
chosen
[ { "from": "system", "value": "Add deprecated flag to npm-bcrypt\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Wrapper around the bcrypt npm package\",\n version: \"0.9.3\",\n documentation: null\n});\n\nNpm.depends({\n bcryptjs: \"2.3.0\"\n});\n\nPackage.onUse(function (...
javascript
chosen
[ { "from": "system", "value": "Convert login tab to react-intl\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Message } from 'retranslate';\n\nclass LoginTab extends Component {\n static propTypes = {\n activeTab: Pr...
javascript
chosen
[ { "from": "system", "value": "Add source to Article objects\n" }, { "from": "human", "value": "'use strict';\n\nvar app = app || {};\n\n(function (module) {\n\n\tlet sourceArticles = {};\n\tsourceArticles.all = [];\n\n\tsourceArticles.requestArticles = function (callback) {\n\t\tconsole.log('req...
javascript
chosen
[ { "from": "system", "value": "Use single quotes for a string.\n" }, { "from": "human", "value": "/*\n* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n*\n* Use of this source code is governed by a BSD-style license\n* that can be found in the LICENSE file in the root of t...
javascript
chosen
[ { "from": "system", "value": "Use item_type, and also register a block helper for each template\n" }, { "from": "human", "value": "/**\n * Class - a registry of templates. Duh.\n */\ncronenberg.TemplateRegistry = function() {\n this.registry = {};\n\n /**\n * Compile a template and reg...
javascript
chosen
[ { "from": "system", "value": "[TASK] Convert spaces to tabs for code consistency\n" }, { "from": "human", "value": "define(function(require) {\n\t'use strict';\n\n\tvar App = function(el) {\n this.el = el;\n };\n\n App.prototype.render = function() {\n this.el.innerHTML = 're...
javascript
chosen
[ { "from": "system", "value": "Move perm check for starring via reaction\n" }, { "from": "human", "value": "const { Listener } = require('discord-akairo');\n\nclass MessageReactionAddListener extends Listener {\n\tconstructor() {\n\t\tsuper('messageReactionAdd', {\n\t\t\teventName: 'messageReacti...
javascript
chosen
[ { "from": "system", "value": "Fix 'Day' button is not working correctly issue\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport ReactDOM from 'react-dom'\nimport classnames from 'classnames'\nimport classes from './RadioButton.scss'\n\nexport default class Radio...
javascript
chosen
[ { "from": "system", "value": "Add tests for boolean attributes\n" }, { "from": "human", "value": "const assert = require('assert')\nconst h = require('../index.js')\nconst jsdom = require('mocha-jsdom')\n\ndescribe('hashish', () => {\n jsdom()\n\n it(\"should return proper node for simple ...
javascript
chosen
[ { "from": "system", "value": "Fix join room autocomplete to use event instead of callback\n" }, { "from": "human", "value": "Template.joinRoom.helpers({\n settings: function () {\n return {\n position: \"top\",\n limit: 5,\n rules: [\n {\...
javascript
chosen
[ { "from": "system", "value": "Add contact info to next steps\n\nas per MoH feedback" }, { "from": "human", "value": "module.exports = {\n pageTitle: '<i class=\"fa fa-check success\" aria-hidden=\"true\"></i> Your application has been submitted',\n secondTitle: 'What happens next',\n printEma...
javascript
chosen
[ { "from": "system", "value": "Add map and filter methods\n" }, { "from": "human", "value": "// map\nconst double = num => 2*num;\nconst doubleEach = input => input.map(double);\n\nconst square = num => num*num;\nconst squareEach = input => input.map(square);\n\nconst doubleAndSquareEach = input ...
javascript
chosen
[ { "from": "system", "value": "Change StateSortedSchools section to white\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport Section from 'shared/components/section/section';\nimport FormInput from 'shared/components/form/formInput/formInput';\n// import styles f...
javascript
chosen
[ { "from": "system", "value": "Make Storybook work with babel 7\n" }, { "from": "human", "value": "/* eslint-disable no-param-reassign, global-require */\n\nmodule.exports = baseConfig => {\n baseConfig.module.rules.push({\n test: /\\.css$/,\n use: [\n {\n loader: 'style-loader...
javascript
chosen
[ { "from": "system", "value": "Add fetch as global method for jest\n" }, { "from": "human", "value": "module.exports = {\n moduleDirectories: ['node_modules', 'src']\n}\n" }, { "from": "gpt", "value": "module.exports = {\n moduleDirectories: ['node_modules', 'src'],\n globals: {\n ...
javascript
chosen
[ { "from": "system", "value": "Set default value for radio buttons\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport ReactDOM from 'react-dom'\nimport classnames from 'classnames'\nimport classes from './RadioButton.scss'\n\nclass RadioButton extends React.Compon...
javascript
chosen
[ { "from": "system", "value": "Rename transpile label to transpile-app\n" }, { "from": "human", "value": "var\n gulp = require('gulp'),\n babel = require('gulp-babel'),\n watch = require('gulp-watch'),\n uglify = require('gulp-uglify'),\n strip = require('gulp-strip-comme...
javascript
chosen
[ { "from": "system", "value": "Add checks to prevent errors\n" }, { "from": "human", "value": "Migrations.add({\n version: 1,\n name: 'Remove base URL from settings.',\n up: function() {\n let settings = Settings.findOne();\n\n let settingsId = settings._id;\n\n let settingsHasBaseUrl...
javascript
chosen
[ { "from": "system", "value": "Highlight: Use lighter theme with good contrast.\n" }, { "from": "human", "value": "// jscs:disable maximumLineLength\n\n/**\n * Highlight Module\n *\n *\n * High Level API:\n *\n * api.init()\n *\n *\n * Hooks To:\n *\n * 'document:loaded' ~> highlight.init();\n...
javascript
chosen
[ { "from": "system", "value": "Allow initializing of plugin by other plugins\n" }, { "from": "human", "value": "(function()\n{\n\tvar FLD = Craft.FieldLayoutDesigner;\n\tvar FLDinit = FLD.prototype.init;\n\n\t/**\n\t * Override the current FieldLayoutDesigner \"constructor\" so new buttons can be...
javascript
chosen
[ { "from": "system", "value": "Update lintAll() usage and implement proper error handling\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar ghlint = require('ghlint');\n\n/* GET home page. */\nrouter.get('/', function(req, res) {\n ghlint.l...
javascript
chosen
[ { "from": "system", "value": "Update demo server vers. reponse\n" }, { "from": "human", "value": "const EventEmitter = require(\"events\");\nclass DemoClient extends EventEmitter {}\n\nconst Client = new DemoClient();\nexports.client = Client;\n\nClient.connect = () => {\n Client.emit(\"ready\"...
javascript
chosen
[ { "from": "system", "value": "Add placeholder for ticket history search\n" }, { "from": "human", "value": "function short_hash(data, type, row, meta)\n{\n return data.substring(0,7);\n}\n\nfunction init_page()\n{\n $('#tickets').dataTable({\n \"ajax\": '/tickets/ajax/tickets.php?all...
javascript
chosen
[ { "from": "system", "value": "Declare with const in test\n" }, { "from": "human", "value": "// TODO: Convert this to full-on integration test\nimport { moduleForComponent, test } from 'ember-qunit';\n\nmoduleForComponent('user-avatar', 'UserAvatarComponent | Unit', {\n unit: true\n});\n\ntest('...
javascript
chosen
[ { "from": "system", "value": "Include course number in course search results\n" }, { "from": "human", "value": "/** Course search utility for admin **/\n\n!function(app, $) {\n $(document).ready(function() {\n if($('.courses-search-query').length) {\n var target = $('.courses-search-que...
javascript
chosen
[ { "from": "system", "value": "issue-1809: Fix issue hiding zero-balance categories in move money menu\n" }, { "from": "human", "value": "import { Feature } from 'toolkit/extension/features/feature';\nimport { isCurrentRouteBudgetPage } from 'toolkit/extension/utils/ynab';\n\nexport class RemoveZ...
javascript
chosen
[ { "from": "system", "value": "Refactor region utils a bit and add a method\n" }, { "from": "human", "value": "import assert from 'assert'\nconst TYPE_TO_PREFIXES = {\n municipality: 'K',\n borough: 'B',\n county: 'F',\n commerceRegion: 'N'\n}\n\n// we might need this reverse mapping at some ...
javascript
chosen
[ { "from": "system", "value": "Remove sent word count from jQuery.\n" }, { "from": "human", "value": "function countWords() {\n var string = $.trim($(\"textarea\").val()),\n words = string.replace(/\\s+/gi, ' ').split(' ').length\n chars = string.length;\n if(!chars)words=0;\n\n $(\"...
javascript
chosen
[ { "from": "system", "value": "Fix js pagination after mongo switch." }, { "from": "human", "value": "$(function () {\n colorbox_init();\n\n $('.pager a').live('click', function () {\n var url = $(this).attr(\"href\").replace(/^.*\\/page\\//, \"#/page/\");\n AjaxLinks.setLocation(url);\n ...
javascript
chosen
[ { "from": "system", "value": "Fix event by returning properly\n" }, { "from": "human", "value": "AFRAME.registerComponent('cursor-interaction', {\r\n schema: {\r\n startPlay: {default: false}\r\n },\r\n\r\n init: function () {\r\n var el = this.el;\r\n var data = this;data\r\n // ...
javascript
chosen
[ { "from": "system", "value": "OwnedCrateRow: Use `guidFor()` to generate `controlId`\n" }, { "from": "human", "value": "import Component from '@ember/component';\nimport { action, computed } from '@ember/object';\n\nexport default class OwnedCrateRow extends Component {\n tagName = '';\n\n @co...
javascript
chosen
[ { "from": "system", "value": "Use blank string instead of null to clear CSS value.\n" }, { "from": "human", "value": "$(document).ready(function(){\n // focus first field in an admin form.\n $('form input[type=text]:first').focus();\n\n init_flash_messages();\n});\n\ninit_flash_messages = fun...
javascript
chosen
[ { "from": "system", "value": "Fix bug not skip install on test\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar os = require('os');\nvar helpers = require('yeoman-generator').test;\nvar util = require('./util.js');\n\nmodule.exports = function (testGeneratorNa...
javascript
chosen
[ { "from": "system", "value": "Add highlighting for hbs and json\n" }, { "from": "human", "value": "import Prism from 'prismjs/components/prism-core';\nimport 'prismjs/components/prism-markup-templating';\nimport 'prismjs/components/prism-markup';\nimport 'prismjs/components/prism-twig';\nimport ...
javascript
chosen
[ { "from": "system", "value": "Fix Wishlist add button on Spree 4.1\n" }, { "from": "human", "value": "(function() {\n Spree.ready(function($) {\n $('#new_wished_product').on('submit', function() {\n var cart_quantity, selected_variant_id;\n selected_variant_id = $('#product-variant...
javascript
chosen
[ { "from": "system", "value": "Add new config variables to example config\n" }, { "from": "human", "value": "var fs = require('fs');\nvar splitca = require('split-ca');\n\nmodule.exports = {\n webServerPort: 8080,\n\n /* MySQL config */\n MySQL_Hostname: 'localhost',\n MySQL_Username:...
javascript
chosen
[ { "from": "system", "value": "Fix missing slash in example config file\n" }, { "from": "human", "value": "module.exports = {\n\tDB_HOST: '',\n\tDB_USER: '',\n\tDB_PASS: '',\n\tWS_SERVER_KEY: '',\n\n\t// For development only\n\tLOCALHOST: true,\n\tSSL_CERT: \"/path/to/ssl.crt\",\n\tSSL_KEY: \"pat...
javascript
chosen
[ { "from": "system", "value": "Fix parsing of related concepts responses. [rev: matthew.gordon]\n" }, { "from": "human", "value": "/*\n * Copyright 2014-2015 Hewlett-Packard Development Company, L.P.\n * Licensed under the MIT License (the \"License\"); you may not use this file except in complia...
javascript
chosen
[ { "from": "system", "value": "Update the WYSIWYG when we get our first real value on the model\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc directive\n * @name wwwApp.directive:mbSimpleMde\n * @description\n * # mbSimpleMde\n */\nangular.module('mb.simplemde')\n.directive('...
javascript
chosen
[ { "from": "system", "value": "Load features via fs instead of imports\n" }, { "from": "human", "value": "import * as engine from './engine';\nimport express from 'express';\nimport features from '../dist/features';\nimport logger from 'morgan';\nimport webpack from 'webpack';\nimport webpackConf...
javascript
chosen
[ { "from": "system", "value": "Add ability to specify service port.\n\nTo specify different port, pass it as the first arugment, i.e.\nnode start 5000\n\nDefault port is 8080.\n" }, { "from": "human", "value": "'use strict';\n\nimport express from 'express';\nimport ReactDOMServer from 'react-dom...
javascript
chosen
[ { "from": "system", "value": "Change slider to update map on slide rather than release\n" }, { "from": "human", "value": "var TopicChartsView = Backbone.View.extend({\n\n initialize: function() {\n this.$el = $(\"#charts-container\");\n this.template = JST[\"templates/topic-charts/topicCh...
javascript
chosen
[ { "from": "system", "value": "Remove description missing warning from field sets\n" }, { "from": "human", "value": "import styles from './styles/DefaultFieldset.css'\nimport React, {PropTypes} from 'react'\n\nexport default function Fieldset(props) {\n const {fieldset, legend, description} = pr...
javascript
chosen
[ { "from": "system", "value": "Add case for select-multiple inputs" }, { "from": "human", "value": "import React from 'react';\nimport classNames from 'classnames';\n\n\nexport default function(WrappedComponent) {\n const Field = React.createClass({\n getInitialState() {\n return {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix JS error preventing newly created dictionary items from opening automatically\n" }, { "from": "human", "value": "/**\n * @ngdoc controller\n * @name Umbraco.Editors.Dictionary.CreateController\n * @function\n * \n * @description\n * The controller for creating ...
javascript
chosen
[ { "from": "system", "value": "Add in FstalPvP spam remover\n" }, { "from": "human", "value": "import BaseWatcher from './BaseWatcher';\n\n/**\n * This checks for people spamming links.\n */\nclass LinkSpamWatcher extends BaseWatcher {\n constructor(bot) {\n super(bot);\n }\n\n us...
javascript
chosen
[ { "from": "system", "value": "Add in new Kazuto Kirigia spam\n\n" }, { "from": "human", "value": "import BaseWatcher from './BaseWatcher';\n\nimport config from '../config';\n\n/**\n * This checks for people spamming text stuff.\n */\nclass TextSpamWatcher extends BaseWatcher {\n usesBypassRu...
javascript
chosen
[ { "from": "system", "value": "Add React.memo dynamic snippet to official-storybook\n" }, { "from": "human", "value": "import React from 'react';\nimport { DocgenButton } from '../../components/DocgenButton';\n\nconst ButtonWithMemo = React.memo((props) => <DocgenButton {...props} />);\n\nexport ...
javascript
chosen
[ { "from": "system", "value": "Allow creation of expired tokens\n" }, { "from": "human", "value": "import jsrsasign from 'jsrsasign';\n\n@registerDynamicValueClass\nclass JsonWebTokenDynamicValue {\n static identifier = 'de.choffmeister.PawExtensions.JsonWebTokenDynamicValue';\n static title = ...
javascript
chosen
[ { "from": "system", "value": "Remove função para criação do usuário\n" }, { "from": "human", "value": "(function () {\n angular\n .module(\"viewpoint.services\")\n .factory(\"userService\", userService);\n\n userService.$inject = [\"$http\", \"$q\", \"envService\"];\n\n function userSer...
javascript
chosen
[ { "from": "system", "value": "Update examples for form <TextInput>\n" }, { "from": "human", "value": "import React from 'react';\n\nimport TextInput from '@ichef/gypcrete-form/src/TextInput';\n\nfunction BasicUsage() {\n return (\n <TextInput\n label=\"Module name\"\n ...
javascript
chosen
[ { "from": "system", "value": "Replace login call from ngGAPI with\n\nangular-googleapi. Close #6\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n angular\n .module('annualTimeBlock')\n .controller('MainController', MainController);\n\n /** @ngInject */\n function Ma...
javascript
chosen
[ { "from": "system", "value": "Refresh comments box on login/logout\n" }, { "from": "human", "value": "/**\n * # Comments\n *\n * Allow to list and add comments on an object of the current application.\n *\n * ## Example\n *\n * <div data-hull-widget=\"comments@hull\" data-hull-id=\"OBJECT_ID...
javascript
chosen
[ { "from": "system", "value": "Use getOwnPropertyNames to check for empty object.\n\nAdded hasOwnProperty check to for..in loop.\n" }, { "from": "human", "value": "export default function isObjectEmpty(obj) {\n if (Object.keys) {\n return (Object.keys(obj).length === 0);\n } else {\n...
javascript
chosen
[ { "from": "system", "value": "Fix assessment metadata state for exercises\n" }, { "from": "human", "value": "export function SET_LESSON_CONTENTNODES(state, contentNodes) {\n state.pageState.contentNodes = [...contentNodes];\n}\n\nexport function SET_CURRENT_LESSON(state, lesson) {\n state.page...
javascript
chosen
[ { "from": "system", "value": "[Glitch] Fix showing profile's featured tags on individual statuses\n\nPort bfafb114a2135b1f21ba7e6d54ee13e8da75b629 to glitch-soc\n\nSigned-off-by: Claire <82b964c50e9d1d222e48cf5046e6484a966a7b07@sitedethib.com>\n" }, { "from": "human", "value": "import React from...
javascript
chosen
[ { "from": "system", "value": "Remove redundand props & imports\n" }, { "from": "human", "value": "import React from 'react';\nimport { bindActionCreators } from 'redux';\nimport { connect } from 'react-redux';\nimport { Link } from 'react-router';\n\nimport { setNavigationVisibility } from '../N...
javascript
chosen
[ { "from": "system", "value": "Add the photo listing to use the proper image size" }, { "from": "human", "value": "import React from 'react';\n\nexport default class PhotoList extends React.Component {\n render() {\n return (\n <div className=\"row\">\n {this.props.photos.map((pho...
javascript
chosen
[ { "from": "system", "value": "Store reference to player, dim lights\n" }, { "from": "human", "value": "elation.require(['engine.engine', 'engine.things.light', 'janusweb.janusweb'], function() {\n elation.component.add('janusweb.client', function() {\n this.initEngine = function() {\n /...
javascript
chosen
[ { "from": "system", "value": "Order Detail is working with limited functionality.\n" }, { "from": "human", "value": "function showDetails(orderId)\n{\n\tvar url = 'index.php';\n\tvar data = { op : 'showDetails', orderId : orderId };\n\n\tcallServer(url, data, fillOrderDetails, alert);\n}\n\nfunc...
javascript
chosen
[ { "from": "system", "value": ":bug: Make sure the download analyze is done\n\nUse magic delay seconds to implement that, may improve in the futrue\n" }, { "from": "human", "value": "const { resolve: pathResolve } = require('path')\nconst { readFileSync } = require('fs')\n\nconst chromeLauncher =...
javascript
chosen
[ { "from": "system", "value": "Disable test until filesystem-graph issue works\n\n- seems that this error comes in test environment, have to figure out is\n this something phantomjs specific...\n" }, { "from": "human", "value": "var env = require('../env');\nvar fs = require('fs');\nenv.init();\...
javascript
chosen
[ { "from": "system", "value": "Add prop for mini calendar\n" }, { "from": "human", "value": "import React from 'react';\nimport { useModals, NavMenu } from 'react-components';\nimport { c } from 'ttag';\nimport EventModal from '../modals/EventModal';\nimport MiniCalendar from '../MiniCalendar';\n...
javascript
chosen
[ { "from": "system", "value": "Load Room name from Firebase.\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('chatterApp')\n .controller('RoomCtrl', function ($scope) {\n\n $scope.room = {\n name: 'Room 1'\n };\n\n $scope.activity = [\n {\n user: {\n ...
javascript
chosen
[ { "from": "system", "value": "Allow access to the packet object\n\nI'm trying to use some field packet information in my custom \"typeCast\" function, but right now the Field object don't have access to it.\r\n\r\n\"RowDataPacket.prototype._typeCast\" function have access to it, and I need to check the fiel...
javascript
chosen
[ { "from": "system", "value": "Fix broken example in Korean docs\n" }, { "from": "human", "value": "/*\n * @name 연속된 선\n * @description 마우스를 클릭하고 드래그하여 선을 그려보세요.\n */\nfunction setup() {\n createCanvas(710, 400);\n background(102);ㅌ\n}\n\nfunction draw() {\n stroke(255);\n if (mouseIsPressed ...
javascript
chosen
[ { "from": "system", "value": "Migrate from class to function\n" }, { "from": "human", "value": "var net = require('net');\nvar EventEmitter = require('events').EventEmitter;\nvar q = require('q');\n\n/**\n *\n * @constructor\n */\nvar ElementExplorerClient = function() {\n this.client_ = null;\...
javascript
chosen
[ { "from": "system", "value": "Add some handling to auto-retry failed tests in Siesta.\n\nThis implementation will also click each failed test row to see the DOM\nand failed assertions." }, { "from": "human", "value": "/**\n * Selenium script for running Siesta unit tests.\n */\nmodule.exports = ...
javascript
chosen
[ { "from": "system", "value": "Use prop-types package in vulcan-voting\n" }, { "from": "human", "value": "import React, { PropTypes, Component } from 'react';\nimport { graphql } from 'react-apollo';\nimport gql from 'graphql-tag';\nimport { performVoteClient } from '../modules/vote.js';\nimport ...
javascript
chosen
[ { "from": "system", "value": "Refactor polymer-app-generator to use helper functions.\n" }, { "from": "human", "value": "const generators = require('yeoman-generator');\nconst path = require('path');\n\nconst util = require('../util.js');\n\nconst generator = generators.Base.extend({\n\t// Cann...
javascript
chosen
[ { "from": "system", "value": "Switch to paorwise method for PopcornTime\n" }, { "from": "human", "value": "// @flow\nconst Rx = require('rx')\nconst _ = require('lodash')\n\nconst PopcornTime = require('../../sources/PopcornTime')\n\nconst INTERVAL: number = 1000 * 60 * 60 // 1 hour\n// const IN...
javascript
chosen
[ { "from": "system", "value": "Add $ to format helper\n" }, { "from": "human", "value": "import stache from 'can-stache';\n\nstache.registerHelper('formatDollarAmount', function(value) {\n\treturn value.toFixed(2);\n});\n" }, { "from": "gpt", "value": "import stache from 'can-stache';...
javascript
chosen
[ { "from": "system", "value": "Add option to silence warnings from environment plugin\n\nIf a process.env variable is is added to the EnvironmentPlugin but not defined, it is reported in the terminal as:\n`WARNING in NODE_ENV environment variable is undefined.`\n\nThis pull request adds an option as the seco...
javascript
chosen
[ { "from": "system", "value": "Fix all items needs key\n" }, { "from": "human", "value": "import React, { PropTypes, Component } from 'react';\nimport { Link } from 'react-router';\nimport shouldPureComponentUpdate from '../../../../node_modules/react-pure-render/function';\n\nexport default clas...
javascript
chosen
[ { "from": "system", "value": "refactor: Remove added code to go back to the simpler approach for now, at least for this PR.\n" }, { "from": "human", "value": "import { name as $name } from '../util/symbols';\nimport Component from './component';\nimport uniqueId from '../util/unique-id';\n\nexpo...
javascript
chosen
[ { "from": "system", "value": "Add smooth transition between create and image upload forms\n" }, { "from": "human", "value": "function createExperience(form){\n formData = $(form).serialize();\n var request = $.ajax({\n method: 'post',\n url: '/experiences',\n data: formData\n })\n r...
javascript
chosen
[ { "from": "system", "value": "Fix Notification import error after reabse.\n" }, { "from": "human", "value": "/**\n * UserInputSuccessNotification component.\n *\n * Site Kit by Google, Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may...
javascript
chosen
[ { "from": "system", "value": "QS-1249: Replace history state when clicking on toolbar links\n" }, { "from": "human", "value": "import React, { PropTypes, Component } from 'react';\nimport connectToStores from '../../utils/connectToStores';\nimport shouldPureComponentUpdate from '../../../../node...
javascript
chosen
[ { "from": "system", "value": "test/unit/default-config: Add describe() block per config file\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar assert = require('power-assert');\nvar rules = require('../../lib/rules');\n\nvar DEFAULT_CONFIG_PATH = path.j...
javascript
chosen
[ { "from": "system", "value": "Check path for safe uri\n" }, { "from": "human", "value": "function checkPathParsed (uri) {\n if (uri.charAt(0) !== '/') {\n uri = '/' + uri;\n }\n var safeUrl;\n var myUrl = parseURL(uri);\n if (myUrl.pathname.charAt(myUrl.pathname.length-1) === '/') {\n ...
javascript
chosen
[ { "from": "system", "value": "Refactor the nextCoordsFrom function to use less if statements\n" }, { "from": "human", "value": "import { List, is } from 'immutable';\nimport { isUndefined } from 'lodash';\n\nexport function nextCoordsFrom({\n path,\n alternate,\n switchCoord,\n fromCoord,\n ...
javascript
chosen
[ { "from": "system", "value": "Handle hidden fields on individual documents\n\nThis handles hiding fields on individual documents as opposed to doing\nit collection-wide. Currently it only works for `/:collection/:id`\nroutes, I foresee a potential issue with the `/:collection` urls because\nthere will be mu...
javascript
chosen
[ { "from": "system", "value": "Support string value for color.\n" }, { "from": "human", "value": "import {makeInner} from '../../util/model';\n\nvar inner = makeInner();\n\nexport default {\n clearColorPalette: function () {\n inner(this).colorIdx = 0;\n inner(this).colorNameMap ...
javascript
chosen
[ { "from": "system", "value": "Add function to simply check for presense of CLI param\n\nTODO: Check for multiple parameters and validate\n" }, { "from": "human", "value": "'use strict';\n\nvar request = require('request');\n\nvar opts = {\n uri: 'https://api.github.com' + '/users/' + process...
javascript
chosen
[ { "from": "system", "value": "Use const instead of var.\n" }, { "from": "human", "value": "var webpack = require('webpack')\nvar WebpackDevServer = require('webpack-dev-server')\nvar config = require('../webpack.config.dev.js')\n\nnew WebpackDevServer(webpack(config), {\n contentBase: './src',\...
javascript
chosen
[ { "from": "system", "value": "Add error checking for missing json schema\n" }, { "from": "human", "value": "var wrappedRequest = {}\n_.each(_currentRequest._getAccessibleProperties(), function(property){\n if(typeof _currentRequest[property] == 'function'){\n wrappedRequest[property] =...
javascript
chosen