conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix spelling of HTTP referer header\n"
},
{
"from": "human",
"value": "/*\n * Copyright (c) 2014-2020 Bjoern Kimminich.\n * SPDX-License-Identifier: MIT\n */\n\nconst models = require('../models/index')\nconst insecurity = require('../lib/insecurity')\nconst utils =... | javascript | chosen |
[
{
"from": "system",
"value": "Handle Meteor's stripping out methods from the fs core API.\n"
},
{
"from": "human",
"value": "var fs = require('fs');\nvar run = require('./runner');\n\nvar defaults = {\n opensslPath : '/usr/bin/openssl',\n padding : 'pkcs'\n};\n\nfunction verifyOptions (opt... | javascript | chosen |
[
{
"from": "system",
"value": "Fix 'rollup-plugin-replace' order and variable name\n"
},
{
"from": "human",
"value": "import resolve from 'rollup-plugin-node-resolve';\nimport eslint from 'rollup-plugin-eslint';\nimport babel from 'rollup-plugin-babel';\nimport commonjs from 'rollup-plugin-common... | javascript | chosen |
[
{
"from": "system",
"value": "Fix change to resolve promise before controller\n"
},
{
"from": "human",
"value": "product\n.config(function ($routeProvider) {\n $routeProvider\n .when('/', {\n templateUrl: 'components/chooseLanguage/chooseLanguage.tpl.html'\n ,cont... | javascript | chosen |
[
{
"from": "system",
"value": "Make unit test slightly less weird.\n"
},
{
"from": "human",
"value": "/**\n * Smoke-test the default \n */\nvar assert = require('chai').assert;\n\nvar breakWords = require('../../build/intermediate').wordBreakers['uax29'];\nconst SHY = '\\u00AD';\n\ndescribe('The ... | javascript | chosen |
[
{
"from": "system",
"value": "Work ex fix in summary\n"
},
{
"from": "human",
"value": "/**\n * Created by sujithkatakam on 3/15/16.\n */\n\nfunction pagination() {\n var monkeyList = new List('test-list', {\n valueNames: ['name'],\n page: 4,\n innerWindow: 4,\n pl... | javascript | chosen |
[
{
"from": "system",
"value": "Fix wrong oauthId when creating users.\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nconst passport = require('passport');\nconst BdApiStrategy = require('passport-bdapi').Strategy;\n\nmodule.exports = (config, app, passport, models) => {\n passport.use(n... | javascript | chosen |
[
{
"from": "system",
"value": "Fix Raise the Alarm bug\n"
},
{
"from": "human",
"value": "const DrawCard = require('../../drawcard.js');\n\nclass RaiseTheAlarm extends DrawCard {\n setupCardAbilities(ability) {\n this.action({\n title: 'Flip a dynasty card',\n cond... | javascript | chosen |
[
{
"from": "system",
"value": "Set trust proxy to true\n"
},
{
"from": "human",
"value": "/**\n * @module App Main Application Module \n */\n'use strict';\n\nconst express = require('express');\nconst app = express();\nconst api = require('./api/api.router');\n\napp.use('/', express.static('publi... | javascript | chosen |
[
{
"from": "system",
"value": "Sort topics by the number of upvotes/downvotes\n"
},
{
"from": "human",
"value": "import React, { Component } from 'react'\nimport { connect } from 'react-redux'\nimport PropTypes from 'prop-types'\n\nimport Sidebar from '../../../components/Sidebar'\nimport TopicLi... | javascript | chosen |
[
{
"from": "system",
"value": "Allow server to be accessed via IP\n"
},
{
"from": "human",
"value": "//extend webpack.config.js\nvar config = require('./webpack.config');\nvar path = require('path');\n\n//for more info, look into webpack.config.js\n//this will add a new object into default settin... | javascript | chosen |
[
{
"from": "system",
"value": "Tweak for Superuser UI in projects.\n\nThis will properly align the create-project button for superadmin.\n\nChange-Id: Id79c7daa66b7db559bda5a41e494f17d519cf6a3\n"
},
{
"from": "human",
"value": "/*\n * Copyright (c) 2014 Hewlett-Packard Development Company, L.P.\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add docs on global test file\n"
},
{
"from": "human",
"value": "const chai = require('chai');\nconst sinon = require('sinon');\nconst sinonChai = require('sinon-chai');\n\n// Require and load .env vars\nrequire('./dotenv');\n\n// Configure chai to use Sinon-Chai\nch... | javascript | chosen |
[
{
"from": "system",
"value": "Add global.css file to pages by default\n"
},
{
"from": "human",
"value": "const buildBaseCss = require(`./_build-base-css.js`);\nconst buildBaseHtml = require(`./_build-base-html.js`);\nconst buildPackageCss = require(`./_build-package-css.js`);\nconst buildPackage... | javascript | chosen |
[
{
"from": "system",
"value": "Make correct context when select entity in search\n"
},
{
"from": "human",
"value": "'use strict';\n\nangular.module('mean.icu').service('context', function ($injector, $q) {\n var mainMap = {\n task: 'tasks',\n user: 'people',\n project: 'pr... | javascript | chosen |
[
{
"from": "system",
"value": "Remove rendering for debugging click handlers\n"
},
{
"from": "human",
"value": "import Prop from 'props/prop';\nimport canvas from 'canvas';\nimport mouse from 'lib/mouse';\n// http://stackoverflow.com/questions/16628184/add-onclick-and-onmouseover-to-canvas-elemen... | javascript | chosen |
[
{
"from": "system",
"value": "Enable every/some methods to return early to prevent iterating over entire array\n"
},
{
"from": "human",
"value": "// Arrays also come with the standard methods every and some. Both take a predicate function that, when called with an array element as argument, retu... | javascript | chosen |
[
{
"from": "system",
"value": "Remove unused command line options parsing code\n\nSigned-off-by: Sonmez Kartal <d2d15c3d37396a5f2a09f8b42cf5f27d43a3fbde@koding.com>\n"
},
{
"from": "human",
"value": "require('coffee-script').register();\n\nvar argv = require('minimist')(process.argv);\n\n// r... | javascript | chosen |
[
{
"from": "system",
"value": "Remove testing CachePath from example.\n"
},
{
"from": "human",
"value": "var app = module.exports = require('appjs').createApp({CachePath: '/Users/dbartlett/.cache1'});\n\napp.serveFilesFrom(__dirname + '/content');\n\nvar window = app.createWindow({\n width : 64... | javascript | chosen |
[
{
"from": "system",
"value": "Change the import path for log\n"
},
{
"from": "human",
"value": "import log from './lib/log';\n\nlet socket = root.io.connect('');\n\nsocket.on('connect', () => {\n log.debug('socket.io: connected');\n});\nsocket.on('error', () => {\n log.error('socket.io: er... | javascript | chosen |
[
{
"from": "system",
"value": "Watch dist files on browsersync\n"
},
{
"from": "human",
"value": "var webpack = require('webpack');\nvar BrowserSyncPlugin = require('browser-sync-webpack-plugin');\n\nmodule.exports = {\n context: __dirname,\n\n entry: './src/whoami.js',\n\n output: {\n pat... | javascript | chosen |
[
{
"from": "system",
"value": "Fix bug: export NGSI API also for widgets\n"
},
{
"from": "human",
"value": "(function () {\n\n \"use strict\";\n\n var key, manager = window.parent.NGSIManager, NGSIAPI = {};\n\n NGSIAPI.Connection = function Connection(url, options) {\n manager.Con... | javascript | chosen |
[
{
"from": "system",
"value": "Fix test so is timezone independent\n"
},
{
"from": "human",
"value": "'use strict';\n\nmodule.exports = function (t, a) {\n\tvar mayanEndOfTheWorld = new Date(2012, 11, 21, 1, 1);\n\n\ta.deep(t(mayanEndOfTheWorld, 'America/Guatemala').valueOf(),\n\t\tnew Date(2012,... | javascript | chosen |
[
{
"from": "system",
"value": "Remove params from login route.\n"
},
{
"from": "human",
"value": "var express = require('express');\nvar app = express();\n\nvar CurrentUser = require('../Architecture/CurrentUser').CurrentUser;\nvar WebService = require('../Architecture/WebService').WebService;\nv... | javascript | chosen |
[
{
"from": "system",
"value": "Set default token to empty string insted of null\n"
},
{
"from": "human",
"value": "\nimport 'babel-polyfill';\n\nimport { existsSync } from 'fs';\nimport { resolve } from 'path';\nimport merge from 'lodash.merge';\nimport TipsBot from './Tipsbot';\n\nconst tokenPat... | javascript | chosen |
[
{
"from": "system",
"value": "Use jQuery instead of document.getElementById.\n"
},
{
"from": "human",
"value": "//Memberlist JavaScript\n\nfunction hookUpMemberlistControls() {\n\t$(\"#orderBy,#order,#sex,#power\").change(function(e) {\n\t\trefreshMemberlist();\n\t});\n\n\t$(\"#submitQuery\").cl... | javascript | chosen |
[
{
"from": "system",
"value": "Fix chld-show command line usage\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar fs = require('fs');\n\nvar program = require('commander');\n\nprogram\n .option('-f, --file [filename]', 'Changelog filename', 'CHANGELOG.md')\n .parse(process.argv);\n\nfunct... | javascript | chosen |
[
{
"from": "system",
"value": "Convert ArrayBuffer to Blob in FormData\n"
},
{
"from": "human",
"value": "/*global window*/\nvar isBrowser = typeof window !== 'undefined' &&\n typeof window.FormData !== 'undefined';\n\n// use native FormData in a browser\nvar FD = isBrowser?\n w... | javascript | chosen |
[
{
"from": "system",
"value": "Fix file extension in file input\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport style from './style.css';\nimport Modal from 'react-modal';\n\nimport H1 from '../h1';\nimport ControllButton from '../controllButton';\nimport SelectedPrinters fr... | javascript | chosen |
[
{
"from": "system",
"value": "Change activity type selection on change event\n"
},
{
"from": "human",
"value": "Template.latestActivitiesByType.created = function () {\n // Create 'instance' variable for use througout template logic\n var instance = this;\n\n // Subscribe to all activity type... | javascript | chosen |
[
{
"from": "system",
"value": "Add error handling to Read book page\n"
},
{
"from": "human",
"value": "// @flow\n/**\n * Part of GDL gdl-frontend.\n * Copyright (C) 2017 GDL\n *\n * See LICENSE\n */\n\nimport * as React from 'react';\n\nimport { fetchBook } from '../../fetch';\nimport type { Book... | javascript | chosen |
[
{
"from": "system",
"value": "Fix For Loop to Iterate Every Link in Primary Nav\n"
},
{
"from": "human",
"value": "var fs = require('fs');\nvar links;\n\nfunction getLinks() {\n// Scrape the links from primary nav of the website\n var links = document.querySelectorAll('.nav-link.t-nav-link');... | javascript | chosen |
[
{
"from": "system",
"value": "Create modalOpen and modalClose events.\n"
},
{
"from": "human",
"value": "/* ========================================================================\n * Ratchet: modals.js v2.0.2\n * http://goratchet.com/components#modals\n * ======================================... | javascript | chosen |
[
{
"from": "system",
"value": "Fix fatal when matching null values in needle\n"
},
{
"from": "human",
"value": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root... | javascript | chosen |
[
{
"from": "system",
"value": "Remove the console log from a fixture.\n"
},
{
"from": "human",
"value": "const R = require('ramda')\n\nexport default async () => {\n console.log('1...2...3...')\n return R.range(1, 4)\n // return [1, 2, 3]\n}\n"
},
{
"from": "gpt",
"value": "const R... | javascript | chosen |
[
{
"from": "system",
"value": "Use appendChild instead of insertBefore for a small perfomance boost\n\n- Fixes #11\n"
},
{
"from": "human",
"value": "var hostname = location.hostname.replace(/^www\\./, '');\n\nvar style = document.createElement('link');\nstyle.rel = 'stylesheet';\nstyle.href = ch... | javascript | chosen |
[
{
"from": "system",
"value": "Use ES2015 destructuring and add memoization to dijkstra\n"
},
{
"from": "human",
"value": "import _ from 'lodash';\nimport {Graph, alg} from 'graphlib';\n\nconst dijkstra = alg.dijkstra;\n\nexport function setupGraph(relationships) {\n let graph = new Graph({\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Allow updeep to be require()’d from CommonJS"
},
{
"from": "human",
"value": "import constant from './constant';\nimport freeze from './freeze';\nimport is from './is';\nimport _if from './if';\nimport ifElse from './ifElse';\nimport map from './map';\nimport omit f... | javascript | chosen |
[
{
"from": "system",
"value": "Rename binary filename to gifsicle\n"
},
{
"from": "human",
"value": "'use strict';\nvar path = require('path');\nvar BinWrapper = require('bin-wrapper');\nvar pkg = require('../package.json');\n\nvar url = 'https://raw.githubusercontent.com/jihchi/giflossy-bin/v' +... | javascript | chosen |
[
{
"from": "system",
"value": "Update regexp for HTML strip\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar config = require('../config/configuration.js');\n\nfunction htmlReplace(str) {\n return str.replace(/<\\/?[a-z1-9]+(\\s+[a-z]+=[\"'](.*)[\"'])*\\/?>/g, ' ').replace(/ +/g, ' ').rep... | javascript | chosen |
[
{
"from": "system",
"value": "Correct spacing and language in comments\n"
},
{
"from": "human",
"value": "describe(\"About Expects\", function() {\n\n //We shall contemplate truth by testing reality, via spec expectations. \n it(\"should expect true\", function() {\n expect(false).toBeTrut... | javascript | chosen |
[
{
"from": "system",
"value": "feat(plugins): Add moduleURLs in addition to scriptURLs\n"
},
{
"from": "human",
"value": "export class OHIFPlugin {\n // TODO: this class is still under development and will\n // likely change in the near future\n constructor () {\n this.name = \"Un... | javascript | chosen |
[
{
"from": "system",
"value": "Add Jonathan Schwartz as fund in mirage factory\n"
},
{
"from": "human",
"value": "import { Factory, faker } from 'ember-cli-mirage';\n\nexport default Factory.extend({\n fund: () => faker.random.arrayElement([\"WNYC\", \"WQXR\", \"Radiolab\"]),\n orderPrice: () =... | javascript | chosen |
[
{
"from": "system",
"value": "Handle correctly error from epubcheck\n"
},
{
"from": "human",
"value": "var _ = require('lodash');\nvar path = require('path');\nvar exec = require('child_process').exec;\n\nvar LOG_TYPES = [\n\t\"ERROR\", \"WARNING\"\n];\n\n\nmodule.exports = function(filepath, op... | javascript | chosen |
[
{
"from": "system",
"value": "Speed up the download menu appear/disappear a bit\n"
},
{
"from": "human",
"value": "function show_download_menu() {\n $('#download-menu').slideDown();\n setTimeout(hide_download_menu, 20000);\n $('#download-link').html('cancel');\n}\n\nfunction hide_download_men... | javascript | chosen |
[
{
"from": "system",
"value": "Add vault url config environment variable\n"
},
{
"from": "human",
"value": "\nmodule.exports = {\n Urls: {\n vault_base_url: '',\n base_url: process.env.BASE_URL || process.env.HUBOT_ROOT_URL\n },\n Strings: {\n sorry_dave: 'I\\'m sorry %s, I\\'m afraid... | javascript | chosen |
[
{
"from": "system",
"value": "Fix typo in setting default time zone for game\n\nClose #110\n"
},
{
"from": "human",
"value": "utils = {\n startsAtMomentWithOffset: function (game) {\n var offset = game.location.utc_offset;\n if (! Match.test(offset, UTCOffset)) {\n offset: -8; // Def... | javascript | chosen |
[
{
"from": "system",
"value": "Add route for example structures, and home page\n"
},
{
"from": "human",
"value": "// @flow\nimport React from 'react';\nimport { Route, IndexRoute } from 'react-router';\nimport App from './containers/App';\nimport VerticalTree from './containers/VerticalTree';\n\n... | javascript | chosen |
[
{
"from": "system",
"value": "Update CLI based on @sindresorhus feedback\n\n* don't use flagged args for file and selector\n* exit properly if error opening file\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\nvar oust = require('../index');\nvar pkg = require('../package.json');\nvar ... | javascript | chosen |
[
{
"from": "system",
"value": "refactor: Merge request now exports its desired collection name\n"
},
{
"from": "human",
"value": "const mongoose = require('mongoose');\nconst Schema = mongoose.Schema;\n\nmodule.exports = new Schema({\n merge_request: {\n id: Number,\n url: String,\n tar... | javascript | chosen |
[
{
"from": "system",
"value": "Add spec for numbers divisible by 5\n"
},
{
"from": "human",
"value": "describe('pingPongOutput', function() {\n it(\"is the number for most input numbers\", function() {\n expect(pingPongOutput(2)).to.equal(2);\n });\n\n it(\"is 'ping' for numbers divisible b... | javascript | chosen |
[
{
"from": "system",
"value": "Fix typo in sg context menu selector\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nangular.module('arethusa.sg').directive('sgContextMenuSelector', [\n 'sg',\n function(sg) {\n return {\n restrict: 'A',\n scope: {\n obj: '='\n },\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add tactile id to output"
},
{
"from": "human",
"value": "'use strict';\nconst CLI = require('clui');\nconst clc = require('cli-color');\nconst gauge = CLI.Gauge;\nconst Line = CLI.Line;\n\nmodule.exports = function (tactile, max) {\n\tif (!tactile) {\n\t\treturn ne... | javascript | chosen |
[
{
"from": "system",
"value": "Add comment about real data\n"
},
{
"from": "human",
"value": "'use strict';\n\n/* Services */\n\nvar splitcoinServices = angular.module('splitcoin.services', ['ngResource']);\n\n// Demonstrate how to register services\n// In this case it is a simple value service.\... | javascript | chosen |
[
{
"from": "system",
"value": "Add JS hack cuz Bootstrap don't work right with collapsible.\n"
},
{
"from": "human",
"value": "/* expand_contract_toggle.js: Support for show more/hide more in lists of umlaut content.\n \n The JS needs to swap out the image for expand/contract toggle. AND we n... | javascript | chosen |
[
{
"from": "system",
"value": "Fix mouse events in arethusaGridHandle\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nangular.module('arethusa.core').directive('arethusaGridHandle', [\n function() {\n return {\n restrict: 'E',\n scope: true,\n link: function(scope, elemen... | javascript | chosen |
[
{
"from": "system",
"value": "Use yaml safeLoad instead of load"
},
{
"from": "human",
"value": "const yaml = require('js-yaml');\nconst ignore = require('ignore');\n\nmodule.exports = robot => {\n robot.on('pull_request.opened', autolabel);\n robot.on('pull_request.synchronize', autolabel);\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add reference to allowed sources\n"
},
{
"from": "human",
"value": "import dotenv from \"dotenv\";\nimport moment from \"moment\";\n\ndotenv.load();\n\nexport const MONGODB_URL = process.env.MONGODB_URL || \"mongodb://localhost:27017/test\";\nexport const KINESIS_ST... | javascript | chosen |
[
{
"from": "system",
"value": "Fix error in IE8 \"attr(...)' is null or not an object\"\n"
},
{
"from": "human",
"value": "(function($, window, document, undefined) {\n\n $.rapido_Utilities = {\n\n // Get class of element object\n getClass: function(el) {\n el = $(el).attr('class').re... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"feat: make results cacheable\"\n\nThis reverts commit 43ac8eee4f33ac43c97ed6831a3660b1387148cb.\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nvar glob = require(\"glob\");\nvar path = require(\"path\");\n\nmodule.exports = function (content, sourceM... | javascript | chosen |
[
{
"from": "system",
"value": "Fix relative path being relative to install location and not requesting file\n\nFixes #2.\n"
},
{
"from": "human",
"value": "var fs = require('fs'),\n path = require('path')\n\nmodule.exports = function (target) {\n var directory = path.dirname(module.parent.fil... | javascript | chosen |
[
{
"from": "system",
"value": "Fix planning page on Safari\n\nnew Date(\"…\") cannot parse ISO8601 with a timezone on certain non-fully\nES5 compliant browsers\n"
},
{
"from": "human",
"value": "App.Views.PlanningView = Backbone.View.extend({\n\n className: 'planning',\n\n initialize: funct... | javascript | chosen |
[
{
"from": "system",
"value": "Define 'name' on the prototype instead of constructor\n"
},
{
"from": "human",
"value": "export function ValidationError(message, details = {}) {\n const {\n columns = {},\n value = null\n } = details;\n\n this.message = message;\n this.col... | javascript | chosen |
[
{
"from": "system",
"value": "Use `xtend` to add a property to tasks, add view to show state\n\nState is not being saved anywhere.\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst choo = require('choo');\nconst html = require('choo/html');\nconst app = choo();\n\n\napp.model({\n state:... | javascript | chosen |
[
{
"from": "system",
"value": "Fix to use `html` outputFormat"
},
{
"from": "human",
"value": "'use strict';\n\nvar eco = require('eco');\n\nexports.name = 'eco';\nexports.outputFormat = 'xml';\nexports.compile = eco;\n"
},
{
"from": "gpt",
"value": "'use strict';\n\nvar eco = require... | javascript | chosen |
[
{
"from": "system",
"value": "Change default route to pages/home\n"
},
{
"from": "human",
"value": "'use strict';\n\n/**\n * @ngdoc Main App module\n * @name app\n * @description Main entry point of the application\n *\n */\nangular.module('app', [\n 'ui.router', 'ui.bootstrap',\n 'app.environ... | javascript | chosen |
[
{
"from": "system",
"value": "Create loadMap function to load map images\n"
},
{
"from": "human",
"value": "function ImageFile(_game) {\r\n\tthis.game = _game;\r\n\tthis.name = new Array();\r\n\tthis.data = new Array();\r\n\tthis.counter = 0;\r\n\t\r\n\treturn this;\r\n};\r\n\t\r\nImageFile.prot... | javascript | chosen |
[
{
"from": "system",
"value": "Fix module resolution for npm 3+\n"
},
{
"from": "human",
"value": "var babelPresetEs2015,\n commonJsPlugin,\n es2015PluginList,\n es2015WebpackPluginList;\n\nbabelPresetEs2015 = require('babel-preset-es2015');\n\ntry {\n // npm ^2\n commonJsPlugin = ... | javascript | chosen |
[
{
"from": "system",
"value": "Remove let until upstream Ember-CLI issue is fixed\n"
},
{
"from": "human",
"value": "/* jshint node: true */\n'use strict';\nvar request = require('request');\nvar BasePlugin = require('ember-cli-deploy-plugin');\n\nmodule.exports = {\n name: 'ember-cli-deploy-cdn... | javascript | chosen |
[
{
"from": "system",
"value": "Use request and allow passing object\n"
},
{
"from": "human",
"value": "var url = require('url')\n\nmodule.exports = function(uri, cb) {\n var parsed\n try {\n parsed = url.parse(uri)\n }\n catch (err) {\n return cb(err)\n }\n\n if (!parsed.host) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Allow configuration of property name and config path in app *build options* (ember-cli-build.js)\n"
},
{
"from": "human",
"value": "/* eslint-env node */\n'use strict';\n\nmodule.exports = {\n name: 'ember-cli-flagpole',\n\n flagpoleConfigPath: 'config/flagpole',\... | javascript | chosen |
[
{
"from": "system",
"value": "Include the missing `see` function\n"
},
{
"from": "human",
"value": "\"use strict\"\n\nconst examine = require(\"./lib/examine\")\nconst inspect = require(\"./lib/inspect\")\nconst isPlainObject = require(\"./lib/is-plain-object\")\nconst whereAll = require(\"./lib... | javascript | chosen |
[
{
"from": "system",
"value": "Align to grid before placing object\n"
},
{
"from": "human",
"value": "import Phaser from 'phaser';\n\nexport default class extends Phaser.Sprite {\n constructor(game, x, y, sprite, frame) {\n super(game, x, y, sprite, frame);\n\n this.anchor.setTo(0.5, 0.5);... | javascript | chosen |
[
{
"from": "system",
"value": "Add serialization and deserlization for User\n\nSerialization step: get the user.id as a cookie value and send it back to the client for later user.\nDeserialization: client sends make a request with cookie value that can be turned into an actual user instance."
},
{
"f... | javascript | chosen |
[
{
"from": "system",
"value": "Fix temporary build label init process\n"
},
{
"from": "human",
"value": "/*\n * JBoss, Home of Professional Open Source.\n * Copyright 2014-2018 Red Hat, Inc., and individual contributors\n * as indicated by the @author tags.\n *\n * Licensed under the Apache Licen... | javascript | chosen |
[
{
"from": "system",
"value": "Use spread syntax instead of Object.assign\n"
},
{
"from": "human",
"value": "const colors = {\n red: '#e42d40',\n white: '#ffffff',\n veryLightGray: '#ededed',\n lightGray: '#cccccc',\n gray: '#888888',\n darkGray: '#575757'\n}\n\nconst brandPreferences = {\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add pagination support to API\n"
},
{
"from": "human",
"value": "(function() {\n 'use strict';\n\n var app = angular.module('radar.auth');\n\n app.factory('authService', function(session, $q, store, adapter) {\n return {\n login: login\n };\n\n func... | javascript | chosen |
[
{
"from": "system",
"value": "Remove unnecessary instance methods of collection\n"
},
{
"from": "human",
"value": "var TreeModel = require('tree-model');\n\nmodule.exports = function(DataTypes) {\n return [{\n name: {\n type: DataTypes.STRING,\n allowNull: false\n }\n }, {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use __dirname when setting the root\n"
},
{
"from": "human",
"value": "// require Johnny's static\nvar JohhnysStatic = require(\"../index\")\n\n // require http\n , http = require('http');\n\n// set static server: public folder\nJohhnysStatic.setStaticServer({ro... | javascript | chosen |
[
{
"from": "system",
"value": "Check output is valid css in test cases\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst cp = require('child_process');\nconst sass = require('../');\n\nconst root = path.resolve(__dirname, './test-c... | javascript | chosen |
[
{
"from": "system",
"value": "Add an action that redirects to a missing route\n"
},
{
"from": "human",
"value": "import AppController from './AppController'\n\nexport default class DefaultController extends AppController {\n async indexAction(context) {\n return context.redirectToRoute('hell... | javascript | chosen |
[
{
"from": "system",
"value": "Add test cases for utility functions\n"
},
{
"from": "human",
"value": "import assert from 'power-assert';\nimport { camelToKebab } from '../src/utils';\n\ndescribe('utils', () => {\n it('translates camelCase to kebab-case', () => {\n assert(camelToKebab('camelC... | javascript | chosen |
[
{
"from": "system",
"value": "Fix the populate query on update\n"
},
{
"from": "human",
"value": "'use strict';\nvar P = require('bluebird');\nvar _ = require('lodash');\nvar Schemas = require('../generators/schemas');\n\nfunction ResourceUpdater(model, params) {\n var schema = Schemas.schemas[... | javascript | chosen |
[
{
"from": "system",
"value": "Disable chrome sandbox in tests"
},
{
"from": "human",
"value": "import puppeteer from 'puppeteer';\n\nexport async function evaluatePage (url, matches, timeout = 4000) {\n const args = await puppeteer.defaultArgs();\n const browser = await puppeteer.launch({\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use arrow functions instead of `function` keyword"
},
{
"from": "human",
"value": "'use strict';\n\nconst debug = require('debug')('calendar:routes:year');\nconst express = require('express');\nconst common = require('./common');\nconst monthRouter = require('./mont... | javascript | chosen |
[
{
"from": "system",
"value": "Add auth-cookie options to SSR.\n"
},
{
"from": "human",
"value": "var ssr = require('done-ssr-middleware');\n\nmodule.exports = ssr({\n config: __dirname + \"/package.json!npm\",\n main: \"bitcentive/index.stache!done-autorender\",\n liveReload: true\n});\n"
}... | javascript | chosen |
[
{
"from": "system",
"value": "Update logging to return this.\n"
},
{
"from": "human",
"value": "function log(level, msg) {\n var args = [level].concat([].slice.call(msg));\n console.log.apply(console, args); // eslint-disable-line no-console\n}\n\nexport var None = 0;\nexport var Warn = 1;\n... | javascript | chosen |
[
{
"from": "system",
"value": "Return less info to the user when verifying\n"
},
{
"from": "human",
"value": "const Route = require('../structures/Route');\n\nclass verifyGET extends Route {\n\tconstructor() {\n\t\tsuper('/verify', 'get');\n\t}\n\n\trun(req, res, user) {\n\t\treturn res.json({\n\... | javascript | chosen |
[
{
"from": "system",
"value": "Add `-rc.n` suffix to `modules-runtime`.\n"
},
{
"from": "human",
"value": "Package.describe({\n name: \"modules-runtime\",\n version: \"0.7.10\",\n summary: \"CommonJS module system\",\n git: \"https://github.com/benjamn/install\",\n documentation: \"README.md... | javascript | chosen |
[
{
"from": "system",
"value": "Rename Store into MongoStore to pass JSLint\n"
},
{
"from": "human",
"value": "'use strict';\n\n/*\n** Module dependencies\n*/\nvar mongoose = require('mongoose');\nvar util = require('util');\n\nvar TTL = 24*3600;\n\nvar Schema = new mongoose.Schema({\n sid: { t... | javascript | chosen |
[
{
"from": "system",
"value": "Comment on why the closure was used.\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nvar commonmark = require(\"commonmark\");\n\nvar markdownTransform = function(){\n let reader = new commonmark.Parser();\n let writer = new commonmark.HtmlRenderer({\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Call _super so that we don't stomp on headers returned by other mixins\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport config from 'ember-get-config';\n\nconst {\n 'ember-new-version-detection': {\n appName,\n },\n} = config;\n\nconst {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Change text for hover over rate your pup\n"
},
{
"from": "human",
"value": "/**\n * Created by mcgourtyalex on 4/14/15.\n */\n\nvar MainButtons = {\n\n // setup sets a callback for #breeder_find keyup\n setup: function() {\n $('.button-a').hover( functi... | javascript | chosen |
[
{
"from": "system",
"value": "Add constant & function for dev.\n"
},
{
"from": "human",
"value": "function getRandomLatLng(map) {\n var bounds = map.getBounds(),\n southWest = bounds.getSouthWest(),\n northEast = bounds.getNorthEast(),\n lngSpan = northEast.lng - southWest.lng,\n... | javascript | chosen |
[
{
"from": "system",
"value": "Fix but with reset always triggering\n"
},
{
"from": "human",
"value": "let videoImage = document.getElementById('video_image');\nvideoImage.src = `http://${document.domain}:8080/?action=stream`;\nlet cameraJoystick = {\n zone: videoImage,\n color: 'red'\n};\... | javascript | chosen |
[
{
"from": "system",
"value": "Update dramactrl to fetch dramas from api using restangular\n"
},
{
"from": "human",
"value": "App.controller('DramasCtrl', [ '$http', function($http, $q) {\n var dramas = this;\n dramas.list1 = 'Drag and Drop with default confirmation';\n \n dramas.items = [];\... | javascript | chosen |
[
{
"from": "system",
"value": "Fix non-logged in error when visiting a profile.\n"
},
{
"from": "human",
"value": "'use strict';\n\nangular.module('webClientApp')\n .controller('ProfileCtrl', ['$scope', '$rootScope', '$location', '$routeParams', 'UserArticle', 'UserDraft', 'User',\n functio... | javascript | chosen |
[
{
"from": "system",
"value": "Add lang property to the html tag\n"
},
{
"from": "human",
"value": "import React, { PropTypes } from 'react'\n\nexport default class Html extends React.Component {\n render ({ children, assets, title } = this.props) {\n return (\n <html>\n <head>\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use div to fix centering\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nconst { Component } = Ember;\n\nexport default Component.extend({\n tagName: 'box'\n});\n"
},
{
"from": "gpt",
"value": "import Ember from 'ember';\nconst { Componen... | javascript | chosen |
[
{
"from": "system",
"value": "Remove the metricFeeder for the overflow items too for now.\n"
},
{
"from": "human",
"value": "import React from 'react';\n\nimport metricFeeder from '../../hoc/metric-feeder';\nimport { formatMetric } from '../../utils/string-utils';\n\nfunction NodeDetailsHealthOv... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.