conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix compression tests for legacy IE; make compression tests test for size rather than exact value stored\n" }, { "from": "human", "value": "var { deepEqual } = require('../tests/util')\n\nmodule.exports = {\n\tplugin: require('./compression'),\n\tsetup: setup,\n}\n\...
javascript
chosen
[ { "from": "system", "value": "Use https for POI fetching to prevent mixed content blocking.\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('placesOfInterest').\nservice('fetchPlaceOfInterestData', function (BING_API_KEY) {\n return function(lat, lng, radius) {\n var...
javascript
chosen
[ { "from": "system", "value": "Fix getConfig and add validation\n" }, { "from": "human", "value": "const path = require('path');\nconst fs = require('fs-extra');\n\nmodule.exports = {\n\n /**\n * Database source directory.\n */\n sourceDir: 'sql-database',\n\n /**\n * Config ...
javascript
chosen
[ { "from": "system", "value": "Disable fetching on new props\n" }, { "from": "human", "value": "// @flow\n\nimport { compose } from 'redux';\nimport { connect } from 'react-redux';\nimport { createStructuredSelector } from 'reselect';\nimport { dispatched } from 'react-prepare';\nimport { fetchAl...
javascript
chosen
[ { "from": "system", "value": "Add headline \"Petitionen\" to petitions page\n" }, { "from": "human", "value": "import React from 'react';\nimport PetitionListItem from 'components/PetitionListItem';\n\nconst Petitions = ({ total, petitions, currentPage, perPage }) => (\n <ul>\n {petitions.ma...
javascript
chosen
[ { "from": "system", "value": "Select all when editing in angular-xeditable by default\n" }, { "from": "human", "value": "var app = angular.module('swot', [\n 'ui.bootstrap',\n 'ui.utils',\n 'ui.sortable',\n 'focus',\n 'confirmExit',\n 'ngDebounce',\n 'ngAnimate',\n 'xedit...
javascript
chosen
[ { "from": "system", "value": "Add difficulty to stub challenge to allow cheat calculation to happen\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2014-2021 Bjoern Kimminich.\n * SPDX-License-Identifier: MIT\n */\n\nconst chai = require('chai')\nconst expect = chai.expect\nconst chaiAsP...
javascript
chosen
[ { "from": "system", "value": "Update searchBox view to match new WP templates\n" }, { "from": "human", "value": "import $ from 'jquery';\nimport * as Backbone from 'backbone';\nimport dispatcher from '../helpers/dispatcher.js';\n\nclass SearchBoxView extends Backbone.View {\n\n get el() { retur...
javascript
chosen
[ { "from": "system", "value": "Use component in example for consistency\n" }, { "from": "human", "value": "import React from 'react';\nimport { dispatch, composeStores } from 'redux';\nimport CounterApp from './CounterApp';\nimport TodoApp from './TodoApp';\nimport * as stores from '../stores/ind...
javascript
chosen
[ { "from": "system", "value": "Move validation checks into the constructor of Bookmark Entity\n" }, { "from": "human", "value": "import * as Id from './id';\nimport * as Fields from './fields';\n\nclass Bookmark {\n constructor(id, fields) {\n this.id = id;\n this.fields = fields;\n ret...
javascript
chosen
[ { "from": "system", "value": "[fix] Add enum types to interaction prop types\n\nClose #1358\n" }, { "from": "human", "value": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tr...
javascript
chosen
[ { "from": "system", "value": "Add script to add \"today\" class to monthwidget" }, { "from": "human", "value": "require(['jquery', 'wdn'], function($, WDN) {\n\tvar $progress = $('<progress>');\n\t\n\t$(function() {\n\t\tWDN.log('Something should happen')\n\t});\n});\n" }, { "from": "gpt...
javascript
chosen
[ { "from": "system", "value": "Refactor controller to use promises\n" }, { "from": "human", "value": "/**\n * PlayersController\n *\n * @description :: Server-side logic for managing Players\n * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers\n */\n\nmodule.exports = ...
javascript
chosen
[ { "from": "system", "value": "Make possible to open youtube links as audio only\n\nThis add to youtube plugin the ability to open youtube links as audio only (without image, only the control panel)" }, { "from": "human", "value": "// Namespace\nvar mejs = mejs || {};\n\n// version number\nmejs.v...
javascript
chosen
[ { "from": "system", "value": "Support age verification for alcohol\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Amazon age-verification autoredirect\n// @namespace curipha\n// @description Click the \"I'm over 18\" link automatically at amazon.co.jp.\n// @incl...
javascript
chosen
[ { "from": "system", "value": "Fix how we export processors\n" }, { "from": "human", "value": "'use strict';\n\nexport Taxonomy from './processor.taxonomy';\nexport Compromise from './processor.compromise';\nexport Relations from './processor.relations';\nexport Sentiment from './processor.sentim...
javascript
chosen
[ { "from": "system", "value": "Add a Redmine 'Done' button\n" }, { "from": "human", "value": "/*jslint indent: 2, unparam: true*/\n/*global $: false, document: false, togglbutton: false*/\n'use strict';\n\ntogglbutton.render('body.controller-issues.action-show h2:not(.toggl)', {}, function (elem)...
javascript
chosen
[ { "from": "system", "value": "Set localhost as default proxy\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar path = require('path');\nvar loaders = require('./webpack.loaders');\n\nmodule.exports = {\n\tentry: [\n\t\t'webpack/hot/only-dev-server',\n\t\t'./src/index.jsx'...
javascript
chosen
[ { "from": "system", "value": "Allow adding custom response listeners\n" }, { "from": "human", "value": "var http = require(\"http\");\n\nfunction HttpServer(config) {\n this.port = config.port || 8181;\n this.address = config.address || \"localhost\";\n this.options = {\n data: null,\n ...
javascript
chosen
[ { "from": "system", "value": "Add line break to avoid long line\n" }, { "from": "human", "value": "/* global describe it */\n'use strict'\n\nconst chai = require('chai')\nconst chaiAsPromised = require('chai-as-promised')\nconst requireInject = require('require-inject')\nconst sinon = require('s...
javascript
chosen
[ { "from": "system", "value": "Add error responses to fakeServer\n" }, { "from": "human", "value": "// go.testHelpers.rpc\n// ==================\n\n(function(exports) {\n var assertRequest = function(req, url, method, params) {\n assert.equal(req.url, url);\n assert.equal(req.data.method, ...
javascript
chosen
[ { "from": "system", "value": "Add texture format to texture loader\n" }, { "from": "human", "value": "(function(){\n\t\n\t'use strict';\n\n\t/**\n\t * Texture loader based on {@link https://github.com/mrdoob/three.js/blob/master/src/loaders/TextureLoader.js}\n\t * @memberOf PANOLENS.Utils\n\t * ...
javascript
chosen
[ { "from": "system", "value": "Check if HTTPS is active and use proper proxies\n" }, { "from": "human", "value": "var request = require('xhr');\nvar url = require('./url');\n\nvar CORS_PROXIES = ['http://cors.corsproxy.io?url=', 'http://www.corsproxy.com/'];\n\nfunction getUrl ( text ) {\n\tvar p...
javascript
chosen
[ { "from": "system", "value": "Update token after each request to back\n" }, { "from": "human", "value": "angular.module('mewpipe')\n .factory('tokenInterceptor', tokenInterceptor);\n\ntokenInterceptor.$inject = ['Config'];\n\nfunction tokenInterceptor(Config){\n\treturn {\n\n\t\t'response'...
javascript
chosen
[ { "from": "system", "value": "Add a callback for recaptcha\n" }, { "from": "human", "value": "(function() {\n var submitButton = document.querySelector('[data-fx=\"submit-button\"]');\n submitButton.disabled = true;\n\n var bouncer = new Bouncer('[data-validate]', {\n disableSubmit: true,\...
javascript
chosen
[ { "from": "system", "value": "Define cell value as a read only cp\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/lt-cell';\n\nconst {\n get,\n computed\n} = Ember;\n\nexport default Ember.Component.extend({\n layout,\n tagName: 'td'...
javascript
chosen
[ { "from": "system", "value": "MDS: Fix ajax error while checking available tabs\n\nChange-Id: I4f8a4d538e59dcdb03659c7f5405c40abcdafed8\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n var mds = angular.module('mds', [\n 'motech-dashboard', 'entityService','inst...
javascript
chosen
[ { "from": "system", "value": "Allow commas in assessment fees and expenses values\n" }, { "from": "human", "value": "\"use strict\";\n\nvar adp = adp || {};\n\nadp.determination = {\n init : function(container_id) {\n this.addChangeEvent(container_id);\n },\n calculateAmount: function(fee,...
javascript
chosen
[ { "from": "system", "value": "Apply stacked graph improvements to LPA graph as example\n" }, { "from": "human", "value": "define([\n 'require',\n 'extensions/views/timeseries-graph/timeseries-graph',\n 'extensions/views/graph/linelabel',\n './callout'\n],\nfunction (require, TimeseriesGraph,...
javascript
chosen
[ { "from": "system", "value": ":ambulance: Fix return of fetch response\nAPI response now uses a top level key items followed by the array\n" }, { "from": "human", "value": "import axios from 'axios';\n\nexport default itemIdentifier => axios.get(`items`, {\n baseURL: `http://track.bpost.be/btr/...
javascript
chosen
[ { "from": "system", "value": "Fix add to cart JS for compatibility with group buy\n" }, { "from": "human", "value": "/**\n * Update the price on the product details page in real time when the variant or the quantity are changed.\n **/\n\n$(document).ready(function() {\n // Product page with var...
javascript
chosen
[ { "from": "system", "value": "Handle creates and updates in the reducer\n" }, { "from": "human", "value": "import * as types from '../actions/action-types';\nimport initialState from './initial-state';\n\nexport default (state = initialState.courses, action) => {\n switch (action.type) {\n ...
javascript
chosen
[ { "from": "system", "value": "Implement Create a Subcampaign Model Setting Dynamically\n" }, { "from": "human", "value": "var configuration = require('../../../config/configuration.json')\nvar utility = require('../../../public/method/utility')\n\nmodule.exports = {\n setsubCampaignSettingModel...
javascript
chosen
[ { "from": "system", "value": "Set contributor alt gh username\n" }, { "from": "human", "value": "import React from 'react';\n\nexport default ({contributors}) => {\n return <ul className=\"bubble-list\">\n {contributors.map(c =>\n <Contributor\n key={c.id}\n avatar={c.avat...
javascript
chosen
[ { "from": "system", "value": "Add new properties to user schema\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\nvar userSchema = new Schema({\n githubId: Number,\n name: String,\n avatar_url: String,\n isDeveloper: Boolean,\n projects...
javascript
chosen
[ { "from": "system", "value": "Remove select2 library from config\n" }, { "from": "human", "value": "/*\n * EksiOkuyucu - unofficial eksisozluk client\n * http://eksiokuyucu.com/\n *\n * Copyright (C) 2014 Onur Aslan <onuraslan@gmail.com>\n * Licensed under MIT\n * https://github.com/onuraslan/...
javascript
chosen
[ { "from": "system", "value": "Use N4JDB.query to create a (:Meteo4j {name: 'hello world'}) node\n" }, { "from": "human", "value": "\n\nif (Meteor.isServer) {\n // Check if there are any nodes at all in the database\n var query = 'MATCH (n) RETURN n'\n var options = null\n Meteor.N4JDB.query(...
javascript
chosen
[ { "from": "human", "value": "Add aria state setting, class toggles and ID setting.\n" }, { "from": "gpt", "value": ";(function (w, doc) {\n // Enable strict mode\n \"use strict\";\n var accordion = document.querySelectorAll('.accordion');\n\n var forEach = function (array, callback, scope) {...
javascript
chosen
[ { "from": "system", "value": "Improve low level string representation\n" }, { "from": "human", "value": "'use strict';\n\nvar d = require('es5-ext/lib/Object/descriptor')\n , proto = require('../_proto')\n , simple = require('./simple')\n\n , validate;\n\nObject.defineProperties(simple(...
javascript
chosen
[ { "from": "system", "value": "Fix FF issues with doghouse.\n\nDog House loading for latest versions of FF, Chrome and even IE (likely works on safari too). Basically make it so that the popstate event is ignored on the first load of the page (which is what FF does)...that made all the other browsers fall i...
javascript
chosen
[ { "from": "system", "value": "Format date and time display.\n" }, { "from": "human", "value": "import React from 'react'\n\nexport default ({ event }) => (\n <h4>\n {\n `${event.code}\n - ${new Date(event.date * 1000).toLocaleString()}\n - ${event.home} X ${event.away}\n ...
javascript
chosen
[ { "from": "system", "value": "Change to use HTML5mode for URL. Remove hashbang and hash prefix from app URL.\n" }, { "from": "human", "value": "'use strict';\n\n//Start by defining the main module and adding the module dependencies\nangular.module(ApplicationConfiguration.applicationModuleName,\...
javascript
chosen
[ { "from": "system", "value": "Normalize entity name and return promises\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n afterInstall: function() {\n this.addPackagesToProject([\n { name: 'ember-cli-paint' },\n { name: 'ember-cli-lod...
javascript
chosen
[ { "from": "system", "value": "Fix scope issues in CommentsRetriever\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.comments').factory('CommentsRetriever', [\n 'configurator',\n 'idHandler',\n function(configurator, idHandler) {\n var comments = {};\n\n fu...
javascript
chosen
[ { "from": "system", "value": "Increase timeout for stopping processes during tests.\n" }, { "from": "human", "value": "'use strict';\n\nfunction killApiUmbrellaServer(callback) {\n global.apiUmbrellaStopping = true;\n\n if(global.apiUmbrellaServer) {\n if(callback) {\n global.apiUmbrel...
javascript
chosen
[ { "from": "system", "value": "Repair tests with new grunt\n" }, { "from": "human", "value": "module.exports = {\n server: {},\n\n options: {\n hostname: '0.0.0.0',\n port: (process.env.PORT || 8000),\n base: '.',\n middleware: function(connect, options) {\n return [\n r...
javascript
chosen
[ { "from": "system", "value": "Update ID to be archived company ID\n" }, { "from": "human", "value": "const selectors = require('../../selectors')\n\ndescribe('Company interaction', () => {\n beforeEach(() => {\n cy.visit('/companies/4cd4128b-1bad-4f1e-9146-5d4678c6a018/interactions')\n })\n...
javascript
chosen
[ { "from": "system", "value": "Update datasets assignment in namespace\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar merge = require( '@stdlib/utils/merge' );\nvar NS = require( '@stdlib/datasets' );\n\n\n// ASSIGN //\n\n/**\n* Assigns modules to a namespace.\n*\n* @pri...
javascript
chosen
[ { "from": "system", "value": "Add firefox launching for CI.\n" }, { "from": "human", "value": "/* eslint-env node */\nmodule.exports = {\n \"test_page\": \"tests/index.html?hidepassed\",\n \"disable_watching\": true,\n \"launch_in_ci\": [\n \"PhantomJS\"\n ],\n \"launch_in_dev\": [\n ...
javascript
chosen
[ { "from": "system", "value": "Check that position code is present before reading" }, { "from": "human", "value": "define(['mac/roman'], function(macintoshRoman) {\n\n 'use strict';\n \n return function(resource) {\n var dv = new DataView(resource.data.buffer, resource.data.byteOffset, reso...
javascript
chosen
[ { "from": "system", "value": "Use null dataObject if color table is empty" }, { "from": "human", "value": "define(function() {\n\n return function(resource) {\n var dv = new DataView(resource.data.buffer, resource.data.byteOffset, resource.data.byteLength);\n var entryCount = dv.getInt16(...
javascript
chosen
[ { "from": "system", "value": "Remove credentials path in TURN request URL.\n" }, { "from": "human", "value": "module.exports = {\n constant: {\n LOOPBACK_CLIENT_ID: 'LOOPBACK_CLIENT_ID',\n TURN_BASE_URL: 'https://node-apprtc.herokuapp.com',\n TURN_URL_TEMPLATE: '%s/turn?username=%s&key...
javascript
chosen
[ { "from": "system", "value": "Make compatible with Node 0.10 🤢\n" }, { "from": "human", "value": "'use strict';\n\nconst assert = require('assert');\nconst encoders = require('../lib/encoders');\nconst fixtures = require('./fixture/server');\n\n\ndescribe('encoders', function () {\n describe('...
javascript
chosen
[ { "from": "system", "value": "Update test to check for required new format\n" }, { "from": "human", "value": "var test = require('tape');\nvar expect = require('./helpers/expect-constraints');\n\ntest('camera max:15fps', expect({\n audio: true,\n video: {\n mandatory: {\n maxFrameRate:...
javascript
chosen
[ { "from": "system", "value": "Change double quotes to single quotes to satisfy linter\n" }, { "from": "human", "value": "import \"./App.css\"\nimport { BrowserRouter, Route } from \"react-router-dom\"\n\nimport Login from \"./containers/Login/Login\"\nimport SGonksPlatfrom from \"./containers/SG...
javascript
chosen
[ { "from": "system", "value": "Hide empty TOC items in metadata editor.\n" }, { "from": "human", "value": "import { ModelComponent } from '../../kit'\n\nexport default class MetaSectionTOCEntry extends ModelComponent {\n render ($$) {\n const id = this.props.id\n const name = this.props.na...
javascript
chosen
[ { "from": "system", "value": "Add corrected key for pageinfocolumns\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { FlexColumn } from '../FlexColumn';\nimport { PageInfoRow } from './PageInfoRow';\n\nexport const PageInfoColumn = ({\...
javascript
chosen
[ { "from": "system", "value": "Add extra FastBoot protection when loading the sdk\n" }, { "from": "human", "value": "import Service from '@ember/service';\nimport { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promi...
javascript
chosen
[ { "from": "system", "value": "jf-vscroll: Use one time watch, instead of timeout to init element height init\n" }, { "from": "human", "value": "export function jfVScrollElement($compile) {\n return {\n restrict: 'E',\n scope: {\n data: '=',\n template: '=',...
javascript
chosen
[ { "from": "system", "value": "Add a place holder for chart\n" }, { "from": "human", "value": "import React from \"react\"\nimport {TradingView} from \"../Market\"\n\nexport default class LimitOrderChart extends React.Component {\n render() {\n return (\n <TradingView />\n )\n }\n}\n...
javascript
chosen
[ { "from": "system", "value": "Convert data to float in sparklines\n" }, { "from": "human", "value": "import { Sparkline } from 'lib/visualizations'\n\nwindow.GobiertoCharters.ChartersController = (function() {\n\n function ChartersController() {}\n\n ChartersController.prototype.show = functio...
javascript
chosen
[ { "from": "system", "value": "Change the ping service message\n" }, { "from": "human", "value": "module.exports = function(server) {\n\t//This route is added for the server health monitoring\n\tserver.use('/ping', function(req, res, next) {\n\t res.send('pong');\n\t});\n};" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Update maxValues for fps anf cps\n" }, { "from": "human", "value": "const series = {\n fps: {\n label: \"FPS\",\n maxValue: 65,\n color: \"#F78900\"\n },\n fpsMin: {\n label: \"FPS Min\",\n ...
javascript
chosen
[ { "from": "system", "value": "Set alt attr as team member's name" }, { "from": "human", "value": "import React from 'react'\nimport {\n Flex,\n Box,\n Heading,\n Text,\n Avatar,\n Badge\n} from '@hackclub/design-system'\n\nconst Base = Flex.extend`\n border-radius: ${props => props.theme....
javascript
chosen
[ { "from": "system", "value": "Remove nearby enemies on game start.\n" }, { "from": "human", "value": "/* global game, Phaser, ms */\n\nvar Player = function(targetTile) {\n Phaser.Sprite.call(this, game, 0, 0, 'pix');\n game.add.existing(this);\n ms.player = this;\n this.anchor.set(0...
javascript
chosen
[ { "from": "system", "value": "Set up all the URLs\n" }, { "from": "human", "value": "import 'babel-polyfill'\nimport express from 'express'\nimport fallback from 'express-history-api-fallback'\nimport path from 'path'\nimport log from './log'\nimport proxy from 'http-proxy-middleware'\n\n// Prop...
javascript
chosen
[ { "from": "system", "value": "Change of second error message\n" }, { "from": "human", "value": "\"use strict\";\n\nvar utils = require(\"../utils\");\nvar log = require(\"npmlog\");\n\nmodule.exports = function(defaultFuncs, api, ctx) {\n return function changeNickname(nickname, threadID, parti...
javascript
chosen
[ { "from": "system", "value": "Switch left/right mouse buttons, remove zoom on middle\n" }, { "from": "human", "value": "'use strict';\ndefine(\n ['three', 'OrbitControls'],\n function(THREE) {\n return class Camera {\n \n // ####################################...
javascript
chosen
[ { "from": "system", "value": "Move helper call to router.js\n" }, { "from": "human", "value": "const AWS = require('aws-sdk');\nconst config = require('./config');\nconst helpers = require('./helpers');\n\nif (process.argv.length < 2 || process.argv.length > 3) {\n console.error('Usage: node li...
javascript
chosen
[ { "from": "system", "value": "jf-tooltip-on-overflow: Use the root dir element as the target, not the actual event target.\n" }, { "from": "human", "value": "/*\n USAGE EXAMPLE:\n\n <jf-grid-filter\n filter-grid=\"gridOptions\" //the name of the grid (grid options)\n filter-field=\"fieldName\" ...
javascript
chosen
[ { "from": "system", "value": "Add 5 minutes to start boundary\n" }, { "from": "human", "value": "export const getSelectedTime = (\n server_time,\n selected_time,\n market_open_time,\n) => {\n const boundaries = selected_time.isBefore(market_open_time)\n ? market_open_time.isBe...
javascript
chosen
[ { "from": "system", "value": "Fix spelling error in module\n" }, { "from": "human", "value": "const Tweet = require('../models/tweet')\nconst controllerUtils = require('./controllerUtils')\n\nconst specificTweetsController = function (req, res) {\n if (!req.params.name) {\n res.status(400).s...
javascript
chosen
[ { "from": "system", "value": "Add GraphQL schema description for args.page\n" }, { "from": "human", "value": "'use strict';\n\n\nconst { GraphQLInt, GraphQLString } = require('graphql');\n\n\n// Pagination arguments\nconst paginationActionTypes = ['find'];\nconst getPaginationArgument = function...
javascript
chosen
[ { "from": "system", "value": "Clean up Commit cha verify, add completed steps\n" }, { "from": "human", "value": "var exec = require('child_process').exec\nvar fs = require('fs')\n\nvar helper = require('../verify/helpers.js')\nvar userData = require('../data.json')\n\nvar addtoList = helper.addt...
javascript
chosen
[ { "from": "system", "value": "Fix bug in launch-screen that disabled holding it beyond a 6s timeout\n\nThe default behavior meant that the launch screen would always be\nreleased twice on a single hold: once when the template is rendered,\nand once after a 6s timeout. So additional holds would not have any\...
javascript
chosen
[ { "from": "system", "value": "Allow run to not run on unmount\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nimport SearchActions from '../actions/SearchActions.js';\n\nclass Run extends Component {\n componentDidMount() {\n SearchActions.nsearch(this.props.n...
javascript
chosen
[ { "from": "system", "value": "Revert \"Show tampering warning *only* when data has been tampered with :ninja:\"\n\nThe position was intentional. it should be loud until we pull out the fake\npart of this options method.\n" }, { "from": "human", "value": "import backbone from 'backbone';\nimport ...
javascript
chosen
[ { "from": "system", "value": "Add header comments to JS code\n" }, { "from": "human", "value": "(function () {\n function initTwinklingStars() {\n const devicePixelRatio = Math.min(window.devicePixelRatio, 3) || 1;\n\n particlesJS('stars', {\n particles: {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix missing exports for SpecError\n\nThis needs to be followed-up with test coverage.\n" }, { "from": "human", "value": "// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this so...
javascript
chosen
[ { "from": "system", "value": "Handle navigation on keydown instead of keypress to work around automatic input focus acquisition.\n" }, { "from": "human", "value": "window.addEventListener(\"keypress\", function (event) {\n if (window.document.activeElement !== window.document.body) {\n ...
javascript
chosen
[ { "from": "system", "value": "Handle failure when attempting to send a message\n" }, { "from": "human", "value": "import Ember from \"ember\";\n\nexport default Ember.ArrayController.extend({\n needs: [\"offer\"],\n sortProperties: [\"createdAt\"],\n sortAscending: true,\n isPrivate: false,\...
javascript
chosen
[ { "from": "system", "value": "Add type computed to the component calendar model.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport computedMoment from 'ember-calendar/macros/computed-moment';\nimport computedDuration from 'ember-calendar/macros/computed-duration';\nimport Cal...
javascript
chosen
[ { "from": "system", "value": "Add className and styles props\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport { findDOMNode } from 'react-dom';\nimport Count from 'countup.js';\n\nclass CountUp extends React.Component {\n componentDidMount() {\n const {\n ...
javascript
chosen
[ { "from": "system", "value": "Change button text and other stuff\n" }, { "from": "human", "value": "var fipsData;\ngoogle.load('visualization', '1', {packages:['table']});\n$(function() {\n $.ajax({\n url: '/data/fipsData.json',\n dataType: 'json',\n success: function(dat...
javascript
chosen
[ { "from": "system", "value": "Add test to cover generating creditor reference from zero padded number\n" }, { "from": "human", "value": "import test from 'tape'\nimport {generate, validate} from '../src/index'\n\ntest('should generate reference with numbers', (assert) => {\n const expected = 'R...
javascript
chosen
[ { "from": "system", "value": "Add more files to test for creation\n" }, { "from": "human", "value": "/*global describe, beforeEach, it*/\n'use strict';\n\nvar path = require('path');\nvar helpers = require('yeoman-generator').test;\n\n\ndescribe('digitaria generator', function () {\n befor...
javascript
chosen
[ { "from": "system", "value": "Add logo to command help information\n\n" }, { "from": "human", "value": "/**\n * Copyright 2017-present, Callstack.\n * All rights reserved.\n * \n * @flow\n */\nconst program = require(\"commander\");\nconst pjson = require(\"../../package.json\");\nconst logger =...
javascript
chosen
[ { "from": "system", "value": "Handle missing test data directory.\n" }, { "from": "human", "value": "var fs = require(\"q-io/fs\"); // https://github.com/kriskowal/q-io\nvar request = require('request');\n\nmodule.exports = function () {\n\n this.Given(/^a set of specifications exists$/, functi...
javascript
chosen
[ { "from": "system", "value": "Remove hot loader from webpack config\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar path = require('path');\n\nmodule.exports = {\n devtool: 'source-map',\n context: __dirname,\n entry: [\n './index.js'\n ],\n output: {\n path:...
javascript
chosen
[ { "from": "system", "value": "Create show and hidden methods\n" }, { "from": "human", "value": "'use strict';\n\nconst template = require('../../views/components/Logo.hbs');\n\nclass Logo {\n\n\tconstructor() {\n\t\tthis.container = document.createElement('div');\n\n\n\t\tthis.container.classLis...
javascript
chosen
[ { "from": "system", "value": "Add user details in the cookie\n" }, { "from": "human", "value": "const Request = require('request');\nconst env2 = require('env2');\nconst HapiCookie = require('hapi-auth-cookie');\n\nenv2('./config.env');\n\nmodule.exports = {\n path: '/welcome',\n method: 'GET'...
javascript
chosen
[ { "from": "system", "value": "Fix travis? It was referencing the old /components folder which has since been renamed.\n" }, { "from": "human", "value": "var config = module.exports;\n\nconfig['development'] = {\n env: 'browser'\n , rootPath: '../'\n , deps: [\n 'components/jquer...
javascript
chosen
[ { "from": "system", "value": "Fix require for node v5\n" }, { "from": "human", "value": "const assert = require('assert');\nconst { crypto, config } = require('./config');\n\ndescribe(\"WebCrypto\", () => {\n\n it(\"get random values\", () => {\n var buf = new Uint8Array(16);\n ...
javascript
chosen
[ { "from": "system", "value": "Add start and reset fn\n" }, { "from": "human", "value": "$(function(){\n var\n $btns = $('.btn'),\n colors = ['#1ABC9C','#2ECC71','#3498DB','#34495E','#9B59B6','#F1C40F','#E67E22','#E74C3C','#7F8C8D','#2980B9','#95A5A6','#C0392B','#D35400','#F39C12','#666'],...
javascript
chosen
[ { "from": "system", "value": "Support nested key path for result, fix bugs\n" }, { "from": "human", "value": "const jsonServer = require('json-server')\nconst server = jsonServer.create()\nconst path = require('path')\nconst router = jsonServer.router(path.join(__dirname, 'db.json'))\nconst midd...
javascript
chosen
[ { "from": "system", "value": "Add console.log error message in case gif folder is not found\n" }, { "from": "human", "value": "const express = require('express');\nconst fs = require('fs');\nconst app = express();\nconst port = 3000;\nconst gifFolder = './public/gifs';\n\napp.use(express.static(...
javascript
chosen
[ { "from": "system", "value": "Fix modal cannot be opened after minification\n" }, { "from": "human", "value": "class BrowseController {\n constructor($scope, $uibModalInstance, ImageFactory, text) {\n var imageCount = 60;\n\n $scope.text = text;\n $scope.photos = [];\n $scope.canSho...
javascript
chosen
[ { "from": "system", "value": "Update usage of lodash get\n" }, { "from": "human", "value": "const { get } = require('lodash')\n\n// eslint-disable-next-line camelcase\nconst transformAccountManager = ({ one_list_group_global_account_manager }) => ({\n name: get(one_list_group_global_account_man...
javascript
chosen
[ { "from": "system", "value": "Manage SupplementaryFile labels only in body.\n" }, { "from": "human", "value": "import CitableContentManager from './CitableContentManager'\n\nexport default class SupplementaryManager extends CitableContentManager {\n constructor (documentSession, labelGenerator)...
javascript
chosen
[ { "from": "system", "value": "[core] GraphQL: Align help text of graphql list command with other optionless commands\n" }, { "from": "human", "value": "import lazyRequire from '@sanity/util/lib/lazyRequire'\n\nconst helpText = `\nOptions\n N/A\n\nExamples\n sanity graphql list\n`\n\nexport def...
javascript
chosen