conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Correct issue while trying to connect to backend without credentials\n\nA JavaScript error was dispatched when trying to connect to backend, from login page, without credentials.\n" }, { "from": "human", "value": "(function(app){\n\n \"use strict\"\n\n app.control...
javascript
chosen
[ { "from": "system", "value": "Set projectile positions to the edge of the screen\n" }, { "from": "human", "value": "\"use strict\";\n\nfunction cast_to_edge(x, y, pos) {\n var d = Math.sqrt((pos.x - x) * (pos.x - x) + (pos.y - y) * (pos.y - y)); \n var uv = {\n \"x\": (x-pos.x)/d,\n ...
javascript
chosen
[ { "from": "system", "value": "Remove isSupported check: cookie fallback appears to be automatic\n\nFrom the https://github.com/grevory/angular-local-storage#get docs:\n\n> If local storage is not supported, use cookies instead.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc d...
javascript
chosen
[ { "from": "system", "value": "feat(form): Add class id to form dropdown container\n" }, { "from": "human", "value": "import React, {PropTypes, Component} from 'react'\nimport { Form, FormGroup, FormControl, Row, Col } from 'react-bootstrap'\nimport { connect } from 'react-redux'\n\nimport { setQ...
javascript
chosen
[ { "from": "system", "value": "[core] GraphQL: Remove special handling of 404 in graphql list command\n" }, { "from": "human", "value": "module.exports = async function listApisAction(args, context) {\n const {apiClient, output, chalk} = context\n\n const client = apiClient({\n requireUser: ...
javascript
chosen
[ { "from": "system", "value": "Remove \"The Key Details\" from Event component\n" }, { "from": "human", "value": "import React from 'react';\nimport styles from 'components/Event/Event.scss';\n\nexport default class Event extends React.Component {\n\n render() {\n return (\n <div>\n ...
javascript
chosen
[ { "from": "system", "value": "Improve next gen MCAS score abbreviations\n" }, { "from": "human", "value": "export function shortLabelFromScore(score) {\n if (score >= 400 && score < 450) return 'NM';\n if (score >= 450 && score < 500) return 'P';\n if (score >= 500 && score < 550) return 'M';...
javascript
chosen
[ { "from": "system", "value": "Add comments to explain checking for userAgent" }, { "from": "human", "value": "/* Copyright 2015 Realm Inc - All Rights Reserved\n * Proprietary and Confidential\n */\n\n'use strict';\n\nif (typeof Realm != 'undefined') {\n module.exports = Realm; // eslint-dis...
javascript
chosen
[ { "from": "system", "value": "Fix tooltip flickering on Firefox.\n" }, { "from": "human", "value": "import { getSelectedAlgorithm } from './utils.js';\nimport { \n secretInput,\n secretBase64Checkbox,\n} from '../dom-elements.js';\n\nimport log from 'loglevel';\nimport tippy from 'tippy.js';\n...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"just to initiate travis\"\"\n\nThis reverts commit 8a7889643ce9cbf566d76538acee5b55afc67900.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n\tEdge: require('./edge'),\n\tSystem: require('./system')\n};\n" }, { "from...
javascript
chosen
[ { "from": "system", "value": "Add js to load and close modal window\n" }, { "from": "human", "value": "$().ready(function() {\n const location = getCookie('location');\n if (location != \"\") {\n $('#location-checkbox').prop('checked', true);\n }\n\n $('#location-checkbox').change(functio...
javascript
chosen
[ { "from": "system", "value": "Fix a rather awful phone nav bug\n" }, { "from": "human", "value": "\nconst Marionette = require('backbone.marionette');\nconst CapabilityIconsView = require('./CapabilityIconsView.js');\nconst NotificationBadgeView = require('./NotificationBadgeView.js');\n\nmodule...
javascript
chosen
[ { "from": "system", "value": "Fix basic methods not assgin into vm\n" }, { "from": "human", "value": "import pluck from './pluck';\nimport {\n ref,\n refs,\n noop,\n mixin,\n insertCss,\n emptyTemplate,\n computedAll,\n pureComputedAll\n} from '../util/';\n\nconst moduleP...
javascript
chosen
[ { "from": "system", "value": "Enable jQuery and set layout to null\n\nlayout: null is required to keep Jekyll from adding the default HTML\nboilerplate to the main.js file once it’s been processed.\n\njQuery has been enabled for responsive menu feature – this may be\nremoved if functionality can be duplicat...
javascript
chosen
[ { "from": "system", "value": "Exclude script tags from being shown" }, { "from": "human", "value": "require([\"gitbook\"], function(gitbook) {\n gitbook.events.bind(\"page.change\", function() {\n $('ul.summary li li').hide();\n // $('ul.summary li').find('li.active').parent().c...
javascript
chosen
[ { "from": "system", "value": "Test ´ifShortPart´: fix code style\n" }, { "from": "human", "value": "import chai from 'chai'\nimport ifShortPart from '@/wordbreaker-russian/rules/if-short-part'\n\ndescribe(\n 'ifShortPart', () => {\n it(\n 'Это функция', () => {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix usage of id instead of _id\n\n" }, { "from": "human", "value": "const assert = require('assert');\nconst chai = require('chai');\nconst chaiHttp = require('chai-http');\nconst app = require('../../../src/app');\n\nchai.use(chaiHttp);\n\ndescribe('link service', ...
javascript
chosen
[ { "from": "system", "value": "Allow steps to be placed in subdirectories\n" }, { "from": "human", "value": "var Yadda = require('yadda'),\n config = require('./configure'),\n language = Yadda.localisation[upperCaseFirstLetter(config.language)],\n fs = require('fs'),\n path = require(...
javascript
chosen
[ { "from": "system", "value": "Fix a bug where fetch v3 wasn't used\n" }, { "from": "human", "value": "// For normal consumers, use -1\nconst REPLICA_ID = -1\n\nconst versions = {\n 0: ({ replicaId = REPLICA_ID, maxWaitTime, minBytes, topics }) => {\n const request = require('./v0/request')\n...
javascript
chosen
[ { "from": "system", "value": "Add other sections for account page\n" }, { "from": "human", "value": "import React from 'react';\nimport { NewsSection } from 'react-components';\nimport { c } from 'ttag';\n\nimport Page from '../components/page/Page';\n\nconst AccountContainer = () => {\n retu...
javascript
chosen
[ { "from": "system", "value": "Add unit tests for indeterminable.js\n" }, { "from": "human", "value": "\n$(function () {\n \n 'use strict';\n \n var fixture = $('#qunit-fixture');\n \n QUnit.module('indeterminable.js');\n \n});\n" }, { "from": "gpt", "value": "\n$...
javascript
chosen
[ { "from": "system", "value": "Add current user id to client side state\n" }, { "from": "human", "value": "import { Map } from 'immutable';\n\nimport {\n START_LINE,\n END_LINE\n} from './../client/app/canvas/canvasActions';\n\nexport const initialBoard = Map({\n isDrawing: false\n});\n\nconst...
javascript
chosen
[ { "from": "system", "value": "Official-storybook: Add DocsContainer as story decorator\n" }, { "from": "human", "value": "import React from 'react';\nimport markdown from './markdown.stories.mdx';\n\nexport default {\n title: 'Addons|Docs/mdx-in-story',\n};\n\n// This renders the contents of th...
javascript
chosen
[ { "from": "system", "value": "Add a global diamondash config\n" }, { "from": "human", "value": "window.diamondash = function() {\n return {\n };\n}.call(this);\n" }, { "from": "gpt", "value": "window.diamondash = function() {\n var DiamondashConfigModel = Backbone.RelationalModel....
javascript
chosen
[ { "from": "system", "value": "Add strict mode to support generation\n" }, { "from": "human", "value": "var fs = require('fs'),\n words = require('./data/profanities.json');\n\nfs.writeFileSync('Supported-profanities.md',\n 'Supported Profanities\\n' +\n '=================\\n' +\n '\\...
javascript
chosen
[ { "from": "system", "value": "Prepare support for new data source\n" }, { "from": "human", "value": "var Departure = require('./Components/Departure');\n\nvar url = 'http://bybussen.api.tmn.io/';\n\nvar get = function (path, callback) {\n return fetch(url + path, {\n method: 'GET',\n head...
javascript
chosen
[ { "from": "system", "value": "Improve destroy method to actually catch calls / read of destroy objects properties / methods\n" }, { "from": "human", "value": "(function(exports) {\n\n // Dependencies -----------------------------------------------------------\n var Class = require('./Class...
javascript
chosen
[ { "from": "system", "value": "Add owner level to logger\n" }, { "from": "human", "value": "const pino = require('pino')\nconst serializers = require('./serializers.js')\n\nfunction createLogger (shardID) {\n return pino({\n base: {\n shardID: String(shardID)\n },\n prettyPrint: {\...
javascript
chosen
[ { "from": "system", "value": "Add analytics for bottom toolbar events\n" }, { "from": "human", "value": "/* global $ */\nvar PanelToggler = require(\"../side_pannels/SidePanelToggler\");\n\nvar buttonHandlers = {\n \"bottom_toolbar_contact_list\": function () {\n BottomToolbar.toggleCo...
javascript
chosen
[ { "from": "system", "value": "Change redirect to go to selecting projects after creating pathway\n" }, { "from": "human", "value": "'use strict'\n\nangular.module('pathwayApp')\n.controller('PathwayController', function ($scope, $http, $stateParams, $cookieStore, $state) {\n $scope.user = $cook...
javascript
chosen
[ { "from": "system", "value": "Support Ctrl-click to mimic link behaviour\n" }, { "from": "human", "value": "$('table.table-clickable tr.row-clickable').click(function () {\n let href = $(this).data('href')\n\n if (href) {\n window.location.href = href\n }\n})\n" }, { "fro...
javascript
chosen
[ { "from": "system", "value": "Add sign out button to banner.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Link } from 'react-router-dom';\nimport { Navbar } from 'react-bootstrap';\nimport 'bootstrap/dist/css/bootstrap.css';\nimport './Banner.css';\n\ncl...
javascript
chosen
[ { "from": "system", "value": "[docs]: Add a bit of description for the window js.\n" }, { "from": "human", "value": "!function () {\n\n var keys\n , timer\n , timeout = 300\n , issueURLs = []\n , issueIndex = ''\n ;\n\n var issues = Array.prototype.slice....
javascript
chosen
[ { "from": "system", "value": "Fix for EADDRNOTAVAIL 0.0.0.0:5980 on windows ws\n" }, { "from": "human", "value": "'use strict'\nvar pick = require('lodash.pick')\nvar url = require('url')\nvar connect = require('pull-ws/client')\n\nmodule.exports = function (params, cb) {\n params = pick(params...
javascript
chosen
[ { "from": "system", "value": "Fix domain issue between local and production\n" }, { "from": "human", "value": "'use strict';\n\n(function () {\n var app = angular.module('dailyMummApp',\n ['ngCookies',\n 'ngResource',\n 'ngSanitize',\n 'ui.router',\n ...
javascript
chosen
[ { "from": "human", "value": "Complete lesson 10 - picker view\n" }, { "from": "gpt", "value": "function PickerView() {\n\tvar self = Ti.UI.createWindow({});\n\t\n\t// create the picker\n\tvar picker = Ti.UI.createPicker({});\n\tself.add(picker);\n\t\n\t// create fruit column\n\tvar fruitColumn =...
javascript
chosen
[ { "from": "system", "value": "Update docs ref example so as to not promote bad practices\n" }, { "from": "human", "value": "import md from 'components/md'\n\nconst Refs = () => md`\n ## Refs\n\n Passing a \\`ref\\` prop to a styled component will give you an instance of\n the \\`StyledCompone...
javascript
chosen
[ { "from": "system", "value": "Fix unnecessary top space (this time produced by (redundant) <List/> from RN Elements)\n" }, { "from": "human", "value": "'use strict';\n\nimport React, { Component } from 'react';\nimport {\n View,\n ListView,\n Text,\n} from 'react-native';\n\nimport globalStyl...
javascript
chosen
[ { "from": "system", "value": "Introduce a linter error for testing CI\n\nThis commit is provokin this error:\n\n```\n/strapi/strapi/packages/strapi/lib/index.js 6:7 error\n'foo' is assigned a value but never used no-unused-vars\n```\n\nThe CI should detect this and avoid the merge to `master`\n" }, {...
javascript
chosen
[ { "from": "system", "value": "Fix setting targetHeight option for getPicture.\n" }, { "from": "human", "value": "MeteorCamera.getPicture = function (options, callback) {\n // if options are not passed\n if (! callback) {\n callback = options;\n options = {};\n }\n\n var success = funct...
javascript
chosen
[ { "from": "system", "value": "Fix typo on bypass function and standardize invalid token message\n" }, { "from": "human", "value": "const jwt = require('jsonwebtoken')\nconst config = require('config')\nconst CurrentUser = require('./../../services/current-user')\nconst Messages =...
javascript
chosen
[ { "from": "system", "value": "Use the embetter preview in an embed block.\n\n[Fixes #113198007]" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react'\nimport Block from './Block'\n\nclass EmbedBlock extends Component {\n\n static propTypes = {\n data: PropTypes...
javascript
chosen
[ { "from": "system", "value": "Check if modal got opened.\n" }, { "from": "human", "value": "import { testAsync } from './testHelpers'\nimport setupTestApp from './setupTestApp'\n\ntestAsync('Add Reference: TODO do serious stuff here', async (t) => {\n let { app } = await setupTestApp(t)\n let ...
javascript
chosen
[ { "from": "system", "value": "Add new test: new != old\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar expect = require('chai').expect;\nvar bitmapReader = require('../lib/bitmapReader');\n\ndescribe('bitmapReader', function() {\n before(function() {\n // rem...
javascript
chosen
[ { "from": "system", "value": "Fix intermittent build errors caused by Windows XP\n\nXP doesn't support the new TLS protocol used on https://d3fc.io\n" }, { "from": "human", "value": "exports.config = {\n user: process.env.BROWSERSTACK_USER,\n key: process.env.BROWSERSTACK_KEY,\n specs: ...
javascript
chosen
[ { "from": "system", "value": "Clear indices list before reload\n" }, { "from": "human", "value": "\nfunction DropdownCtrl($scope, $http, Data, pubsub) {\n $scope.data = Data;\n $scope.pubsub = pubsub;\n $scope.indices = [];\n $scope.types = [];\n\n $scope.pubsub.subscribe('HOST_CH...
javascript
chosen
[ { "from": "system", "value": "Allow passing other key codes, not just the ones from the list\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst keyCodeToEventMap = {\n 27: 'esc',\n 37: 'leftArrow',\n 38: 'upArrow',\n 39: 'rightArrow',\n 40: 'downArrow'\n};\n\nexport defa...
javascript
chosen
[ { "from": "system", "value": "Correct URL for user stories collection\n" }, { "from": "human", "value": "define([\n 'backbone', 'moment',\n 'connect/models/Story'\n], function(Backbone, moment, Story) {\n\n 'use strict';\n\n var Stories = Backbone.Collection.extend({\n model: Story,\n\n ...
javascript
chosen
[ { "from": "system", "value": "Refactor to use DOM API instead of embedded HTML strings\n" }, { "from": "human", "value": "var autocompleter = {\n look_up: function(value) {\n if(value == \"\") {\n this.clear_popup();\n }\n else {\n var self = this;\n $.ajax(\"/autocomple...
javascript
chosen
[ { "from": "system", "value": "Add 'it' in front of spec descriptions" }, { "from": "human", "value": "const { TerminalReporter } = require('jasmine-tagged')\n\nclass JasmineListReporter extends TerminalReporter {\n fullDescription (spec) {\n let fullDescription = spec.description\n let cu...
javascript
chosen
[ { "from": "system", "value": "Sort trains by stop order as a default\n" }, { "from": "human", "value": "var mongoose = require( \"mongoose\" );\n\nvar Schema = mongoose.Schema;\n\n\nvar TransitStopSchema = Schema ( {\n system: String,\n name: String,\n latitude: Number,\n longitude: ...
javascript
chosen
[ { "from": "system", "value": "Update PreviewFilter for invalid/non-returned timestamps (v2).\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc filter\n * @name dockstore.ui.filter:PreviewFilter\n * @function\n * @description\n * # PreviewFilter\n * Filter in the dockstore.ui.\n ...
javascript
chosen
[ { "from": "system", "value": "Add `published=all` query param to client request\n" }, { "from": "human", "value": "/*\n * Copyright 2015 Studentmediene i Trondheim AS\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with...
javascript
chosen
[ { "from": "system", "value": "Fix syntax according to jshint\n" }, { "from": "human", "value": "import AppConfig from 'scripts/config';\n\nexport default class User extends Backbone.Model {\n constructor(...args) {\n this.urlRoot = `${AppConfig.apiPath}/users`;\n\n this.validation = {\n ...
javascript
chosen
[ { "from": "system", "value": "Add todo for removing combineReducer\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport Pollard from './Pollard';\nimport { createStore, combineReducers } from 'redux';\nimport { Provider } from 'react-redux';\nimport * as reducers ...
javascript
chosen
[ { "from": "system", "value": "Check auth status in initial state\n" }, { "from": "human", "value": "import {CHANGE_FORM, SET_AUTH, SENDING_REQUEST} from '../actions/constants'\n\nlet assign = Object.assign\n\nlet initialState = {\n formState: {\n username: '',\n password: ''\n },\n curr...
javascript
chosen
[ { "from": "system", "value": "[BUG] Rename drop_table table name from old bank_transactions.\n" }, { "from": "human", "value": "var dbm = require('db-migrate');\nvar type = dbm.dataType;\n\nexports.up = function(db, callback) {\n db.createTable('external_transactions', { \n\t\tid: { type: 'int'...
javascript
chosen
[ { "from": "system", "value": "Cut the rate of score decay in half\n" }, { "from": "human", "value": "\nMeteor.startup(function () {\n var scoreInterval = getSetting(\"scoreUpdateInterval\") || 30;\n if(scoreInterval>0){\n\n // active items get updated every N seconds\n intervalId=Meteor....
javascript
chosen
[ { "from": "system", "value": "Use https for x-frame policy\n" }, { "from": "human", "value": "var Hapi = require('hapi');\nvar Path = require('path');\nvar routes = require('./lib/routes');\n\n// Create server\nvar server = new Hapi.Server({\n connections: {\n router: { stripTrailingSlash: t...
javascript
chosen
[ { "from": "system", "value": "Stop right trimming markdown strings\n" }, { "from": "human", "value": "import showdown from \"showdown\"\n\nmodule.exports = {\n getShowdownConverter: (mediaPath) => {\n return new showdown.Converter({\n extensions: [\n (converter) => [\n {...
javascript
chosen
[ { "from": "system", "value": "Resolve tsx and jsx extentions for SSR\n" }, { "from": "human", "value": "const path = require('path')\nconst nodeExternals = require('webpack-node-externals')\nconst TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin')\n\nconst ROOT = path.join(__dirname,...
javascript
chosen
[ { "from": "system", "value": "Enforce MFA for ALL ldap users\n" }, { "from": "human", "value": "function (user, context, callback) {\n // /!\\ DO NOT EDIT THIS FILE /!\\\n // Please use http://github.com/mozilla-iam/auth0-rules instead\n\n // LDAP group okta_mfa requires MFA authentication ev...
javascript
chosen
[ { "from": "system", "value": "Set maxInstances to 10, timeout to 9min and memory to 128MB\n" }, { "from": "human", "value": "'use strict';\n\nconst mirror = require('./mirror'),\n functions = require('firebase-functions');\n\nmodule.exports = { mirror: functions.https.onRequest(mirror.app) };...
javascript
chosen
[ { "from": "system", "value": "Extend a preexisting color array.\n\nMaximize performance, minimize memory footprint.\n" }, { "from": "human", "value": "\"use strict\";\n\n/**\n * Creates and returns a JavaScript array containing WebGL compatible colors\n * from a grayscale palette, enough to cove...
javascript
chosen
[ { "from": "system", "value": "Send 404 if page not found\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar child = require(\"child_process\");\nvar http = require(\"http\");\nvar os = require(\"os\");\nvar url = require(\"url\");\n\nvar irc = require(\"../library/irc.js\");\nvar settin...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Add ripple.txt support with cold wallet address.\n" }, { "from": "human", "value": "var express = require('express');\nvar nconf = require('./config/nconf.js');\nvar fs = require('fs');\nvar https = require('https');\n\nvar adapter = require(nconf.get('RIP...
javascript
chosen
[ { "from": "system", "value": "Remove legacy socket error handler\n" }, { "from": "human", "value": "module.exports = function (socket) {\n socket.on('connect', function () {\n console.log('Socket: connect');\n });\n socket.on('connect_error', function () {\n console.log('Socket: connect...
javascript
chosen
[ { "from": "system", "value": "Remove width and height when the overlay is invisible" }, { "from": "human", "value": "import React from 'react';\nimport {\n Animated,\n StyleSheet,\n View,\n Dimensions,\n TouchableHighlight\n} from 'react-native';\n\nconst DEFAULT_ANIMATE_TIME = 300;\nconst ...
javascript
chosen
[ { "from": "system", "value": "Update some weak typing to fix code climate\n" }, { "from": "human", "value": "// @flow\nimport type { Store } from 'redux'\nimport type { RoutesMap } from '../flow-types'\n\nexport default (routesMap: RoutesMap, selectLocationState: Function) => ({\n dispatch,\n ...
javascript
chosen
[ { "from": "system", "value": "Change method of transmission dependency and returns value.\n" }, { "from": "human", "value": "var PermissionConstructor = require('./PermissionConstructor').PermissionConstructor;\n\nfunction WebService(currentUser, dependencies) {\n\tthis.currentUser = currentUser...
javascript
chosen
[ { "from": "system", "value": "Add fill to progress bar\n" }, { "from": "human", "value": "import React from 'react';\n\nimport timeFormatter from './../../utils/timeformatter';\n\nconst style = {\n\n container: {\n position: 'absolute',\n left: '0',\n bottom: '0',\n ...
javascript
chosen
[ { "from": "system", "value": "Update action to use domain register for places repo.\n" }, { "from": "human", "value": "\"use strict\";\n\nimport placeToEat from \"../domain/placeToEat\";\n\n// First implementation always return the same in memory hardcoded place :)\nfunction selectAPlaceToEat() ...
javascript
chosen
[ { "from": "system", "value": "Fix sounds being uploaded to the wrong path\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar express = require('express');\nvar app = express();\nvar multer = require('multer');\nvar path ...
javascript
chosen
[ { "from": "system", "value": "Fix parseDocument (was broken on Firefox)" }, { "from": "human", "value": "/* HTML utilities */\ndefine(function () {\n function parseDocument(html) {\n /*\n var parser = new DOMParser();\n return parser.parseFromString(html, 'text/html');\n ...
javascript
chosen
[ { "from": "system", "value": "Comment out some unused assets loading\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/java...
javascript
chosen
[ { "from": "system", "value": "Allow html editor components to be moved around the page.\n" }, { "from": "human", "value": "$(document).ready(function() {\n // setup html editor\n var imgUploadHtml = $('#html-editor-image-upload-tab').html();\n var handler;\n\n if (imgUploadHtml) {\n var o...
javascript
chosen
[ { "from": "system", "value": "Include date in time in errorLogger\n" }, { "from": "human", "value": "import manifest from '../../../package.json';\nimport debug from 'debug';\nimport path from 'path';\nimport app from 'app';\n\nexport function debugLogger(filename) {\n const name = path.basenam...
javascript
chosen
[ { "from": "system", "value": "Add polygon tool to default set\n" }, { "from": "human", "value": "export default {\n // Get an array specifying the tools included in the current step.\n getStepTools: state => {\n if (state.steps && state.steps[state.activeStep].tools) {\n return state.s...
javascript
chosen
[ { "from": "system", "value": "Allow turbolinks to handle our custom push states\n" }, { "from": "human", "value": "// This code is to implement the tabs on the home page\n\n// navigate to the selected tab or the first tab\nfunction tabNavigation(e) {\n var activeTab = $('[href=\"' + location....
javascript
chosen
[ { "from": "system", "value": "Fix getting the default state.\n" }, { "from": "human", "value": "import reducer from \"./reducers\";\nimport { getEqfData } from \"./selectors\";\ndescribe(\"getEqfData\", () => {\n it(\"can extract EQF data from the current state\", () => {\n const state = red...
javascript
chosen
[ { "from": "system", "value": "Clear query cache after sign-in, sign-out\n" }, { "from": "human", "value": "import axios from 'axios'\nimport { useQuery, useQueryClient, useMutation } from 'react-query'\n\nimport { getCSRFToken, setCSRFToken } from 'utils/csrfToken'\n\nconst getCurrentUser = () =...
javascript
chosen
[ { "from": "system", "value": "Use stripes-core v0.3.0 API for permissions.\n" }, { "from": "human", "value": "import _ from 'lodash';\n\nconst IfPermission = props =>\n (_.get(props, ['currentPerms', props.perm]) ? props.children : null);\n\nexport default IfPermission;\n" }, { "from": ...
javascript
chosen
[ { "from": "system", "value": "Update PUT response to align with current dashboard\n" }, { "from": "human", "value": "// global_config.js\n\nvar Parse = require('parse/node').Parse,\n PromiseRouter = require('./PromiseRouter');\n\nvar router = new PromiseRouter();\n\nfunction getGlobalConfig(r...
javascript
chosen
[ { "from": "system", "value": "Revert \"Stopped minification because something isn't working.\"\n\nThis reverts commit 71f7cc626e2172f0c68d90e595a38003ac4ecef1.\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\tgrunt.registerTask('compileAssetsProd', [\n 'compileAssets'...
javascript
chosen
[ { "from": "system", "value": "Use ES5 in Sprocket compiled JS" }, { "from": "human", "value": "function unveil() {\n $('img').unveil()\n}\n\n$(document).on('content:update', () => {\n unveil()\n\n $('body').on('shown.bs.modal', () => {\n unveil()\n })\n})\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Add a warning if a browser does not support SharedArrayBuffers.\n" }, { "from": "human", "value": "const worker = new Worker('worker.js');\nworker.addEventListener('message', function (event) {\n document.getElementById('output').textContent = event.data;\n});\n\...
javascript
chosen
[ { "from": "system", "value": "Patch over bugs in sentry patch to upgrade version\n" }, { "from": "human", "value": "var getDefaultClientConfig = require('./getDefaultClientConfig');\nvar getDefaultProductionClientConfig = require('./getDefaultProductionClientConfig');\nvar getDefaultServerConfig...
javascript
chosen
[ { "from": "system", "value": "Add copy sitecore libraries task\n" }, { "from": "human", "value": "import yargs from 'yargs';\n\nexport default {\n /**\n * Task name\n * @type {String}\n */\n name: 'sitecore:copy-sitecore-libraries',\n\n /**\n * Task description\n * @type {String}\n ...
javascript
chosen
[ { "from": "system", "value": "Add GUI support for Travis\n" }, { "from": "human", "value": "module.exports = function(config) {\n var configuration = {\n\n client: {\n captureConsole: false\n },\n\n plugins: [\n 'karma-chai',\n 'karma-sino...
javascript
chosen
[ { "from": "system", "value": "Exclude presenter from unit testing\n" }, { "from": "human", "value": "module.exports = function(config) {\n\n var karma = {\n frameworks: ['jasmine'],\n files: [\n 'test/*.spec.js',\n 'src/js/model.js',\n 'src/js/view.js',\n 'src/js/prese...
javascript
chosen
[ { "from": "system", "value": "Add base _setup for pluginslist\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nvar Promise = require('../utils/promise');\nvar BookPlugin = require('./plugin');\n\n\n/*\nPluginsManager is an interface to work with multiple plugins at once:\n- Extra...
javascript
chosen
[ { "from": "system", "value": "Check that notification onclick is a function before calling\n" }, { "from": "human", "value": "const { ipcRenderer } = require('electron');\nconst uuidV1 = require('uuid/v1');\n\nclass Notification {\n static permission = 'granted';\n\n constructor(title = '', op...
javascript
chosen
[ { "from": "system", "value": "Reduce the pollution of global scope i.e. don't overwrite document with the fake one if one is already available.\nPrevent Sizzle to depend on window\n" }, { "from": "human", "value": "var document = {\n\tcreateElement: function(tag) {\n\t\treturn {\n\t\t\tappendChi...
javascript
chosen
[ { "from": "system", "value": "Use ES5 syntax for getter\n" }, { "from": "human", "value": "var get_system_locale_name = require('../build/Release/get_system_locale_name')\n\nmodule.exports.__defineGetter__('name', function getSystemLocaleName() {\n var systemLocaleName = get_system_locale_name(...
javascript
chosen
[ { "from": "system", "value": "Fix npm gulp not found issue\n" }, { "from": "human", "value": "const path = require('path');\nconst execa = require('execa');\nconst errorHandler = require('./errorHandler');\n\nmodule.exports = function runGulp() {\n execa(\n 'node',\n [\n path.join(__...
javascript
chosen
[ { "from": "system", "value": "Improve code style, fix JSDoc annotation\n" }, { "from": "human", "value": "'use strict';\n\n// FUNCTIONS //\n\nvar ln = Math.log;\n\n\n// WEIGHT TF-IDF //\n\n/**\n* Weights a document-term matrix by\n* term frequency - inverse document frequency.\n*\n* @param {Obje...
javascript
chosen
[ { "from": "system", "value": "Make Phantom exit when you don't give it an argument\n" }, { "from": "human", "value": "/*global phantom */\n\n\nvar args = require('system').args;\nvar fs = require('fs');\nvar page = require('webpage').create();\n\nif (args.length < 2) {\n\tconsole.log('kensington...
javascript
chosen
[ { "from": "system", "value": "Add message when email already exist\n" }, { "from": "human", "value": "Template.register.events({\n 'submit #register-form': function(e, t) {\n e.preventDefault();\n\n var isValidPassword = function(val, field) {\n if (val.length >= 6) {\n return...
javascript
chosen
[ { "from": "system", "value": "Clean up hook and make sure build in right place\n" }, { "from": "human", "value": "const path = require('path');\nconst fs = require('fs');\n// eslint-disable-next-line camelcase\nconst child_process = require('child_process');\n\nasync function doPostInstall() {\n...
javascript
chosen
[ { "from": "system", "value": "Fix `detectCircular` on root groups.\n" }, { "from": "human", "value": "// Checks if inheritance list of the given group is not circular.\n// Returns (via a callback) ObjectID of the group whree the circularity appears.\n//\n\n\n'use strict';\n\n\nvar _ = require('l...
javascript
chosen