conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Use promises for flatter code\n"
},
{
"from": "human",
"value": "import mongoose from 'mongoose'\nimport bcrypt from 'bcrypt'\n\nconst User = new mongoose.Schema({\n type: { type: String, default: 'User' },\n name: { type: String },\n username: { type: String, re... | javascript | chosen |
[
{
"from": "system",
"value": "Fix typo in error message\n"
},
{
"from": "human",
"value": "/*global exports: true, require: true */\n/*jslint onevar: true, undef: true, nomen: true, eqeqeq: true, bitwise: true, newcap: true, immed: true */\nvar path = require('path'),\n\n compressor = require... | javascript | chosen |
[
{
"from": "system",
"value": "Throw an error if we attempt to modify a different version of Leaflet.\n"
},
{
"from": "human",
"value": "// Modify Draggable to ignore shift key. \nL.Draggable.prototype._onDown = function(e) {\n this._moved = false;\n\n if ((e.which !== 1) && (e.button !== 1) &&... | javascript | chosen |
[
{
"from": "system",
"value": "Bring in PropTypes and and set prop type for portalTo prop\n"
},
{
"from": "human",
"value": "let traps = [];\n\nconst React = require('react');\nconst FocusTrap = require('focus-trap-react');\n\n/**\n * MXFocusTrap\n *\n * Why is this needed?\n *\n * FocusTrap does... | javascript | chosen |
[
{
"from": "system",
"value": "Fix mix of tabs and spaces for indentation\n"
},
{
"from": "human",
"value": "L.CRS.proj4js = (function () {\r\n\tvar createProjection = function (code, def, /*L.Transformation*/ transformation) {\r\n\t\tif (typeof(def) !== 'undefined') {\r\n\t\t\tProj4js.defs[code]... | javascript | chosen |
[
{
"from": "system",
"value": "Fix array parser parsing blank string.\n"
},
{
"from": "human",
"value": "'use strict';\n\nfunction parseQueryParamAsArray(p) {\n return function parseQueryParameter(q) {\n var query = {};\n query[p] = q[p].split(',');\n\n return query;\n };\n}\n\nmodule.... | javascript | chosen |
[
{
"from": "system",
"value": "Remove redundant branches to fix Airbnb 9 issue."
},
{
"from": "human",
"value": "'use strict';\n\n/**\n * Registration record for a dependency\n */\nclass RegistrationRecord {\n /**\n * Initialize a new registration record\n * @param {object} details ... | javascript | chosen |
[
{
"from": "system",
"value": "Add support for private packages\n\nFixes #3\n"
},
{
"from": "human",
"value": "var registryUrl = require('registry-url')\nvar request = require('superagent')\nvar url = require('url')\nvar parsePackage = require('./parse-package')\n\nmodule.exports = registryPackag... | javascript | chosen |
[
{
"from": "system",
"value": "Use the session user to fetch org repos\n"
},
{
"from": "human",
"value": "/*jshint strict:true, trailing:false, unused:true, node:true */\n'use strict';\n\nrequire(\"babel/register\");\n\nvar GitHub = require('../github');\nvar redis = require('../redis');\nvar Re... | javascript | chosen |
[
{
"from": "system",
"value": "Add ability to add dependencies in extractor\n"
},
{
"from": "human",
"value": "var path = require('path');\nvar _readFile = require('../utils/readFile');\n\nfunction resolve(filepath) {\n return path.resolve(this.source.absolutePath, filepath);\n}\n\nfunction addD... | javascript | chosen |
[
{
"from": "system",
"value": "Use deepmerge on loaded inventory items\n"
},
{
"from": "human",
"value": "import devtools from '../devtools';\nimport { REALLY_BIG_NUMBER } from '../utils';\nimport { load } from '../save';\n\nimport merge from 'deepmerge';\n\nimport PineCone from '../sprites/objec... | javascript | chosen |
[
{
"from": "system",
"value": "Use full path for import"
},
{
"from": "human",
"value": "define(['./open_wctb'], function(open_wctb) {\n return open_wctb;\n});\n"
},
{
"from": "gpt",
"value": "define(['mac/resources/open_wctb'], function(open_wctb) {\n return open_wctb;\n});\n"
}
... | javascript | chosen |
[
{
"from": "system",
"value": "Improve error handling of internal server\n"
},
{
"from": "human",
"value": "const pnut = require('pnut-butter')\n\nmodule.exports = async ctx => {\n const { method, state, params, query, request } = ctx\n if (state.user) {\n pnut.token = state.user.token\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Watch the console and throw on any error\n"
},
{
"from": "human",
"value": "const Enzyme = require('enzyme');\nconst EnzymeAdapter = require('enzyme-adapter-react-16');\n\n// Setup enzyme's react adapter\nEnzyme.configure({ adapter: new EnzymeAdapter() });\n"
},
... | javascript | chosen |
[
{
"from": "system",
"value": "Check for night evt type\n"
},
{
"from": "human",
"value": "'use babel';\n\nimport EventEmitter from 'events';\n\nexport default class TimeEmitter extends EventEmitter {\n constructor(dayTime, nightTime) {\n let curTime = new Date();\n let msToDay = Math.abs(... | javascript | chosen |
[
{
"from": "system",
"value": "Fix case: tostring to toString"
},
{
"from": "human",
"value": "define(function() {\n \n 'use strict';\n \n return function(item) {\n return item.getBytes().then(function(bytes) {\n var dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);... | javascript | chosen |
[
{
"from": "system",
"value": "Fix syntax error in 'requiresSecure' middleware.\n"
},
{
"from": "human",
"value": "function requiresLogin(req, res, next) {\n if (!req.session.account) {\n return res.redirect('/');\n }\n\n next();\n}\n\nfunction requiresLogout(req, res, next) {\n if (req.se... | javascript | chosen |
[
{
"from": "system",
"value": "Select a citation after updating.\n"
},
{
"from": "human",
"value": "import { documentHelpers } from '../model'\nimport ApiExtension from './ApiExtension'\n\nexport default class ReferenceApi extends ApiExtension {\n /**\n * @param {object} data from ReferenceMod... | javascript | chosen |
[
{
"from": "system",
"value": "Make Sequelize use settings from config file.\n"
},
{
"from": "human",
"value": "var Sequelize = require('sequelize');\nvar fs = require('fs');\nvar path = require('path');\n\nvar sequelize = new Sequelize('cacophony_metadata', 'test', 'pass', {\n host: '192.168.33... | javascript | chosen |
[
{
"from": "system",
"value": "Fix bug on get first word\n"
},
{
"from": "human",
"value": "const tjbot = require('./tjbotlib');\nconst config = require('./config/configs');\n\nconst credentials = config.credentials;\nconst WORKSPACEID = config.conversationWorkspaceId;\n\nconst hardware = ['micro... | javascript | chosen |
[
{
"from": "system",
"value": "Stop using deprecated bodyParser constructor\n\nThis resolves the following warnings we were seeing in test output:\n\n body-parser deprecated bodyParser: use individual json/urlencoded middlewares app.js:15:9\n body-parser deprecated undefined extended: provide extended ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix warning on docs deploy.\n"
},
{
"from": "human",
"value": "import React, {Component, PropTypes} from \"react\";\nimport {Route} from \"react-router\";\nimport PhenomicPageContainer from \"phenomic/lib/PageContainer\";\nimport LayoutContainer from \"../LayoutCont... | javascript | chosen |
[
{
"from": "system",
"value": "[core] GraphQL: Format output from graphql list command a little better\n"
},
{
"from": "human",
"value": "module.exports = async function listApisAction(args, context) {\n const {apiClient, output} = context\n\n const client = apiClient({\n requireUser: true,\... | javascript | chosen |
[
{
"from": "system",
"value": "Remove redundant sign in toggle\n"
},
{
"from": "human",
"value": "$(document).ready(function() {\n\t\n\t\n\t/*\n\t\tEnlarge and shrink the search box on focus\n\t*/\n\t$('#person-search').focus(function(event) {\n\t\t$('.person-header-nav').addClass('focus-search')... | javascript | chosen |
[
{
"from": "system",
"value": "Update count value to Number type."
},
{
"from": "human",
"value": "var mongoose = require('mongoose');\r\nrequire('./projectModel');\r\n\r\nvar AkamaiSchema = new mongoose.Schema({\r\n\tDay : { type: String, index: true},\r\n\tURL: String,\r\n\tCompleted : Number,\... | javascript | chosen |
[
{
"from": "system",
"value": "Add escape listener to main activity input\n"
},
{
"from": "human",
"value": "import React, { Component, PropTypes } from 'react';\n\nimport { getDescriptionAndTags } from '../helpers';\n\nclass AddActivityForm extends Component {\n createActivity(e) {\n e.preve... | javascript | chosen |
[
{
"from": "system",
"value": "Hide save and validate buttons\n"
},
{
"from": "human",
"value": "'use strict';\n\n/**\n * @ngInject\n */\nvar DatasetEditController = function ($scope, $controller, $routeParams, Dataset) {\n\n // EditController -> NpolarEditController\n $controller('NpolarEditCo... | javascript | chosen |
[
{
"from": "system",
"value": "feat: Add base test for containing any value\n"
},
{
"from": "human",
"value": "describe(\"About Maps\", function () {\n\n describe(\"Basic Usage\", function () {\n\n it(\"should understand they are key, value stores\", function () {\n var trooper = new Map... | javascript | chosen |
[
{
"from": "system",
"value": "Improve interceptor with correct redirect URL\n"
},
{
"from": "human",
"value": "/**\n * 403 Forbidden Network Error Interceptor\n *\n * This interceptor redirects to login page when\n * any 403 session expired error is returned in any of the\n * network requests\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix typo in observable name.\n"
},
{
"from": "human",
"value": "(function () {\n 'use strict';\n\n define(\n [\n 'lodash',\n 'knockout'\n ],\n function (_, ko) {\n var AVAILABLE_MODES = [ 'List', 'Thumbnail... | javascript | chosen |
[
{
"from": "system",
"value": "Use ui-router's state changes for default route, this ensures we don't get the infinite redirect loop\n\nSigned-off-by: Tom Barlow <adf75c2c2ec965e68e8d4752c9742146f0b6495c@gmail.com>\n"
},
{
"from": "human",
"value": "(function() {\n 'use strict';\n\n angular... | javascript | chosen |
[
{
"from": "system",
"value": "Define some functions to implement based on php-sdk\n"
},
{
"from": "human",
"value": "var https = require('https');\nvar url = require('url');\nvar crypto = require('crypto');\n\nvar DOMAIN_MAP = {\n\tapi : 'https://api.facebook.com/',\n\tapiVideo : 'https://api-vi... | javascript | chosen |
[
{
"from": "system",
"value": "Add better watchword, picture, instead of selfie\n"
},
{
"from": "human",
"value": "Module.register(\"recognizer\",{\n start() {\n console.log(\"Recognizer started\");\n this.sendSocketNotification(\"RECOGNIZER_STARTUP\");\n return;\n },\n\n socketNotifi... | javascript | chosen |
[
{
"from": "system",
"value": "Add quotes around undefined when checking for type\n"
},
{
"from": "human",
"value": "'use strict'\nvar _ = require('underscore')\n\n/**\n * Given a maze, position to start at, and a visited set, apply a randomized\n * depth-first-search algorithm to the maze.\n *\n... | javascript | chosen |
[
{
"from": "system",
"value": "feat: Add new line after a .gitignore template\n"
},
{
"from": "human",
"value": "import fs from 'fs'\nimport { join } from 'path'\n\nconst templatesDir = join(__dirname, '..', 'templates')\n\nconst readFile = async (file) => {\n return new Promise((resolve, reject... | javascript | chosen |
[
{
"from": "system",
"value": "Add date to response body\n"
},
{
"from": "human",
"value": "var os = require( \"os\" );\nvar throng = require( \"throng\" );\nvar connections = require( \"./shared/connections\" );\nvar utils = require( \"./shared/utils\" );\n\n\nvar logger = connections.logger( [ ... | javascript | chosen |
[
{
"from": "system",
"value": "Use apply to forward call to registry.\n"
},
{
"from": "human",
"value": "exports = module.exports = function(registry) {\n var api = {};\n \n api.resolve = function(type, domain, rrtype, cb) {\n registry.resolve(type, domain, rrtype, function(err, records) {\... | javascript | chosen |
[
{
"from": "system",
"value": "Fix local participant was not shown on large video after merge\n"
},
{
"from": "human",
"value": "import { ReducerRegistry } from '../base/redux';\n\nimport { LARGE_VIDEO_PARTICIPANT_CHANGED } from './actionTypes';\n\nconst INITIAL_STATE = {\n participantId: unde... | javascript | chosen |
[
{
"from": "system",
"value": "build: Add missing flow definitions for mocha\n"
},
{
"from": "human",
"value": "// flow-typed signature: 6b82cf8c1da27b4f0fa7a58e5ed5babf\n// flow-typed version: edf70dde46/mocha_v3.1.x/flow_>=v0.22.x\n\ntype TestFunction = ((done: () => void) => void | Promise<mix... | javascript | chosen |
[
{
"from": "system",
"value": "Make it work by default\n"
},
{
"from": "human",
"value": "\n'use strict';\n\nvar glob = require('glob'),\n _ = require('underscore'),\n ParallelExec = require('./lib/ParallelExec'),\n BehatTask = require('./lib/BehatTask'),\n defaults = {\n src: ... | javascript | chosen |
[
{
"from": "system",
"value": "Remove unused code from line graph view\n"
},
{
"from": "human",
"value": "define([\n 'extensions/views/graph/graph',\n 'extensions/views/graph/linelabel'\n],\nfunction (Graph, LineLabel) {\n var LineGraph = Graph.extend({\n\n components: function () {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix mostUrgentSubject query to not use r.row in subquery\n"
},
{
"from": "human",
"value": "var r = require('rethinkdb');\n\n// Number of seconds after which Reddit will archive an article\n// (180 days): https://github.com/reddit/reddit/commit/b7b24d2e9fa06ba37ea78... | javascript | chosen |
[
{
"from": "system",
"value": "Make TwG Settings Edit view consistent.\n"
},
{
"from": "human",
"value": "/**\n * Thank with Google Settings Form component.\n *\n * Site Kit by Google, Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may ... | javascript | chosen |
[
{
"from": "system",
"value": "Use global to pull in the window\n"
},
{
"from": "human",
"value": "/**\n * Treasure Client Loader\n */\n\n// Modules\nvar _ = require('./utils/lodash')\n\n// Helpers\nfunction applyToClient (client, method) {\n var _method = '_' + method\n if (client[_method]) {\... | javascript | chosen |
[
{
"from": "system",
"value": "Rename event handler for consistency\n"
},
{
"from": "human",
"value": "import React, { Component } from 'react';\nimport {\n SearchBar,\n} from 'react-native-elements';\n\nexport default class RepoSearchBar extends Component {\n constructor(props) {\n super(pr... | javascript | chosen |
[
{
"from": "system",
"value": "Add simple test for store 'subscribe' function\n"
},
{
"from": "human",
"value": "'use strict';\n\nimport counterReducer from '../reducers/counterReducer';\nimport simpleActionCreator from '../actions/simpleActionCreators';\n\nfunction createStore( reducer, initialS... | javascript | chosen |
[
{
"from": "system",
"value": "Fix check for valid date to avoid displaying invalid dates\n"
},
{
"from": "human",
"value": "//noinspection JSUnusedAssignment\ndashlight.widgets = (function (module) {\n\n module.build_status = (function () {\n var build = function (content) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Make missing assets 404 correctly\n"
},
{
"from": "human",
"value": "/**\n * Module dependencies.\n */\n\nvar Promise = require('bluebird');\nvar path = require('path');\nvar _ = require('lodash');\n\nvar utils = require('.... | javascript | chosen |
[
{
"from": "system",
"value": "Add honorCount to test config to prevent timeout being sent\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar PerfTestFramework = require('../../../TestServer/PerfTestFramework.js');\nvar TestDevice = require('../../../TestServer/TestDevice.js');\nvar tape = r... | javascript | chosen |
[
{
"from": "system",
"value": "Remove the dubagger from the file\n"
},
{
"from": "human",
"value": "$( document ).on('turbolinks:load', function() {\n $('.modal-trigger').on('click',function(){\n debugger\n $('#modal1').modal();\n })\n})"
},
{
"from": "gpt",
"value": "$( docum... | javascript | chosen |
[
{
"from": "system",
"value": "Fix for silly default in Station name field\n"
},
{
"from": "human",
"value": "var keystone = require('keystone'),\n\tTypes = keystone.Field.Types;\n\nvar Station = new keystone.List('Station', {\n\tautokey: { from: 'name', path: 'key' }\n});\n\nStation.add({\n\tnam... | javascript | chosen |
[
{
"from": "system",
"value": "Remove extra new line from log\n"
},
{
"from": "human",
"value": "\"use strict\";\nconst fs = require(\"fs\");\n\nconst prettyDate = function(date) {\n\tconst months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\",\n\t\t\"Jul\", \"Aug\", \"Sep\", \"Oct\", \"... | javascript | chosen |
[
{
"from": "system",
"value": "Clear the overriden permissions if the role is changed\n"
},
{
"from": "human",
"value": "define(function (require) {\n\t\n\t// Dependencies\n\tvar $ = require('jquery')\n\t\t, _ = require('lodash')\n\t\t, Backbone = require('backbone')\n\t;\n\t\n\t/**\n\t * Setup v... | javascript | chosen |
[
{
"from": "system",
"value": "feat(a11y): Add aria key-value pairs so that a bunch of magic strings can be removed.\n"
},
{
"from": "human",
"value": "(function rocketbelt(window, document) {\n window.rb = window.rb || {};\n\n window.rb.getShortId = function getShortId() {\n // Break the id... | javascript | chosen |
[
{
"from": "system",
"value": "Complete string tests to pass\n"
},
{
"from": "human",
"value": "\nmodule(\"About Strings (topics/about_strings.js)\");\n\ntest(\"delimiters\", function() {\n var singleQuotedString = 'apple';\n var doubleQuotedString = \"apple\";\n equal(__, singleQuotedSt... | javascript | chosen |
[
{
"from": "system",
"value": "Add instructions for custom titles\n"
},
{
"from": "human",
"value": "var data = require('../../../data/titles');\nvar search = require('../../../data/search');\n\n// Use this space to insert any prototype specific entries onto the available\n// set of data.\n// For... | javascript | chosen |
[
{
"from": "system",
"value": "Use global directive to avoid jslint errors\n"
},
{
"from": "human",
"value": "var LocationMap = {\n 'initialize': function initialize() {\n // Map centered in NowSecure HQ by default\n this.map = L.map('map').setView([40.2001925,-89.0876265], 3);\n this.m... | javascript | chosen |
[
{
"from": "system",
"value": "Remove default output of all env vars\n"
},
{
"from": "human",
"value": "const _ = {\n pick: require('lodash.pick'),\n};\nconst express = require('express');\nconst fs = require('fs');\nconst path = require('path');\n\nmodule.exports = () => {\n const router = new... | javascript | chosen |
[
{
"from": "system",
"value": "Clean up output from wmic\n"
},
{
"from": "human",
"value": "const childProcess = require('child_process')\nconst command = 'wmic logicaldisk get caption'\n\nmodule.exports = function () {\n return new Promise((resolve, reject) => {\n childProcess.exec(command, ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix typo in function name\n"
},
{
"from": "human",
"value": "import cozydb from 'cozydb';\nimport invariant from 'invariant';\nimport logger from 'debug';\nimport hasValue from '../hasValue';\n\nconst debug = logger('app:model:favorite_tag');\n\nconst FavoriteTag = ... | javascript | chosen |
[
{
"from": "system",
"value": "Simplify Elements example by using Math.max\n\nUsed Math.max to simplify the lineWidth logic in elements example."
},
{
"from": "human",
"value": "/*\n tags: basic, lines\n<p> This example demonstrates how you can use `elements` to draw lines. </p>\n */\n\nconst re... | javascript | chosen |
[
{
"from": "system",
"value": "Fix type name of initial content element of new sections\n\n`editableTextBlock` was a temporary name.\n\nREDMINE-17338, REDMINE-17339\n"
},
{
"from": "human",
"value": "import Backbone from 'backbone';\n\nimport {\n configurationContainer,\n entryTypeEditorControl... | javascript | chosen |
[
{
"from": "system",
"value": "Make sure events are working correctly on front page\n"
},
{
"from": "human",
"value": "define([\n 'zepto',\n 'Underscore',\n 'Backbone',\n 'models/expenses',\n 'text!../../tpl/home.html' ],\n function ($, _, Backbone, Expenses, template) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Make compatible with hydro 0.6\n"
},
{
"from": "human",
"value": "/**\n * External dependencies.\n */\n\nvar Formatter = require('hydro-formatter');\n\n/**\n * Dot formatter.\n *\n * @constructor\n */\n\nvar Dot = Formatter.extend();\n\n/**\n * Before all tests.\n *... | javascript | chosen |
[
{
"from": "system",
"value": "Fix addon page with wrong baseURL\n"
},
{
"from": "human",
"value": "/* jshint node: true */\n\nmodule.exports = function (environment) {\n\tvar ENV = {\n\t\tmodulePrefix: \"dummy\",\n\t\tenvironment: environment,\n\t\tbaseURL: \"/\",\n\t\tlocationType: \"auto\",\n\... | javascript | chosen |
[
{
"from": "system",
"value": "docs(gh-pages): Fix refresh 404 with hash URL"
},
{
"from": "human",
"value": "/* jshint node: true */\n\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'dummy',\n environment: environment,\n baseURL: '/',\n locationType: 'auto... | javascript | chosen |
[
{
"from": "system",
"value": "Add support for observing an SNS topic.\n"
},
{
"from": "human",
"value": "var Rx = require('rx'),\n _ = require('lodash');\n\nfunction receiveMessage(sqs, params, callback) {\n sqs.receiveMessage(params, function (err, data) {\n callback(err, data);\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix templates and add newlines\n"
},
{
"from": "human",
"value": "export function CORDOVA_ASSET_TEMPLATE(assetType, platform, {src, d, w, h} = {}) {\n return `<${assetType} src=\"${src}\" platform=\"${platform}\"${d?` density=\"${d}\"`:``}${w?` width=\"${w}\"`:``... | javascript | chosen |
[
{
"from": "system",
"value": "Add setting about server port"
},
{
"from": "human",
"value": "/**\r\n * Created by dell on 2015/7/20.\r\n * This is gulp init\r\n */\r\n(function(){\r\n\r\n \"use strict\";\r\n\r\n var gulp = require('gulp');\r\n var loadPlugins = require('gulp-load-plugin... | javascript | chosen |
[
{
"from": "system",
"value": "Implement the closure-generating click handler generator\n"
},
{
"from": "human",
"value": "function Board(submitBtn, options) {\n this.submitBtn = submitBtn;\n this.options = options;\n}\n\nBoard.prototype.prepareBoard = function() {\n this.hideButton(this... | javascript | chosen |
[
{
"from": "system",
"value": "Add callback to handle result of promises queued\n"
},
{
"from": "human",
"value": "'use strict';\n\nexport class PromiseQueue {\n\tconstructor() {\n\t\tthis.promises = [];\n\t\tthis.endCallback;\n\t\tthis.exceptionCallback;\n\t\tthis.running;\n\t}\n\trun() {\n\t\ti... | javascript | chosen |
[
{
"from": "system",
"value": "Switch bootstrap module import to foundation\n"
},
{
"from": "human",
"value": "// import external dependencies\nimport 'jquery';\n\n// Import everything from autoload\nimport \"./autoload/**/*\"\n\n// import local dependencies\nimport Router from './util/Router';\n... | javascript | chosen |
[
{
"from": "system",
"value": "Update server to run on port 3000\n"
},
{
"from": "human",
"value": "const express = require('express');\nconst path = require('path');\nconst app = express();\n\napp.use(express.static(path.join(__dirname, 'build')));\n\napp.get('/', function (req, res) {\n res.se... | javascript | chosen |
[
{
"from": "system",
"value": "chore: Add a 10s timeout to reachable-url\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\n'use strict';\n\nvar stdin = process.openStdin();\n\nvar async = require('async');\nvar reachableUrl = require('reachable-url')\n\nif (require.main === module) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Resolve image icon path relative to module\n"
},
{
"from": "human",
"value": "var {JFrame, JButton, ImageIcon, JLabel} = javax.swing;\nvar {setInterval} = require('ringo/scheduler');\nvar n = 0;\n\nfunction main() {\n var frame = new JFrame(\"Swing Demo\");\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Update python script arguments in node script\n"
},
{
"from": "human",
"value": "var PythonShell = require('python-shell');\n\nvar options = {\n\tscriptPath: 'realclearpolitics-scraper',\n\targs: [\n\t\t'http://www.realclearpolitics.com/epolls/2016/president/nv/neva... | javascript | chosen |
[
{
"from": "system",
"value": "Exit if unable to create ninja.\n"
},
{
"from": "human",
"value": "var\n\tfs = require('fs')\n\t, path = require('path')\n\t, util = require('util')\n\t, events = require('events')\n\t, argv = require(path.resolve(__dirname, 'app', 'argv'))\n\t, client = require(pat... | javascript | chosen |
[
{
"from": "system",
"value": "Store appx in out folder\n"
},
{
"from": "human",
"value": "const ChildProcess = require('child_process')\nconst path = require('path')\n\nconst version = require('../package').version + '.0'\n\nconst command = path.join(__dirname, '..', 'node_modules', '.bin', 'ele... | javascript | chosen |
[
{
"from": "system",
"value": "Add Remove All labels prompt\n"
},
{
"from": "human",
"value": "/**\n * The \"Initial\"/\"Main\" prompts\n */\n\"use strict\";\nmodule.exports = [\n {\n type: \"list\",\n name: \"main\",\n message: \"Welcome to git-labelmaker!\\nWhat would you ... | javascript | chosen |
[
{
"from": "system",
"value": "Remove traces of jshint config\n"
},
{
"from": "human",
"value": "/* jshint browser: true */\n'use strict';\n\n// returns true if the image is loaded and decoded,\n// or a number, if it didn't find one single image,\n// or a helpful error if it wasn't an image,\n// ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix issue-1: Keep waiting if the same user joins\n"
},
{
"from": "human",
"value": "var OngoingGames = require(\"../models/OngoingGames\");\n\nvar playerQueue = [];\n\nexports.startGame = function(req, res) {\n\n var player1 = req.body.username;\n\n var game = Ong... | javascript | chosen |
[
{
"from": "system",
"value": "Remove more content from the wikipedia article, that we dont want.\n"
},
{
"from": "human",
"value": "const jsdom = require('jsdom');\n\nconst f = (context, cb) => {\n const wikipediaUrl = context.data['article-url'];\n jsdom.env({\n url: `${ wikipediaUrl }?pri... | javascript | chosen |
[
{
"from": "system",
"value": "Fix gender definition not exists in zh-Hant-TW.\n"
},
{
"from": "human",
"value": "export {default as name} from './name';\nexport {default as firstName} from './firstName';\nexport {default as lastName} from './lastName';\n"
},
{
"from": "gpt",
"value":... | javascript | chosen |
[
{
"from": "system",
"value": "Fix bug in server image\n"
},
{
"from": "human",
"value": "var fs = require(\"fs\");\nvar queryString = require(\"querystring\");\n\nfunction start(response, postData) {\n console.log(\"Request handler 'start' was called.\");\n\n fs.readFile(\"./public/in... | javascript | chosen |
[
{
"from": "system",
"value": "Fix absolute value of cartesian (was previously x*x+y*y, but should be Sqrt[x^2+y^2])\n"
},
{
"from": "human",
"value": "Expression.prototype.polar = function() {\n\tvar ri = this.realimag();\n\tvar two = new Expression.Integer(2);\n\treturn Expression.List.ComplexP... | javascript | chosen |
[
{
"from": "system",
"value": "Update cypress test expected value given new step value for regional pop\n"
},
{
"from": "human",
"value": "/// <reference types=\"cypress\" />\n\ncontext('Actions', () => {\n beforeEach(() => {\n cy.visit('http://localhost:8000')\n });\n\n it('All + elements ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix syntax rules for npm test\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport Button from 'react-bootstrap/lib/Button';\nimport Panel from 'react-bootstrap/lib/Panel';\n\nimport Icon from './icon.react';\n\nexport default class Example extends ... | javascript | chosen |
[
{
"from": "system",
"value": "Use correct keys for measurement & label"
},
{
"from": "human",
"value": "import React, { Component } from 'react';\nimport Chart from 'chart.js';\n\nclass ChartComponent extends Component {\n\n componentDidMount() {\n this.renderChart(this.props.measurement.mea... | javascript | chosen |
[
{
"from": "system",
"value": "Add module as unit test dependency\n"
},
{
"from": "human",
"value": "const path = require(\"path\");\n\nmodule.exports = function(config) {\n config.set({\n frameworks: [\"jasmine\"],\n proxies: {\n '/lib/css/': '/base/lib/css'\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Save user displayName; rename signedInAt → lastSignedInAt\n\nlastSignedInAt matches the name in firebase auth:export\n"
},
{
"from": "human",
"value": "import { Firebase, firebaseAuth, firebaseRef } from './firebase'\n\nexport const login = () => {\n const provider... | javascript | chosen |
[
{
"from": "system",
"value": "Fix `/upcoming` getting drafts and unpulished meets\n"
},
{
"from": "human",
"value": "const MySql = require(\"./MySql.js\");\nconst entities = require(\"entities\");\nconst moment = require(\"moment\");\n\nclass Meet{\n constructor(obj){\n Object.keys(obj).forE... | javascript | chosen |
[
{
"from": "system",
"value": "Add minimum target browser versions\n"
},
{
"from": "human",
"value": "/**\n * Add targets -> node -> current as per this comment https://github.com/babel/babel/issues/5085#issuecomment-363242788\n */\nmodule.exports = {\n env: {\n test: {\n pre... | javascript | chosen |
[
{
"from": "system",
"value": "Fix reloading bug with MutationObserver\n"
},
{
"from": "human",
"value": "function tryMe() {\n if (document.getElementsByClassName(\"_48e9\").length < 1) {\n window.requestAnimationFrame(tryMe);\n } else {\n startBlock();\n }\n}\ntryMe();\n\nfunction start... | javascript | chosen |
[
{
"from": "system",
"value": "Add callback to call to process\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\n\"use strict\";\n\nvar path = require(\"path\");\nvar fs = require(\"fs\");\n\nvar commander = require(\"commander\");\n\nvar libPath = path.join(path.dirname(fs.realpathSync(_... | javascript | chosen |
[
{
"from": "system",
"value": "Remove loose mode from babel\n"
},
{
"from": "human",
"value": "const createConfig = (api) => {\n api.cache.never();\n return {\n presets: [\n '@babel/preset-react',\n [\n '@babel/env',\n {\n modules: false,\n loose: tr... | javascript | chosen |
[
{
"from": "system",
"value": "Fix wrong link in JS sources\n"
},
{
"from": "human",
"value": "/*!\n * JS-Tricks main script\n */\n\n(function (w, d) {\n // Touch detection ( ͡ᵔ ͜ʖ ͡ᵔ)\n // @see http://localhost:8080/detect-touch-devices-using-javascript\n if('ontouchstart' in window) {\n v... | javascript | chosen |
[
{
"from": "system",
"value": "Use system import for code splitting\n"
},
{
"from": "human",
"value": "import {subscribe, getTodo} from '../todo'\nimport renderGraph from './render'\n\nlet graphArea\nconst unsubscribe = {\n store: null,\n todo: null,\n}\n\nexport default toggleGraph\n\nfunction... | javascript | chosen |
[
{
"from": "system",
"value": "Update tests to match new render names.\n"
},
{
"from": "human",
"value": "const renders = require('../test/renders');\nconst pretty = require('pretty');\nimport assert from 'power-assert';\n\nconst AllComponents = require('../lib/components').default;\nconst templa... | javascript | chosen |
[
{
"from": "system",
"value": "Index route needs a vehicle loader as well\n"
},
{
"from": "human",
"value": "import React from 'react'\nimport { Route, IndexRoute } from 'react-router'\n\nimport App from './app'\n\nimport VehicleLoader from './utilities/vehicle-loader'\nimport VehicleListContaine... | javascript | chosen |
[
{
"from": "system",
"value": "Remove (From|To|Subject|Cc|Date) from the trace\n"
},
{
"from": "human",
"value": "// Generated by CoffeeScript 1.10.0\n(function() {\n $(\"blockquote\").each((function(_this) {\n return function(i, element) {\n var contents;\n contents = $(element).co... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.