conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Support log4js custom appender from config file\n\nFix #44\n" }, { "from": "human", "value": "'use strict';\n\nvar FluentSender = require('./sender').FluentSender;\nvar sender = new FluentSender('debug');\n\nmodule.exports = {\n configure: function(tag, options){\n...
javascript
chosen
[ { "from": "system", "value": "Add documentation, add all model implementation\n" }, { "from": "human", "value": "'use strict';\n\nvar Debug = require('debug')('Tuleap');\n\nvar Client \t\t= require('./client');\nvar Token \t\t= require('./Models/token');\nvar Projects \t= require('./Models/proje...
javascript
chosen
[ { "from": "system", "value": "Change render function to ignore special replacement patterns\n" }, { "from": "human", "value": "var fs = require('fs');\nvar logger = require('./logger');\n\nvar template = exports;\n\ntemplate.load = function(path) {\n try {\n path = fs.realpathSync(path);\n ...
javascript
chosen
[ { "from": "system", "value": "Append \"Behavior\" to \"BootstrapValidator\" for consistency-sake\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n jQueryBehavior: require('./behaviors/jquery-behavior.js'),\n StickitBehavior: require('./behaviors/stickit-behavior.js')...
javascript
chosen
[ { "from": "system", "value": ":art: Add a new line after variable declaration\n" }, { "from": "human", "value": "'use strict';\n\nconst fs = require('fs');\n\nclass Storage {\n /**\n * Constructor\n * @param {string} file\n */\n constructor(file) {\n this.data = null;\n this.file =...
javascript
chosen
[ { "from": "system", "value": "Fix exporting functions at the module level" }, { "from": "human", "value": "'use strict';\n\nimport debug from 'debug';\nimport rtcninja from 'rtcninja';\nimport { Connection } from './connection';\n\n\n// Public API\n\nfunction createConnection(options = {}) {\n ...
javascript
chosen
[ { "from": "system", "value": "Exclude ES7 shims of core-js\n" }, { "from": "human", "value": "require('core-js/shim');\n\nconst $ = require('jquery');\nconst stageConfigs = require('./stages.json');\nconst Game = require('./game');\n\n$(document).ready(() => {\n\tconst game = new Game(stageConfi...
javascript
chosen
[ { "from": "system", "value": "Clear highlight when the animation finishes\n" }, { "from": "human", "value": "// ONLY works for numbers\nfunction countingSort(array, maxValue) {\n highlightCode([0]);\n\n if (array.constructor !== Array || array.length == 0) {\n highlightCode([1]);\n ...
javascript
chosen
[ { "from": "system", "value": "Fix uuid generator, add objectSize calculator\n" }, { "from": "human", "value": "var titleCase = function toTitleCase(str) {\n return str.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n};\n\nvar u...
javascript
chosen
[ { "from": "system", "value": "Load custom actions not only for managers\n\nCG artists may have some custom action to runs on selected tasks.\n" }, { "from": "human", "value": "import async from 'async'\nimport store from '../store'\n\nconst init = (callback) => {\n const storeActions = [\n '...
javascript
chosen
[ { "from": "system", "value": "Use dot reporter for server tests\n\nFurther noise reductions" }, { "from": "human", "value": "import Gulp from 'gulp';\nimport istanbul from 'gulp-istanbul';\nimport mocha from 'gulp-mocha';\n\nimport {Server as KarmaServer} from 'karma';\n\nimport plumber from '@k...
javascript
chosen
[ { "from": "system", "value": "Select chosen stylesheet on load\n" }, { "from": "human", "value": "/*\n * style-select.js\n * https://github.com/savetheinternet/Tinyboard/blob/master/js/style-select.js\n *\n * Changes the stylesheet chooser links to a <select>\n *\n * Released under the MIT licen...
javascript
chosen
[ { "from": "system", "value": "Use firefox for testing by default\n\n- Chrome support on Linux platform is bad\n" }, { "from": "human", "value": "exports.config = {\n seleniumAddress: 'http://localhost:4444/wd/hub',\n specs: [\n 'internal/modeCostTracking/*.js',\n 'internal/modeDevelop/*....
javascript
chosen
[ { "from": "system", "value": "Update tests to remove some deprecated stuff.\n\nsvn path=/trunk/; revision=745\n" }, { "from": "human", "value": "#!/usr/bin/env seed\n// Returns: 0\n// STDIN:\n// STDOUT:255\\.000000\\n0\\.000000\n// STDERR:\n// Returns: 0\n// STDIN:\n// STDOUT:\n// STDERR:\\/bin\...
javascript
chosen
[ { "from": "system", "value": "Fix issue when server changed and connection failed" }, { "from": "human", "value": "import {\n DB_CONNECT_REQUEST,\n DB_CONNECT_SUCCESS,\n DB_CONNECT_FAILURE,\n} from '../actions/connections';\nimport { UPDATE_SERVER_SUCCESS } from '../actions/servers';\n\n\ncon...
javascript
chosen
[ { "from": "system", "value": "Fix regex in test case\n" }, { "from": "human", "value": "var expect = require('expect');\n\nmodule.exports = function chunk2(callback) {\n function forEachElement(el) {\n var src = el.getAttribute('src') || el.getAttribute('href');\n var integrity = el.getAt...
javascript
chosen
[ { "from": "system", "value": "Remove redundant call to disable webpack 'watch' mode\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar rename = require('gulp-rename');\nvar browserSync = require('browser-sync');\nvar webpackStream = require('webpack-stream');\n...
javascript
chosen
[ { "from": "system", "value": "Load last saved checks on page load\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('checks').controller('ChecksController', ['$scope', 'Socket',\n\tfunction($scope, Socket) {\n\n\t\tSocket.on('checks.updated', function(data) {\n \t\tconsole.lo...
javascript
chosen
[ { "from": "system", "value": "Fix association model with user and email\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar Sequelize = require('sequelize');\nvar basename = path.basename(module.filename);\nvar env = pr...
javascript
chosen
[ { "from": "system", "value": "Change plugin name and version to pkg\n" }, { "from": "human", "value": "'use strict';\n\nconst Hoek = require('hoek');\nconst Config = require('./config');\n\nexports.register = function (server, options, next) {\n\n Hoek.assert(server.connections.length === 1,\...
javascript
chosen
[ { "from": "system", "value": ":new: Make sure flint and language-flint are uninstalled\n" }, { "from": "human", "value": "'use babel'\n\nimport {Motion} from './main'\nimport {ensureUninstalled} from './helpers'\n\nmodule.exports = {\n config: {\n liveReload: {\n description: 'Automatic...
javascript
chosen
[ { "from": "system", "value": "Raise log level to debug\n\nSince nwitch is still being developed, this is okay. Also, all the\ncurrent debug logs check `config.debug` first anyways.\n" }, { "from": "human", "value": "var winston = require('winston');\n\nvar transports = [\n new winston.transport...
javascript
chosen
[ { "from": "system", "value": "Refactor config class in dataservice module\n" }, { "from": "human", "value": "'use strict';\n\nvar EventEmitter = require('events').EventEmitter\n\nclass Config {\n constructor() {\n this.requiredKeys = ['url','type']\n this.messages = {\n missingConfig...
javascript
chosen
[ { "from": "system", "value": "Fix schema not being defined\n" }, { "from": "human", "value": "import { runQuery } from 'graphql-server-core';\n\nexport function graphQlMethod ({ query, variables }) {\n this.unblock();\n\n const { userId } = this;\n\n return runQuery({\n schema,\n...
javascript
chosen
[ { "from": "system", "value": "Update statistics page to use header\n" }, { "from": "human", "value": "import React, {Component} from 'react';\n\nexport default class Statistics extends Component {\n render() {\n return (\n <div>Statistics</div>\n );\n }\n}" }, { "from": "gpt...
javascript
chosen
[ { "from": "system", "value": "Remove reference to unused ui service.\n" }, { "from": "human", "value": "(function (module) {\n module.controller('projectHome', projectHome);\n projectHome.$inject = [\"project\"];\n\n function projectHome(project, ui) {\n var ctrl = this;\n ...
javascript
chosen
[ { "from": "system", "value": "Add tests for the file-renderer component.\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\n\nmoduleForComponent('file-renderer', 'Integration | Component | file renderer', {\n...
javascript
chosen
[ { "from": "system", "value": "Remove siteIds from virtualPageView urls.\n\n" }, { "from": "human", "value": "/* eslint-disable no-undef */\nimport { takeEvery } from 'redux-saga';\nimport { select } from 'redux-saga/effects';\nimport { capitalize } from 'lodash';\nimport * as deps from '../deps'...
javascript
chosen
[ { "from": "system", "value": "test: Update SocketProvider to have new prop name\n" }, { "from": "human", "value": "import React from 'react';\nimport { expect } from 'chai';\nimport { shallow } from 'enzyme';\nimport SocketProvider from '../lib/SocketProvider.jsx';\n\ndescribe('<SocketProvider /...
javascript
chosen
[ { "from": "system", "value": "Test deferring to an object's own map implementation if available\n" }, { "from": "human", "value": "(function() {\n module(\"R.map\");\n\n var map = require('eigensheep/map')['default'];\n var double = function(x) { return x * 2 };\n\n test(\"on empty arrays\",...
javascript
chosen
[ { "from": "system", "value": "Debug spreadsheet location to console\n" }, { "from": "human", "value": "(function() {\n\tangular.module('c4cWebsite.actions')\n\t.factory('ActionService', ['$q', '$log', 'Tabletop', actionService]);\n\t\n\t/**\n\t * Returns a promise when the action service is loa...
javascript
chosen
[ { "from": "system", "value": "Rewrite pull request message module\n\nPrevious step to handle missing template file\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar Promise = require('bluebird');\nvar temp = require('temp');\...
javascript
chosen
[ { "from": "system", "value": "Add logic for multiremote object when setting tunnelIdentifier\n" }, { "from": "human", "value": "import SauceConnectLauncher from 'sauce-connect-launcher'\n\nclass SauceLaunchService {\n /**\n * modify config and launch sauce connect\n */\n onPrepare ...
javascript
chosen
[ { "from": "system", "value": "Exclude method Titanium.App.appURLToPath Maybe It is removed or deprecated method\n" }, { "from": "human", "value": "function app_data() {\n\tvar win = Titanium.UI.createWindow();\n\t\n\tvar data = '';\n\t\n\tdata+= 'ID: ' + Titanium.App.getID() + '\\n';\n\tdata+= '...
javascript
chosen
[ { "from": "system", "value": "Test code: block a URL by onBeforeRequest with specific filter\n" }, { "from": "human", "value": "(function() {\n\tmain = function() {\n\t\tchrome.webRequest.onBeforeRequest.addListener(\n\t\t\tfunction(details) {\n\t\t\t\tconsole.log(\"details.url: \" + details.url...
javascript
chosen
[ { "from": "system", "value": "Set up rendering in view, and subscribe view to model data load." }, { "from": "human", "value": "(function(){\n var dc = window.dc;\n var $ = dc.$;\n var _ = dc._;\n var Backbone = dc.Backbone;\n\n var definition = dc.embed.definition;\n v...
javascript
chosen
[ { "from": "system", "value": "Change to gridboard to add column picker\n" }, { "from": "human", "value": "Ext.define('CustomApp', {\n extend: 'Rally.app.App',\n componentCls: 'app',\n\n \n launch: function() {\n \n var self = this;\n Ext.create('Rally.data.wsapi.Store', {...
javascript
chosen
[ { "from": "system", "value": "Refactor auth store, make use of getters and actions\n\n" }, { "from": "human", "value": "import User from 'src/models/User';\nimport axios from 'axios';\n\n/* eslint no-param-reassign: 0 */\nexport default {\n state: {\n authenticated: false,\n user: new Use...
javascript
chosen
[ { "from": "system", "value": "Fix failing update on change test\n\nRegression was not ran before last commit. When testing the view\nstandalone the liveUpdate configuration ahd to be set.\n" }, { "from": "human", "value": "/* global jasmine atom beforeEach waitsForPromise waitsFor runs describe ...
javascript
chosen
[ { "from": "system", "value": "Fix typo on facebook setting form\n" }, { "from": "human", "value": "'use strict';\n\nvar form = require('express-form')\n , field = form.field;\n\nmodule.exports = form(\n field('settingForm[fb:appId]').trim().is(/^\\d+$/),\n field('settingForm[fb:seret]').trim(...
javascript
chosen
[ { "from": "system", "value": "Use jQuery's on/off instead of bind/unbind and specify proper events.\n" }, { "from": "human", "value": "jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) {\n var _that = this;\n\n if ( iDelay === undefined ) {\n iDelay = ...
javascript
chosen
[ { "from": "system", "value": "[bugfix] Reset redux value to defualt success.\n" }, { "from": "human", "value": "import {\n NO_EXPANDED_ROUTES,\n REQUEST_ROUTES,\n REQUEST_EXPANDED_ROUTES,\n RECEIVE_EXPANDED_ROUTES,\n RECEIVE_ROUTES_LYFT,\n RECEIVE_ROUTES_UBER\n} from '../actions/types';\n\...
javascript
chosen
[ { "from": "system", "value": "Adjust space inner the tag\n" }, { "from": "human", "value": "import _ from 'lodash';\nimport React, { Component } from 'react';\n\nexport default class TagLabels extends Component {\n\n render() {\n const { tags, activeTag, handler } = this.props\n return (\...
javascript
chosen
[ { "from": "system", "value": "Sort language dropdown by localized language name\n" }, { "from": "human", "value": "import Controller from \"@ember/controller\";\nimport { computed } from \"@ember/object\";\nimport { locales as localesConfig, themes as themesConfig } from \"config\";\n\n\nconst {...
javascript
chosen
[ { "from": "system", "value": "Copy local URL to clipboard\n" }, { "from": "human", "value": "// Packages\nconst {copy} = require('copy-paste')\nconst ip = require('ip')\nconst chalk = require('chalk')\n\nconst copyToClipboard = async text => {\n try {\n await copy(text)\n return true\n }...
javascript
chosen
[ { "from": "system", "value": "Use the latest version of React.\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport 'bootstrap/dist/css/bootstrap.css';\nimport './index.css';\nimport App from './containers/App';\n\nReactDOM.render(\n <React.St...
javascript
chosen
[ { "from": "system", "value": "Fix tiny typo in deprecation notice.\n" }, { "from": "human", "value": "import Ember from 'ember-metal/core';\nimport ControllerMixin from 'ember-runtime/mixins/controller';\nimport ObjectProxy from 'ember-runtime/system/object_proxy';\n\nexport var objectController...
javascript
chosen
[ { "from": "system", "value": "Use native Map instead of plain object\n\nAlso reduce the use of lodash\n" }, { "from": "human", "value": "\nconst _ = require('lodash');\n\nclass TextLocationRegistry {\n\n constructor() {\n this._recordMap = {};\n }\n\n register({editorId, decorati...
javascript
chosen
[ { "from": "system", "value": "Add RESTful structure for list\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\nrouter.route('/')\n .all(function(req, res, next) {\n next();\n })\n .get(function(req, res, next) {\n res.send('OK');\n ...
javascript
chosen
[ { "from": "system", "value": "Fix browsers other than the local browser not being able to connect\n" }, { "from": "human", "value": "var events = require(\"events\");\nvar io = require('socket.io-client');\n\nvar Receiver = function () {};\nReceiver.prototype = new events.EventEmitter;\n\nReceiv...
javascript
chosen
[ { "from": "system", "value": "Add validation to check the country code to be replaced\n" }, { "from": "human", "value": "export default function replaceCountryCode(\n currentSelectedCountry,\n nextSelectedCountry,\n number,\n) {\n const dialCodeRegex = RegExp(`^(${currentSelectedCountry.dial...
javascript
chosen
[ { "from": "system", "value": ":art: Clean up boolean cell styles\n" }, { "from": "human", "value": "import React from 'react';\nimport { Dropdown, Icon, Menu, Button } from 'antd';\nimport { func, number, string, any } from 'prop-types';\n\nconst { Item } = Menu;\n\nconst BooleanCell = ({ childr...
javascript
chosen
[ { "from": "system", "value": "Add callback function after updateUserList function\n" }, { "from": "human", "value": "var telegramBot = require('node-telegram-bot-api');\nvar twitter = require('twitter');\nvar aws = require('aws-sdk');\nvar nconf = require('nconf');\nvar log4js = require('log4js'...
javascript
chosen
[ { "from": "system", "value": "Add basic API for countries\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\nvar mysql = require('mysql');\n\n// TODO pull out config.js\n// TODO set up read-only db user!\nvar connection = mysql.createConnection({\n ...
javascript
chosen
[ { "from": "system", "value": "Support for 0.10 and 0.12\n" }, { "from": "human", "value": "var fs = require('fs');\nvar npmi = require('npmi');\nvar path = require('path');\nvar Hjson = require('hjson');\nvar process = require('./lib/process.js');\n\nvar Jodot = function () {};\n\nJodot.prototyp...
javascript
chosen
[ { "from": "system", "value": "Fix to work with Meteor 1.0.4\n\nThere were some Mongo updates mentioned in the Meteor 1.0.4 announcement\n@ http://goo.gl/YwsbES I'm thinking were related. Accessing internals\nis hackish and makes sense it broke?\n\nSee GitHub issue @ https://github.com/meteorhacks/meteor-ag...
javascript
chosen
[ { "from": "system", "value": "Switch componentWillMount / componentWillUnmount order\n\nSummary:\nThis switches our React feature flag so that componentWillMount happens before\ncomponentWillUnmount when a child switches. It used to be inconsistent and this\nmakes it consistent and inline with what React Fi...
javascript
chosen
[ { "from": "system", "value": "Fix arguments passed to the required file\n\nSigned-off-by: Henrique Vicente <d390f26e2f50ad5716a9c69c58de1f5df9730e3b@gmail.com>\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function exports() {\n var path,\n params = [];\n\n if...
javascript
chosen
[ { "from": "system", "value": "Add members endpoint, move around gated data\n" }, { "from": "human", "value": "const router = require('express').Router();\nconst {Clan} = require('../database');\n\nrouter.get('/', (req, res) => {\n return Clan.findAll(req.query)\n .then(clans => {\n res....
javascript
chosen
[ { "from": "system", "value": "Use filename from css.parse errors.\n\nThe file we're compiling might not be the same as the file that\ncontains the error.\n" }, { "from": "human", "value": "'use strict';\nvar gutil = require('gulp-util');\nvar through = require('through2');\nvar _ = require('loda...
javascript
chosen
[ { "from": "system", "value": "Order \"See no evil, hear no evil, speak no evil\"\n\nCredit to @willingc" }, { "from": "human", "value": "\"use strict\";\n\nfunction *evil() {\n var monkeyBase = 128584;\n\n while(true) {\n yield \"🙊\";\n yield \"🙈\";\n yield \"🙉\";\n...
javascript
chosen
[ { "from": "system", "value": "Use compilation warnings instead of console.log\n" }, { "from": "human", "value": "var path = require('path');\nvar findRoot = require('find-root');\nvar chalk = require('chalk');\nvar _ = require('lodash');\n\nfunction DuplicatePackageCheckerPlugin() {}\n\nDuplicat...
javascript
chosen
[ { "from": "system", "value": "Change name of controller to match file.\n" }, { "from": "human", "value": "(function (module) {\n module.controller(\"FilesEditController\", FilesEditController);\n\n FilesEditController.$inject = ['file'];\n\n /* @ngInject */\n function FilesEditContro...
javascript
chosen
[ { "from": "system", "value": "Fix regexp so that git@blah.com:blah.gitblah fails" }, { "from": "human", "value": "/*!\n * is-git-url <https://github.com/jonschlinkert/is-git-url>\n *\n * Copyright (c) 2014-2015, Jon Schlinkert.\n * Licensed under the MIT License.\n */\n\nmodule.exports = functio...
javascript
chosen
[ { "from": "system", "value": "Update all checks to use assertions\n" }, { "from": "human", "value": "/**\n * Module dependences\n */\n\nvar assert = require('assert');\n\n/**\n * Exports\n */\n\nmodule.exports = Dispatcher;\n\n/**\n * Dispatcher prototype\n */\n\nvar dispatcher = Dispatcher.prot...
javascript
chosen
[ { "from": "system", "value": "Fix bug reporting some kinds of warnings/errors\n\nSome (unknown to me right now) errors and warnings from webpack may lack\nthe \"module\" field which provides the filename of the error. Avoid\nattempts to access that attribute if it's not present.\n" }, { "from": "hum...
javascript
chosen
[ { "from": "system", "value": "Switch doc to closure compiler templating\n" }, { "from": "human", "value": "var polygon = require('turf-polygon');\n\n/**\n * Takes a bbox and returns the equivalent {@link Polygon} feature.\n *\n * @module turf/bbox-polygon\n * @category measurement\n * @param {Ar...
javascript
chosen
[ { "from": "system", "value": "Update methods to reflect platform information\n\nThis updates the implementations of the os.type() and os.platform()\nmethods to reflect more accurate system/platform information.\n\nos.type() has been updated to simply return 'React Native'\nos.platform() has been updated to ...
javascript
chosen
[ { "from": "system", "value": "Add object argument to save\n" }, { "from": "human", "value": "const nefHandler = {\n get(target, name) {\n if (!target[name]) target[name] = {};\n let object = target[name];\n\n const methods = {\n get(key, defaultValue) {\n const value = obje...
javascript
chosen
[ { "from": "system", "value": "Fix case sensitive email login\n" }, { "from": "human", "value": "/* eslint-disable func-names, prefer-arrow-callback */\n\nimport local from 'passport-local';\nimport * as objection from 'objection';\nimport bcrypt from 'bcrypt';\nimport { User } from './models';\n...
javascript
chosen
[ { "from": "system", "value": "Split out function to be able to use it separately.\n" }, { "from": "human", "value": "if (typeof define !== 'function') { var define = require('amdefine')(module) }\n\ndefine([\n '../shortcut-manager'\n],function(\n ShortcutManager\n) {\n\n var keyCodeMap = Shor...
javascript
chosen
[ { "from": "system", "value": "Fix the messaging timing extension to only message the toplevel frame.\n\nBUG=no\n\nReview URL: http://codereview.chromium.org/384133\n\ngit-svn-id: http://src.chromium.org/svn/trunk/src@31978 4ff67af0-8c30-449e-8e8b-ad334ec8d88c\n\nFormer-commit-id: 882ecab1c967ae90828b9e87221...
javascript
chosen
[ { "from": "system", "value": "Set import name to \"array-pauser\"\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-cli-array-pauser'\n};\n" }, { "from": "gpt", "value": "/* jshint node: true */\n'use strict';\n\nmodule.ex...
javascript
chosen
[ { "from": "system", "value": "Update path to work on all SOs\n" }, { "from": "human", "value": "'use strict'\n\nconst path = require('path')\nconst webpack = require('webpack')\nconst validate = require('webpack-validator')\n\nconst ExtractTextPlugin = require('extract-text-webpack-plugin')\n\nm...
javascript
chosen
[ { "from": "system", "value": "Add ability to \"fix\" texture\n\n\n\nFormer-commit-id: ef8268a05c85fdc1f0a3f5af77ceab963bc5f0f3" }, { "from": "human", "value": "import {\n RepeatWrapping,\n UVMapping,\n NearestFilter,\n LinearMipMapLinearFilter,\n TextureLoader,\n Vector2\n} from 'three';\...
javascript
chosen
[ { "from": "system", "value": "Fix build URLs on index page\n" }, { "from": "human", "value": "var delegate = require('delegate');\n\nvar form = document.querySelector('.component-build-form');\n\nif(form) {\n var checkboxes = form.querySelectorAll('input[type=\"checkbox\"]');\n var buildUrl = ...
javascript
chosen
[ { "from": "system", "value": "[CCUK-3425] Add settings page to app.\n\nCurrently it appears for all users, but will be non-functional.\n\n[rev: ivo.miller]\n" }, { "from": "human", "value": "/*\n * Copyright 2015 Hewlett-Packard Development Company, L.P.\n * Licensed under the MIT License (the \...
javascript
chosen
[ { "from": "system", "value": "Remove github app client credentials\n" }, { "from": "human", "value": "var nconf = require('nconf');\n\nnconf.argv().env();\n\nvar STREAM_URL = process.env.STREAM_URL.replace(/[@=:]/g, '/').split('/');\n\nnconf.defaults({\n 'MONGOLAB_URI': 'mongodb://localhost/s...
javascript
chosen
[ { "from": "system", "value": "Add support for heroku PORT process\n" }, { "from": "human", "value": "var express = require('express');\nvar mongoose = require('mongoose');\nvar bodyParser = require('body-parser');\nvar app = express();\n\nvar port = 3000;\n\napp.use(express.static('../client'));...
javascript
chosen
[ { "from": "system", "value": "Refactor to conform to JSlint\n" }, { "from": "human", "value": "start();\nfunction start () {\n 'use strict';\n\n const express = require('express');\n const app = express();\n\n // app.use(bodyParser.json());\n app.use(express.static('public'));\n\n const lo...
javascript
chosen
[ { "from": "system", "value": "Make header link to index.html so it works on the filesystem\n" }, { "from": "human", "value": "\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n var h1 = document.querySelector(\"h1\");\n if (h1 && !document.title) {\n document.title = \"DevTool...
javascript
chosen
[ { "from": "system", "value": "Update user object on `earn` events.\n" }, { "from": "human", "value": "export default function notificationsPlugin () {\n const currentNotifications = Symbol('Notifications')\n\n return (mp) => {\n mp[currentNotifications] = []\n\n function onNotify (notif)...
javascript
chosen
[ { "from": "system", "value": "Exclude disabled fields as well\n" }, { "from": "human", "value": "(function ($) {\n\nvar toInt = function (value, defaultValue) {\n\tvar parsed = parseInt(value);\n\treturn isNaN(parsed) ? defaultValue : parsed;\n};\n\nvar showCharacterCount = function ($counter, $...
javascript
chosen
[ { "from": "system", "value": "Update to Olm 3 here too\n" }, { "from": "human", "value": "\n\"use strict\";\nimport 'source-map-support/register';\nimport Crypto from '../../lib/crypto';\nimport expect from 'expect';\n\nconst sdk = require(\"../..\");\n\nconst Olm = global.Olm;\n\ndescribe(\"Cry...
javascript
chosen
[ { "from": "system", "value": "Clean up user detail route\n" }, { "from": "human", "value": "var util = require( \"util\" );\nvar ReadHandler = require( \"express-classy\" ).ReadHandler;\nvar User = require( \"./models\" ).User;\n\n\nmodule.exports = GetDetail;\n\n\nfunction GetDetail () {\n R...
javascript
chosen
[ { "from": "system", "value": "Sort objectives alphabetically in single event view\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/ilios-calendar-single-event-objective-list';\n\nconst { computed, isEmpty } = Ember;\n\nexport default Embe...
javascript
chosen
[ { "from": "system", "value": "Return next fiscal year in YYYY format\n" }, { "from": "human", "value": "// moment-fquarter.js\n// version : 0.3\n// author : Rob Allen\n// license : MIT\n// github.com/robgallen/moment-fquarter\n\n(function () {\n\n function onload(moment) {\n moment.fn....
javascript
chosen
[ { "from": "system", "value": "Print message when quitting on exception\n\nThis makes sure that an explanatory message is printed when quitting\nthe main loop due to an exception in a test suite but outside a test\n(e.g. in a beforeEach function.)\n\n[endlessm/eos-sdk#737]\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Fix issue with getState not bound to store properly\n" }, { "from": "human", "value": "// Function taken from redux source\n// https://github.com/reactjs/redux/blob/master/src/compose.js\nfunction compose(...funcs) {\n if (funcs.length === 0) {\n return arg => a...
javascript
chosen
[ { "from": "system", "value": "Fix node v4 in tests by forcing strict mode\n" }, { "from": "human", "value": "/* eslint-env node */\n\nmodule.exports = function(environment) {\n let ENV = {\n modulePrefix: 'dummy',\n environment,\n rootURL: '/',\n locationType: 'auto',\n EmberENV:...
javascript
chosen
[ { "from": "system", "value": "Add some changes in initialization file\n" }, { "from": "human", "value": "import Server from './server';\nimport minimist from 'minimist';\n\n(() => {\n\tconst args = minimist(process.argv.slice(2));\n\tconst port = args.port && parseInt(args.port) ...
javascript
chosen
[ { "from": "system", "value": "Add missing api key in product picker.\n\nFixes #6185\n" }, { "from": "human", "value": "$.fn.productAutocomplete = function () {\n 'use strict';\n\n this.select2({\n minimumInputLength: 1,\n multiple: true,\n initSelection: function (element, callback) {...
javascript
chosen
[ { "from": "system", "value": "Add starfield to battle scene.\n" }, { "from": "human", "value": "define(function(require){\r\n var scene = new THREE.Object3D();\r\n var camera = new THREE.PerspectiveCamera(75, 16 / 9, 0.1, 5000);\r\n var loader = new THREE.JSONLoader(true);\r\n var or...
javascript
chosen
[ { "from": "system", "value": "Tweak for Node / Browserify / Browser unity\n" }, { "from": "human", "value": "/**\n * Autoincrementing Counter\n * @constructor\n */\nvar PrivateAutoincrementer = function() {\n\tvar id = 0;\n\n\t/**\n\t * Generate a unique ID\n\t * @param {Function} cb The callba...
javascript
chosen
[ { "from": "system", "value": "Remove console log with errors\n" }, { "from": "human", "value": "'use strict'\nconst jsonPatch = require('fast-json-patch')\nconst getValue = require('./../fn/getValue')\nconst nestingPatches = require('./../fn/nestingPatches')\nconst decomposePath = require('./../...
javascript
chosen
[ { "from": "system", "value": "Add check for user existance inside session\n" }, { "from": "human", "value": "const UserDB = require('../db/userdb').Users\nexports.ui = (req, res, next) => {\n if (req.session) {\n let name = req.session.user.userName\n console.log('</routes/chat.js , ui> u...
javascript
chosen
[ { "from": "system", "value": "Use history directly from `react-router`\n" }, { "from": "human", "value": "// Polyfills\nimport 'babel-polyfill';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { Router } from 'react-router';\n\nimport { createHashHistory } from 'histor...
javascript
chosen
[ { "from": "system", "value": "Remove overlay so files/editor still accessible when terminal is open\n" }, { "from": "human", "value": "/*\n * Copyright (c) Codiad & Kent Safranski (codiad.com), distributed\n * as-is and without warranty under the MIT License. See\n * [root]/license.txt for mo...
javascript
chosen
[ { "from": "system", "value": "Remove toLowerCase so that the env var doesn't need to be set\n" }, { "from": "human", "value": "const winston = require('winston');\nconst winstonError = require('winston-error');\n\nconst levels = {\n levels: {\n error: 0,\n warn: 1,\n info: 2,\n verb...
javascript
chosen
[ { "from": "system", "value": "Use process.exit once final callback is called\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar cdbExport = require('cartodb-export');\nvar fs = require('fs');\nvar program = require('commander');\n\nvar cartodb2leaflet = require('../index');\n\nprogram...
javascript
chosen