conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Increase number of search results\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\n\nfunction keywordMatches (keyword='', query='') {\n let normalizedQuery = query.toLowerCase().replace(/\\W*/, '');\n return keyword.replace(/_/g, '').indexOf(normaliz... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"Refactoring of various aspects of this directive\"\n"
},
{
"from": "human",
"value": "angular.module('eee-c.angularBindPolymer', [])\n .directive('bindPolymer', function() {\n 'use strict';\n return {\n restrict: 'A',\n link: function($scop... | javascript | chosen |
[
{
"from": "system",
"value": "Fix hardcoded redirect URL; redirect to current page on oauth completion\n"
},
{
"from": "human",
"value": "girder.views.oauth_LoginView = girder.View.extend({\n events: {\n 'click .g-oauth-button': function (event) {\n var provider = $(event.cu... | javascript | chosen |
[
{
"from": "system",
"value": "Add workaround for Node v0.10\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar repl = require( './../lib' );\n\n// Start the REPL:\nvar r = repl();\n\n// After the REPL has started, exit the process...\nsetTimeout( onTimeout, 2500 );\n\nfunction onTimeout() {... | javascript | chosen |
[
{
"from": "system",
"value": "Add newlines between file contents\n"
},
{
"from": "human",
"value": "var fs = require('fs'),\n path = require('path');\n\nfunction stripExports(string) {\n var match = string.match(/\\/\\/ <browser>([\\s\\S]*)\\/\\/ <\\/browser>/);\n return (match ? matc... | javascript | chosen |
[
{
"from": "system",
"value": "Add es6 spread copy example\n"
},
{
"from": "human",
"value": "// 06 - Callee-evaluated default parameter values.\n\n// Default params\n\nfunction mul(a, b = 100) {\n return a * b;\n}\nconsole.log(\"MUL: \", mul(5));\n\nfunction sum(a, b = getSum()) {\n return a +... | javascript | chosen |
[
{
"from": "system",
"value": "Remove unnecessary constructor callback on Kiel\n"
},
{
"from": "human",
"value": "var Sydney = require(\"sydney\")\nvar PortScanner = require(\"./src/port-scanner\")\nvar HostScanner = require(\"./src/host-scanner\")\n\nvar Kiel = function () {\n this.link(new Por... | javascript | chosen |
[
{
"from": "system",
"value": "Use platform-agnostic file path constructor\n"
},
{
"from": "human",
"value": "var fs = require('fs'),\n _ = require('lodash');\n\nfolders = fs.readdirSync(process.cwd());\n\nthemes = _(folders).reject(function(file) {\n var stats = fs.statSync(file),\n rej... | javascript | chosen |
[
{
"from": "system",
"value": "Remove custom message from shouldThrowError (not needed)\n"
},
{
"from": "human",
"value": "var chimneypot = require('./index.js');\n\n// Empty constructor\nshouldThrowError(function() {\n new chimneypot();\n});\n\n// No port\nshouldThrowError(function() {\n new c... | javascript | chosen |
[
{
"from": "system",
"value": "Change theme color to green and blue\n"
},
{
"from": "human",
"value": "/* eslint-disable no-underscore-dangle */\n\nimport { SheetsRegistry } from 'jss';\nimport { createMuiTheme, createGenerateClassName } from 'material-ui/styles';\nimport purple from 'material-ui... | javascript | chosen |
[
{
"from": "system",
"value": "Set image max limit for proto\n"
},
{
"from": "human",
"value": "const $answer = $('.answer')\nconst {makeRichText} = require('./rich-text-editor')\n\nconst save = ($elem, async = true) => $.post({\n url: '/save',\n data: {text: $elem.html(), answerId: $elem.a... | javascript | chosen |
[
{
"from": "system",
"value": "[test] Use commonjs module system for mocks.\n"
},
{
"from": "human",
"value": "/**\n * Trickery to ensure that the mock is the default export.\n */\n\nexport default jest.fn()\n"
},
{
"from": "gpt",
"value": "/**\n * Trickery to ensure that the mock is ... | javascript | chosen |
[
{
"from": "system",
"value": "Add github api and username options\n"
},
{
"from": "human",
"value": "export default {\n authToken: process.env.AUTH_TOKEN || 'secret',\n env: process.env.NODE_ENV,\n host: process.env.HOST || 'localhost',\n mongo: {\n url: process.env.MONGO_URL || 'mongodb:... | javascript | chosen |
[
{
"from": "system",
"value": "Fix bad dialect : mysql -> postgres\n"
},
{
"from": "human",
"value": "module.exports = {\n development: {\n username: \"cyrilcanete\",\n password: null,\n database: \"cyrilcanete\",\n host: \"localhost\",\n port: \"5432\",\n dialect: \"postgres\"... | javascript | chosen |
[
{
"from": "system",
"value": "Add import for db and close it at the end of the request\n"
},
{
"from": "human",
"value": "\n\nmodule.exports = {\n\n setupRestApiGet : function(app) {\n\n // get sent a lat, long, send all items near it\n app.get('/parkItems', function(req, res) {... | javascript | chosen |
[
{
"from": "system",
"value": "Use report instead of console\n"
},
{
"from": "human",
"value": "import React from \"react\";\nimport Pin from \"./Pin\";\n\nexport default function pinned(Component) {\n let f = function(props) {\n if (!props.coords) {\n console.error(\n `Missing \"... | javascript | chosen |
[
{
"from": "system",
"value": "Enhance tests up to changes in dbjs-persistence\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar resolve = require('path').resolve\n , rmdir = require('fs2/rmdir')\n , getTests = require('dbjs-persistence/test/_common')\n\n , dbPath = resolve(__dirname... | javascript | chosen |
[
{
"from": "system",
"value": "Add failing blank string test\n"
},
{
"from": "human",
"value": "var caps = require('../');\nvar test = require('tape');\n\ntest('works', function(t) {\n var TEST_ARRAY = [\n ['kitten', 0.0],\n ['Kitten', 1 / 6.0],\n ['KItten', 1 / 3.0],\n ['KITten', 0.... | javascript | chosen |
[
{
"from": "system",
"value": "Fix test dataabse configuration and enhance tests\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar getTests = require('dbjs-persistence/test/_common')\n\n , env, copyEnv, tests;\n\ntry {\n\tenv = require('../env');\n} catch (e) {\n\tenv = null;\n}\n\nif (env... | javascript | chosen |
[
{
"from": "system",
"value": "Set default settings on install\n"
},
{
"from": "human",
"value": "function onInstalled(e) {\n if (e.reason === 'install') {\n chrome.tabs.create({\n \"url\": `../pages/welcome/welcome.html?reason=install`\n })\n } else if (e.reason === 'updated') {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix issue where Utils.extend did not properly extend sub-objects\n"
},
{
"from": "human",
"value": "/* exported Utils */\n\n/**\n * Simple utility class.\n */\nclass Utils {\n\n\t/**\n\t * Extends an object with the members of another.\n\t *\n\t * @param {Object} a ... | javascript | chosen |
[
{
"from": "system",
"value": "Remove es6 template string usage\n"
},
{
"from": "human",
"value": "var util = require('util')\n\nfunction InvalidDependencyError (dependency, requiredVersion, installedVersion) {\n // Super constructor\n Error.call(this)\n\n // Super helper method to include sta... | javascript | chosen |
[
{
"from": "system",
"value": "Add /fonts to fix ui date bug\n"
},
{
"from": "human",
"value": "module.exports = exports = {\n injection : {\n route: [\n { name: \"frontend\", object: \"FrontendRoute.js\" },\n { name: \"error\", object: \"ErrorRoute.js\" }\n ]\n },\n publicRout... | javascript | chosen |
[
{
"from": "system",
"value": "Add title to page + notice about storage/processing\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nvar React = require('react')\n , h = require('react-hyperscript')\n\nmodule.exports = React.createClass({\n displayName: 'Main',\n\n getInitialState() {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add IS breaking news ticker\n"
},
{
"from": "human",
"value": "$(function() {\n // Main body titles\n $('a h2, a h3, h2 a, h3 a').satanify();\n\n // Sidebar most read\n $('h2.currentlyread').satanify();\n $('[id^=mostRead_] .numberbullet-list li a').satanify(' ... | javascript | chosen |
[
{
"from": "system",
"value": "Remove -beta.n suffix from minifier-css before republishing.\n"
},
{
"from": "human",
"value": "Package.describe({\n summary: \"CSS minifier\",\n version: \"1.2.16-beta.1\"\n});\n\nNpm.depends({\n \"css-parse\": \"2.0.0\",\n \"css-stringify\": \"2.0.0\"\n});\n\n... | javascript | chosen |
[
{
"from": "system",
"value": "Remove text property from theme customisation\n"
},
{
"from": "human",
"value": "import React from 'react';\n\nimport { flavourOptions } from '../data';\nimport Select from '../../src';\n\nexport default () => (\n <Select\n defaultValue={flavourOptions[2]}\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix Monitors not receiving the value\n"
},
{
"from": "human",
"value": "import React from 'react';\n\nexport const sideMonitors = [\n ['LogMonitor', 'Log Monitor'],\n ['DiffMonitor', 'Diff Monitor'],\n ['ChartMonitor', 'Chart Monitor']\n];\n\nexport const bottomM... | javascript | chosen |
[
{
"from": "system",
"value": "Hide link when game has started\n"
},
{
"from": "human",
"value": "const h = require('virtual-dom/h');\n\nmodule.exports = function (data) {\n const {gameID, game} = data;\n return h('div', {className: 'room'}, [\n game.playing ? null : h('form', {id: 'setup', ... | javascript | chosen |
[
{
"from": "system",
"value": "Add shebang to node test runner"
},
{
"from": "human",
"value": "var QUnit = require('qunitjs');\nvar chalk = require('chalk');\nvar path = require('path');\nvar glob = require('glob');\n\nQUnit.moduleStart(function(details) {\n if (details.name) {\n console.log... | javascript | chosen |
[
{
"from": "system",
"value": "Change node-dir options to disable recursion to have a more predictable behaviour\n"
},
{
"from": "human",
"value": "import safeEval from 'safe-eval';\nimport dir from 'node-dir';\nimport path from 'path';\nimport {ipcRenderer} from 'electron';\nconst babel = requir... | javascript | chosen |
[
{
"from": "system",
"value": "Add test to check if the HTML component is built with an empty attribute name\n"
},
{
"from": "human",
"value": "'use strict';\nimport { HTMLComponent } from './HTML';\nimport { components as comps } from './fixtures/index';\nimport { Harness } from '../../../test/h... | javascript | chosen |
[
{
"from": "system",
"value": "Fix server listening port issue"
},
{
"from": "human",
"value": "var host = (process.env.VCAP_APP_HOST || 'localhost');\r\nvar port = (process.env.VCAP_APP_PORT || 8080);\r\nvar http = require('http');\r\n\r\nvar days = [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thu... | javascript | chosen |
[
{
"from": "system",
"value": "Use props instead of state\n"
},
{
"from": "human",
"value": "import { h } from 'preact'\n\nimport Nav from '../components/Nav'\nimport Loading from '../components/Loading'\n\nimport displayDate from '../helpers/display-date'\n\nconst Wrapper = (props) => {\n let t... | javascript | chosen |
[
{
"from": "system",
"value": "fix: Move attributes to const since they don't change.\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport CircularProgress from 'material-ui/CircularProgress';\n\nexport default function LoadingSpinner (props) {\n return (\n <div style={{ widt... | javascript | chosen |
[
{
"from": "system",
"value": "Send error on unknown error\n"
},
{
"from": "human",
"value": "const hookRouter = require('./hooks')\n\nmodule.exports = exports = app => {\n app.use('/api/v1', hookRouter)\n\n app.get('/api/v1/hello-world', (req, res) => {\n return res.status(200).json({ messa... | javascript | chosen |
[
{
"from": "system",
"value": "Rewrite FormattedMessage to fix react-docgen\n"
},
{
"from": "human",
"value": "import { createElement, isValidElement } from 'react';\nimport PropTypes from 'prop-types';\nimport format from 'format-message';\n\nexport default function FormattedMessage({ message, v... | javascript | chosen |
[
{
"from": "system",
"value": "Fix Guide Text not showing up\n"
},
{
"from": "human",
"value": "Mx.doAfterRouterLoad(function(){\n $(\"[data-textfield]\").each(function() {\n var $guideText = $(this).data(\"text-field\");\n\n if (!$(this).isMeteorOnce(\"text-field\")) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix no target provided errors. Apparently target in “this” context here is some other object so renamed it."
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport urlRegex from 'ember-linkify/utils/url-regex';\n\nexport function linkify(textToLinkify, t... | javascript | chosen |
[
{
"from": "system",
"value": "Add canceledDate on booking order item\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar BaseModel = require('model-toolkit').BaseModel;\nvar BookingItem = require('./booking-order-item');\n\nmodule.exports = class BookingOrder extends BaseModel {\n constru... | javascript | chosen |
[
{
"from": "system",
"value": "Create items of GeoNames locations\n"
},
{
"from": "human",
"value": "(function(app) {\n 'use strict';\n\n var Events = app.Events || require('../base/events.js');\n\n var GeoNamesLocations = function() {\n this._enabled = false;\n this._events = new Events... | javascript | chosen |
[
{
"from": "system",
"value": "Add the ability to use wildcard in white/black lists\n"
},
{
"from": "human",
"value": "/**\n * Creates an array from list using \\n as delimiter\n * and checks if any element in list is contained in the url.\n *\n * @param url\n * @param list\n * @returns {boolean}... | javascript | chosen |
[
{
"from": "system",
"value": "Add correct documentation for variantForOptions from product helpers\n"
},
{
"from": "human",
"value": "/**\n * @namespace ProductHelpers\n */\nexport default {\n\n /**\n * Returns the variant of a product corresponding to the options given.\n *\n * @example\... | javascript | chosen |
[
{
"from": "system",
"value": "Watch for broken white space changes\n"
},
{
"from": "human",
"value": "module.exports = {\n\tjs: {\n\t\tfiles: [\n\t\t\t'Gruntfile.js',\n\t\t\t'package.json',\n\t\t\t'<%= source %>/js/**/*.js',\n\t\t\t'tests/**/*.js'\n\t\t],\n\t\ttasks: [\n\t\t\t'jshint',\n\t\t\t'n... | javascript | chosen |
[
{
"from": "system",
"value": "Change Object.entries() to ES5 compatible method.\n"
},
{
"from": "human",
"value": "/**\n * Identical to `Array.prototype.map()` except for object values.\n * @param {Object} object - The object whose values will be mapped.\n * @param {Function} callback - The call... | javascript | chosen |
[
{
"from": "system",
"value": "Use test workspace when testing the ide\n"
},
{
"from": "human",
"value": "#! /usr/bin/env node\n\nvar path = require(\"path\");\nvar codebox = require(\"../lib\");\n\ncodebox.start({\n port: 3000,\n root: path.resolve(__dirname, \"../\")\n})\n.fail(function(e... | javascript | chosen |
[
{
"from": "system",
"value": "chore(karma): Update adapter selection to 0.9.x\n"
},
{
"from": "human",
"value": "// Karma configuration\n\n\n// base path, that will be used to resolve files and exclude\nbasePath = '';\n\n\n// list of files / patterns to load in the browser\nfiles = [\n MOCHA,\n... | javascript | chosen |
[
{
"from": "system",
"value": "Allow DebuggerComponent to take external props"
},
{
"from": "human",
"value": "/** @babel */\n/** @jsx etch.dom */\n\nimport etch from 'etch'\n\nconst style = {\n position: 'fixed',\n zIndex: 100000000,\n backgroundColor: 'white',\n minWidth: '100px',\n minHei... | javascript | chosen |
[
{
"from": "system",
"value": "Fix NL local-time months names being off-by-one\n"
},
{
"from": "human",
"value": "/* globals I18n LocalTime */\n\nif (I18n.translations.nl) {\n LocalTime.config.i18n['nl'] = {\n date: {\n dayNames: I18n.translations.nl.date.day_names,\n abbrDayNames: ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix not shutting down after last change.\n"
},
{
"from": "human",
"value": "module.exports = function(sails) {\n return {\n initialize: function(cb) {\n sails.on('app:bootstrap', function() {\n LogService.create('System started', ... | javascript | chosen |
[
{
"from": "system",
"value": "Move npmbrew to home path\n"
},
{
"from": "human",
"value": "var path = require(\"path\")\n\nmodule.exports = {\n url : \"http://registry.npmjs.org/npm/\",\n pkg : require(path.join(__dirname, \"../package.json\")),\n dirname : {\n current : path.join(__dirnam... | javascript | chosen |
[
{
"from": "system",
"value": "Clean up, Clean up, Clean up!\n"
},
{
"from": "human",
"value": "function string_to_color(str,options){this.hash=function(str){var h=0;for(var i=0;i<str.length;i++)h=str.charCodeAt(i)+((h<<5)-h);return h};this.shade=function(color,percent){var num=parseInt(color,16)... | javascript | chosen |
[
{
"from": "system",
"value": "Stop button should only stop.\n"
},
{
"from": "human",
"value": "chrome.runtime.onMessage.addListener( function(request, sender, sendResponse){\r\n var click_event = new MouseEvent('click', {\r\n 'view': window,\r\n 'bubbles': true,\r\n 'canc... | javascript | chosen |
[
{
"from": "system",
"value": "Make registering as a subscriber or publisher an option for the streaming API\n"
},
{
"from": "human",
"value": "var Topic = require('../core/Topic');\nvar DuplexStream = require('stream').Duplex;\n\n/**\n * Publish a connected ROS topic to a duplex\n * stream. This... | javascript | chosen |
[
{
"from": "system",
"value": "Set useLint to true by default.\n"
},
{
"from": "human",
"value": "var lint = require('./lint');\nvar clean = require('./clean');\nvar compile = require('./compile');\nvar copy = require('./copy');\n\nvar runSequence = require('run-sequence');\n\nexports.config = fu... | javascript | chosen |
[
{
"from": "system",
"value": "Refactor function for rounding currency\n"
},
{
"from": "human",
"value": "/*\n Returns letters with currencies to shorten them.\n Taken from: http://stackoverflow.com/questions/36734201/how-to-convert-numbers-to-million-in-javascript\n */\nexport default function... | javascript | chosen |
[
{
"from": "system",
"value": "[fix] Make sure that formatting of %s still works as intended\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar enabled = require('enabled');\n\n/**\n * Bare minimum browser version of diagnostics. It doesn't need fancy pancy\n * detection algorithms. The code... | javascript | chosen |
[
{
"from": "system",
"value": "Add test to show parser crash.\n"
},
{
"from": "human",
"value": "/**\n * this is TestGuessReturn.\n */\nexport default class TestGuessReturn {\n method1(){\n return 123;\n }\n\n method2(){\n return [123, 456];\n }\n\n method3(){\n return {x1: 123, x2:... | javascript | chosen |
[
{
"from": "system",
"value": "Remove person resource methods for photo\n\nUser photos are only fetched by img tags\n"
},
{
"from": "human",
"value": "/*\n * Copyright 2016 Studentmediene i Trondheim AS\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use ... | javascript | chosen |
[
{
"from": "system",
"value": "Format and update the secure ping url\n"
},
{
"from": "human",
"value": "angular.module( 'sample.home', [\n'auth0'\n])\n.controller( 'HomeCtrl', function HomeController( $scope, auth, $http, $location, store ) {\n\n $scope.auth = auth;\n\n $scope.callApi = functio... | javascript | chosen |
[
{
"from": "system",
"value": "Correct AdminQueryHandler allowAccess function to be set on prototype\n"
},
{
"from": "human",
"value": "\"use strict\"\n\nconst QueryHandler = require('./queryHandler');\nconst AdminHandler = require('../../router/handler/adminHandler');\n\nclass AdminQueryHandler ... | javascript | chosen |
[
{
"from": "system",
"value": "Use navigator.platform to detect ios in desktop mode\n"
},
{
"from": "human",
"value": "const ua = typeof navigator === 'undefined'? '' : navigator.userAgent;\n\nexport const isTrident = ua.indexOf('Trident') > -1;\nexport const isEdge = ua.indexOf('Edge') > -1;\nex... | javascript | chosen |
[
{
"from": "system",
"value": "Fix bug with custom tag importing.\n"
},
{
"from": "human",
"value": "import { sourceNode } from './sourceNode';\nimport { notNull } from '../utils';\n\nexport default {\n Document: ({node, figure, compile, options}) => {\n figure.children = node.body.map((child... | javascript | chosen |
[
{
"from": "system",
"value": "Add copyright to test file\n"
},
{
"from": "human",
"value": "c = Object(Symbol());\nvar y = { [e = c]:(class {}) };\nprint('Pass');"
},
{
"from": "gpt",
"value": "//----------------------------------------------------------------------------------------... | javascript | chosen |
[
{
"from": "system",
"value": "Return empty list if it can't find a ticket\n"
},
{
"from": "human",
"value": "if (window == top) {\n chrome.extension.onRequest.addListener(function(req, sender, sendResponse) {\n if (req.supported) {\n sendResponse(true);\n } else if (req.tickets) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Change variable name for clarity\n"
},
{
"from": "human",
"value": "/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\... | javascript | chosen |
[
{
"from": "system",
"value": "Add robots=noindex,nofollow to search page\n"
},
{
"from": "human",
"value": "// General search\n//\n\n'use strict';\n\nconst querystring = require('querystring');\n\n\nmodule.exports = function (N, apiPath) {\n N.validate(apiPath, {\n $query: { type: 'string', ... | javascript | chosen |
[
{
"from": "system",
"value": "Prepend creation form at the appropriate place\n"
},
{
"from": "human",
"value": "define([\n 'jquery',\n 'app',\n 'views/event/creation'\n], function ($, Stratus, EventCreationView) {\n var create = Stratus.module('Events.Create', { startWithPar... | javascript | chosen |
[
{
"from": "system",
"value": "Clean up code a bit.\n"
},
{
"from": "human",
"value": "/*\n * Paper.js\n *\n * This file is part of Paper.js, a JavaScript Vector Graphics Library,\n * based on Scriptographer.org and designed to be largely API compatible.\n * http://paperjs.org/\n * http://scripto... | javascript | chosen |
[
{
"from": "system",
"value": "Update test to match changes in index\n"
},
{
"from": "human",
"value": "module.exports = {\n 'Filtering on search page': function (browser) {\n browser\n .url('http://localhost:8000/search?q=rocket')\n .waitForElementVisible('body', 1000)\n .wait... | javascript | chosen |
[
{
"from": "system",
"value": "Fix the wildcards in watch task\n"
},
{
"from": "human",
"value": "module.exports = function(grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n\n watch: {\n react: {\n files: ['components/*.jsx', 'dashboards/*.jsx'],\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Update default grunt task to run unit tests and cssmin\n"
},
{
"from": "human",
"value": "module.exports = function(grunt) { \n grunt.initConfig({\n jshint: {\n options: {\n \"sub\": true\n },\n all: ['src/**... | javascript | chosen |
[
{
"from": "system",
"value": "Comment Licenses and Profile top-menu buttons for interface RFL.\n\nCloses #78"
},
{
"from": "human",
"value": "import * as deps from '../deps';\nimport { closeMobileMenu } from '../actions';\n\nexport const initialHeaderItems = [];\n\nconst closeMobileMenuAction = ... | javascript | chosen |
[
{
"from": "system",
"value": "Add test for the result function\n"
},
{
"from": "human",
"value": "/**\n * Created by Fabian on 12.07.2015.\n */\n"
},
{
"from": "gpt",
"value": "// Copyright 2015 Fabian Dietenberger\n\nvar should = require('chai').should(),\n hypemResolver = requir... | javascript | chosen |
[
{
"from": "system",
"value": "Fix bug where the login did not properly handle the redirect and thus was trying to send headers twice (and content).\n"
},
{
"from": "human",
"value": "var Ni = require('ni');\n\nvar userController = module.exports = {\n __init: function (cb, req, res, next) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "[test] Use new API in `simple/use-load` test\n"
},
{
"from": "human",
"value": "/*\n * use-test.js: Basic tests for the carapace module\n *\n * (C) 2011 Nodejitsu Inc\n * MIT LICENCE\n *\n */\n \nvar assert = require('assert'),\n vows = require('vows'),\n help... | javascript | chosen |
[
{
"from": "system",
"value": "Add a default command that watches\n"
},
{
"from": "human",
"value": "var gulp = require(\"gulp\");\nvar browserify = require(\"browserify\");\nvar source = require(\"vinyl-source-stream\");\n\n\nvar alias = function(name) {\n return {cwd: \"src/coffee/\" + name, b... | javascript | chosen |
[
{
"from": "system",
"value": "Remove unecessary stuff from asar archive\n"
},
{
"from": "human",
"value": "var packager = require('electron-packager');\nvar path = require('path');\nvar os = require('os');\n\noptions = {\n\t\"dir\": \".\",\n\t\"out\": path.resolve(os.homedir(), \"firmware_flashe... | javascript | chosen |
[
{
"from": "system",
"value": "Fix errors with onClick in MenuItem\n"
},
{
"from": "human",
"value": "import React from 'react'\n\nexport default class MenuItem extends React.Component {\n componentDidMount () {\n this.props.getMenu().menuItems.push(this)\n }\n\n render () {\n return (\n... | javascript | chosen |
[
{
"from": "system",
"value": "Write two zeros when 0 minutes. Looks nicer"
},
{
"from": "human",
"value": "Ext.define('MusicSearch.App', {\n\textend: 'Deft.mvc.Application',\n\n\tinit: function() {\n\t\tExt.fly('followingBallsG').destroy();\n\n\t\tExt.tip.QuickTipManager.init();\n\n\t\tDeft.Inje... | javascript | chosen |
[
{
"from": "system",
"value": "Change for case sensitive loading on Linux\n"
},
{
"from": "human",
"value": "/**\n * Name: Figlet\n * Description: Replies with a figlet of a message.\n * Usage: /figlet String in\n * Author: j <jay@jayhankins.me>\n */\n\nvar figlet = require('figlet');\n\nfunc... | javascript | chosen |
[
{
"from": "system",
"value": "Change `print` utility function to print repl prompt on end."
},
{
"from": "human",
"value": "/* vim:set ts=2 sw=2 sts=2 expandtab */\n/*jshint asi: true undef: true es5: true node: true browser: true devel: true\n forin: true latedef: false globalstrict: tr... | javascript | chosen |
[
{
"from": "system",
"value": "Allow styles to be overwritten on each deployment\n"
},
{
"from": "human",
"value": "// Polyfill needed by ie 11\nimport 'string.prototype.startswith';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport Router from 'react-router/BrowserRouter';... | javascript | chosen |
[
{
"from": "system",
"value": "Change color of 'Tor Enabled' label\n"
},
{
"from": "human",
"value": "/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n*/\nwindow.addEventListener(\"load\", function(e) {\n startup();\n}, false);\n\nfunction startup() {\n var m... | javascript | chosen |
[
{
"from": "system",
"value": "Add Input Validation Methods to Campaign\n"
},
{
"from": "human",
"value": "module.exports = function (campaign) {\n \n // Should Add Some Validation Methods\n \n campaign.beforeRemote('prototype.__create__subcampaigns', function (ctx, modelInstance, next) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Update API_EVENT_URL for new year\n"
},
{
"from": "human",
"value": "export const __DEV__ = process.env.NODE_ENV !== 'production';\n\nexport const API_BASE_URL = process.env.SPLASH_API_BASE_URL || 'https://online.ntnu.no';\n\nexport const API_APPLICATION_PERIODS_URL... | javascript | chosen |
[
{
"from": "system",
"value": "Fix byContractName to support either name name\n"
},
{
"from": "human",
"value": "const Config = require(\"truffle-config\");\nconst expect = require(\"truffle-expect\");\nconst Resolver = require(\"truffle-resolver\");\nconst Artifactor = require(\"truffle-artifact... | javascript | chosen |
[
{
"from": "system",
"value": "Use object spread instead of altering passed object.\n"
},
{
"from": "human",
"value": "import {Strategy} from 'passport-saml'\n\n// ===================================================================\n\nfunction extract (obj, prop, defaultValue = undefined) {\n if... | javascript | chosen |
[
{
"from": "system",
"value": "Add use strict to stub controller\n"
},
{
"from": "human",
"value": "let db = require('./db.js'),\n express = require('express'),\n router = express.Router();\n\nfunction convertBase62ToId(base62) {\n let chars = base62.split('');\n return chars.reduce(funct... | javascript | chosen |
[
{
"from": "system",
"value": "refactor: Add static template() method to base\n"
},
{
"from": "human",
"value": "class ComponentViewModel {\n constructor (root, params, attrs, MDCFoundation, MDCComponent) {\n this.root = root;\n this.foundation = MDCFoundation;\n this.attachTo = MDCComp... | javascript | chosen |
[
{
"from": "system",
"value": "Read thread dump line by line\n"
},
{
"from": "human",
"value": "function analyze_textfield() {\n var text = document.getElementById(\"TEXTAREA\").value;\n\n var analyzer = new Analyzer(text);\n setOutputText(analyzer.toString());\n}\n\nfunction setOutputTe... | javascript | chosen |
[
{
"from": "system",
"value": "Add bash hack to ensure node is run with --harmony\n\nFor details, see: http://sambal.org/?p=1014\n\ntl;dr:\n * Bash reads the first two lines, switching to node from `exec ...`\n * Node re-reads the entire file, and skips over the string constant + comment line\n"
},
{
... | javascript | chosen |
[
{
"from": "system",
"value": "Add promise returning on sending\n"
},
{
"from": "human",
"value": "var util = require('util');\nvar extend = require('extend');\nvar nodemailer = require('nodemailer');\nvar smtpTransport = require('nodemailer-smtp-transport');\nvar BaseMailer = require('./BaseMail... | javascript | chosen |
[
{
"from": "system",
"value": "Choose api host depending on url\n"
},
{
"from": "human",
"value": "import { PropTypes } from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\n\n// PropTypes\nexport const paperPropType = ImmutablePropTypes.contains({\n id: PropTypes.number,\n... | javascript | chosen |
[
{
"from": "system",
"value": "Make it a bit lighter"
},
{
"from": "human",
"value": "const crypto = require('crypto');\n\n/**\n * memHandler - In memory upload handler\n * @param {object} options\n * @param {string} fieldname\n * @param {string} filename\n */\nmodule.exports = function(options, ... | javascript | chosen |
[
{
"from": "system",
"value": "Use userCache as filestore's storage\n\nCo-authored-by: Delisa <af4f0ea8b5fc1012c4f5f436ed6f406c522717bf@users.noreply.github.com>"
},
{
"from": "human",
"value": "const electron = require('electron')\nconst Client = require('@bugsnag/core/client')\nconst makeDelive... | javascript | chosen |
[
{
"from": "system",
"value": "Fix fast visibility change not registering change\n"
},
{
"from": "human",
"value": "\ndefine([\n 'flight/lib/component',\n 'tpl!./form'\n], function(\n defineComponent,\n formTemplate) {\n 'use strict';\n\n return defineComponent(VisibilityEditor)... | javascript | chosen |
[
{
"from": "system",
"value": "Add a missing semi-colon in JS (bug with closure compiler)\n"
},
{
"from": "human",
"value": "/* Nano Templates (Tomasz Mazur, Jacek Becela) */\n\n(function($){\n $.nano = function(template, data){\n return template.replace(/\\{([\\w\\.]*)}/g, function(str, key)... | javascript | chosen |
[
{
"from": "system",
"value": "Add a useful standard ACE shortcut."
},
{
"from": "human",
"value": "var $ = document.getElementById.bind(document);\nvar exampleTests = require('./example-tests');\nvar Main = require('../src/main/main-controller');\n\nvar providedByAceEditor = function() {/* noop(... | javascript | chosen |
[
{
"from": "system",
"value": "Correct demo so it actually works"
},
{
"from": "human",
"value": "/* \n\nExamples\nAuthor: Addy Osmani\n\nSee: http://wiki.ecmascript.org/doku.php?id=harmony:module_loaders\nfor more information on the module loader proposal\n*/\n\n\n//Module: Define a new module\n... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.