conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Return false if it false\n" }, { "from": "human", "value": "window.onload = action\nvar action = document.pesan.action = login();\n\nfunction login() {\n\tvar nama = document.pesan.nama.value;\n\tvar no-bpjs = document.pesan.no-bpjs.value;\n\tvar name = \"Andre Chri...
javascript
chosen
[ { "from": "system", "value": "Use MemoryLocation by default in non-DOM environments\n" }, { "from": "human", "value": "module.exports = process.env.NODE_ENV === 'test'\n ? require('./MemoryLocation')\n : require('./HashLocation');\n" }, { "from": "gpt", "value": "var canUseDOM = re...
javascript
chosen
[ { "from": "system", "value": "Comment on Safari's utter <audio> failure.\n" }, { "from": "human", "value": "Rubpocalypse.Sounds = (function() {\n\n var soundForName = function(name) {\n return $(\"#\" + name + \"-sound\").get(0);\n };\n \n return {\n play: function(name) {\n if (!...
javascript
chosen
[ { "from": "system", "value": "Update asset paths in production\n" }, { "from": "human", "value": "var webpack = require(\"webpack\");\n\n/**\n * This is the Webpack configuration file for production.\n */\nmodule.exports = {\n entry: \"./src/main\",\n\n output: {\n path: __dirname + \"/buil...
javascript
chosen
[ { "from": "system", "value": "Use new version of npm-node-aes-gcm, which works on Windows\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Encrypt account secrets stored in the database\",\n version: '1.0.4'\n});\n\nPackage.onUse(function (api) {\n api.use(\"npm-node-aes-gcm...
javascript
chosen
[ { "from": "system", "value": "Fix status handling in getRestaurants\n\nThe changes in #15 were meant to fix a bug where we were looking at\nan incorrect field for the status code of the fetch response.\nHowever, these changes were not thoroughly tested and actually didn't\ncompletely work as coded, because ...
javascript
chosen
[ { "from": "system", "value": "Fix default state query param\n" }, { "from": "human", "value": "export default (params = {}, query = {}) => ({\n page: parseInt(params.page || 1),\n city: params.city || '',\n cityName: params.cityName || '',\n limit: parseInt(query.limit || 12),\n state: quer...
javascript
chosen
[ { "from": "system", "value": "Add ProgressColors to exports in entry script\n" }, { "from": "human", "value": "export { Badge, BadgeColors } from './components/badge';\nexport { Breadcrumbs, BreadcrumbItem } from './components/breadcrumbs';\nexport { Button, Link, ButtonSizes, ButtonColors } fro...
javascript
chosen
[ { "from": "system", "value": "Change endpoint to /events for consistency\n" }, { "from": "human", "value": "const express = require('express');\nconst bodyParser = require('body-parser');\nconst createClient = require('@rabblerouser/stream-client');\n\nconst config = require('./config');\nconst ...
javascript
chosen
[ { "from": "system", "value": "Set modules option based on BABEL_ENV\n\n(Only if it hasn't been overriden in the preset options.)\n" }, { "from": "human", "value": "import pluginLodash from 'babel-plugin-lodash'\nimport pluginReactRequire from 'babel-plugin-react-require'\nimport presetLatest fro...
javascript
chosen
[ { "from": "system", "value": "Change code to allow compiling with just ES2015\n" }, { "from": "human", "value": "import React from 'react';\n\nfunction requiredPropTypesMustExist(props, { propTypes, displayName }) {\n Object.keys(propTypes).every(propName => propTypes[propName](props, propName,...
javascript
chosen
[ { "from": "system", "value": "feat: Add isRunning, start and stop method\n" }, { "from": "human", "value": "'use strict';\n\nvar polyfills = require('famous-polyfills');\nvar rAF = polyfills.requestAnimationFrame;\n\nfunction Engine () {\n this.updates = [];\n var _this = this;\n this.l...
javascript
chosen
[ { "from": "system", "value": "Use ‚de_DE‘ instead of ‚de‘ locale for testing\n" }, { "from": "human", "value": "// eslint-disable react/jsx-filename-extension\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport './index.css';\n\nReactDOM.render(\n Re...
javascript
chosen
[ { "from": "system", "value": "Remove useless line of code\n" }, { "from": "human", "value": "// main function\nvar zpad = function (n, m, c) {\n if (!m) m = zpad._amount;\n if (!c) c = zpad._character;\n if (m < 1) m = 1;\n n = \"\" + n;\n m -= n.length;\n while (m-- > 0) n = c + n;\n ret...
javascript
chosen
[ { "from": "system", "value": "Fix to take an optional target\n" }, { "from": "human", "value": "// reduce and expand\nexport const reduce = (x, start, end) => (x - start) / (end - start);\nexport const expand = (x, start, end) => (x * (end - start)) + start;\n\nexport const chainFns = fns => va...
javascript
chosen
[ { "from": "system", "value": "Move getPrediction function to controller\n" }, { "from": "human", "value": "const Model = require('../../database/models/model.js');\nconst Redis = require('../../database/redis/redis.js')\nconst axios = require('axios');\n\nmodule.exports = {\n getHistoricalData:...
javascript
chosen
[ { "from": "system", "value": "Update tests to remove an attempt at unit testing.\n" }, { "from": "human", "value": "const nock = require(\"nock\");\nvar path = require(\"path\");\nvar Browser = require(\"zombie\");\n\nrequire(\"../js/everything\");\n\nconst browser = new Browser();\nvar youTubeD...
javascript
chosen
[ { "from": "system", "value": "Remove defers from docker remote promise api\n" }, { "from": "human", "value": "var docker = require('docker-remote-api'),\n request = docker(),\n Q = require('q');\n\nvar DockerRemote = function() {};\n\nDockerRemote.containers = function() {\n var defer = Q.def...
javascript
chosen
[ { "from": "system", "value": "Test .get(key) returns a Promise\n" }, { "from": "human", "value": "import test from 'ava';\nimport Keyv from '../';\n\ntest('Keyv is a function', t => {\n\tt.is(typeof Keyv, 'function');\n});\n\ntest('Keyv cannot be invoked without \\'new\\'', t => {\n\tt.throws(()...
javascript
chosen
[ { "from": "system", "value": "Fix missing this in function call\n" }, { "from": "human", "value": "var util = require('util');\nvar dsUtil = require('./_utils.js');\n\nvar Baro = function(data) {\n this.config = data.Config;\n this.start = new Date(1000 * data.Activation.sec);\n this.end = ne...
javascript
chosen
[ { "from": "system", "value": "Add icon that works for linux apps also\n" }, { "from": "human", "value": "const electron = require('electron');\nconst app = electron.app;\nconst BrowserWindow = electron.BrowserWindow;\nconst Menu = electron.Menu;\n\nvar menu = require('./menu');\nvar argv = requi...
javascript
chosen
[ { "from": "system", "value": "refactor: Move program option object into its own function\n" }, { "from": "human", "value": "\"use strict\";\n\nvar program = require('commander');\nvar path = require('path');\nvar appDir = path.resolve(__dirname, '..', 'app'); \n\nvar newCommand = require('./comm...
javascript
chosen
[ { "from": "system", "value": "Remove question, and minor correction\n" }, { "from": "human", "value": "var data = {\n \"title\": \"Programmeringspraxis\",\n \"questions\": [\n {\n \"description\": \"En funktion som har bieffekter kan ej anses vara korrekt\",\n ...
javascript
chosen
[ { "from": "system", "value": "Remove log from build script\n" }, { "from": "human", "value": "const uglifyPlugin = require(\"rollup-plugin-uglify\");\nconst replace = require(\"rollup-plugin-replace\");\nconst commonjs = require(\"rollup-plugin-commonjs\");\nconst resolve = require(\"rollup-plug...
javascript
chosen
[ { "from": "system", "value": "Fix browser history app launch\n" }, { "from": "human", "value": "'use strict'\n\nconst AppBase = require(global.upath.joinSafe(__dirname, 'AppBase'))\n\nconst defaultWrapper = {\n\tname: '',\n\ttext: '',\n\texec: 'browserHistory',\n\ticon: 'link.png',\n\ttype: '_in...
javascript
chosen
[ { "from": "system", "value": "Fix header options typo from '.header()' to '.setHeader()'\n" }, { "from": "human", "value": "// Potential fix for CORS API request issues\n\nmodule.exports = function(req, res, next) {\n res.header('Access-Control-Allow-Origin', '*')\n res.header('Access-Control-...
javascript
chosen
[ { "from": "system", "value": "Use `bind` to give context to `atob` and `btoa`.\n" }, { "from": "human", "value": "\"use strict\";\n/*global window*/\n\nexports.encode = window.btoa;\nexports.decode = window.atob;\n" }, { "from": "gpt", "value": "\"use strict\";\n/*global window*/\n\n...
javascript
chosen
[ { "from": "human", "value": "Complete lesson 12 - List View\n" }, { "from": "gpt", "value": "function ListView() {\n\tvar self = Ti.UI.createWindow({});\n\t\n\t// list views are designed to perform better than table views\n\t\t// table view is more customizable than list view\n\t\t\n\tvar listVi...
javascript
chosen
[ { "from": "system", "value": "Use ES6 import instead of System.import to make style bundling work\n" }, { "from": "human", "value": "'use strict';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nSystem.import('./src/shared/components/Card/Card').then((content) => {\n console...
javascript
chosen
[ { "from": "system", "value": "Split out template config for readability\n" }, { "from": "human", "value": "var metalsmith = require('metalsmith');\nvar markdown = require('metalsmith-pandoc');\nvar templates = require('metalsmith-templates');\nvar serve = require('metalsmith-serve');...
javascript
chosen
[ { "from": "system", "value": "Prepare entry function for multiple function forks.\n" }, { "from": "human", "value": "module.exports = function (context, req) {\n \n var https = require('https');\n\n var input = JSON.stringify(req.body);\n var icao = input.split('&')[8].split('=')[1];...
javascript
chosen
[ { "from": "system", "value": "Send link id with action\n" }, { "from": "human", "value": "import {\n LOAD_COMMENTS_REQUEST, LOAD_COMMENTS_SUCCESS, LOAD_COMMENTS_FAILURE,\n} from '../constants/ActionTypes';\nimport { CALL_API, Schemas } from '../middleware/api';\n\nconst loadCommentsRequest = ({...
javascript
chosen
[ { "from": "system", "value": "Make sure the whole canvas is cleared.\n" }, { "from": "human", "value": "Doc = Base.extend({\n\tbeans: true,\n\n\tinitialize: function(canvas) {\n\t\tif (canvas) {\n\t\t\tthis.canvas = canvas;\n\t\t\tthis.ctx = this.canvas.getContext('2d');\n\t\t\tthis.size = new S...
javascript
chosen
[ { "from": "system", "value": "Add custom error messages to error handler\n" }, { "from": "human", "value": "import chalk from 'chalk';\nimport { get, includes } from 'lodash';\nimport {DEBUG} from './flags';\n\nconst formatMessage = (err) => {\n switch (err.code) {\n case 'ENOENT':\n ...
javascript
chosen
[ { "from": "system", "value": "Add check to ensure trim does not error\n\n- checks that input exists before attempting regex\n- silences a thrown error\n\t- seems to keep with spirit of template filters, if value is not provided no need to throw an error\n" }, { "from": "human", "value": "/**\n *...
javascript
chosen
[ { "from": "system", "value": "Allow HTML/React elements in message content\n\nMore information about PropTypes.node here: https://facebook.github.io/react/docs/typechecking-with-proptypes.html\r\n\r\nATM passing HTML/React produces validation error in console. Regardless that everything seems working smooth...
javascript
chosen
[ { "from": "system", "value": "Add license to JS files\n" }, { "from": "human", "value": "// Continuously get from a latch. Depends on jQuery.\n\nfunction waitForLatch(name) {\n //$('#latch-status').text(\"Waiting for change\");\n\n var url = '/-/latch/' + name;\n\n // TODO: use raw XHR to ge...
javascript
chosen
[ { "from": "system", "value": "Call done() only if it has been supplied.\n" }, { "from": "human", "value": "\nfunction handle( req, res, done )\n{\n if( !req.flick ) {\n return done();\n }\n\n var payload = req.flick.payload,\n repository = payload.repository.owner.name + '...
javascript
chosen
[ { "from": "system", "value": "Add SlideShow folder to the dependency graph." }, { "from": "human", "value": "//= require_directory ./AbstractDocument\r\n//= require_directory ./BrowserWidget\r\n//= require_directory ./ComponentStateManager\r\n//= require_directory ./Desktop\r\n//= require_direct...
javascript
chosen
[ { "from": "system", "value": "Put focus in searchinput on page load\n\nSigned-off-by: Kaustav Das Modak <ba1ce5b1e09413a89404909d8d270942c5dadd14@yahoo.co.in>\n" }, { "from": "human", "value": "window.addEventListener(\"DOMContentLoaded\", function () {\n\n // Initiate the app with a config. ...
javascript
chosen
[ { "from": "system", "value": "Move cursor to end of textarea on load\n" }, { "from": "human", "value": "var textarea;\nvar localforage = require('localforage');\n\nwindow.onload = function() {\n // Get textarea and test for localStorage support\n textarea = document.querySelector('.textarea');...
javascript
chosen
[ { "from": "system", "value": "Add ability to provide a target for links." }, { "from": "human", "value": "import Ember from 'ember';\nimport urlRegex from 'ember-linkify/utils/url-regex';\n\nexport function linkify(textToLinkify) {\n textToLinkify = Ember.Handlebars.Utils.escapeExpression(textT...
javascript
chosen
[ { "from": "system", "value": "Remove default parameter value from App\n" }, { "from": "human", "value": "'use strict'\n\nconst Koa = require('koa-plus')\n\nclass App extends Koa {\n /**\n * Creates an `App` instance\n *\n * @param {Object} config - Configuration for the app\n * @returns...
javascript
chosen
[ { "from": "system", "value": "Throw errors to stop the promise chain\n" }, { "from": "human", "value": "'use strict';\n\n// External modules\nvar Bluebird = require('bluebird');\n\n// Local modules\nvar Support = require('./support');\n\nmodule.exports = {\n bump: function (args) {\n return ...
javascript
chosen
[ { "from": "system", "value": "Add back Track component image\n" }, { "from": "human", "value": "import PropTypes from 'prop-types';\nimport React from 'react';\nimport styles from 'components/Track/Track.scss';\n\nexport default class Track extends React.Component {\n\n render() {\n return (...
javascript
chosen
[ { "from": "system", "value": "[UPADTE] Change router to history mode\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport Router from 'vue-router'\nimport Home from '@/components/Home'\nimport Team from '@/components/Team'\nimport Events from '@/components/Events'\nimport Timeline fr...
javascript
chosen
[ { "from": "system", "value": "Use strict mode in view code." }, { "from": "human", "value": "/*\n * Copyright (c) 2013 Csernik Flaviu Andrei\n *\n * See the file LICENSE.txt for copying permission.\n *\n */\n\nwindow.requestAnimationFrame =\n window.requestAnimationFrame || window.mozRequestAni...
javascript
chosen
[ { "from": "system", "value": "Add support for generating version 1 TFDT boxes\n" }, { "from": "human", "value": "BoxParser.tfdtBox.prototype.write = function(stream) {\n\tthis.version = 0;\n\tthis.flags = 0;\n\tthis.size = 4;\n\tif (this.version === 1) {\n\t\tthis.size += 4;\n\t}\n\tthis.writeHe...
javascript
chosen
[ { "from": "system", "value": "Make search toggle into function\n" }, { "from": "human", "value": "$(document).ready(function(){\n\t$(\".show-search\").on(\"click\",function(){\n\t\t$(\"#search-box\").fadeIn(\"slow\");\n\t\treturn false;\n\t});\n})" }, { "from": "gpt", "value": "$(doc...
javascript
chosen
[ { "from": "system", "value": "Fix search by adding trait_type_id to path\n" }, { "from": "human", "value": "$(document).ready(function(){\n //autocomplete for trait search\n $(\"#search_trait\").autocomplete({\n position: {\n my: \"right top\", at: \"right bottom\"\n ...
javascript
chosen
[ { "from": "system", "value": "Fix fetch keys refresh condition\n" }, { "from": "human", "value": "/*\n * Copyright 2018 Expedia Group\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * ...
javascript
chosen
[ { "from": "system", "value": "Build script: move resolveModuleSource outside waterfall function\n" }, { "from": "human", "value": "const babel = require('babel-core');\nconst glob = require('glob');\nconst fs = require('fs');\nconst _ = require('async');\n\nconst babelrc = {\n presets: ['es2015...
javascript
chosen
[ { "from": "system", "value": "Add guild to PRESENCE_UPDATE event\n" }, { "from": "human", "value": "\"use strict\";\n\nconst Constants = require(\"../../../Constants\");\nconst Events = Constants.Events;\n\nmodule.exports = function handler(data, gw) {\n if (this.User.id != data.user.id) {\n ...
javascript
chosen
[ { "from": "system", "value": "Put a random bot replay on intro halite\n" }, { "from": "human", "value": "$(function() {\n var data = textFromURL(\"ar1481484242-3993659735.hlt\", $(\"#gameReplay\"), function(data) {\n console.log(data)\n if(data != null) {\n showGame(d...
javascript
chosen
[ { "from": "system", "value": "Fix widgets required mobilization props that injected by container\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport { connect } from 'react-redux'\n\n// Global module dependencies\nimport { SettingsPageLayout } from '../../../compo...
javascript
chosen
[ { "from": "system", "value": "Add missing semicolon for linting.\n" }, { "from": "human", "value": "import os from 'os';\nimport mongo from '../mongo';\nimport redis from '../redis';\nimport config from '../../config';\nimport NR from 'node-resque';\nimport tasks from './tasks';\n\nexport defaul...
javascript
chosen
[ { "from": "system", "value": "Make booksOwned of user be an empty array not 404 when there are no owned books of the user\n" }, { "from": "human", "value": "/**\n * Created by esso on 02.09.15.\n */\nvar Books = require('../models/book');\nvar Crowds = require('../models/crowd.js');\n\nmodule.ex...
javascript
chosen
[ { "from": "system", "value": "Fix issue with Npm.depends being in wrong place\n" }, { "from": "human", "value": "Package.describe({\n name: 'fongandrew:jwt-login',\n version: '0.1.1',\n summary: 'Log into Meteor\\'s user account system with a JSON web token',\n git: 'https://github.com/fonga...
javascript
chosen
[ { "from": "system", "value": "Use babel-polyfill for server to enable await async\n" }, { "from": "human", "value": "require('babel-register');\n\nconst Bluebird = require('bluebird');\nconst WebpackIsomorphicTools = require('webpack-isomorphic-tools');\nconst rootDir = require('path').resolve(_...
javascript
chosen
[ { "from": "system", "value": "Add test that params (dynamic segments) are passed" }, { "from": "human", "value": "var pretender;\nmodule(\"pretender invoking\", {\n setup: function(){\n pretender = new Pretender();\n },\n teardown: function(){\n pretender && pretender.shutdown();\n p...
javascript
chosen
[ { "from": "system", "value": "Test that features stop sharding beyond Math.pow(2,20) when it becomes pointless.\n" }, { "from": "human", "value": "var tape = require('tape');\nvar feature = require('../lib/util/feature.js');\n\ntape('seek', function(assert) {\n var shardString = JSON.stringif...
javascript
chosen
[ { "from": "system", "value": "Improve logic checking for `options.dest.root`\n" }, { "from": "human", "value": "import { deepCollection } from './object'; // TODO NOPE\nimport { resourcePath } from './shared';\nimport path from 'path';\n\nfunction getBaseUrl (resource, drizzleData) {\n const op...
javascript
chosen
[ { "from": "system", "value": "Add export of Cancel icon\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nexport { Button, ProgressBar } from 'react-native-ui-components';\n\nexport { AutocompleteSelector } from './AutocompleteSelector';\n...
javascript
chosen
[ { "from": "system", "value": "Refactor profile css module with new storage/messenger utilities\n" }, { "from": "human", "value": "import CESModule from './core/CESModule';\nimport dom from '../utils/dom';\n\nexport default class HideProfileCSS extends CESModule {\n constructor () {\n super()...
javascript
chosen
[ { "from": "system", "value": "Add security when converting milliseconds to time to avoid NaN\n" }, { "from": "human", "value": "(function(app){\n\n \"use strict\"\n\n /**\n * Creates a filter to convert a time in milliseconds to \n * an hours:minutes:seconds format.\n *\n * e.g.\n * ...
javascript
chosen
[ { "from": "system", "value": "Add common folder to tests\n" }, { "from": "human", "value": "/**\n * JS Linting\n */\n\nlet colors = require('mocha/lib/reporters/base').colors;\ncolors['pass'] = '1;36';\ncolors['error stack'] = '1;36';\ncolors['fast'] = '1;36';\ncolors['light'] = '1;36';\ncolors[...
javascript
chosen
[ { "from": "system", "value": "Test for mock `GET /batch`\n" }, { "from": "human", "value": "'use strict';\n\nvar createMockServer = require('../lib/test-server/index.js');\nvar configuration = require('../config/configuration.js');\n\ndescribe('<Mock server>', function() {\n\n before(function(d...
javascript
chosen
[ { "from": "system", "value": "Add missing return for test helper\n" }, { "from": "human", "value": "// Testing libraries\nconst chai = require('chai');\nchai.use(require('chai-as-promised'));\nglobal.cheerio = require('cheerio');\nglobal.expect = chai.expect;\nglobal.fs = require('fs');\nglobal....
javascript
chosen
[ { "from": "system", "value": "Increase test transition-duration from 20ms to 50ms\n" }, { "from": "human", "value": "import m from 'mithril';\nimport AppComponent from '../../app/scripts/components/app.js';\nimport AIPlayer from '../../app/scripts/models/ai-player.js';\nimport { qs } from './uti...
javascript
chosen
[ { "from": "system", "value": "Fix logoutLink key in AJAX catch for Redux\n" }, { "from": "human", "value": "import axios from 'axios'\n\nlet links\n\nexport default async function AJAX({\n url,\n resource,\n id,\n method = 'GET',\n data = {},\n params = {},\n headers = {},\n}) {\n try {\...
javascript
chosen
[ { "from": "system", "value": "Add strict mode to support generation\n" }, { "from": "human", "value": "var fs = require('fs'),\n words = require('./data/weasels.json');\n\nfs.writeFileSync('Supported-weasel-words.md',\n 'Supported Weasel-words\\n' +\n '=================\\n' +\n '\\n'...
javascript
chosen
[ { "from": "system", "value": "Remove plan until we have some asyncs\n" }, { "from": "human", "value": "var test = require('tape');\n\nvar testXHRCall = require('./lib/test-xhr-call');\nvar table = require('./tables/index.search.js');\n\ntable.calls.forEach(function(call) {\n test('index.search ...
javascript
chosen
[ { "from": "system", "value": "Improve and document field value check.\n" }, { "from": "human", "value": "/**\n * CreateAccountField component.\n *\n * Site Kit by Google, Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this ...
javascript
chosen
[ { "from": "system", "value": "Update how filter query is applied\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nimport config from '../config/environment';\n\nexport default Ember.Service.extend({\n host: config.HOST,\n namespace: 'solr',\n core: 'dina',\n \n par...
javascript
chosen
[ { "from": "system", "value": "Fix URL schema for subscribers\n" }, { "from": "human", "value": "const express = require('express')\nconst guildFeedSubscriberAPI = express.Router({ mergeParams: true })\nconst controllers = require('../../../../../controllers/index.js')\nconst feedHasSubscriber = ...
javascript
chosen
[ { "from": "system", "value": "Remove spaces in computed properties\n" }, { "from": "human", "value": "import fetch from 'isomorphic-fetch';\nimport url from 'url';\n\nconst baseUrlObj = {\n protocol: 'https:',\n host: 'api.github.com',\n pathname: '/gists',\n};\n\nconst baseUrlStr = url.forma...
javascript
chosen
[ { "from": "system", "value": "Change highest color to orange\n" }, { "from": "human", "value": "/*eslint-env browser*/\n/*eslint no-use-before-define:0 */\n/*global $*/\n\n(function(){\n \"use strict\";\n $(document).ready(function(){\n setInterval(updatePage, 100);\n });\n\n\n function u...
javascript
chosen
[ { "from": "system", "value": "Fix previous month bug due to 0-11 months scale.\n" }, { "from": "human", "value": "module.exports = (function(){\n\t\n\treturn function unixToDate(unixTime) {\n\t\tvar date = new Date(Number(unixTime));\n\t\tvar year = date.getFullYear();\n\t\tvar month;\n\t\tvar d...
javascript
chosen
[ { "from": "system", "value": "Implement temporary version of `closeSlot` HTTP function\n" }, { "from": "human", "value": "var functions = require('firebase-functions');\n\n// // Create and Deploy Your First Cloud Functions\n// // https://firebase.google.com/docs/functions/write-firebase-function...
javascript
chosen
[ { "from": "system", "value": "Put the missing semicolon at the end of exports declaration\n" }, { "from": "human", "value": "module.exports = function (db) {\n\tdb.set = set;\n\treturn db;\n}\n\nfunction set(path, obj, cb) {\n\tvar objs = [];\n putObjBatch(path, obj, objs);\n\n this.batch(objs...
javascript
chosen
[ { "from": "system", "value": "Remove old code in addFavorite\n" }, { "from": "human", "value": "var Storage = require('FuseJS/Storage');\n\nvar data = 'favorites';\n\n\n/* ...\n-----------------------------------------------------------------------------*/\nvar addFavorite\n, deleteFavorite\n, g...
javascript
chosen
[ { "from": "system", "value": "Check req for user property.\n" }, { "from": "human", "value": "/**\n * Module dependencies.\n */\nvar passport = require('passport-strategy')\n , util = require('util');\n\n\nfunction Strategy() {\n passport.Strategy.call(this);\n this.name = 'authenticated';\n}...
javascript
chosen
[ { "from": "system", "value": "Handle responce if no access\n" }, { "from": "human", "value": "var https = require('https');\nvar inspect = require('eyes').inspector({ stream: null });\nvar querystring = require('querystring');\nvar xml2js = require('xml2js');\n\nmodule.export.acce...
javascript
chosen
[ { "from": "system", "value": "Modify name db helper function\n" }, { "from": "human", "value": "'use strict';\n\nconst express = require('express');\nconst db = require('./db.js');\n\nconst app = express();\n\nconst PORT = process.env.PORT || 3020;\n\napp.get('/tickets', (req, res) => {\n const...
javascript
chosen
[ { "from": "system", "value": "Fix entering password in Vision Banco interface\n" }, { "from": "human", "value": "var password_field = document.getElementById(\"textfield\");\npassword_field.removeAttribute(\"onkeyup\");\n\nvar virtual_keyboard = document.getElementById(\"a_0\").parentElement;\nv...
javascript
chosen
[ { "from": "system", "value": "Use single quotes instead of double quotes\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/...
javascript
chosen
[ { "from": "system", "value": "Add sample configuration for normalizing ID\n" }, { "from": "human", "value": "/**\n * The root component that wraps the main app component with all \n * data-related components such as `ApolloProvider`.\n * This component works on all platforms.\n * @flow\n */\n\ni...
javascript
chosen
[ { "from": "system", "value": "Send error in callback, too.\n" }, { "from": "human", "value": "var ds_model = require('./datasource/model');\n\n\nfunction resolve (name, callback) {\n\n // TODO check name to be valid (and avoid SQL injection)\n if (!name) {\n return callback(M.error(...
javascript
chosen
[ { "from": "system", "value": "Add Pool to exported classes.\n" }, { "from": "human", "value": "module.exports = {\n Tile: require('./tile'),\n Map: require('./map'),\n TileBatch: require('./batch'),\n MBTiles: require('./mbtiles'),\n SphericalMercator: require('./sphericalmercator...
javascript
chosen
[ { "from": "system", "value": "Handle stack variation in Node v0.8\n" }, { "from": "human", "value": "var tape = require('../');\nvar tap = require('tap');\nvar concat = require('concat-stream');\n\nvar stripFullStack = require('./common').stripFullStack;\nvar testWrapper = require('./anonymous-f...
javascript
chosen
[ { "from": "system", "value": "Add timeout for requests to jenkins masters\n" }, { "from": "human", "value": "var request = require('request');\nvar async = require('async');\n\nfunction SuperMaster(masters){\n this.cache = {};\n this.masters = masters;\n\n // Initialize cache with empty...
javascript
chosen
[ { "from": "system", "value": "Update music search label text\n" }, { "from": "human", "value": "// @flow\n\nimport RaisedButton from \"material-ui/RaisedButton\";\nimport TextField from \"material-ui/TextField\";\nimport * as React from \"react\";\n\ntype Props = {\n term: string,\n onSearch: ...
javascript
chosen
[ { "from": "system", "value": "Move manual project ID dropdown to Bootstrap styles\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nexport default class AddProject extends Component {\n constructor() {\n super();\n\n this.state = {\n projectId: '',\n ...
javascript
chosen
[ { "from": "system", "value": "Add 2-way data binding unit tests\n" }, { "from": "human", "value": "describe('rte directive', function () {\n var scope, element;\n\n beforeEach(module('templates'));\n beforeEach(module('rte-angular'));\n\n beforeEach(inject(function ($rootScope, $compile, $sc...
javascript
chosen
[ { "from": "system", "value": "Add several tests for handlers.js, getRoutes()\n" }, { "from": "human", "value": "var chai = require('chai');\nvar expect = chai.expect;\n\ndescribe('Client', function() {\n //Add subsections\n});" }, { "from": "gpt", "value": "var chai = require('chai'...
javascript
chosen
[ { "from": "system", "value": "Use title with graph type\n" }, { "from": "human", "value": "\"use strict\";\n\nconst baseConfig = require(\"./rollup.config\");\nconst plugin = require(\"./plugin\");\nconst path = require(\"path\");\n\nmodule.exports = baseConfig.map(config => {\n const templateT...
javascript
chosen
[ { "from": "system", "value": "Add server task to gulp watch task\n" }, { "from": "human", "value": "'use strict';\n\nimport gulp from 'gulp';\n\ngulp.task('watch', [\n 'framework:watch',\n 'bower:watch',\n 'assets:watch',\n 'copy:watch',\n 'locales:watch',\n 'markup:watch',\n 'scripts:wat...
javascript
chosen
[ { "from": "system", "value": "Replace local tile URL with Chattanooga Public Library map tiles on GitHub.\n" }, { "from": "human", "value": "var southWest = L.latLng(34.9816, -85.4719);\nvar northEast = L.latLng(35.217, -85.0462);\nvar center = L.latLng(35.0657, -85.241);\nvar bounds = L.latLngB...
javascript
chosen
[ { "from": "system", "value": "Implement width and height options\n" }, { "from": "human", "value": "// @flow\nimport { NARROW_SPACE, WIDE_SPACE, NARROW_BAR, WIDE_BAR } from \"../Core/Characters\"\n\nconst NARROW_WIDTH = 1\nconst WIDE_WIDTH = 3\n\nexport function rect(x: number, wide: boolean, fi...
javascript
chosen
[ { "from": "system", "value": "Create deletePost function and import/wire up deletePost action creator\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { Link } from 'react-router-dom';\nimport { fetchPost } from '../acti...
javascript
chosen