conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove unused functions in Expirer.js\n" }, { "from": "human", "value": "var utils = require('./util'),\n util = require(\"util\"),\n events = require(\"events\");\n\t\t\nfunction Expirer(collection, options){\n\tvar defaults = {\n\t\t\texpire_after_ms: 10 * 6...
javascript
chosen
[ { "from": "system", "value": "Set prettier to only create warnings\n\nThrowing errors in prettier breaks CI as lots of the code has not had\nprettier run on it.\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n extends: ['coderdojo', 'eslint:recommended', 'prettier'],\n pl...
javascript
chosen
[ { "from": "system", "value": "Disable eslint rules ember/no-legacy-test-waiters and ember/no-mixins\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOptions: {\n ecmaVersion: 2018,\n sourceType: 'module',\n },\n plu...
javascript
chosen
[ { "from": "system", "value": "Fix find function in content manager controller\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * A set of functions called \"actions\" for `ContentManager`\n */\n\nmodule.exports = {\n\n models: async(ctx) => {\n ctx.body = strapi.models;\n },\n\n f...
javascript
chosen
[ { "from": "system", "value": "Add initial batch operations to retrieve data\n" }, { "from": "human", "value": "/*! Kernel CI Dashboard | Licensed under the GNU GPL v3 (or later) */\nrequire([\n], function() {\n 'use strict';\n});\n" }, { "from": "gpt", "value": "/*! Kernel CI Dash...
javascript
chosen
[ { "from": "system", "value": "Connect to MongoDB on AppFog\n" }, { "from": "human", "value": "var parseEnv = require('parse-env');\n\nvar configTemplate = require('./config.template');\nvar config;\n\ntry {\n config = require('./config');\n}\ncatch(e) {}\n\nmodule.exports = parseEnv(process.e...
javascript
chosen
[ { "from": "system", "value": "Update overrides iterator to use Array.forEach\n" }, { "from": "human", "value": "var log = require('../lib/logger');\n\nvar allTheSettings = {\n coinbaseApiKey: process.env.COINBASE_API_KEY,\n coinbaseApiSec: process.env.COINBASE_API_SECRET,\n coinbaseApiUri: pr...
javascript
chosen
[ { "from": "system", "value": "Enable German locale for select2 dropdown form field.\n" }, { "from": "human", "value": "//= require jquery.cookie\n//= require jquery.timeago\n//= require jquery.timeago.de\n//= require leaflet\n//= require foundation/modernizr.foundation\n//= require foundation/jq...
javascript
chosen
[ { "from": "system", "value": "Include is_odata_config in brief exports\n\nApparently the old version of the dbaccessors weren't actually\nrespecting include_docs=False - they returned the full, wrapped\ninstances.\n" }, { "from": "human", "value": "function(doc) {\n if (doc.doc_type === \"For...
javascript
chosen
[ { "from": "system", "value": "Trim pasted URL before submitting.\n\nCloses #14\n" }, { "from": "human", "value": "function(context) {\n var app = $$(this).app;\n var url = $(\"#pasted_url\").val();\n if (url.length > 0) {\n idPos = url.indexOf(\"id=\");\n if (idPos > -1) {\n url = ...
javascript
chosen
[ { "from": "system", "value": "Disable analysis and subscription from the Indonesia Forest Area layer as requested\n" }, { "from": "human", "value": "/**\n * The Indonesian Forest Area layer module. (based on IdnPlantationsLayerBySpecies.js)\n * More info @ https://basecamp.com/3063126/projects/1...
javascript
chosen
[ { "from": "system", "value": "Check is user already signed up.\n" }, { "from": "human", "value": "/*jslint white: true */\n'use strict';\n\nfunction SignupController($location, $scope, $routeParams, authenticateRequest, errorHandler, httpRequest, itemsRequest, userSession) {\n\n $scope.user = {...
javascript
chosen
[ { "from": "system", "value": "Add a test for the right date being set\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\n\nmoduleForComponent('zesty/time-input', 'Integration | Component | zesty/time-input', ...
javascript
chosen
[ { "from": "system", "value": "Add 'name' option to Printer object, to specify the 'printer_name' argument sent to the client.\n" }, { "from": "human", "value": "openerp.printer_proxy = function (instance) {\n instance.printer_proxy = {};\n instance.printer_proxy.Printer = instance.web.Cla...
javascript
chosen
[ { "from": "system", "value": "Fix layout issue on IE 10 in production\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar precss = require('precss');\nvar autoprefixer = require('autoprefixer');\nvar TransferWebpackPlugin = require('transfer-webpack-plugin');\nvar path = re...
javascript
chosen
[ { "from": "system", "value": "Make a difference between add slug and remove slug\n" }, { "from": "human", "value": "/*****************************************************************************/\n/* PageSettings: Event Handlers and Helpersss .js*/\n/*********************************************...
javascript
chosen
[ { "from": "system", "value": "Remove text transformation on user account dropdown button\n" }, { "from": "human", "value": "import {Dropdown} from 'reactjs-components';\nimport React from 'react';\n\nclass UserAccountDropdown extends React.Component {\n handleItemSelection(item) {\n if (item...
javascript
chosen
[ { "from": "system", "value": "Fix bug whereby all blueprint Endpoints shared a driver\n" }, { "from": "human", "value": "var endpoint = require('../../lib/endpoint')\n , driver = require('../../lib/drivers/base')\n , io = require('../mocks/io').new();\n\nmodule.exports = endpoint;\n\nmodule.ex...
javascript
chosen
[ { "from": "system", "value": "Print routing errors to console\n" }, { "from": "human", "value": "angular.module('rosieApp', [\n 'ui.router',\n 'rosieApp.layout',\n 'rosieApp.lights',\n 'rosieApp.remotes',\n 'rosieApp.tasks'\n])\n" }, { "from": "gpt", "value": "angular.module('ro...
javascript
chosen
[ { "from": "system", "value": "Save modal dialog now correctly imports html template\n\nError as a result of shufling file structure, not updating paths" }, { "from": "human", "value": "/** @ngInject */\nexport function SaveModalDialogFactory($uibModal) {\n var modalSaveDialog = {\n showModal...
javascript
chosen
[ { "from": "system", "value": "Change 'init' to true on each save.\n\n" }, { "from": "human", "value": "import { Meteor } from 'meteor/meteor';\nimport { check } from 'meteor/check';\nimport { settingsLive } from './collections';\nimport defaultSettings from './defaultSettings';\nimport { checkSi...
javascript
chosen
[ { "from": "system", "value": "Stop ping when client is not open\n" }, { "from": "human", "value": "function noop(){}\n\nmodule.exports = function(ws) {\n let isAlive = true;\n\n ws.on('pong', () => isAlive = true);\n\n setInterval(function ping() {\n if(!isAlive) return ws.terminate();\n\n...
javascript
chosen
[ { "from": "system", "value": "Dropdown::Trigger: Remove unused `.rl-dropdown-toggle` CSS class assignment\n" }, { "from": "human", "value": "import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n classNames: ['rl-dropdown-togg...
javascript
chosen
[ { "from": "system", "value": "Format parsed month-year inputs as unambiguous data format for input\n\nAvoid pushing user towards ambiguous input formats" }, { "from": "human", "value": "'use strict';\n\nangular.module('ddsApp').directive('ddsDateMonthYear', function() {\n return {\n re...
javascript
chosen
[ { "from": "system", "value": "Stop event propagation in form-selector\n" }, { "from": "human", "value": "\"use strict\";\n\nannotationApp.directive('formSelector', function() {\n return {\n restrict: 'E',\n replace: true,\n controller: function($scope, $element, $attrs) {\n var id...
javascript
chosen
[ { "from": "system", "value": "Add `sound` to the default settings\n" }, { "from": "human", "value": "import {homedir} from 'os';\n\nimport settings from 'electron-settings';\nimport objectPath from 'object-path';\n\nconst DEFAULTS = {\n kapturesDir: `${homedir()}/Movies/Kaptures`,\n openOnStar...
javascript
chosen
[ { "from": "system", "value": "Load demo on new sheet click\n" }, { "from": "human", "value": "/**\n * Main entrypoint for banknote.\n *\n * Copyright 2015 Ethan Smith\n */\n\nvar Backbone = require('backbone'),\n Marionette = require('backbone.marionette'),\n $ = require('jquery'),\n _ ...
javascript
chosen
[ { "from": "system", "value": "Use import statement to convert jade template during bundle\n" }, { "from": "human", "value": " System.import('./test.jade!')\n .then(function(fn) {\n document.body.innerHTML = fn({local: 'no'});\n })\n .catch(function(err) {\n console.log('ERROR: ...
javascript
chosen
[ { "from": "system", "value": "Comment library that is only required when doing development locally.\n" }, { "from": "human", "value": "'use strict';\n\n// Load environment variables.\nrequire('dotenv').load();\n\nvar shell = require('shelljs');\nvar settings = require('./settings');\n\n// Genera...
javascript
chosen
[ { "from": "system", "value": "Convert CityDasbhboard to the module pattern\n" }, { "from": "human", "value": "var CityDashboard = {\n mainContainerID: '#city-dashboard',\n mapWindowID: '#mapWindow',\n infoWindowID: '#infoWindow',\n filterBarID: '#filterBar',\n getData: function ( url, callb...
javascript
chosen
[ { "from": "system", "value": "Return the proper cached object\n" }, { "from": "human", "value": "var mapnik = require('mapnik');\n\nfunction Renderer(color, options) {\n this.color = color || '#ffffff';\n\n this.options = options || {};\n this.options.tileSize = this.options.tileSize ||...
javascript
chosen
[ { "from": "system", "value": "Test view allowed for also teachers\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\n/* GET home page. */\nrouter.get('/', function(req, res, next) {\n\n if (!req.user) {\n\tres.render('login', { title: 'Expr...
javascript
chosen
[ { "from": "system", "value": "Add Checkbox into IconCheckbox storybook subcomponents\n" }, { "from": "human", "value": "import React from 'react';\nimport IconCheckbox from '@ichef/gypcrete/src/IconCheckbox';\n\nimport FlexRow from 'utils/FlexRow';\n\nexport default {\n title: '@ichef/gypcret...
javascript
chosen
[ { "from": "system", "value": "Increase requirejs timeout to 60s\n\nChange-Id: I80c50a0ca2ce57bea0a5d4402e208384932963fc\n" }, { "from": "human", "value": "requirejs.config({\n baseUrl: \"js\",\n urlArgs: '_=' + (new Date()).getTime(),\n paths: {\n jquery: 'libs/jquery',\n ...
javascript
chosen
[ { "from": "system", "value": "Replace undefined with null as default for index for BufferGeometry\n" }, { "from": "human", "value": "import * as THREE from 'three';\nimport PropTypes from 'prop-types';\n\nimport GeometryDescriptorBase from './GeometryDescriptorBase';\nimport propTypeInstanceOf f...
javascript
chosen
[ { "from": "system", "value": "Use moduleDirectory instead of paths for import/resolver\n" }, { "from": "human", "value": "const paths = require('./paths');\n\nmodule.exports = {\n parser: 'babel-eslint',\n extends: [\n 'airbnb',\n 'plugin:flowtype/recommended',\n 'prettier',\n 'pre...
javascript
chosen
[ { "from": "system", "value": "Move conditional to chached data\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar nodemailer = require('nodemailer');\n\n// create reusable transporter object using the default SMTP transport\nvar smtp = proce...
javascript
chosen
[ { "from": "system", "value": "Send game_ready to players when game is ready\n" }, { "from": "human", "value": "class LoadingController {\n constructor($log, $scope, $state, $interval, SocketService, GameService) {\n 'ngInject';\n\n this.$log = $log;\n this.$state = $state;\n this.$i...
javascript
chosen
[ { "from": "system", "value": "Add untested support for change lists\n" }, { "from": "human", "value": "/* global django */\n/* eslint indent:[2,4] */\n/* eslint comma-dangle:[2,\"never\"] */\ndjango.jQuery(function($){\n var context = document.getElementById('admin-ordering-context');\n if...
javascript
chosen
[ { "from": "system", "value": "Support website on port other than 80.\n" }, { "from": "human", "value": "function doConfig() {\n if (window.location.hostname === 'localhost') {\n mcglobals.apihost = window.location.protocol + '//localhost:5002';\n } else {\n mcglobals.apihost ...
javascript
chosen
[ { "from": "system", "value": "Change initial year in slider for 100 years ago from now\n" }, { "from": "human", "value": "$().ready(function(){\n function init(){\n var initialYear = new Date().getFullYear() - 100;\n renderMap();\n\n requestYears(function(years, formattedYears){\n ...
javascript
chosen
[ { "from": "system", "value": "Enable multi-element selectors for hideOtherLinks\n" }, { "from": "human", "value": "/*global $ */\n/*jslint\n white: true,\n vars: true,\n indent: 2\n*/\n(function($) {\n \"use strict\";\n $.fn.hideOtherLinks = function() {\n var $el = $(this),\n showHi...
javascript
chosen
[ { "from": "system", "value": "Enable pending HTTP requests to get list of SAML2 identity providers.\n" }, { "from": "human", "value": "import template from './auth-saml2-dialog.html';\n\nconst authSaml2Dialog = {\n template,\n bindings: {\n dismiss: '&',\n close: '&',\n },\n controller...
javascript
chosen
[ { "from": "system", "value": "Remove node engine version from published package\n" }, { "from": "human", "value": "/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n/* eslint-disable no-consol...
javascript
chosen
[ { "from": "system", "value": "Add getCartByUser in shared cart.\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module(\"piadinamia\").factory(\"sharedCartService\",\n [\"$firebase\", \"Firebase\", \"FBURL\",\n function ($firebase, Firebase, FBURL) {\n var myCustomers ...
javascript
chosen
[ { "from": "system", "value": "Add collection insert on click\n" }, { "from": "human", "value": "Template.feelings.events({\n 'click .feeling' (event, templateInstance) {\n console.log(event.currentTarget.id);\n }\n});\n" }, { "from": "gpt", "value": "import Feelings from '/feeli...
javascript
chosen
[ { "from": "system", "value": "Include node-interval-tree in debugger bundle\n" }, { "from": "human", "value": "const path = require('path');\nconst webpack = require('webpack');\nconst nodeExternals = require('webpack-node-externals');\n\nmodule.exports = {\n entry: \"./debugger\",\n\n module:...
javascript
chosen
[ { "from": "system", "value": "Add register command-line interface option\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar program = require('commander');\nvar autometa = require('../lib/autometa.js');\nvar package = require('../package.json');\n\nprogram\n .version(package['version...
javascript
chosen
[ { "from": "system", "value": "Fix loading indicator for subscribe view\n" }, { "from": "human", "value": "/**\n * The SpinnerTabsPresenter class for the SpinnerTabsPresenter view.\n *\n * @return SpinnerTabsPresenter class.\n */\ndefine([\n 'underscore',\n 'mps',\n 'map/presenters/PresenterCl...
javascript
chosen
[ { "from": "system", "value": "Add addEventListener, removeEventListener to the window stub\n" }, { "from": "human", "value": "/* Implementation from: https://github.com/laszlopandy/elm-console/blob/master/elm-io.sh */\nmodule.exports =\n \"(function(){\\n\" +\n \" window = {Date: Date};\\n\...
javascript
chosen
[ { "from": "system", "value": "Update dev server to send requests to worker site.\n" }, { "from": "human", "value": "const express = require('express');\r\nconst request = require('request');\r\nconst cookies = require('./cookie');\r\n\r\nconst app = express();\r\n\r\napp.use('*', (req, res) => {...
javascript
chosen
[ { "from": "system", "value": "Make webpack's library output name read ReactRedux instead of ReduxReact" }, { "from": "human", "value": "'use strict';\n\nvar webpack = require('webpack');\n\nvar plugins = [\n new webpack.DefinePlugin({\n 'process.env.NODE_ENV': JSON.stringify(process.env.NODE...
javascript
chosen
[ { "from": "system", "value": "Fix Invalid Variable + Session Leak\n" }, { "from": "human", "value": "'use strict';\n\nconst Express = require('express');\nconst Proxy = require('express-http-proxy');\nconst Router = Express.Router();\nconst env = process.env;\n/*\n * Helpers, In-House Mod...
javascript
chosen
[ { "from": "system", "value": "Make edit the default project view\n" }, { "from": "human", "value": "import React from 'react'\nimport { BrowserRouter as Router, Route, Switch } from 'react-router-dom'\n\nimport Header from './components/header'\nimport Footer from './components/footer'\n\nimport...
javascript
chosen
[ { "from": "system", "value": "Allow for more flexible arguments to BEST.register\n" }, { "from": "human", "value": "'use strict';\n\nvar DataStore = require('./data-store/data-store');\nvar Messenger = require('./messenger/messenger');\nvar Deployer = require('./deploy/deployer');\nvar helpers =...
javascript
chosen
[ { "from": "system", "value": "Adjust the style to truncate post index.\n" }, { "from": "human", "value": "$(function() {\n function traverse($node, len, maxCount) {\n var reachMaxCount = len > maxCount;\n if (reachMaxCount) {\n $node.hide();\n }\n var $c...
javascript
chosen
[ { "from": "system", "value": "Trim added to Mark's Form Validations.\n" }, { "from": "human", "value": "var validateEditForm = function (formObject) {\n\tvar error = false;\n\n\t// check name\n\tif (formObject.name.length < 1) {\n\t\ttoastr.error(\"You did not enter a valid name\");\n\t\terror =...
javascript
chosen
[ { "from": "system", "value": "BAP-258: Apply layout to user edit account form. JS collection minor refactoring.\n" }, { "from": "human", "value": "$(document).ready(function () {\n $('#add-another-email').click(function () {\n var emailList = $('#email-fields-list');\n var newWi...
javascript
chosen
[ { "from": "system", "value": "Check observer callback functionhood at registration\n" }, { "from": "human", "value": "/*\n * debugger.io: An interactive web scripting sandbox\n *\n * observers.js: mutation observers\n */\n\ndefine([\n 'config', 'utils', 'jquery', 'underscore',\n 'bus'\n],\nfun...
javascript
chosen
[ { "from": "system", "value": "Add compound statements back in.\n" }, { "from": "human", "value": "module.exports = grammar({\n name: 'ruby',\n\n extras: $ => [\n $.comment,\n $._line_break,\n /[ \\t\\r]/\n ],\n\n rules: {\n program: $ => repeat(seq($._statement, optional($._termi...
javascript
chosen
[ { "from": "system", "value": "[plugins] Allow empty plugin add method call\n\nAllow the general plugin add method to be called\nwith an empty object.\n" }, { "from": "human", "value": "import * as config from './config'\nimport * as dict from '../get/dict'\nimport * as input from '../parse/inter...
javascript
chosen
[ { "from": "system", "value": "Clean up unique project colours\n" }, { "from": "human", "value": "import uniqolor from \"uniqolor\";\nimport { v5 as uuidv5 } from \"uuid\";\n\n/**\n * Create a unique color for any IRIDA thing (project, sample, etc.)\n * @param id identifier for the thing\n * @par...
javascript
chosen
[ { "from": "system", "value": "Replace int values with string representations for renewFromOptions\n" }, { "from": "human", "value": "export const loanProfileTypesMap = {\n FIXED: 'Fixed',\n ROLLING: 'Rolling',\n INDEFINITE: 'Indefinite',\n};\n\nexport const intervalPeriodsMap = {\n MINUTE: '...
javascript
chosen
[ { "from": "system", "value": "Add cca run chrome support for windows (maybe?)\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar Q = require('q');\nvar child_process = require('child_process');\n\n// Returns a promise.\nmodule.exports = exports = functio...
javascript
chosen
[ { "from": "system", "value": "Handle itemref loops in JSON conversion\n" }, { "from": "human", "value": "/* -*- mode: js; js-indent-level: 2; indent-tabs-mode: nil -*- */\n\n// http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#json\njQuery.microdata.json = function(selector,...
javascript
chosen
[ { "from": "system", "value": "Build for production with options -p and --bail\n" }, { "from": "human", "value": "/* jshint node:true */\n/* jshint -W034 */\n/* jshint -W097 */\n\n'use strict';\n\nlet exec = require('child_process').exec;\nlet path = require('path');\n\nlet cmdLine = path.join('....
javascript
chosen
[ { "from": "system", "value": "Fix client 'moment.locale' not being set to 'fi'.\n" }, { "from": "human", "value": "'use strict'\n\nvar page = require('page');\nvar React = require('react');\nvar moment = require('moment');\n\nvar WeekView = React.createFactory(require('./views/week.jsx'));\n\np...
javascript
chosen
[ { "from": "system", "value": "Add my page stack to manage navigation on both iOS and Android\n" }, { "from": "human", "value": "// The contents of this file will be executed before any of\n// your view controllers are ever executed, including the index.\n// You have access to all functionality ...
javascript
chosen
[ { "from": "system", "value": "Add facebook login button (functional.. ish)\n" }, { "from": "human", "value": "import React, { Component } from 'react'\n\nexport class SignIn extends Component {\n constructor(props) {\n super(props)\n }\n render() {\n return (\n <div>\n <div>...
javascript
chosen
[ { "from": "system", "value": "Add filter by state (SAAS-635)\n" }, { "from": "human", "value": "'use strict';\n\n(function() {\n angular.module('ncsaas')\n .service('customersService', ['baseServiceClass', '$q', 'agreementsService', customersService]);\n\n function customersService(baseServ...
javascript
chosen
[ { "from": "system", "value": "Add variables and function call for longtouch\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { TouchableOpacity, Image, View } from 'react-native';\n// import styles from './styles/ClickableImageStyle';\nimport PropTypes from 'p...
javascript
chosen
[ { "from": "system", "value": "Make epochDays more legible by visualizing what it's divided by\n" }, { "from": "human", "value": "import Day from './day';\n\nconst Calendar = ({ events }) => {\n\n let id = 0;\n let lastEpochDays = 0;\n let daysEvents = [];\n let allDays = [];\n\n for (let ev...
javascript
chosen
[ { "from": "system", "value": "Add command to allow reset with longpress on both a and b.\n" }, { "from": "human", "value": "var EventEmitter = require('events').EventEmitter;\n\nvar hardware = module.exports = new EventEmitter();\n//var e = nobleEmitter.connect(peripheralUuid, serviceUuid, chara...
javascript
chosen
[ { "from": "system", "value": "Initialize GameService upon displaying GameComponent\n" }, { "from": "human", "value": "import angular from 'angular';\nimport uiRouter from 'angular-ui-router';\nimport gameComponent from './game.component';\n\nconst gameModule = angular\n .module('game', [uiRoute...
javascript
chosen
[ { "from": "system", "value": "client: Add a margin around server thumbnails for mobile screens.\n" }, { "from": "human", "value": "import React from 'react';\nimport ServerThumbnail from './ServerThumbnail';\n\nconst ServerListing = ({\n servers\n}) => (\n <div className=\"servers\">\n {ser...
javascript
chosen
[ { "from": "system", "value": "Fix redux update not using self link\n" }, { "from": "human", "value": "export const UPDATE_ENTITY = 'UPDATE_ENTITY';\n\nexport function updateEntity(href, token, entity) {\n\treturn {\n\t\ttype: UPDATE_ENTITY,\n\t\thref,\n\t\ttoken,\n\t\tentity,\n\t\tupdatedAt: Dat...
javascript
chosen
[ { "from": "system", "value": "Create file and process instance every time\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozil...
javascript
chosen
[ { "from": "system", "value": "Add credentials option in order to send headers\n" }, { "from": "human", "value": "var Timers = require('timers')\nvar SenecaModule = require('seneca')\n\nglobal.setImmediate = global.setImmediate || Timers.setImmediate\n\nvar SenecaExport = function(options, more_o...
javascript
chosen
[ { "from": "system", "value": "Check for new version on load.\n" }, { "from": "human", "value": "// We don't want everyone to be synchronized, so add a random amount to the interval\nconst NEW_VERSION_INTERVAL = (10 + Math.random() * 5) * 60 * 1000;\n// const NEW_VERSION_INTERVAL = 5000; // For d...
javascript
chosen
[ { "from": "system", "value": "Make the default duration of the transition in the 'setSmooth' method of\nSmoothHelper a property.\n" }, { "from": "human", "value": "Dashboard.SmoothHelper = Ember.Mixin.create({\n _smoothHelperInterval: 10,\n\n _smoothHelperProperties: function() {\n return {...
javascript
chosen
[ { "from": "system", "value": "Fix console polyfill for Graal\n" }, { "from": "human", "value": "\n\n(function(context) {\n context.global = context;\n\n var logger = context.logger || Interop.import('logger');\n\n if(!context.console){\n context.console = {\n log: func...
javascript
chosen
[ { "from": "system", "value": "Add call to Board flatten function and create selectPiece prototype function\n" }, { "from": "human", "value": "// Game Controller\n// A checkers board has 64 squares like a chess board but it only uses 32 squares all the same color\n// Each player has 12 pieces and...
javascript
chosen
[ { "from": "system", "value": "Remove lucene query parser lib\n\nOriginally added for an experiment to parse lucene query_string\nqueries, this lib is not currently used. Removeing\nfrom the autoloader sequence, but leaving the lib and grammar\nfile in case I want to revisit the experiment later.\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Fix example for vuex store\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport Vuex from 'vuex'\n\nVue.use(Vuex)\n\nconst store = new Vuex.Store({\n state: {\n counter: 0\n },\n mutations: {\n increment (state) {\n state.counter++\n }\n...
javascript
chosen
[ { "from": "system", "value": "Add pretty print for Jade HTML output\n" }, { "from": "human", "value": "var express = require('express');\n\nmodule.exports = function() {\n this.use(express.errorHandler({ dumpExceptions: true, showStack: true }));\n this.set('db-uri', 'mongodb://localhost/rezer...
javascript
chosen
[ { "from": "system", "value": "Remove typo from sample JS test path\n\nSigned-off-by: Robert Munteanu <1e9fedd098ac4a5f16a7ae3d8ed22e10bc2a35a7@adobe.com>\n" }, { "from": "human", "value": "/*\n * Copyright 2015 Adobe Systems Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (...
javascript
chosen
[ { "from": "system", "value": "Remove global Cuecard dep to run slideshow\n" }, { "from": "human", "value": "#! /usr/bin/env node\n\nvar cuecard = require('./cuecard.js'),\n\tpath = require('path'),\n\tcuecardFile = require(path.join(process.cwd(), 'cuecard.js'));\n\nif (cuecardFile.config) {\n\t...
javascript
chosen
[ { "from": "system", "value": "Send error log to stdout\n" }, { "from": "human", "value": "\"use strict\";\nvar errorHandler = module.exports = { };\n\nvar helper = require(\"./helper.js\");\nvar router = require(\"../router.js\");\n\n\nerrorHandler.register = function() {\n router.bindErrorHand...
javascript
chosen
[ { "from": "system", "value": "Improve container detection for images lazy load\n" }, { "from": "human", "value": "/*\n * Author: CM\n */\n\n(function($) {\n\n /**\n * @param {Object} [lazyLoadOptions] options to lazy-load-images plugin.\n * @returns {jQuery}\n */\n $.fn.lazyImageSetup = ...
javascript
chosen
[ { "from": "system", "value": "Add Access-Control-Allow-Origin for CORS from gh-pages\n" }, { "from": "human", "value": "var express = require('express');\nvar path = require('path');\nvar expressValidator = require('express-validator');\n\nvar home = require('./routes/home.js');\nvar api = requi...
javascript
chosen
[ { "from": "system", "value": "Resolve browser field even in server runtime\n\nOtherwise node shims aren't included (see\nhttps://github.com/substack/node-browserify/issues/1654).\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict'\n\nconst browserify = require('browserify')\nc...
javascript
chosen
[ { "from": "system", "value": "Use \"$\" instead of \"jquery\" to follow the import statement\n" }, { "from": "human", "value": "/*\n * This file is part of the Sylius package.\n *\n * (c) Paweł Jędrzejewski\n *\n * For the full copyright and license information, please view the LICENSE\n * file ...
javascript
chosen
[ { "from": "system", "value": "Clear out series number if the user removes the series option\n" }, { "from": "human", "value": "function displaySeriesNumber() {\n var s = document.getElementById(\"id_series\");\n var name = s.options[s.selectedIndex].text;\n\n if (name != '---------') {\n d...
javascript
chosen
[ { "from": "system", "value": "Add test to ensure that ElementMorph's can be cleaned up.\n" }, { "from": "human", "value": "import run from 'ember-metal/run_loop';\nimport EmberView from 'ember-views/views/view';\nimport compile from 'ember-template-compiler/system/compile';\nimport { runAppend, ...
javascript
chosen
[ { "from": "system", "value": "Add a 'createUser' function to the user helper module\n" }, { "from": "human", "value": "var bcrypt = require('bcrypt');\n\nvar redisHelper = require('./redis');\nvar db = redisHelper.getConnection();\n\nfunction findByUsername(username, next) {\n db.hget('users', ...
javascript
chosen
[ { "from": "system", "value": "Add test for generation of multilingual book\n" }, { "from": "human", "value": "var path = require('path');\nvar _ = require('lodash');\nvar assert = require('assert');\n\nvar fs = require(\"fs\");\nvar fsUtil = require(\"../lib/utils/fs\");\n\n\ndescribe('Website G...
javascript
chosen
[ { "from": "system", "value": "Add setInterval to keep clock up to date\n" }, { "from": "human", "value": "angular.module('mini-data.controllers', [])\n .controller('mainCtrl', function($scope){\n \n var getTimeInfo = function(){\n var now = new Date();\n var hours = now.getHours...
javascript
chosen
[ { "from": "system", "value": "Add additional test to determine monster\n" }, { "from": "human", "value": "const { describe, it } = global;\n\nimport {expect} from 'chai';\nimport {default as GameUtil} from '../game';\n\ndescribe('game utilities', () => {\n it('determines the correct monster', (...
javascript
chosen
[ { "from": "system", "value": "Add a dirty hack for not loosing value of selects while mooving\n" }, { "from": "human", "value": "/*\nCode taken from django snippets\nhttp://djangosnippets.org/snippets/1053/\n*/\n(function($){\n $(function() {\n $('div.inline-group').sortable({\n ...
javascript
chosen
[ { "from": "system", "value": "chore: Add browserstack capabilities to webdriver config\n" }, { "from": "human", "value": "import { Builder, Key } from 'selenium-webdriver';\n\nexport const driver = new Builder()\n .forBrowser('chrome')\n .usingServer('http://localhost:4444/wd/hub')\n .build...
javascript
chosen