conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove duplicate keys in eslint `globals`" }, { "from": "human", "value": "module.exports = {\n env: {\n browser: true,\n es6: true,\n },\n globals: {\n afterEach: true,\n beforeEach: true,\n chrome: true,\n expect: true,\n jest: true,\n b...
javascript
chosen
[ { "from": "system", "value": "Enable ES6 support for const\n" }, { "from": "human", "value": "module.exports = {\n \"env\": {\n \"node\": true\n },\n \"extends\": \"eslint:recommended\",\n \"rules\": {\n \"indent\": [\n \"error\",\n 2\n ],\n \"linebreak-style\": [\n ...
javascript
chosen
[ { "from": "system", "value": "Add eslint-plugin-html to config file\n" }, { "from": "human", "value": "module.exports = {\n 'env': {\n 'commonjs': true,\n 'es6': true,\n 'node': true,\n 'browser': true,\n 'jest': true,\n 'mocha': true,\n 'jasmine': true,\n },\n 'extends':...
javascript
chosen
[ { "from": "system", "value": "Change language name 'Japan' to 'Japanese'.\n" }, { "from": "human", "value": "var langs = {\n\t'de':'deutsch',\n\t'en':'english',\n\t'es':'español',\n\t'fr':'français',\n\t'it':'italiano',\n\t'ja':'日本',\n\t'ko':'한국어',\n\t'pl':'polski',\n\t'pt':'português',\n\t'ru':...
javascript
chosen
[ { "from": "system", "value": "Change default debug behavior back to false\n" }, { "from": "human", "value": "/**\n * In-Memory configuration storage\n */\nlet Config = {\n isInitialized: false,\n debug: true,\n overridePublishFunction: true,\n mutationDefaults: {\n pushToRedis...
javascript
chosen
[ { "from": "system", "value": "Apply params in header and footer.\n" }, { "from": "human", "value": "var _ = require('underscore'),\n fs = require('fs');\n\nfunction Writer() {\n \n function gen(templates, numSegments, params, outFile, cb) {\n var stream = fs.createWriteStream(outFile,\n ...
javascript
chosen
[ { "from": "system", "value": "Make it compatible with old browsers\n" }, { "from": "human", "value": "/* eslint-env amd */\n(function (name, definition) {\n if (typeof define === 'function') {\n // AMD\n define(definition)\n } else if (typeof module !== 'undefined' && module.exports) {\n...
javascript
chosen
[ { "from": "system", "value": "Fix to console check causing breaks in IE.\n" }, { "from": "human", "value": "steal('can/util/mvc.js')\n.then('funcunit/qunit', \n\t 'can/util/fixture')\n.then(function() {\n\tvar oldmodule = window.module;\n\n\t// Set the test timeout to five minutes\n\tQUnit.conf...
javascript
chosen
[ { "from": "system", "value": "Fix variation matches with variations\n" }, { "from": "human", "value": "var basename = require('path').basename;\n\nmodule.exports = variationMatches;\nfunction variationMatches(variations, path) {\n var result;\n variations.some(function(variation) {\n ...
javascript
chosen
[ { "from": "system", "value": "Change 'year' from persistent to virtual and get from 'releaseDate'\n" }, { "from": "human", "value": "const mongoose = require('mongoose')\nconst uniqueValidator = require('mongoose-unique-validator')\nconst paginate = require('mongoose-paginate')\nconst requiredVa...
javascript
chosen
[ { "from": "system", "value": "Remove deprecated MI site from GLOBAL_NAV_ITEMS\n" }, { "from": "human", "value": "const fs = require('fs')\nconst path = require('path')\nconst { compact, sortBy, concat, includes } = require('lodash')\n\nconst config = require('../config')\nconst urls = require('....
javascript
chosen
[ { "from": "system", "value": "Update tests to use react-dom/test-utils\n" }, { "from": "human", "value": "import React from 'react';\nimport TestUtils from 'react-addons-test-utils';\n\nexport default {\n renderComponent(Component, props = {}, state = {}) {\n const component = TestUtils.rend...
javascript
chosen
[ { "from": "system", "value": "Set the timezone on MySQL formatted dates.\n" }, { "from": "human", "value": "'use strict';\n\n/*\n * Number Filters\n * \n * In HTML Template Binding\n * {{ filter_expression | filter : expression : comparator}}\n * \n * In JavaScript\n * $filter('filter')(array, e...
javascript
chosen
[ { "from": "system", "value": "Unplug client streams when requests end\n" }, { "from": "human", "value": "\"use strict\";\n\nvar zlib = require(\"zlib\");\n\nvar cors = require(\"cors\"),\n express = require(\"express\");\n\nvar SyslogFilter = require(\"./syslog-filter\");\n\nmodule.exports = ...
javascript
chosen
[ { "from": "system", "value": "Add notification about gemini config overriding\n" }, { "from": "human", "value": "'use strict';\nvar path = require('path'),\n opener = require('opener'),\n chalk = require('chalk'),\n pkg = require('../package.json'),\n server = require('./server'),\n ...
javascript
chosen
[ { "from": "system", "value": "Fix weird logo size on Firefox\n" }, { "from": "human", "value": "import React from 'react';\nimport SVGInline from 'react-svg-inline';\nimport svg from '../../static/logo.svg';\n\nconst Logo = (props) => {\n return (\n <SVGInline\n svg={svg}\n ...
javascript
chosen
[ { "from": "system", "value": "Refactor to ES6 syntactic sugar\n" }, { "from": "human", "value": "import React from 'react'\n\n//class-based component (ES6)\nclass SearchBar extends React.Component {\n render() { //method definition in ES6\n return <input />;\n }\n}\n\nexport default SearchB...
javascript
chosen
[ { "from": "system", "value": "feat(appSettings): Add view ID's and board layout options\n" }, { "from": "human", "value": "/**\n * Global settings that do not change in a production environment\n */\n\nif (typeof window === 'undefined') {\n // For tests\n global.window = {}\n}\n\nwindow.ap...
javascript
chosen
[ { "from": "system", "value": "Fix names and paths in menu item content directive\n" }, { "from": "human", "value": "'use strict';\nangular.module('eehMenuBs3').directive('eehMenuBs3MenuItemContent', MenuItemContentDirective);\n\n/** @ngInject */\nfunction MenuItemContentDirective(eehNavigation) ...
javascript
chosen
[ { "from": "system", "value": "Check hebrew document in langSpecific\n\nVery troublesome to hardcode this - we have to defer a decision on this\na little longer.\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('arethusa.core').directive('langSpecific', [\n 'languageSettings',\...
javascript
chosen
[ { "from": "system", "value": "Add endpoints for Room creation (start of lecture), Note Creation (end of lecture), Editing Notes\n" }, { "from": "human", "value": "module.exports = function(app, express) {\n\n // Facebook OAuth\n app.get('/auth/facebook', function(req, res) {\n res.send('Fac...
javascript
chosen
[ { "from": "system", "value": "Use getItemViewContainer() for safety - it ensures $itemViewContainer exists\n" }, { "from": "human", "value": "define(['backbone.marionette', './ExamView', 'hbs!../templates/exams'],\n function (Marionette, ExamView, template) {\n 'use strict';\n\n return Ma...
javascript
chosen
[ { "from": "system", "value": "Make driver object filename case-insensitive\n" }, { "from": "human", "value": "class ObjectLocator {\n\n constructor(fs, objectName) {\n this.fs = fs;\n this.objectName = objectName;\n this.objects = [];\n this.objectDirectoryName = \...
javascript
chosen
[ { "from": "system", "value": "Make the fjs redirect shorter\n" }, { "from": "human", "value": "const redirects = [\n ['192.168.99.100/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'],\n ['lucaschmid.net/fjs', 'https://github.com/kriegslustig/presentation-functional-j...
javascript
chosen
[ { "from": "system", "value": "Add function to determine stat bonus from value.\n" }, { "from": "human", "value": "// Source: http://stackoverflow.com/a/1830844\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\n\nfunction AppViewModel() {\n this.statStrength = ko.obse...
javascript
chosen
[ { "from": "system", "value": "Rename variable for more appropriate name\n" }, { "from": "human", "value": "/*\n * Author: Pierre-Henry Soria <hello@ph7cms.com>\n * Copyright: (c) 2015-2017, Pierre-Henry Soria. All Rights Reserved.\n * License: GNU General Public License; See PH7...
javascript
chosen
[ { "from": "system", "value": "Remove discriminator's from player names\n\nThe widget API seems to always set discriminator to 0000\n" }, { "from": "human", "value": "const Core = require('./core');\n\nclass Discord extends Core {\n constructor() {\n super();\n this.dnsResolver = { resolve...
javascript
chosen
[ { "from": "system", "value": "Remove unused user menu methods.\n" }, { "from": "human", "value": "/* Copyright (C) 2017 Canonical Ltd. */\n'use strict';\n\nconst PropTypes = require('prop-types');\nconst React = require('react');\n\nconst ButtonDropdown = require('../button-dropdown/button-dropd...
javascript
chosen
[ { "from": "system", "value": "Support any options mapbox source supports. Maintain backwards compatibility.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/mapbox-gl-source';\n\nconst {\n Component,\n computed,\n get,\n getProperties...
javascript
chosen
[ { "from": "system", "value": "Change publication of sensor-daily-aggregates to include source.\n" }, { "from": "human", "value": "Meteor.publish(\"dailyMeasuresBySensor\", (sensorId, dayStart, dayEnd) => {\n check(sensorId, String);\n check(dayStart, String);\n check(dayEnd, String);\n ...
javascript
chosen
[ { "from": "system", "value": "Add ready function in js with IE8 compatibility\n" }, { "from": "human", "value": "var BOARD_HEIGHT = 288;\nvar BOARD_WIDTH = 224;\nvar VERT_TILES = BOARD_HEIGHT / 8;\nvar HORIZ_TILES = BOARD_WIDTH / 8;\n\ngameBoard = new Array(VERT_TILES);\nfor(var y = 0; y < VERT_...
javascript
chosen
[ { "from": "system", "value": "Allow clearing of date ranges.\n" }, { "from": "human", "value": "// @flow\n /* flowlint\n * untyped-import:off\n */\n\nimport * as React from 'react';\nimport Datepicker from '@salesforce/design-system-react/components/date-picker';\n\nconst dateRangePicker = (...
javascript
chosen
[ { "from": "system", "value": "Remove filter from my localities\n" }, { "from": "human", "value": "import React from \"react-native\";\nimport LocalitiesFiltered from \"./localities-filtered\";\n\nexport default class Home extends React.Component {\n render() {\n return <LocalitiesFilte...
javascript
chosen
[ { "from": "system", "value": "Improve handling of missing config file\n" }, { "from": "human", "value": "/*!\n**| PonkBot\n**| A chat bot for CyTube\n**|\n**@author Xaekai\n**@copyright 2017\n**@license MIT\n*/\n\n'use strict';\n\nconst PonkBot = require('./lib/ponkbot.js');\n\nconst ar...
javascript
chosen
[ { "from": "system", "value": "Add status as a query param for orders state\n" }, { "from": "human", "value": "angular.module('orderCloud')\n .config(OrdersConfig)\n;\n\nfunction OrdersConfig($stateProvider) {\n $stateProvider\n .state('orders', {\n parent: 'account',\n ...
javascript
chosen
[ { "from": "system", "value": "Fix 2 Show numbers of products on cart\n" }, { "from": "human", "value": "\nfunction something()\n{\n\n\tvar x =window.localStorage.getItem('cc');\n\t\n\tx = x * 1 + 1;\n\n\twindow.localStorage.setItem('cc', x);\n\n\talert(x);\t\n\t\n}\n\n\nfunction add_to_cart(id)\...
javascript
chosen
[ { "from": "system", "value": "Fix issue in hot reloading\n\n" }, { "from": "human", "value": "import http from \"http\"\nimport { app, CONFIG } from \"./server\"\n\nlet currentApp = null\nconst server = http.createServer(app)\nserver.listen(CONFIG.port)\nconsole.log(`GraphQL-server listening on ...
javascript
chosen
[ { "from": "system", "value": "Hide module.exports for rollup compatibility\n" }, { "from": "human", "value": "// require('./contentmeter.js');\nimport ContentMeter from './ContentMeter.js';\nmodule.exports = ContentMeter;\n" }, { "from": "gpt", "value": "// require('./contentmeter.js...
javascript
chosen
[ { "from": "system", "value": "Change to react from react-with-addons\n" }, { "from": "human", "value": "var path = require(\"path\");\n\nmodule.exports = {\n cache: true,\n entry: \"./js/main.js\",\n devtool: \"#source-map\",\n output: {\n path: path.resolve(\"./build\"),\n ...
javascript
chosen
[ { "from": "system", "value": "Modify model and add polyfill of promise.catch\n" }, { "from": "human", "value": "\nvar mongoose = require('mongoose');\nmongoose.connect(process.env.MONGO_URI);\n\nmongoose.Model.prototype.psave = function () {\n\n var that = this;\n\n return new Promise(func...
javascript
chosen
[ { "from": "system", "value": "Improve logic for more edge cases\n" }, { "from": "human", "value": "const UPower = imports.ui.status.power.UPower\nconst Main = imports.ui.main\n\nlet watching\n\nfunction bind () {\n getBattery(proxy => {\n watching = proxy.connect('g-properties-changed', upda...
javascript
chosen
[ { "from": "system", "value": "Use LocalStore to have a fallback when localStorage is not avail.\n" }, { "from": "human", "value": "const moment = require('moment');\nconst urlForStatic = require('./url').urlForStatic;\nconst getStaticHash = require('./utility').getStaticHash;\n\n// only ...
javascript
chosen
[ { "from": "system", "value": "Fix translations for unit fields in search suggestions\n" }, { "from": "human", "value": "import React from 'react';\nimport {Link} from 'react-router';\nimport ObservationStatus from '../../unit/components/ObservationStatus';\nimport {getAttr, getUnitIconURL, getSe...
javascript
chosen
[ { "from": "system", "value": "Reword and add emoji on reference\n" }, { "from": "human", "value": "export function createPostbackAction(label, input, issuedAt) {\n return {\n type: 'postback',\n label,\n data: JSON.stringify({\n input,\n issuedAt,\n }),\n };\n}\n\nexport ...
javascript
chosen
[ { "from": "system", "value": "Move the ParentTaxonPrefixPreview logic to the bottom\n\nThe functions are hoisted anyway.\n" }, { "from": "human", "value": "(function (Modules) {\n \"use strict\";\n\n Modules.ParentTaxonPrefixPreview = function () {\n this.start = function(el) {\n var $...
javascript
chosen
[ { "from": "system", "value": "Support for multiple storage names\n" }, { "from": "human", "value": "// Returns primitive { ownerId: sortIndexValue } map for provided sortKeyPath\n\n'use strict';\n\nvar ensureString = require('es5-ext/object/validate-stringifiable-value')\n , ee = requ...
javascript
chosen
[ { "from": "system", "value": "Move please wait to inside the block so we don't show it if its not actually publishing\n" }, { "from": "human", "value": "$(function() {\n\n $(\"#publishButton\").click( function() {\n showPleaseWait('Publishing... (This can take some time depending on t...
javascript
chosen
[ { "from": "system", "value": "Set viewport size to 640 x 480\n" }, { "from": "human", "value": "var page = require('webpage').create(),\n system = require('system'),\n address, output, size;\n\nif (system.args.length < 4 || system.args.length > 5) {\n console.log('Usage: '+system.args[0...
javascript
chosen
[ { "from": "system", "value": "feat(back): Add mapping to angular routes\n" }, { "from": "human", "value": "const path = require('path');\nconst express = require('express');\nconst router = express.Router();\nconst log = require('../logger');\nconst wordsRepository = new (require(\"../repositori...
javascript
chosen
[ { "from": "system", "value": "Remove the auto focus on element toggle feature\n" }, { "from": "human", "value": "$(function() {\n\n // toggle on/off switch\n $(document).on('click', '[data-toggle]', function() {\n targetHide = $(this).data('toggle-hide')\n targetShow = $(this).data('togg...
javascript
chosen
[ { "from": "system", "value": "Make backend call for calculating route\n" }, { "from": "human", "value": "/**\n * This bundle logs the map click coordinates to the console. This is a demonstration of using DefaultExtension.\n *\n * @class Oskari.routing.bundle.inapprouting.InAppRoutingBundleInsta...
javascript
chosen
[ { "from": "system", "value": "Update Rhino example since power-assert-formatter requires estraverse as runtime dependency.\n" }, { "from": "human", "value": "load('bower_components/qunit/qunit/qunit.js');\nload('bower_components/qunit-tap/lib/qunit-tap.js');\nload('bower_components/power-assert-...
javascript
chosen
[ { "from": "system", "value": "Make renderer polymorphically call updateEmptyListContent\n\n@bug W-3836575@\n@rev trey.washington@\n" }, { "from": "human", "value": "/*\n * Copyright (C) 2013 salesforce.com, inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you ma...
javascript
chosen
[ { "from": "system", "value": "Move attribute comparator with others\n" }, { "from": "human", "value": "/*global TodoMVC */\n'use strict';\n\nTodoMVC.module('Todos', function (Todos, App, Backbone) {\n\t// Todo Model\n\t// ----------\n\tTodos.Todo = Backbone.Model.extend({\n\t\tdefaults: {\n\t\t\...
javascript
chosen
[ { "from": "system", "value": "Use innerWindow as conditional comparison for appending/removing collapse class\n" }, { "from": "human", "value": "$(function() {\n\n $('#side-menu').metisMenu();\n\n});\n\n//Loads the correct sidebar on window load,\n//collapses the sidebar on window resize.\n$(...
javascript
chosen
[ { "from": "system", "value": "Change to simple removal of the share panel and button\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Selfish Youtube\n// @namespace https://github.com/ASzc/selfish-youtube\n// @description On the watch page, prevent ...
javascript
chosen
[ { "from": "system", "value": "Add example cases for block:link\n" }, { "from": "human", "value": "({\n block : 'page',\n title : 'bem-components: link',\n mods : { theme : 'normal' },\n head : [\n { elem : 'css', url : '_simple.css' },\n { elem : 'js', url : '_simple.js...
javascript
chosen
[ { "from": "system", "value": "Remove test for configuration-negotiation (not applicable to dummy model).\n" }, { "from": "human", "value": "var assert = chai.assert;\n\ndescribe('LMLayer', function () {\n describe('[[constructor]]', function () {\n it('should construct with zero arguments', ...
javascript
chosen
[ { "from": "system", "value": "Change the index default jade file\n" }, { "from": "human", "value": "var express = require('express');\n\nvar utils = require('../utils');\n\nvar router = express.Router();\n\n/**\n * Render the home page.\n */\nrouter.get('/', function(req, res) {\n res.render('i...
javascript
chosen
[ { "from": "system", "value": "Connect the socket.io instance to the API connection only\n" }, { "from": "human", "value": "/**\n\n Copyright 2015 Covistra Technologies Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with...
javascript
chosen
[ { "from": "system", "value": "Add cached element and props before construction, merge defaults.\n" }, { "from": "human", "value": "import $ from 'jquery';\n\nexport default function plugit( pluginName, pluginClass ) {\n\tlet dataName = `plugin_${pluginName}`;\n\n\t$.fn[pluginName] = function( o...
javascript
chosen
[ { "from": "system", "value": "Allow for multiple files to be urlAdjsted.\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar elixir = require('laravel-elixir');\nvar urlAdjuster = require('gulp-css-url-adjuster');\n\n/*\n |---------------------------------------------------------...
javascript
chosen
[ { "from": "system", "value": "Change time frequency to publish message\n" }, { "from": "human", "value": "'use strict'\n\nconst express = require('express')\nconst bodyParser = require('body-parser')\nconst config = require('./config')\nconst app = express()\nconst publisher = require('./publish...
javascript
chosen
[ { "from": "system", "value": "Allow task third parameter to be optional\n" }, { "from": "human", "value": "'use strict';\n\nvar nomnom = require('nomnom');\n\nvar signal = require('./lib/signal');\nvar tree = require('./lib/tree');\n\nvar task = function (name, callback, options) {\n var comm...
javascript
chosen
[ { "from": "system", "value": "Improve optimizability of the non-try/catch part." }, { "from": "human", "value": "'use strict';\n\nvar toStr = Number.prototype.toString;\n\nmodule.exports = function isNumberObject(value) {\n\tif (typeof value === 'number') { return true; }\n\tif (typeof value !==...
javascript
chosen
[ { "from": "system", "value": "Fix broken iteration of items in Opentype.js slyphs object\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/**\n * index.js\n *\n * for `character-map` command\n */\n\nvar opts = require('minimist')(process.argv.slice(2));\nvar opentype = require('opentype...
javascript
chosen
[ { "from": "system", "value": "Change order of arguments in Fragment.handle\n" }, { "from": "human", "value": "'use strict';\n\nexport default class Fragment {\n render () {\n return null;\n }\n\n /**\n * Generic event handler. Turns class methods into closures that can be use...
javascript
chosen
[ { "from": "system", "value": "Fix param/return documentation for internal curryN\n\nfix(_curryN) fix capitalization in return type\n" }, { "from": "human", "value": "var _arity = require('./_arity');\n\n\n/**\n * Internal curryN function.\n *\n * @private\n * @category Function\n * @param {Numbe...
javascript
chosen
[ { "from": "system", "value": "Bump patch version of accounts-oauth\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Common code for OAuth-based login services\",\n version: \"1.3.0\",\n});\n\nPackage.onUse(api => {\n api.use('check', 'server');\n api.use('webapp', 'server')...
javascript
chosen
[ { "from": "system", "value": "Set noteableType on noteableData as provided from DOM dataset\n" }, { "from": "human", "value": "import Vue from 'vue';\nimport notesApp from '../notes/components/notes_app.vue';\nimport discussionCounter from '../notes/components/discussion_counter.vue';\nimport st...
javascript
chosen
[ { "from": "system", "value": "Make Mandrill install only if service APIKEYs exist\n" }, { "from": "human", "value": "/* \n* @Author: Mike Reich\n* @Date: 2016-01-26 11:48:16\n* @Last Modified 2016-01-26\n*/\n\n'use strict';\n\nimport MandrilService from './MandrilService'\n\nexport default cla...
javascript
chosen
[ { "from": "system", "value": "fix(visit): Change date heading to use day of month with ordinal\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 obtai...
javascript
chosen
[ { "from": "system", "value": "Fix sourceType in server config\n" }, { "from": "human", "value": "module.exports = {\n extends: [\n './base.js'\n ],\n plugins: [\n 'node'\n ],\n rules: {\n 'node/no-unsupported-features': 'error',\n 'node/no-deprecated-api': 'error',\n\n 'gener...
javascript
chosen
[ { "from": "system", "value": "Print Preview: Hook up the cancel button.\n\nBUG=57895\nTEST=manual\nReview URL: http://codereview.chromium.org/5151009\n\ngit-svn-id: http://src.chromium.org/svn/trunk/src@66822 4ff67af0-8c30-449e-8e8b-ad334ec8d88c\n\nFormer-commit-id: b25a2a4aa82aa8107b7f95d2e4a61633652024d7"...
javascript
chosen
[ { "from": "system", "value": "Check for mock api in path\n" }, { "from": "human", "value": "export default function getBaseUrl() {\n const inDevelopment = window.location.hostname === 'localhost';\n return inDevelopment ? 'http://localhost:3001/' : '/'\n}" }, { "from": "gpt", "valu...
javascript
chosen
[ { "from": "system", "value": "Make spinner reappear on subsequent visits\n" }, { "from": "human", "value": "Template.duplicates.onRendered(function() {\n\n var playlist_id = Router.current().params['_id']\n\n Meteor.call('getDuplicateTracksFromPlaylist', playlist_id, function(err, response...
javascript
chosen
[ { "from": "system", "value": "Add caching mechanism for weather icons.\n" }, { "from": "human", "value": "var Utils = {};\n\n(function() {\n Utils.convertTemp = function(temp) {\n if(Ti.App.Properties.getString('units','c')==='f') {\n return Math.round(temp*1.8+32) +'\\u00b0F'; // con...
javascript
chosen
[ { "from": "system", "value": "Fix bug that caused HTML comments to halt all additional parsing\n" }, { "from": "human", "value": "import Bit from '../components/Bit'\nimport { createElement } from 'react'\n\nconst COMMENT_TAG = '--'\nconst DEFAULT_TAG = Bit\n\n// eslint-disable-next-line max-par...
javascript
chosen
[ { "from": "system", "value": "Test shouldn't assume object ids are strictly increasing\n" }, { "from": "human", "value": "// Test object id find.\n\nfunction testObjectIdFind( db ) {\n r = db.ed_db_find2_oif;\n r.drop();\n\n z = [ {}, {}, {} ];\n for( i = 0; i < z.length; ++i )\n\tr....
javascript
chosen
[ { "from": "system", "value": "Allow regexp for authorized array.\n" }, { "from": "human", "value": "var env = require('../lib/environment');\nvar persona = require('../lib/persona');\nvar util = require('util');\n\nexports.login = function(req, res){\n if (req.method === 'GET')\n return res....
javascript
chosen
[ { "from": "system", "value": "Add TODO to fix animation.\n" }, { "from": "human", "value": "$(\".hamburger\").click(function () {\n $('.slider').slideToggle();\n});\n" }, { "from": "gpt", "value": "$(\".hamburger\").click(function () {\n $('.slider').slideToggle();\n}); //TODO:...
javascript
chosen
[ { "from": "system", "value": "Add logging for pcall errors\n" }, { "from": "human", "value": "let Q = require(\"q\");\n\nmodule.exports = {\n // `pcall` takes a function that takes a set of arguments and\n // a callback (NON-Node.js style) and turns it into a promise\n // that gets resolved w...
javascript
chosen
[ { "from": "system", "value": "Update to work in NPM 3\n" }, { "from": "human", "value": "'use strict';\n\nvar JsMockito = require('jsmockito').JsMockito;\nvar JsHamcrest = require('jsmockito/node_modules/jshamcrest').JsHamcrest;\n\nvar mochito = {\n installTo: function(target) {\n JsMockito....
javascript
chosen
[ { "from": "human", "value": "Add unit tests for 100% coverage logger module\n" }, { "from": "gpt", "value": "/**\n * @module src/logger_test\n */\n'use strict'\n\nconst test = require('unit.js')\n\nconst logger = require('./logger')\n\nconst sinon = test.sinon\n\ndescribe('src/logger', () => {\n...
javascript
chosen
[ { "from": "system", "value": "Fix no-op test for string library.\n" }, { "from": "human", "value": "const string = require('../../src/util/string.js');\n\ndescribe('string', () => {\n it('exports string', () => {\n expect(string).toBeDefined();\n });\n\n describe('mapAscii', () => {\n i...
javascript
chosen
[ { "from": "system", "value": "Use RandomUsersRetriever when ENDPOINT_ID is not set\n" }, { "from": "human", "value": "/* eslint-disable no-console */\n\nimport AccessTokenRetriever from './access-token-retriever';\nimport ConfigurationProvider from './configuration-provider';\nimport WebServer f...
javascript
chosen
[ { "from": "system", "value": "Add support for label prop\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport cx from 'classnames';\nimport Background from './background';\nimport Icon from './icon';\nimport Mask from './mask';\nimport { keyFor } from './networks'...
javascript
chosen
[ { "from": "system", "value": "FIX (router): use proper import instead of depricated\n" }, { "from": "human", "value": "import { createStore, applyMiddleware, compose } from 'redux';\nimport createHistory from 'history/createHashHistory';\nimport { routerMiddleware } from 'connected-react-router'...
javascript
chosen
[ { "from": "system", "value": "784: Change the column name to follow the standard naming convention.\n" }, { "from": "human", "value": "const config = require('../../../knexfile').web\nconst knex = require('knex')(config)\nmodule.exports = function (id, type) {\n var table = \"team_caseload_over...
javascript
chosen
[ { "from": "system", "value": "Add example of using the Load method on the Markup object\n" }, { "from": "human", "value": "var markup = null;\r\n$(function() {\r\n var markupTools = MarkupTools('.button-bar > div');\r\n markup = Markup('#pdf-markup', markupTools);\r\n\r\n $(markup).on('...
javascript
chosen
[ { "from": "system", "value": "Disable redux devtools for fixing invalid object on mobile browser\n" }, { "from": "human", "value": "import React from 'react'\nimport { applyMiddleware, createStore, compose } from 'redux'\nimport { render } from 'react-dom'\nimport { Provider } from 'react-redux'...
javascript
chosen
[ { "from": "system", "value": "Remove debugging statements from example.\n" }, { "from": "human", "value": "var hits = 0;\n\nfunction setup() {\n hits = 0;\n}\n\nfunction hit() {\n hits++;\n console.log(hits);\n}\n\nfunction showAll() {\n $('.hole').flip(true);\n}\n\nfunction hideAll(...
javascript
chosen
[ { "from": "system", "value": "Add information about the ancestors to each route descriptor\n" }, { "from": "human", "value": "(function (define) { 'use strict';\ndefine(function (require) {\n\n var _ = require('lodash');\n\n function DSL() {\n this.matches = [];\n }\n\n _.extend(DSL.proto...
javascript
chosen
[ { "from": "system", "value": "Fix loading error of helpers.js" }, { "from": "human", "value": "var config = module.exports;\n\nconfig[\"specs\"] = {\n rootPath: \"../\",\n environment: \"browser\",\n sources: [\n \"lib/*.js\"\n ],\n tests: [\n \"spec/*.spec.js\"\n ],\n}\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Switch from React.addons.cloneWithProps to React.cloneElement\n" }, { "from": "human", "value": "import React from \"react/addons\";\n\nimport Resolver from \"./Resolver\";\n\nclass ResolverContext extends React.Component {\n getChildContext() {\n const resolver...
javascript
chosen
[ { "from": "system", "value": "Exclude the project name when requiring files\n" }, { "from": "human", "value": "/* globals requirejs, require */\n(function() {\ndefine(\"ember-cli/test-loader\",\n [],\n function() {\n \"use strict\";\n\n var TestLoader = function() {\n };\n\n TestLo...
javascript
chosen
[ { "from": "system", "value": "Enhance test coverage of util helpers\n" }, { "from": "human", "value": "'use strict';\n\nvar utils = require('../../').utils;\nvar assert = require('chai').assert;\n\nsuite('Utils', () => {\n test('create a random hex string', () => {\n const test1 = utils.getR...
javascript
chosen
[ { "from": "system", "value": "Add comments explaining how the admin interface works\n" }, { "from": "human", "value": "'use strict';\n\nangular\n .module('lmServices')\n .constant('Admin', (/((; )|^)admin=true(;|$)/).test(document.cookie));\n" }, { "from": "gpt", "value": "'use...
javascript
chosen
[ { "from": "system", "value": "Test that $.create makes a div by default\n\nAdds a test for #13\n" }, { "from": "human", "value": "describe(\"$.create\", function() {\n\tit(\"creates an element and sets properties on it\", function() {\n\t\tvar element = $.create(\"article\", {\n\t\t\tclassName: ...
javascript
chosen
[ { "from": "system", "value": "Add prop inverse for spinner\n" }, { "from": "human", "value": "const React = require('react');\nconst classNames = require('classnames');\n\nconst SIZES = require('./SIZES');\n\nconst Spinner = React.createClass({\n propTypes: {\n centered: React.PropType...
javascript
chosen