conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Move display window to external display based on external display info.\n" }, { "from": "human", "value": "(function(){\n 'use strict';\n\n var controls = document.querySelector('#controls');\n controls.showDisplay = function() {\n chrome.app.window.create('bu...
javascript
chosen
[ { "from": "system", "value": "Add routes for DZI and simple example\n\nRoots also pass props to the components being loaded.\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport Router from 'vue-router'\n\n// Import Components\nimport Landing from '@/components/landing/Landing'\nimpo...
javascript
chosen
[ { "from": "system", "value": "Destroy session redis way too." }, { "from": "human", "value": "var CONTEXT_URI = process.env.CONTEXT_URI;\n\nexports.requiresSession = function (req, res, next) {\n if (req.session.encodedUsername) {\n res.cookie('_eun', req.session.encodedUsername);\n ...
javascript
chosen
[ { "from": "system", "value": "Fix Union Pay credit card regex" }, { "from": "human", "value": "import assertString from './util/assertString';\n\n/* eslint-disable max-len */\nconst creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|...
javascript
chosen
[ { "from": "system", "value": "Fix null/undefined error in hash of strings\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = toHashOfStrings;\n\nfunction toHashOfStrings (obj) {\n var out = {};\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n out[key] = obj[...
javascript
chosen
[ { "from": "system", "value": "ADD - TDD for POST employees endpoint without employee data\n" }, { "from": "human", "value": "var chakram = require('chakram'),\n expect = chakram.expect;\n\ndescribe(\"mPayroll API\", function() {\n\n it(\"should have POST employees endpoint\", function () {...
javascript
chosen
[ { "from": "system", "value": "Fix (ignore) no-underscore-dangle rule violations\n" }, { "from": "human", "value": "/**\n * This is where your tests go. It should happen automatically when you\n * add files to the karma configuration.\n */\n(function() {\n 'use strict';\n\n var specs = [],...
javascript
chosen
[ { "from": "system", "value": "Add --no-sandbox arg to protractor chrome\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n /* global exports, require */\n\n var path = require('path');\n\n exports.config = {\n seleniumAddress: 'http://localhost:4444/wd/hub',\n capabil...
javascript
chosen
[ { "from": "system", "value": "Fix byte swap for Explicit VR Big Endian (retired)\n" }, { "from": "human", "value": "/* eslint no-bitwise: 0 */\nfunction swap16 (val) {\n return ((val & 0xFF) << 8) |\n ((val >> 8) & 0xFF);\n}\n\n\nfunction decodeBigEndian (imageFrame, pixelData) {\n if (imag...
javascript
chosen
[ { "from": "system", "value": "Build websocket URL from existing location\n" }, { "from": "human", "value": "(function() {\n var config = {\n topics: [\n \"sensor/temperature/#\",\n \"control/radiator/+/active\",\n \"control/centralheating/active\",\n ...
javascript
chosen
[ { "from": "system", "value": "Remove show email JS function" }, { "from": "human", "value": "/* Promo page specific JS fucntions */\n\nfunction onReferralURLClick() {\n var ref_url = document.getElementById('referral_display').value;\n window.prompt(\"Copy to clipboard: Ctrl+C, Enter\", re...
javascript
chosen
[ { "from": "system", "value": "Rebuild test add-ons more gently.\n" }, { "from": "human", "value": "#!/usr/bin/env node\nconst test = require('tap').test\n , spawn = require('child_process').spawn\n ;\n\ntest('build test add-ons', function(t) {\n t.plan(1);\n spawn('node-gyp', ['rebuild']...
javascript
chosen
[ { "from": "system", "value": "[feature] Enable performance inspection in dev tools\n" }, { "from": "human", "value": "// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from \"vue\";\nimport App...
javascript
chosen
[ { "from": "system", "value": "Check if language const contains array\n" }, { "from": "human", "value": "export default {\n name: 'folder',\n\n lookup(options) {\n let found;\n if (typeof window !== 'undefined') {\n const language = window.location.pathname.match(/\\/([a-zA-Z-]*)/g);...
javascript
chosen
[ { "from": "system", "value": "Disable max-statements in Mocha tests\n\nOften, Mocha specs will require more statements than allowed by the\n`max-statements` rule. Sometimes it is possible to get around the issue\nby adding nested describes and contexts, but if you define a number of\nconsts and helper funct...
javascript
chosen
[ { "from": "system", "value": "Use update_title in DocumentTitle component\n" }, { "from": "human", "value": "import {connect} from 'react-redux';\nimport {Component} from 'react';\nimport PropTypes from 'prop-types';\n\nclass DocumentTitle extends Component {\n constructor(props) {\n s...
javascript
chosen
[ { "from": "system", "value": "Revert to old version of Backbone\n\nSync doesn't work properly in the latest release. (Though it does work in the\ncurrent master...)\n" }, { "from": "human", "value": "require.config({\n baseUrl: \"/static/scripts/src\",\n paths: {\n // Dependencies:\...
javascript
chosen
[ { "from": "system", "value": "Use simpler toolbar disabled logic\n" }, { "from": "human", "value": "import React from 'react';\nimport './ToolBar.css';\n\nexport default ({ tools }) => {\n return (\n <div className=\"toolbar\">\n {tools.map((tool, index) => (\n <button\n ...
javascript
chosen
[ { "from": "system", "value": "Hide AttachedInstrumentsCard until wired up\n" }, { "from": "human", "value": "// @flow\n// robot status panel with connect button\nimport * as React from 'react'\n\nimport type {Robot} from '../../robot'\n\nimport StatusCard from './StatusCard'\nimport AttachedInst...
javascript
chosen
[ { "from": "system", "value": "Fix Deezer is isPlaying() detection\n\nCurrently to check if a song is playing and should be scrobbled,\nthe existence of an item with css class \"svg-icon-pause\" is being\nchecked. This, unfortunately, causes problems as soon as playlists,\nalbums or anything playable is bein...
javascript
chosen
[ { "from": "system", "value": "Add xhr parsing helper methods\n" }, { "from": "human", "value": "var installAjax = function () {\n\tif (!stubAjax) return;\n\tjasmine.Ajax.install();\n};\n\nvar uninstallAjax = function () {\n\tif (!stubAjax) return;\n\tjasmine.Ajax.uninstall();\n};\n\nvar expectRe...
javascript
chosen
[ { "from": "system", "value": "Fix missing renderer issue when deep merging" }, { "from": "human", "value": "/* @flow */\nimport { isObject, arrayEach, objectEach } from 'fela-utils'\n\nimport type { StyleType } from '../../../flowtypes/StyleType'\nimport type { DOMRenderer } from '../../../flowt...
javascript
chosen
[ { "from": "system", "value": "Include all source files into coverage\n" }, { "from": "human", "value": "var log = require('./helpers/log.js')\nvar bin = require('./helpers/bin.js')\nvar root = require('./helpers/root.js')\nvar exec = require('./helpers/exec.js')\n\nmodule.exports = function () {...
javascript
chosen
[ { "from": "system", "value": "Attach event listeners to all finish buttons\n\n- Atttaching jQuery delegated event listener to the document rather than body targets ALL finish buttons in one foul swoooooop\n" }, { "from": "human", "value": "var storyListener = function (modal) {\n\n var observ...
javascript
chosen
[ { "from": "system", "value": "Add the missing logical not in the scan model validation" }, { "from": "human", "value": "define(['backbone'], function(Backbone) {\n\n return Backbone.Model.extend({\n idAttribute: 'SCANPARAMETERSMODELID',\n urlRoot: '/exp/parameters/models',\n ...
javascript
chosen
[ { "from": "system", "value": "Add show edit form logic\n" }, { "from": "human", "value": "Template.betItem.helpers({\n openStatus: function() {\n return ( this.status === \"open\" ) ? true : false;\n },\n\n pendingStatus: function() {\n return ( this.status === \"pending\" ) ? true : fa...
javascript
chosen
[ { "from": "system", "value": "Test change to see if BOM task is really necessary\n" }, { "from": "human", "value": "// Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information...
javascript
chosen
[ { "from": "system", "value": "Add Grunt JSHint task aliases\n" }, { "from": "human", "value": "\"use strict\";\nmodule.exports = function (grunt) {\n\t// Start w/ a clean slate\n\tgrunt.initConfig({});\n\t// JSHint\n\tgrunt.loadNpmTasks(\"grunt-contrib-jshint\");\n\tgrunt.config(\"jshint\", {\n\...
javascript
chosen
[ { "from": "system", "value": "Update isFeatureEnabled to require a Set and add guard.\n" }, { "from": "human", "value": "/**\n * Feature flags.\n *\n * Site Kit by Google, Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this...
javascript
chosen
[ { "from": "system", "value": "Create a test specifically for naming inconsistencies beween DOM and HTML.\n" }, { "from": "human", "value": "/*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/\n/*global start:false, stop:false ok:false, equal:false, notEqual:false, dee...
javascript
chosen
[ { "from": "system", "value": "Fix casing of require StringUtilities\n" }, { "from": "human", "value": "var assert = require('chai').assert;\nvar StringUtilities = require('../build/StringUtilities').StringUtilities;\n\ndescribe('StringUtilities', function () {\n describe('format', function ()...
javascript
chosen
[ { "from": "system", "value": "Add roboto to google fonts\n" }, { "from": "human", "value": "module.exports = {\n siteMetadata: {\n title: 'Gatsby Default Starter',\n },\n plugins: [\n 'gatsby-plugin-react-helmet',\n {\n resolve: `gatsby-plugin-google-analytics`,\n options: ...
javascript
chosen
[ { "from": "system", "value": "Add basic test with shallow rendering\n" }, { "from": "human", "value": "import expect from 'expect.js';\n\ndescribe('<App />', () => {\n it('should render the application', () => {\n expect(1).to.be(1);\n });\n});\n" }, { "from": "gpt", "value": "...
javascript
chosen
[ { "from": "system", "value": "Use SNI correctly for cert check\n" }, { "from": "human", "value": "'use strict';\n\nconst tls = require('tls');\nconst Promise = require('bluebird');\nconst moment = require('moment');\n\nconst SITES = ['porybox.com', 'hq.porygon.co', 'modapps.porygon.co'];\n\nmodu...
javascript
chosen
[ { "from": "system", "value": "Fix bug with segment parsing\n" }, { "from": "human", "value": "const number2ip = number => [\n (number & (0xff << 24)) >>> 24,\n (number & (0xff << 16)) >>> 16,\n (number & (0xff << 8)) >>> 8,\n number & 0xff\n].join('.');\n\nconst isIP = (ip) => {\n const ipA...
javascript
chosen
[ { "from": "system", "value": "CHANGE install docs on homepage to new package name\n" }, { "from": "human", "value": "import React from 'react';\nimport { Link } from 'react-router';\nimport './style.css';\n\nconst MainLinks = () => (\n <div id=\"main-links\" className=\"row\">\n <div classNa...
javascript
chosen
[ { "from": "system", "value": "Use better source map for filebrowser example.\n" }, { "from": "human", "value": "module.exports = {\n entry: ['whatwg-fetch', './build/index.js'],\n output: {\n path: __dirname + '/build',\n filename: 'bundle.js',\n publicPath: './example/'\n },\n bail...
javascript
chosen
[ { "from": "system", "value": "Add test to ensure mincer is exposed.\n\nThis will allow other modules to modify mincer before we use it — for example, to register an engine as mincer-babel does.\n" }, { "from": "human", "value": "var expect = require(\"expect.js\");\nvar mocha = require(\"mocha\"...
javascript
chosen
[ { "from": "system", "value": "Add function for creating plugins (only works with apivis for now)" }, { "from": "human", "value": "import {\n name as LIB_NAME,\n version as LIB_VERSION\n} from '../package.json';\n\nfunction pretty(arg) {\n let objs = [];\n let keys = [];\n\n return JSON.stri...
javascript
chosen
[ { "from": "system", "value": "Remove browser prefixes for box-sizing\n\n`box-sizing` is supported by all browsers, even in older versions, without a prefix." }, { "from": "human", "value": "import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {ROW, COL} from './co...
javascript
chosen
[ { "from": "system", "value": "Add global editor id and default values\n" }, { "from": "human", "value": "\"use strict\";\n\nvar defaultText = `# newtabnotes\n\nPlease enter *your* **Markdown** text;\n\n- It is\n- *easy*\n- trust me!\n\n-> Ligatures are supported as well!\n\n1 != 2\n`;\n\nvar edi...
javascript
chosen
[ { "from": "system", "value": "Set locale/timezone correctly when in format\n" }, { "from": "human", "value": "import moment from 'moment-timezone';\nimport AbstractFormat from './abstract';\n\nexport default class DateFormat extends AbstractFormat {\n format(dateValue, dateFormat, locale, timez...
javascript
chosen
[ { "from": "system", "value": "Fix a bug in clone action that switched the widgets with elements" }, { "from": "human", "value": "/*\n---\n \nscript: Clone.js\n \ndescription: Clones an element and inserts it back to parent again\n \nlicense: Public domain (http://unlicense.org).\n\nauthors: Yaro...
javascript
chosen
[ { "from": "system", "value": "Update the test with the expected files\n" }, { "from": "human", "value": "/*\n * @license\n * Copyright (c) 2016 The IBM Research Emergent Solutions authors. All rights reserved.\n * This code may only be used under the MIT style license found at https://ibmresearc...
javascript
chosen
[ { "from": "system", "value": "Add an html class to jarvus-ext-searchfield\n" }, { "from": "human", "value": "/*jslint browser: true, undef: true *//*global Ext*/\nExt.define('Jarvus.ext.form.field.Search', {\n extend: 'Ext.form.field.Text',\n xtype: 'jarvus-searchfield',\n\n inputType: ...
javascript
chosen
[ { "from": "system", "value": "Fix tests on Node 10\n" }, { "from": "human", "value": "'use strict';\n/* eslint-env mocha */\nconst assert = require('assert');\nconst execFile = require('child_process').execFile;\nconst path = require('path');\nconst ejslint = path.resolve('cli.js');\n\nsuite('cl...
javascript
chosen
[ { "from": "system", "value": "Add our meta tag CSRF token to every ajax request\n" }, { "from": "human", "value": "(function($){\n $(function(){\n\n \t$('.tooltipped').tooltip({delay: 50});\n \n \t// Smooth scroll for links on the current page\n $(document.body).on('click', 'a[href^...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix a bug when empty files would trigger an error\n" }, { "from": "human", "value": "'use babel'\n\nimport Path from 'path'\nimport Less from 'less'\n\nexport const minifier = false\nexport const compiler = true\nexport function process(contents, {rootDirector...
javascript
chosen
[ { "from": "system", "value": "Use Error constructor in rejection callbacks\n\nAfter updating ava, it seems that `t.throws` expects a proper error\nobject for the check to pass.\n" }, { "from": "human", "value": "import childProcess from 'child_process'\nimport fs from 'fs'\n\nimport promisify fr...
javascript
chosen
[ { "from": "system", "value": "Remove deprecated 'formatter' option (for standard-engine@5)\n" }, { "from": "human", "value": "var eslint = require('eslint')\nvar path = require('path')\nvar pkg = require('./package.json')\n\nmodule.exports = {\n bugs: pkg.bugs.url,\n cmd: 'standard',\n eslint...
javascript
chosen
[ { "from": "system", "value": "Put a bunch of stars together, and you can see that they twinkle at the same rate.\n" }, { "from": "human", "value": "var TwinklingStar = new Class({\n Extends: Star,\n initialize: function(options) {\n this.parent(options);\n if (this.brightness...
javascript
chosen
[ { "from": "system", "value": "Create a closure for click handlers in a loop\n" }, { "from": "human", "value": "\nvar d = new Discovery();\nvar controller;\n$(\"button#discovery\").bind(\"click\", function(e){\n d.start(function(data) {\n $(\"output .progress\").append(data.host).append(\"<...
javascript
chosen
[ { "from": "system", "value": "Reduce the amount of null and undefineds\n" }, { "from": "human", "value": "/**\n * Depending on if null & undefined are allowed they are returned about 10% of the time\n *\n * @param {any} value The value we use if it's not null or undefined\n * @param...
javascript
chosen
[ { "from": "system", "value": "Remove pseudo translation when in production, allow only languages with available translations in the language picker\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nimport countries from './countries';\n\n\nexport default Ember.Component.extend({\n...
javascript
chosen
[ { "from": "system", "value": "Use time parameter in requestAnimationFrame.\n" }, { "from": "human", "value": "function ProgressionController() {\n var counter;\n var request;\n var canvas;\n\n this.draw = function() {\n var ctx = canvas.getContext('2d');\n\n document.getEle...
javascript
chosen
[ { "from": "system", "value": "Revert \"allow for oob enabling of extension\"\n\n246cef3528c9ac38de1e624d10565f9fb3f33d40\n" }, { "from": "human", "value": "export async function up(knex) {\n await knex.raw(`CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public`);\n await knex.raw(\n `cr...
javascript
chosen
[ { "from": "system", "value": "Add className prop to Stats\n" }, { "from": "human", "value": "import cc from 'classcat'\nimport React from 'react'\nimport PropTypes from 'prop-types'\nimport Mute from 'lib/components/Mute'\nimport './style'\n\nconst valueClasses = value => cc([\n 'Stats__value',...
javascript
chosen
[ { "from": "system", "value": "Fix - icon alignment in onboarding modal (calendar ready)\n" }, { "from": "human", "value": "import { Alert, Icon } from 'react-components';\nimport { c } from 'ttag';\nimport React from 'react';\nimport calendarSvg from 'design-system/assets/img/pm-images/calendar....
javascript
chosen
[ { "from": "system", "value": "Use 'number' input to use the width: 80px CSS rule\n\nAuditors: eater, cbhl\n" }, { "from": "human", "value": "(function(Perseus) {\n\nvar InputInteger = Perseus.Widget.extend({\n initialize: function() {\n this.$input = $(\"<input>\");\n },\n\n rend...
javascript
chosen
[ { "from": "system", "value": "Integrate AlertsCtrl with CreateCtrl controller\n" }, { "from": "human", "value": "/**\n * Create Controller\n */\n\nangular\n .module('RDash')\n .controller('CreateCtrl', ['$scope', '$http', CreateCtrl]);\n\nfunction CreateCtrl($scope, $http) {\n $scope.se...
javascript
chosen
[ { "from": "system", "value": "Make this an init task instead, since it doesn't require any arguments\n" }, { "from": "human", "value": "/*\n * grunt-flush-redis\n * https://github.com/yaymukund/grunt-flush-redis\n *\n * Copyright (c) 2012 Mukund Lakshman\n * Licensed under the MIT license.\n */\...
javascript
chosen
[ { "from": "system", "value": "Add file / remove file\n" }, { "from": "human", "value": "const fs = require('fs')\n\nconst { FsUtils } = require('../../shared/utils')\n\nclass AlterationLoggerService {\n get dataPath() {\n return `${this.configService.configFolderPath}/alterations`\n }\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add redirect to root route if unavailable route is entered\n" }, { "from": "human", "value": "angular.module(\"realEstProperties\", [\"ngRoute\",\"realEstProperties.controllers\", \"realEstProperties.services\"])\n.config(function($routeProvider) {\n $routeProvider...
javascript
chosen
[ { "from": "system", "value": "Add test for the historic endpoint\n" }, { "from": "human", "value": "describe('traffic', function() {\n beforeEach(function() {\n window.matrix.settings = {\n profileId: ''\n };\n subject = window.matrix.traffic;\n });\n it('has initial points', f...
javascript
chosen
[ { "from": "system", "value": "Update storage on history filter change\n" }, { "from": "human", "value": "import { createStore, applyMiddleware, compose } from 'redux';\nimport { syncHistoryWithStore, routerMiddleware } from 'react-router-redux';\nimport { browserHistory } from 'react-router';\ni...
javascript
chosen
[ { "from": "system", "value": "Fix link to use the process cwd\n\nUnix behavior which ShellJs tries to emulate is weird in this scenario.\n" }, { "from": "human", "value": "/* global ln */\n\nimport 'shelljs/global';\n\nln('-sf', './', './node_modules/eslint-config-exchange-solutions');\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Fix duplicated banners for single page application" }, { "from": "human", "value": "\n(function() {\n var defaults = require('./defaults');\n\n chrome.storage.sync.get(defaults, function(settings) {\n var body = document.body;\n var bannerWrapper...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary stripCredits() function from Course\n" }, { "from": "human", "value": "\nmodule.exports = {\n Course: function Course(subject, number, credits) {\n this.subject = subject;\n this.number = number;\n if (credits !== undefined...
javascript
chosen
[ { "from": "system", "value": "Add CDATASection to eslint globals\n\n" }, { "from": "human", "value": "\nmodule.exports = {\n 'extends': 'eslint:recommended',\n 'rules': {\n 'indent': ['error', 4, { 'SwitchCase': 1 }],\n 'space-before-function-paren': ['error', 'never'],\n ...
javascript
chosen
[ { "from": "system", "value": "Use the correct analytics custom var\n" }, { "from": "human", "value": "//= require govuk/multivariate-test\n\n$(function () {\n\n GOVUK.taxDiscBetaPrimary = function () {\n $('.primary-apply').html($('#beta-primary').html());\n $('.secondary-apply').html($('...
javascript
chosen
[ { "from": "system", "value": "Improve error checking in browser example\n" }, { "from": "human", "value": "/*jshint browser:true */\n/*global define:false */\n\ndefine([\"underscore\", \"jquery\"], function (_, $) {\n \"use strict\";\n\n // Return the mp3-loader module\n return {\n\n ...
javascript
chosen
[ { "from": "system", "value": "Set default selected doping to Ti\n" }, { "from": "human", "value": "/*\n *\n * ActivityMapsPage reducer\n *\n */\n\nimport {\n DEFAULT_ACTION,\n CLICK_DOT,\n} from './constants';\n\nconst initialState = {\n selectedDot: {},\n};\n\nfunction activityMapsPageReduce...
javascript
chosen
[ { "from": "system", "value": "Allow for event delegation to happen.\n\nBy returning `false` from the `setup` and `teardown` hooks we allow jQuery to automatically attach native event handlers on the element thus allowing for event delegation to work." }, { "from": "human", "value": "/*!\n * jQue...
javascript
chosen
[ { "from": "system", "value": "Allow use-before-define for functions in eslint\n" }, { "from": "human", "value": "module.exports = {\n env: {\n es6: true,\n node: true,\n },\n extends: ['eslint:recommended', 'airbnb-base', 'plugin:prettier/recommended'],\n parserOptions: {\n sourceTy...
javascript
chosen
[ { "from": "system", "value": "Refactor Notification to use hooks\n" }, { "from": "human", "value": "import React from \"react\";\nimport _ from \"lodash\";\n\nclass Notifications extends React.Component {\n render() {\n var { kills } = this.props;\n var date = new Date();\n\n _.remove(...
javascript
chosen
[ { "from": "system", "value": "Include unused rules as well, just in case\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = {\n extends: [\n './default.js'\n ]\n}\n" }, { "from": "gpt", "value": "'use strict'\n\nmodule.exports = {\n extends: [\n './unused.js...
javascript
chosen
[ { "from": "system", "value": "[query-scope] Add a method to dispatch the new value of query and scope.\n" }, { "from": "human", "value": "module.exports = {\n builtInStore: require('./built-in-store')\n};\n" }, { "from": "gpt", "value": "let dispatcher = require('../dispatcher');\...
javascript
chosen
[ { "from": "system", "value": "Remove height setting from js\n" }, { "from": "human", "value": "$(document).ready(function(){\n $('.popup__toggle').on('click', popup);\n function popup() {\n $('#popup').toggleClass(\"open\");\n }\n function fileHandler(event){\n var file...
javascript
chosen
[ { "from": "system", "value": "Support server-side URL routing to React app.\n" }, { "from": "human", "value": "const express = require('express');\nconst app = express();\nconst PORT = process.env.PORT || 5000;\n\napp.use(express.static(__dirname + '/../react-ui/build'));\n\napp.get('/api', func...
javascript
chosen
[ { "from": "system", "value": "Handle HTTPS Git clone URLs\n" }, { "from": "human", "value": "const { execSync } = require('child_process');\nconst { readFileSync } = require('fs');\nconst { resolve } = require('path');\n\nfunction getGitCommit() {\n return execSync('git show -s --format=%h')\n ...
javascript
chosen
[ { "from": "system", "value": "Document response and challenge functions.\n" }, { "from": "human", "value": "(function(root, factory) {\n if (typeof exports === 'object') {\n // CommonJS\n factory(exports, module);\n } else if (typeof define === 'function' && define.amd) {\n // AMD\n ...
javascript
chosen
[ { "from": "system", "value": "Fix all CLI options other than boolean true being converted to false\n\nThe changes made in https://github.com/dbashford/textract/pull/39\nclobber any option passed at the command line. In light of\nhttps://github.com/dbashford/textract/pull/54 this code is unnecessary\nanyway....
javascript
chosen
[ { "from": "system", "value": "Remove unused helpers, use lodash\n" }, { "from": "human", "value": "/*\n * pat\n * https://github.com/mikko/pat\n *\n * Copyright (c) 2013 Mikko Koski\n * Licensed under the MIT license.\n */\n\n\"use strict\";\n\nvar _ = require(\"lodash\");\n\nfunction last(arr) ...
javascript
chosen
[ { "from": "system", "value": "Add some basic error handling\n" }, { "from": "human", "value": "import { ReactiveVar } from 'meteor/reactive-var';\n\nexport class Result {\n constructor({\n observer,\n defaultValue = {}\n } = {}) {\n this.observer = observer;\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add new test files for relativeCoords and neighborCoords\n" }, { "from": "human", "value": "require('./board-test.js');\nrequire('./game-test.js');\nrequire('./light-test.js');\nrequire('./levels-test.js');\nrequire('./score-test.js');\nrequire('./messages-test.js')...
javascript
chosen
[ { "from": "system", "value": "Use slower but safe Live Reload RN impl for now\n" }, { "from": "human", "value": "function liveReloadMiddleware(compiler) {\n let watchers = [];\n\n compiler.plugin('done', () => {\n const headers = {\n 'Content-Type': 'application/json; charset=UTF-8',\n...
javascript
chosen
[ { "from": "system", "value": "Revert 6914a00d4 because it broke 'add event' map\n\nreopens #512\n" }, { "from": "human", "value": "\"use strict\";\n\nvar _ZOOM = {\n NEIGHBORHOOD: 16,\n MIN: 11,\n MAX: 19\n};\n\nmodule.exports = {\n ZOOM: Object.freeze ? Object.freeze(_ZOOM) : _ZOOM,...
javascript
chosen
[ { "from": "system", "value": "Fix wrong dev config logic\n" }, { "from": "human", "value": "process.on('unhandledRejection', err => {\n throw err;\n});\n\nconst express = require('express');\nconst next = require('next');\nconst { createRouter } = require('soya-next/server/router');\nconst { so...
javascript
chosen
[ { "from": "system", "value": "Fix ability to build prod static files\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\nvar ExtractTextPlugin = require('extract-text-webpack-plugin');\nvar HtmlWebpackPlugin = require('html-webpack-plugin');\n\nmodu...
javascript
chosen
[ { "from": "system", "value": "Make EditWidgetView handle widgets with no available widget types\n\nDo not fail if the entry has a a widget with current widget type null\nand no available widget types. Simply hide the select.\n" }, { "from": "human", "value": "pageflow.EditWidgetView = Backbone.M...
javascript
chosen
[ { "from": "system", "value": "Fix validation on noedit initial fields\n" }, { "from": "human", "value": "var keystone = require('../../../../');\n\nmodule.exports = function (req, res) {\n\tif (!keystone.security.csrf.validate(req)) {\n\t\treturn res.apiError(403, 'invalid csrf');\n\t}\n\tvar it...
javascript
chosen
[ { "from": "system", "value": "Replace reference to variant test for preview by nhs chaps\n" }, { "from": "human", "value": "//= require libs/jquery/jquery-ui-1.8.16.custom.min\n//= require libs/jquery/plugins/jquery.base64\n//= require libs/jquery/plugins/jquery.mustache.js\n//= require libs/jqu...
javascript
chosen
[ { "from": "system", "value": "Fix bug in relationships via REST API.\n" }, { "from": "human", "value": "'use strict';\n\nvar DataCollection = require('data-collection');\n\n/**\n * Given a array of relationship data and the HTTP query, filters it\n * @param {Array} data Array of data comin...
javascript
chosen
[ { "from": "system", "value": "Fix behavior when nested in another addon\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n name: 'torii',\n init: function() {\n this.treePaths.app = '../lib/torii';\n this.treePaths.addon = '../lib/torii';\n },\n\n treeForApp: func...
javascript
chosen
[ { "from": "system", "value": "Watch assets and recompile them on change, minify JS for production mode\n" }, { "from": "human", "value": "'use strict';\n\nconst autoprefixer = require('autoprefixer');\nconst ExtractTextPlugin = require('extract-text-webpack-plugin');\n\nmodule.exports = {\n e...
javascript
chosen
[ { "from": "system", "value": "Update dependencies, migrate webpack dev conf + babel + adapt to new react v16\n" }, { "from": "human", "value": "/* eslint-disable */\n//noinspection Eslint\nconst BrowserSyncPlugin = require('browser-sync-webpack-plugin');\n//noinspection Eslint\nconst ExtractText...
javascript
chosen
[ { "from": "system", "value": "Fix for server root relative url\n" }, { "from": "human", "value": "/**\n * Created by SuhairZain on 12/5/16.\n */\n\nvar webpack = require('webpack');\nvar HtmlWebpackPlugin = require('html-webpack-plugin');\n\nvar PROD = JSON.parse(process.env.PROD_ENV || '0');\n\...
javascript
chosen
[ { "from": "system", "value": "Switch default URL back to Jesse\n" }, { "from": "human", "value": "'use strict';\n\nconst webpack = require('webpack');\nconst path = require('path');\nvar CopyWebpackPlugin = require('copy-webpack-plugin');\n\nmodule.exports = {\n\n entry: [\n 'webpack-d...
javascript
chosen
[ { "from": "system", "value": "Send router to home view\n" }, { "from": "human", "value": "define([\n 'Backbone',\n\n //Views\n 'app/views/projectsView',\n\n //Templates\n 'text!templates/home/boxesTemplate.html'\n], function(\n \n Backbone,\n\n projectsView,\n\n //Template\n boxesTempl...
javascript
chosen
[ { "from": "system", "value": "Remove named exports for CJS interop.\n" }, { "from": "human", "value": "// Meta data is stored on the html element\nvar html = document.getElementsByTagName('html')[0];\n\n// A helper to grab our meta data\nfunction getData(name) {\n name = `data-${name}`;\n retu...
javascript
chosen