conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Revert \"Update usage of less-middleware\"\n\nThis reverts commit d6bbc054f68fc7382ab1b14cb8afaff521548019.\n" }, { "from": "human", "value": "var express = require('express');\nvar less = require('less-middleware');\nvar path = require('path');\n\nexports.register ...
javascript
chosen
[ { "from": "system", "value": "Fix setting new indices of playlist entries.\n\n* Was giving entries indices from 2...n+1, Now 1...n like you want\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n \n tagName: '',\n\n fixWidthHelper: funct...
javascript
chosen
[ { "from": "system", "value": "Set the editor to RESOLVE mode\n" }, { "from": "human", "value": "var createEditor;\r\nvar author;\r\n\r\nfunction injectCreate(id) {\r\n $(\"#\" + id).load(\"create/html/createHTML\", function() {\r\n injectCreateEditor();\r\n\t\t\r\n\t\t// Generate a ran...
javascript
chosen
[ { "from": "system", "value": "Enable video only when first toggled\n" }, { "from": "human", "value": "'use babel';\n\nimport {component} from './polymer-es6';\n\n@component('at-video')\nexport class AtomTwitchVideo {\n static properties() {\n return { };\n }\n \n static listeners() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add metalsmith basic debug plugin\n" }, { "from": "human", "value": "var travisUtils = require('./travis-utils');\n\nvar socials = {\n 'facebook-square': 'https://www.facebook.com/romajs.org',\n 'twitter-square': 'https://twitter.com/roma_js',\n 'youtube-square':...
javascript
chosen
[ { "from": "system", "value": "Fix bundles that have mixed node_modules and variations\n" }, { "from": "human", "value": "/* Copyright 2015, Yahoo Inc.\n Copyrights licensed under the MIT License.\n See the accompanying LICENSE file for terms. */\n\nmodule.exports = variationMatches;\nfunctio...
javascript
chosen
[ { "from": "system", "value": "Change url name of tab\n" }, { "from": "human", "value": "export const TABS = [\n {\n name: 'latest',\n urlName: 'siste',\n title: 'Enkeltår',\n chartKind: 'bar',\n year: 'latest'\n },\n {\n name: 'chronological',\n urlName: 'historikk',\n ...
javascript
chosen
[ { "from": "system", "value": "Add hasUser\nReturns true/false if a room contains a user\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\n\nvar Message = new mongoose.Schema({\n\tmessage: String,\n\tsender: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},\n\tmime: {type...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary comments and add a new syntax.\n" }, { "from": "human", "value": "'use strict'\n\nconst fs = require('fs')\nconst path = require('path')\n\n/**\n * Returns the relative path of the template file.\n *\n * @param {String} name\n * @return {String}\...
javascript
chosen
[ { "from": "system", "value": "Use replace instead of set to not mess with browser's back button\n\nFix #1072\n" }, { "from": "human", "value": "/**\n * Show an appriopriate UI based on if we have any users yet.\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * Licen...
javascript
chosen
[ { "from": "system", "value": "Update to new npm style\n" }, { "from": "human", "value": "var registry = require('./utils/registry')\n , ini = require(\"./utils/ini\")\n , log = require(\"./utils/log\")\n , base64 = require(\"./utils/base64\")\n\nvar adduser = function (args, callback) {\n va...
javascript
chosen
[ { "from": "system", "value": "Add JSON and urlencoded body parsers.\n" }, { "from": "human", "value": "'use strict';\n\nlet Gpio = require('pigpio').Gpio;\nlet express = require('express');\nlet path = require('path');\n\nlet gpioService = require('../lib/gpioservice')(Gpio);\nlet ledHandler = r...
javascript
chosen
[ { "from": "system", "value": "Update server: remove process.env read\n" }, { "from": "human", "value": "import express from 'express';\nimport bodyParser from 'body-parser';\nimport favicon from 'serve-favicon';\nimport path from 'path';\nimport helmet from 'helmet';\nimport fs from 'fs';\nimpor...
javascript
chosen
[ { "from": "system", "value": "Fix exception in track-error js module that broke our re-upload button\n" }, { "from": "human", "value": "(function(Modules) {\n \"use strict\";\n\n Modules.TrackError = function() {\n\n this.start = function(component) {\n\n if (!ga) return;\n\n ga(\...
javascript
chosen
[ { "from": "system", "value": "Test - checking visibitlity of Change Avatar link\n" }, { "from": "human", "value": "describe('tests', function() {\n var username = \"USERNAME\";\n var linksnum = 0;\n\n var links = element.all(by.repeater('link in annotatedlinks'));\n\n browser.get('https://we...
javascript
chosen
[ { "from": "system", "value": "Use api instead of this\n" }, { "from": "human", "value": "const fetch = require('node-fetch')\n\nconst endpoint = 'https://www.pivotaltracker.com/services/v5/my/notifications?envelope=true'\nconst api = {\n getNotifications({ token }){\n return fetch(endpoint, ...
javascript
chosen
[ { "from": "system", "value": "Use req.query instead of req.param for clarity\n" }, { "from": "human", "value": "\n/*\n * GET home page.\n */\n\nvar helpers = require('../helpers');\n\nexports.index = function(req, res){\n res.render('index', {\n title: 'JS Box',\n libraryUrls: helpers.get...
javascript
chosen
[ { "from": "system", "value": "Delete the mix.js entry file from the console output\n" }, { "from": "human", "value": "class MockEntryPlugin {\n /**\n * Apply the plugin.\n *\n * @param {Object} compiler\n */\n apply(compiler) {\n compiler.plugin('done', stats => {\n ...
javascript
chosen
[ { "from": "system", "value": "Check element before get an innerHTML\n" }, { "from": "human", "value": "/*!\n Copyright (C) 2017 Google Inc.\n Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n*/\n\n(function(can) {\n can.extend(can.Control.prototype, {\n // ...
javascript
chosen
[ { "from": "system", "value": "Watch also *.scss sources for rebuild\n" }, { "from": "human", "value": "\nmodule.exports = function(gulp, config) {\n\n\treturn function(done) {\n\t\tvar c = require('better-console')\n\t\tc.info('watch sources')\n\n\t\tvar path = require('path')\n\n\t\tvar glob = ...
javascript
chosen
[ { "from": "system", "value": "Correct the rivets file name\n" }, { "from": "human", "value": "var elixir = require('laravel-elixir');\n\nelixir(function(mix) {\n mix.sass('app/assets/sass/main.scss')\n .styles([\n 'app/assets/Bower_components/fontawesome/css/font-awesome.min.css',\n ...
javascript
chosen
[ { "from": "system", "value": "Remove forest green from reports\n" }, { "from": "human", "value": "/**\n* Colors for all reports\n*/\nconst ReportColors = [\n '#FFB067', // Orange\n '#104210', // Forest green\n '#FF7077', // Coral\n '#ACEEF3', // Cyan\n '#FF4500', // Red orange\n ...
javascript
chosen
[ { "from": "system", "value": "Add vvm status bool field\n" }, { "from": "human", "value": "/**\n * Sustainable Solutions (NZ) Ltd. 2020\n * mSupply Mobile\n */\n\nimport Realm from 'realm';\n\nexport class VaccineVialMonitorStatus extends Realm.Object {}\n\nVaccineVialMonitorStatus.schema = {\n ...
javascript
chosen
[ { "from": "system", "value": "Create preloader object and set property\n" }, { "from": "human", "value": "var ImagePreloader = require('./ImagePreloader/');\nvar Overlay = require('./Overlay/');\n\nfunction QueryLoader(element, options) {\n 'use strict';\n this.element = element;\n this...
javascript
chosen
[ { "from": "system", "value": "Fix TypeScript tests so they fail for errors :)\n" }, { "from": "human", "value": "import * as tt from 'typescript-definition-tester'\n\ndescribe('TypeScript definitions', function () {\n it('should compile against index.d.ts', (done) => {\n tt.compileDirectory(...
javascript
chosen
[ { "from": "system", "value": "Fix to set headers correctly.\n" }, { "from": "human", "value": "/**\n * `Message` constructor.\n *\n * @api protected\n */\nfunction Message(queue, message, headers, deliveryInfo) {\n // Crane uses slash ('/') separators rather than period ('.')\n this.topic = de...
javascript
chosen
[ { "from": "system", "value": "Allow method chaining after serveSwagger\n" }, { "from": "human", "value": "import {json} from \"body-parser\";\nimport {Router} from \"express\";\n\nimport * as validate from \"./validate-middleware\";\nimport * as convert from \"./convert\";\n\nexport default func...
javascript
chosen
[ { "from": "system", "value": "Improve filename parser regex (hopefully)\n" }, { "from": "human", "value": "// karaoke-forever string to artist/title parser defaults\nmodule.exports = {\n // regex or string; artist/song get split around this match (default='-')\n delimiter: '-',\n // bool; whe...
javascript
chosen
[ { "from": "system", "value": "Remove tests for things that don’t exist" }, { "from": "human", "value": "'use strict';\n\nvar assert = require('assert');\nvar data = require('../src/data'),\n vlfield = require('../src/field');\n\ndescribe('getUrl', function() {\n //TODO write tests for getUrl\n...
javascript
chosen
[ { "from": "system", "value": "Add support for native Angular event broadcasting\n" }, { "from": "human", "value": "(function(angular) {\n 'use strict';\n var SignalRService = function ($window, url) {\n this.jQuery = $window.jQuery;\n this._url = url;\n };\n\n SignalRSe...
javascript
chosen
[ { "from": "system", "value": "Comment out linter errors temporarily\n" }, { "from": "human", "value": "import {get} from 'utils/ajax'\n\nimport {fixtureJSONFeed} from 'src/status/fixtures'\n// TODO: remove async/await & object return, uncomment get(url) when proxy route implemented\nexport const...
javascript
chosen
[ { "from": "system", "value": "Fix download count not including more than 30 releases\n" }, { "from": "human", "value": "var xmlHttp = new XMLHttpRequest();\n\nxmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState === 4) {\n var releasesData = JSON.parse(xmlHttp.responseText);\n ...
javascript
chosen
[ { "from": "system", "value": "Fix context menu listener when event page becomes inactive\n\nFix #154.\n" }, { "from": "human", "value": "import openDevToolsWindow from './openWindow';\n\nexport default function createMenu() {\n const menus = [\n { id: 'devtools-left', title: 'To left' },\n ...
javascript
chosen
[ { "from": "system", "value": "Fix error in last commit\n" }, { "from": "human", "value": "angular.module('proxtop').controller('MainController', ['$scope', 'ipcManager', '$state', 'notification', '$mdToast', '$translate', 'settings', '$mdDialog', 'open', '$window', 'debounce',\n function($sco...
javascript
chosen
[ { "from": "system", "value": "Use another jquery for chrome font bug\n" }, { "from": "human", "value": "jQuery(function() {\n jQuery('body').hide().show();\n});" }, { "from": "gpt", "value": "jQuery(function($) {\n if (/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())) {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove logo from viewSource button\n" }, { "from": "human", "value": "const sheet = document.createElement('style');\n\nsheet.innerHTML = `\n@media screen {\n #viewSourceHeader.📖-view-source-header {\n display: block !important;\n }\n}\n.📖-view-source-header ...
javascript
chosen
[ { "from": "system", "value": "Include missing argument in router query string method\n" }, { "from": "human", "value": "class GelatoRouter extends Backbone.Router {\n\n execute(callback, args, name) {\n if (this.page) {\n this.page.remove();\n }\n\n this.trigger('navigate:before',...
javascript
chosen
[ { "from": "system", "value": "Update tests to test onChange and value.\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\nimport { find, fillIn } from 'ember-native-dom-helpers';\nimport { skip } from 'qunit'...
javascript
chosen
[ { "from": "system", "value": "Add 'votes' to application's proptypes\n" }, { "from": "human", "value": "//\n// Reusable, domain-specific prop types\n//\nimport PropTypes from \"prop-types\"\n\n// could be an enum if this is a fixed set of strings?\nexport const category = PropTypes.string\n\nexp...
javascript
chosen
[ { "from": "system", "value": "Remove auth from delivery service health check\n" }, { "from": "human", "value": "const configuration = require('../config')\nconst fetch = require('node-fetch')\nconst { URL } = require('url')\n\nasync function checkDeliveryService () {\n const config = configurat...
javascript
chosen
[ { "from": "system", "value": "Fix layout of dogs datatable" }, { "from": "human", "value": "function renderThumbNail( data, type, row, meta ) {\r\n\t\r\n\tif(! window.dogList) {\t\t\r\n\t\twindow.dogList = {};\r\n\t\twindow.dogList.snapshotUrl = '${SNAPSHOTURL}';\r\n\t\twindow.dogList.previewfil...
javascript
chosen
[ { "from": "system", "value": "Set _settingFromFirebase on the PromiseModel when it's resolved" }, { "from": "human", "value": "var get = Ember.get;\n\nFP.PromiseModel = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin, {\n\n // forward on all content's functions where it makes sense to do so\n ...
javascript
chosen
[ { "from": "system", "value": "Fix regex that checks if ember data is present to allow for difference in namespace\n" }, { "from": "human", "value": "/* global requirejs */\n\nfunction _hasEmberData() {\n let matchRegex = /^ember-data/i;\n return !!(Object.keys(requirejs.entries).find(e => !!e....
javascript
chosen
[ { "from": "system", "value": "Rename location email_header to email_template\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\nvar LocationSchema = new Schema({\n\tname: String,\n\tcity: String,\n\taddress: String,\n\timg: String...
javascript
chosen
[ { "from": "system", "value": "Use getter method for listing path\n\n" }, { "from": "human", "value": "'use strict';\n\nconst _path = require('path');\n\nclass Listing {\n\n /**\n * Create path listing\n * @param path {string} Filepath\n */\n constructor({path}){\n let stat = _path.par...
javascript
chosen
[ { "from": "system", "value": "Add on method, and addCallback method with do as alias\n" }, { "from": "human", "value": "var async = require('async');\n\nvar AndThen = function(obj, ev) {\n var args,\n triggerCallbacks,\n callbacks = [];\n\n triggerCallbacks = function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Check cb is a function before calling it\n" }, { "from": "human", "value": "/*\n * stompit.connect\n * Copyright (c) 2013 Graham Daws <graham.daws@gmail.com>\n * MIT licensed\n */\n\nvar net = require('net');\nvar util = require('./util');\nvar Client = requ...
javascript
chosen
[ { "from": "system", "value": "Fix jsdoc error due to undeclared variable\n" }, { "from": "human", "value": "module.exports = {\n /**\n * @param {string} testFilePath - file path of a test\n * @param {array} tags - tags to match\n * @returns {boolean} true if specified test matches given t...
javascript
chosen
[ { "from": "system", "value": "Add stream uri for wappuradio\n" }, { "from": "human", "value": "var util = require('../src/util/seeds');\n\n\nexports.seed = function(knex, Promise) {\n const cities = {};\n\n return knex('cities').select('*')\n .then(rows => {\n rows.forEach(city => {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix Amazon and add Like/Dislike\n" }, { "from": "human", "value": ";(function() {\n \"use strict\";\n\n require(\"BaseController\").init({\n siteName: \"Amazon Music\",\n playPause: \"[playeraction=togglePlay]\",\n playNext: \"[playeraction=next]\",\n ...
javascript
chosen
[ { "from": "system", "value": "Disable buttons while request is pending\n" }, { "from": "human", "value": "isic.views.TermsAcceptanceView = isic.View.extend({\n events: {\n 'click #isic-terms-accept': function (event) {\n if (girder.currentUser) {\n girder.curr...
javascript
chosen
[ { "from": "system", "value": "Update validation in Create Content tour\n\n" }, { "from": "human", "value": "(function () {\n \"use strict\";\n\n function NodeNameController($scope) {\n \n var vm = this;\n var element = angular.element($scope.model.currentStep.element)...
javascript
chosen
[ { "from": "system", "value": "Connect popover to redux store\n" }, { "from": "human", "value": "import React from 'react';\nimport * as styles from './PopOver.scss';\n\nconst PopOver = ({ next, active, first, last, previous, xPos, yPos, children }) => {\n if (!active) {\n return null;\n }\n...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix resolution of babel helper module\nAlso Make the ES6 imports refreshable\n" }, { "from": "human", "value": "'use strict'\n\nconst Stream = require('stream')\nconst Base = require('./base')\nlet Browserify\nlet Babelify\n\nclass PluginBrowserify extends Bas...
javascript
chosen
[ { "from": "system", "value": "Add required \"navigation\" module dependency (for ClientIdentifier)." }, { "from": "human", "value": "/*\n * Copyright (C) 2015 Glyptodon LLC\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated do...
javascript
chosen
[ { "from": "system", "value": "Bring back the post button.\n" }, { "from": "human", "value": "Hummingbird.PostCommentComponent = Ember.Component.extend({\n classNames: [\"status-update-panel\"],\n\n didInsertElement: function() {\n this.$(\".status-form\").focus(function() {\n self.$(\"...
javascript
chosen
[ { "from": "system", "value": "Revert \"don’t return an error for `setGlobal` because it will break some scripts and is also a fingerprinting risk\"\n\nThis reverts commit 56a96a9d4a3c413235a98a2569294e1739122f40.\n" }, { "from": "human", "value": "// disable experimental navigator.credentials\nc...
javascript
chosen
[ { "from": "system", "value": "Update bootstrapped package.json to use Webpack and Karma CLIs" }, { "from": "human", "value": "import { join } from 'path'\nimport json from '../util/json'\n\nconst saguiScripts = {\n 'start': 'npm run develop',\n 'test': 'NODE_ENV=test sagui test',\n 'test-watc...
javascript
chosen
[ { "from": "system", "value": "Fix link to user page and contribs\n\nBug: T107681\nChange-Id: I59d749afe282c7b06a0f9a5a391a72a8bd29fb19\n" }, { "from": "human", "value": "angular\n .module('crosswatch')\n .directive('user', user);\n\nfunction user() {\n var directive = {\n link: link,\n ...
javascript
chosen
[ { "from": "system", "value": "Add support for end attribute within pagination component\n" }, { "from": "human", "value": "module.exports = Pagination;\n\nfunction Pagination() {}\n\nPagination.prototype.view = __dirname + '/views';\nPagination.prototype.style = __dirname + '/styles';\nPaginatio...
javascript
chosen
[ { "from": "system", "value": "Add gas and deploy account" }, { "from": "human", "value": "module.exports = {\n build: \"npm start\",\n networks: {\n development: {\n host: \"localhost\",\n port: 8545,\n network_id: \"*\"\n },\n testnet: {\n host: \"localhost\",\n ...
javascript
chosen
[ { "from": "system", "value": "Use const in place of let\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\nimport ReactTestUtils from 'react-dom/test-utils'\nimport renderer from 'react-test-renderer'\n\nimport { App } from './App'\n\nit('smoke test',...
javascript
chosen
[ { "from": "system", "value": "Handle search action using redux.\n\n- Pass search status & results as props to SearchResults when routed.\n- Call Search action using handleSearch.\n" }, { "from": "human", "value": "/**\n * Poster v0.1.0\n * A React webapp to list upcoming movies and maintain a wa...
javascript
chosen
[ { "from": "system", "value": "Allow for switching of tabs automatically\n" }, { "from": "human", "value": "(function() {\n\tfunction startup() {\n\t\tvar navigatorToolbox = document.getElementById(\"navigator-toolbox\");\n\t\tnavigatorToolbox.iconsize = \"small\";\n\t\tnavigatorToolbox.setAttrib...
javascript
chosen
[ { "from": "system", "value": "Change callback names in the js\n" }, { "from": "human", "value": "var sms = {\n send: function(phone, message, method, successCallback, failureCallback) {\n phone = sms.convertPhoneToArray(phone);\n\n cordova.exec(\n successCallback,\n failureCallb...
javascript
chosen
[ { "from": "system", "value": "Fix small bug with slugs\n" }, { "from": "human", "value": "const mongoose = require('mongoose')\nmongoose.Promise = global.Promise\nconst slug = require('slugs')\n\nconst gameSchema = new mongoose.Schema({\n title: {\n type: String,\n trim: true,\n requir...
javascript
chosen
[ { "from": "system", "value": "Remove banner plugin since it don't work with new release strategy\n" }, { "from": "human", "value": "const webpack = require('webpack')\nconst PACKAGE = require('./package.json')\nconst TerserPlugin = require('terser-webpack-plugin')\n\nmodule.exports = {\n entry:...
javascript
chosen
[ { "from": "system", "value": "[Optimization] Use lazyLoadChunks API to load small chunks at a time\n" }, { "from": "human", "value": "/*!\n * Copyright 2016 Joji Doi\n * Licensed under the MIT license\n */\n\nfunction getMediaFilePath(mediaItem) {\n return \"ext-content/\" + mediaItem.dir + '/'...
javascript
chosen
[ { "from": "system", "value": "Set default log level to WARN (or TRACE, for verbose)\n" }, { "from": "human", "value": "/*\n * grunt-contrib-requirejs\n * http://gruntjs.com/\n *\n * Copyright (c) 2014 Tyler Kellen, contributors\n * Licensed under the MIT license.\n */\n\nmodule.exports = functio...
javascript
chosen
[ { "from": "system", "value": "Add hook to get DOM from Angular\n" }, { "from": "human", "value": "define(function(require) {\n var module = require(\"ui/modules\").get(\"kibana-chord\");\n\n module.controller(\"ChordController\", function($scope, Private) {\n $scope.$watch(\"esResponse\", f...
javascript
chosen
[ { "from": "system", "value": "Add identifiers function and create an array of identifiers and their number of times they appear\n" }, { "from": "human", "value": "const esprima = require('esprima');\nvar source = 'answer = 42; hola = 5; isCold = \"Si\"; answer = 50;';\nconst tokens = esprima.tok...
javascript
chosen
[ { "from": "system", "value": "Fix up test runner for windows\n" }, { "from": "human", "value": "var childProcess = require(\"child_process\")\nvar path = require(\"path\")\n\nvar env = process.env\nenv.NODE_ENV = \"test\"\n\nvar options = {\n\tenv: env,\n\tstdio: \"inherit\",\n}\n\nvar command...
javascript
chosen
[ { "from": "system", "value": "Add checks for preserving the original snake_case version of property names\n" }, { "from": "human", "value": "\"use strict\";\n\nvar assert = require(\"assert\");\nvar comfy = require(\"../src/comfy\");\n\nvar env = {\n \"REQUIRED_PROP\": \"required_value\",\n \"...
javascript
chosen
[ { "from": "system", "value": "Fix unit test assertion for number of pre-included apps\n" }, { "from": "human", "value": "window = {};\n\nvar assert = require('assert');\nvar model = require('../../lib/model')({\n memory: true,\n noConnect: true\n});\n\ndescribe('Model', function () {\n ...
javascript
chosen
[ { "from": "system", "value": "Add FETCH_POST case to reducer\n" }, { "from": "human", "value": "import _ from 'lodash';\nimport { FETCH_POSTS } from '../actions';\n\nexport default function(state = {}, action) {\n switch (action.type) {\n case FETCH_POSTS:\n return _.mapKeys(action.payl...
javascript
chosen
[ { "from": "system", "value": "Create a scene to work with.\n" }, { "from": "human", "value": "Polymer\n({\n is: \"editor-viewport\",\n\n // member variables\n properties:\n {\n width: { type: Number, value: 0 },\n height: { type: Number, value: 0 },\n renderer: { type: Object, value...
javascript
chosen
[ { "from": "system", "value": "Reduce white-space to trim down filesize\n" }, { "from": "human", "value": "---\nlayout: null\n---\n\nvar store = [\n {% for c in site.collections %}\n {% if forloop.last %}\n {% assign l = true %}\n {% endif %}\n {% assign docs = c.docs | where_exp:'...
javascript
chosen
[ { "from": "system", "value": ":notebook: Add notebook demo of color prop\n" }, { "from": "human", "value": "import React from 'react'\nimport { storiesOf } from '@storybook/react'\nimport Loader, { ProgressBar } from 'fyndiq-component-loader'\n\nstoriesOf('Loader/default', module)\n .addWithInf...
javascript
chosen
[ { "from": "system", "value": "Create a user for the gzip test\n" }, { "from": "human", "value": "/*jslint node: true, indent: 2, white: true, vars: true */\n/*globals suite, test, setup, suiteSetup, suiteTeardown, done, teardown */\n'use strict';\n\nvar server = require('../lib/server');\nvar as...
javascript
chosen
[ { "from": "system", "value": "Make sure sort works for numeric fields also.\n" }, { "from": "human", "value": "function() {\n\n $(\"#form-Flight\").validator();\n\n $(this).show();\n $.tablesorter.addParser({\n id: 'surname',\n is: function(s) { return false; },\n format: funct...
javascript
chosen
[ { "from": "system", "value": "Sort agencies page by name\n" }, { "from": "human", "value": "const _ = require('lodash');\nconst gtfs = require('gtfs');\nconst router = require('express').Router();\n\nconst config = require('../config');\nconst utils = require('../lib/utils');\n\n\n/*\n * Show al...
javascript
chosen
[ { "from": "system", "value": "Remove middleware from StatsController route\n" }, { "from": "human", "value": "let express = require('express')\nlet router = express.Router()\nlet acl = require('express-acl')\nlet models = require('../models')\nlet AuthController = require('../controllers/AuthCon...
javascript
chosen
[ { "from": "system", "value": "Use port 3001 for API server.\n\nCurrently, the webpack-dev-server and the API server need to be run\nseparately, like so:\n\nnpm start\n(separate shell)\nnode api-server.js\n\nThe app is then served at localhost:3000 for development.\n" }, { "from": "human", "value...
javascript
chosen
[ { "from": "system", "value": "Add integration test via docker\n" }, { "from": "human", "value": "'use strict';\n\n/*jslint nomen: true, stupid: true*/\n\nmodule.exports = function (grunt) {\n grunt.registerTask('integration-test', 'Run integration tests', [\n 'docker-integration-test'\...
javascript
chosen
[ { "from": "system", "value": "Fix tag select with keyboard.\n\nPreviously the selecting of a tag with the keyboard resulted in\nthe whole tag list being replaced by just the one selected tag.\n" }, { "from": "human", "value": "ep.ui.createTagsInput = function(source) {\n // partly from http:/...
javascript
chosen
[ { "from": "system", "value": "Switch to use plural in endpoint\n" }, { "from": "human", "value": "import express from 'express';\nimport validate from 'express-validation';\nimport paramValidation from './validation/user';\nimport userCtrl from '../controllers/user';\nimport userMiddleware from ...
javascript
chosen
[ { "from": "system", "value": "Use Leaflet container for positioning map controls.\n" }, { "from": "human", "value": "import React from 'react'\nimport { Map, TileLayer } from 'react-leaflet'\nimport NavigationContainer from '../navigation/NavigationContainer'\nimport MarkerCluster from './Marker...
javascript
chosen
[ { "from": "system", "value": "Complete tests for checking that no new enumerable properties are being added to new objects.\n\nAdded tests for array, number and regexp.\nExtracted assertion to its own method.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Run package tests.\n * (C) ...
javascript
chosen
[ { "from": "system", "value": "Set up other two scenarios: implement recursion for each\n" }, { "from": "human", "value": "// Perform binary search using recursion\n\nfunction binarySearch(arr, val, leftPosition, rightPosition) {\n\n\t// value does not exist\n\tif (leftPosition > rightPosition) {...
javascript
chosen
[ { "from": "system", "value": "Add server environment variable for message intervals.\n" }, { "from": "human", "value": "'use strict';\n\nvar SimplexNoise = require( 'simplex-noise' );\nvar WebSocketServer = require( 'ws' ).Server;\nvar wss = new WebSocketServer({ port: 8080 });\n\nvar simplex = ...
javascript
chosen
[ { "from": "system", "value": "Fix JS syntax error in variable declaration\n\nDeclarations in javascript should end with a semicolon. This\notherwise causes strange and hard to debug issues in minified\njs assets.\n\nChange-Id: I821a71b169b86e9f0318cbae4c6cc654cb97a4a7\n" }, { "from": "human", "v...
javascript
chosen
[ { "from": "system", "value": "Fix resource method to query\n" }, { "from": "human", "value": "define(function() {\n var ProjectsUserController = function($routeParams, ProjectResource) {\n this.projects = ProjectResource.get({\n user: $routeParams.user\n })\n }\n\n...
javascript
chosen
[ { "from": "system", "value": "Use pagination on category pages\n\nThe pagination dir is 'page'. For now it's enough, but it should be\ncustomizable per language.\n\nBuilt from adf0bcce5e155e2a38dfa6c6bac2fdd43a367314.\n" }, { "from": "human", "value": "var pagination = require('hexo-pagination')...
javascript
chosen
[ { "from": "system", "value": "Initialize storage instead of the connection.\n" }, { "from": "human", "value": "/*\n * app.js: Entry point for the content-service\n *\n * (C) 2015 Rackspace, Inc.\n *\n */\n\nvar config = require('./src/config');\n\nconfig.configure(process.env);\n\nvar\n async =...
javascript
chosen
[ { "from": "system", "value": "Add route to test ten most recent songs\n" }, { "from": "human", "value": "var express = require('express');\nvar config = require('./config');\nvar playsApp = require('../plays');\nvar app = express();\nvar plays = playsApp({\n\tsource: 'Spinitron',\n\tspinitron: c...
javascript
chosen
[ { "from": "system", "value": "Remove dryrun option from ghPages\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst ghPages = require('gulp-gh-pages');\nconst rename = require('gulp-rename');\n\ngulp.task('deploy', () =>\n gulp.src([\n './dist/**/*',\n './doc...
javascript
chosen
[ { "from": "system", "value": "Fix a path for HTML\n" }, { "from": "human", "value": "var http = require('http');\nvar fs = require('fs');\nvar page = './index.tml';\n\nfs.readFile(page, function (err, data) {\n if (err) return console.error(err.message);\n\n http.createServer(function (req, re...
javascript
chosen
[ { "from": "system", "value": "Update gulp watch to include test files\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar phpunit = require('gulp-phpunit');\nvar watch = require('gulp-watch');\n\ngulp.task('phpunit', function(cb) {\n var options = {\n debug: ...
javascript
chosen
[ { "from": "system", "value": "Store game state in global var\n" }, { "from": "human", "value": "var express = require('express');\nvar http = require('http');\nvar socketIO = require('socket.io');\nvar path = require('path');\nvar game = require('./game.js');\n\nvar app = express();\nvar server ...
javascript
chosen
[ { "from": "system", "value": "Use location.hash instead of url query params\n" }, { "from": "human", "value": "function getQueryVariable(variable){\n var query = window.location.search.substring(1);\n var vars = query.split(\"&\");\n for (var i=0;i<vars.length;i++) {\n var pair =...
javascript
chosen