conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Include block image as base64 in the js." }, { "from": "human", "value": "// alert.js\n\nvar striped_lines_box = document.createElement('div');\nstriped_lines_box.style.cssText = \"background-image: url(https://i.imgur.com/m5Wjo7h.png); height: 100%;width: 100%;posi...
javascript
chosen
[ { "from": "system", "value": "Fix minor issue with Contributor component\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from \"react\"\nimport cx from \"classnames\"\n\nimport Avatar from \"../Avatar\"\n\nexport default class Contributors extends Component {\n\n stati...
javascript
chosen
[ { "from": "system", "value": "Add a cache-busting string to image urls. Not sure this is working though.\n" }, { "from": "human", "value": "//\n// Image loader class.\n//\n\nvar DziViewer = DziViewer || {};\n\nDziViewer.Loader = OcrJs.Base.extend({\n init: function(options) {\n this._...
javascript
chosen
[ { "from": "system", "value": "Add Logined ID Popover in BCBProcess\n" }, { "from": "human", "value": "\nclass BCBProcess extends CommonProcess {\n constructor() {\n super({\n name: `${Project.NAME} Process`\n });\n \n this.initProcess();\n }\n \n initProcess() {\n this.in...
javascript
chosen
[ { "from": "system", "value": "Reset validation status on unchecking item\n" }, { "from": "human", "value": "var tliRegister = tliRegister || {};\n\ntliRegister.discountCodes = function() {\n\n\tvar init = function() {\n\t\tinitCodeItemEnabling();\n\t},\n\n\tinitCodeItemEnabling = function() {\n\...
javascript
chosen
[ { "from": "system", "value": "Refactor .catch's to use util.handleError\n" }, { "from": "human", "value": "var Roadmap = require('./roadmapModel.js');\n\nmodule.exports = {\n\n createRoadmap : function (req, res, next) {\n var newRoadmap = req.body;\n Roadmap(newRoadmap).save()\n .th...
javascript
chosen
[ { "from": "system", "value": "Add install and activate event listeners\n" }, { "from": "human", "value": "/*\nCopyright 2016 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy o...
javascript
chosen
[ { "from": "system", "value": "Fix bug with repeated events\n\nThe first event from the first page was repeated at the top of the\nsecond page\n" }, { "from": "human", "value": "var Activity = require('./activity');\nvar Readable = require('stream').Readable;\nvar util = require('util');\n\n/**\n...
javascript
chosen
[ { "from": "system", "value": "Use cached version of process object\n" }, { "from": "human", "value": "import { remote } from 'electron';\nimport isPlaying from './../reducers/player';\nimport { createStore } from 'redux';\n\n// TODO: Make root reducer later\n// import { combineReducers } from 'r...
javascript
chosen
[ { "from": "system", "value": ":art: Throw TypeError instead of Error\n" }, { "from": "human", "value": "import find from 'lodash.find';\nimport composedFetch from '../composedFetch.js';\n\nexport const sourcePostalPoint = id => composedFetch(id)\n .then(data => {\n const result = find(data.e...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"added promise check\"\"\n\nThis reverts commit ca14308fe85b6d0c3407d5e6c956a3acf78f0ca9.\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('arachne.controllers')\n\n .controller('SearchFormController', ['$scope', '$location', 'a...
javascript
chosen
[ { "from": "system", "value": "Add append-slash modifier to hello example route\n\nCloses gh-260\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (app) {\n app.route('GET /hello/(<name>/)', 'hello_page');\n};\n" }, { "from": "gpt", "value": "'use strict...
javascript
chosen
[ { "from": "system", "value": "Fix grunt errors in node > 6\n" }, { "from": "human", "value": "/*global module:false*/\nmodule.exports = function (grunt) {\n // Project configuration.\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n\n exec: {\n rem...
javascript
chosen
[ { "from": "system", "value": "Remove lint from minified version\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n // contrib-watch\n watch: {\n all: {\n files:...
javascript
chosen
[ { "from": "system", "value": "Fix uglify script no longer running.\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n\n // Project settings\n simg: {\n // configurable paths\n scriptPath: 'src',\n dist...
javascript
chosen
[ { "from": "system", "value": "Clone Merit data as late as possible\n\nIt's not necessary to clone the entire (original) data - especially\nsince the MeritTransformator isn't reused - but instead we can\nshallow-clone each series, and replace the values with those sliced up\nor downsampled by the Transformat...
javascript
chosen
[ { "from": "system", "value": "Fix related box on tablet view\n\ncheckOverflow now checks for position:fixed rather than window width." }, { "from": "human", "value": "$(function(){\n function checkOverflow(){\n if($(window).width() >= \"768\"){\n if($(\".related-positioning\").length !=...
javascript
chosen
[ { "from": "system", "value": "Fix forum topic controller name\n" }, { "from": "human", "value": "angular.module( 'App.Views' ).config( function( $stateProvider )\n{\n\t$stateProvider.state( 'forums.topics.view', {\n\t\turl: '/f/:topicSlug/:topicId',\n\t\tcontroller: 'Forums.TopicCtrl',\n\t\tcont...
javascript
chosen
[ { "from": "system", "value": "Use cli parameter for token.\n" }, { "from": "human", "value": "var Client = require('node-rest-client').Client,\n clientOptions = {\n connection: {\n rejectUnauthorized: false,\n requestCert: true,\n }\n },\n client = new Client(cli...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary mkdirp before moving a file, since fs-plus handles it" }, { "from": "human", "value": "'use babel';\n\nimport { dirname } from 'path';\nimport { existsSync, isFileSync, makeTreeSync, moveSync, statSync } from 'fs-plus';\n\n/*\n code pulled from:\...
javascript
chosen
[ { "from": "system", "value": "Update preview board to initialize with a null tetrinimo\n" }, { "from": "human", "value": "var PreviewBoard = function() {\n this.board = generateEmptyBoard();\n this.tetrinimo;\n}\nPreviewBoard.prototype.blit = function() {\n this.board = generateEmptyBoard();\...
javascript
chosen
[ { "from": "system", "value": "Enable copy on cell output\n" }, { "from": "human", "value": "'use babel';\n\nimport React from 'react';\nimport {Transformime} from 'transformime';\nimport {\n\tStreamTransformer,\n\tTracebackTransformer,\n\tMarkdownTransformer,\n}\nfrom 'transformime-jupyter-trans...
javascript
chosen
[ { "from": "system", "value": "Load unit details from sample data\n" }, { "from": "human", "value": "import {createReducer} from \"common/utils/reducerUtils\";\n\n\nconst initialState = {\n name : \"Black Widow Company\",\n affiliation : \"wd\",\n};\n\n\nexport default createReducer(initial...
javascript
chosen
[ { "from": "system", "value": "Fix removal of q (2)\n" }, { "from": "human", "value": "/*!\n * thought <https://github.com/nknapp/thought>\n *\n * Copyright (c) 2015 Nils Knappmeier.\n * Released under the MIT license.\n */\nvar exec = require('./utils/exeq')\nvar semver = require('semver')\n\nmo...
javascript
chosen
[ { "from": "system", "value": "Add comments for probable refactor\n" }, { "from": "human", "value": "function matchMaker(userList) {\n var likeUsers = [];\n userList.unshift(userList.pop());\n for (var i = 1; i < userList.length; i++) {\n var likenessCounter = 0;\n var j = ...
javascript
chosen
[ { "from": "system", "value": "Update to new DAP location" }, { "from": "human", "value": "// web analytics configuration \nmodule.exports = {\n //ANALYTICS SETTINGS\n google: {\n enabled: true,\n key: 'UA-48605964-17'\n },\n piwik: {\n enabled: false,\n host: '',\n key: ''\n ...
javascript
chosen
[ { "from": "system", "value": "Create observer to create listener for imap folders\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http...
javascript
chosen
[ { "from": "system", "value": "Remove setTimeout in favor of process.nextTick()\n\nAccording to [process.nextTick() documentation](http://nodejs.org/api/process.html#process_process_nexttick_callback), using setTimeout is not recommended:\r\n\r\n On the next loop around the event loop call this callback. ...
javascript
chosen
[ { "from": "system", "value": "Fix a formatting issue when formatting time\n" }, { "from": "human", "value": "var exports = {};\n\nexports.simplePrint = function(video) {\n return `**${video.title}**`;\n};\n\nexports.prettyPrint = function(video) {\n viewCount = video.view_count.replace(/\\B(?=...
javascript
chosen
[ { "from": "system", "value": "Add filter to allow access control of endpoints\n" }, { "from": "human", "value": "(function start() {\n \"use strict\";\n\n const morgan = require(\"morgan\");\n const express = require(\"express\");\n const login = require(`${__dirname}/routes/login`);...
javascript
chosen
[ { "from": "system", "value": "Set degree choice according to data\n" }, { "from": "human", "value": "$(document).ready(function() {\n\n $('#id_degree_programme_options').change(function() {\n console.log('hello');\n if (this.value === 'extra') {\n $('#unknown_degree')...
javascript
chosen
[ { "from": "system", "value": "Fix comment, add sandbox for tests" }, { "from": "human", "value": "'use strict';\n\nbefore(function(done) {\n\n // Ensure that 'should' library methods will be\n // available to all tests\n global.should = require('should');\n global.sinon = require('sinon');\n...
javascript
chosen
[ { "from": "system", "value": "Prepend nickname to alarm messsage\n" }, { "from": "human", "value": "'use strict';\n\nconst config = require('../configurations');\n\nclass Alarm {\n\n constructor(mqttClient) {\n this.mqttClient = mqttClient;\n }\n\n setup(irc) {\n this.irc ...
javascript
chosen
[ { "from": "system", "value": "Remove the lert message of passing id info for Block creation\n\ngit-svn-id: 6eed24e287f84bf0ab23ca377a3e397011128a6f@3438 fdecad78-55fc-0310-b1b2-d7d25cf747c9\n" }, { "from": "human", "value": "//TODO:Javacsript can check if checked Ids hasv the same scale ID\r\nfu...
javascript
chosen
[ { "from": "system", "value": "test: Fix describe label for ivhMultiSelectCollect tests\n" }, { "from": "human", "value": "\ndescribe('Directive: ivhMultiSelect', function() {\n 'use strict';\n\n beforeEach(module('ivh.multiSelect'));\n\n var collect;\n\n beforeEach(inject(function(ivhMultiSe...
javascript
chosen
[ { "from": "system", "value": "Improve mongo logging, so we only log unexpected disconnects.\n\nThis cleans things up a bit so normal shutdown doesn't spew mongo\ndisconnect errors.\n" }, { "from": "human", "value": "'use strict';\n\nvar logger = require('./logger'),\n mongoose = require('mong...
javascript
chosen
[ { "from": "human", "value": "Create express server that serves middleware, webpage, auth, and API routing\n" }, { "from": "gpt", "value": "// Node modules\nconst bodyParser = require('body-parser');\nconst cookieParser = require('cookie-parser');\nconst express\t = require('express');\nconst...
javascript
chosen
[ { "from": "system", "value": "Fix defect for root route\n" }, { "from": "human", "value": "const express = require('express');\nconst app = express();\nconst portNumber = process.env.PORT || 3000;\n\nconst bodyParser = require('body-parser');\nconst cookieParser = require('cookie-parser')\nif (p...
javascript
chosen
[ { "from": "system", "value": "Allow dependency lint to float for ember-get-config\n\nThe 0.4 release doesn't have anything to change functionality, it's only\nan issue because there isn't a 1.0 at this point.\n" }, { "from": "human", "value": "/* eslint-env node */\n'use strict';\n\nmodule.expor...
javascript
chosen
[ { "from": "system", "value": "Fix typo of Util export\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nvar lib = process.env.GEAR_COVER ...
javascript
chosen
[ { "from": "system", "value": "Remove the ugly iframe border.\n" }, { "from": "human", "value": "(function(module) {\n\t\"use strict\";\n\n\tvar nico = {},\n embed = '<iframe src=\"/plugins/nodebb-plugin-niconico/embed/plugin.html?$1\" width=\"485\" height=\"385\"></iframe>';\n\n\tnico.parse = f...
javascript
chosen
[ { "from": "system", "value": "Fix a typo in instance name" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/**\n * Parses an equation given as a command-line argument\n * into an object and computes it. Prints the result into stdout.\n *\n * Usage:\n * ./index.js 1+2-3*4/5%6^7\n */\n\n'...
javascript
chosen
[ { "from": "system", "value": "Use 4 spaces as indentation\n" }, { "from": "human", "value": "var request=require('request');\nvar BASE_URL='https://kat.cr';\n\n/**\n * {String|Object} query string or options f.x {}\n * avaliable options are any url options that kickass.to accepts\n * f.x. {field...
javascript
chosen
[ { "from": "system", "value": "Make hashes that are not valid redirect to DEFAULT_PAGE\n" }, { "from": "human", "value": "var DEFAULT_PAGE = 'about';\n\n// Given an HTML string response, set it as the page content.\nvar onChangePage = function(/*string*/ response) {\n var body = document.getElem...
javascript
chosen
[ { "from": "system", "value": "Use express instead of http\n" }, { "from": "human", "value": "var http = require(\"http\");\n\nhttp.createServer(function (request, response) {\n // Send the HTTP header\n // HTTP Status: 200 : OK\n // Content Type: text/plain\n response.writeHead(200, {'Co...
javascript
chosen
[ { "from": "system", "value": "fix: Add url to raven extra info\n" }, { "from": "human", "value": "const release = require('./package.json').version\n\nif (process.env.RAVEN_DSN) {\n var Raven = require('raven')\n Raven.config(process.env.RAVEN_DSN, {release}).install()\n}\n\nconst url = requir...
javascript
chosen
[ { "from": "system", "value": "Change timezone to New York\n" }, { "from": "human", "value": "var time = require('time');\nexports.handler = (event, context, callback) => {\n var currentTime = new time.Date();\n currentTime.setTimezone(\"America/Los_Angeles\");\n callback(null, {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix template path for use in a module\n" }, { "from": "human", "value": "var ejs = require(\"ejs\");\nvar fs = require(\"fs\");\nvar template = null;\nfs.readFile(\"template.ejs\",\"utf-8\",function (err,data) {\n if (err) throw new Error(err);\n template = ej...
javascript
chosen
[ { "from": "system", "value": "Use the find host method" }, { "from": "human", "value": "/* eslint-env node */\n'use strict';\n\nmodule.exports = {\n name: 'ember-cli-chart',\n included: function(app, parentAddon) {\n this._super.included.apply(this, arguments);\n \n var target = (pare...
javascript
chosen
[ { "from": "system", "value": "fix(~): Update the name and outputFormat" }, { "from": "human", "value": "'use strict';\n\nvar Cleaner = require('clean-css');\nvar defaultCleaner = new Cleaner();\n\nvar versions = {};\n\nexports.name = 'remarkable';\nexports.outputFormat = 'html';\nexports.render...
javascript
chosen
[ { "from": "system", "value": "Resolve an issue when null is in an array" }, { "from": "human", "value": "(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define(factory);\n } else if (typeof exports === 'object') {\n module.exports = factory()...
javascript
chosen
[ { "from": "system", "value": "Add `jade` to the list of inputformats for Pug" }, { "from": "human", "value": "'use strict';\n\nvar pug = require('pug');\n\nexports.name = 'pug';\nexports.outputFormat = 'html';\n\nexports.compile = function (source, options) {\n var fn = pug.compile(source, opti...
javascript
chosen
[ { "from": "system", "value": "Remove usage of Ember.assign to support older version of Ember\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst { assign } = Ember;\n\n/**\n * @class Row\n * @extends Ember.ObjectProxy\n * @namespace SemanticUI\n */\nconst Row = Ember.ObjectPro...
javascript
chosen
[ { "from": "system", "value": "Copy and download is implemented on the list and edit pages\n" }, { "from": "human", "value": "const downloadObjectAsJson = (exportObj, exportName) => {\n const dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(exportObj))\n let dow...
javascript
chosen
[ { "from": "system", "value": "Handle no roles on users table\n" }, { "from": "human", "value": "import React, {PropTypes} from 'react'\n\nconst UsersTable = ({users}) => (\n <div className=\"panel panel-minimal\">\n <div className=\"panel-body\">\n <table className=\"table v-center\">\n...
javascript
chosen
[ { "from": "system", "value": "Remove folder from files search\n" }, { "from": "human", "value": "// Requires\nvar _ = require('lodash');\nvar glob = require(\"glob\");\nvar Q = require('q');\n\n\nfunction setup(options, imports, register) {\n // Import\n var vfs = imports.vfs;\n var wor...
javascript
chosen
[ { "from": "system", "value": "Add comment about location of layouts" }, { "from": "human", "value": "export Page from \"Page\" // default layout\n\nexport Home from \"Home\"\nexport Post from \"Post\"\nexport Collection from \"Collection\"\n" }, { "from": "gpt", "value": "// see web_...
javascript
chosen
[ { "from": "system", "value": "Remove holidays from data file (not supported yet)\n" }, { "from": "human", "value": "function exchanges() {\n\treturn [\t\n\t\t{\n\t\t\t\"short_name\": \"NYSE\",\n\t\t\t\"full_name\": \"New York Stock Exchange\",\n\t\t\t\"timezone\": \"America/New_York\",\n\t\t\t\"...
javascript
chosen
[ { "from": "system", "value": "Add new viewpath for components\n" }, { "from": "human", "value": "var express = require('express'),\n cons = require('consolidate'),\n nunjucks = require('nunjucks'),\n moment = require('moment'),\n path = require('path');\n\nvar app = module.exports = express(...
javascript
chosen
[ { "from": "system", "value": "Add the scroll top when switch channel\n" }, { "from": "human", "value": "define([\n 'jquery',\n 'underscore',\n 'backbone',\n 'router',\n 'jquerySidr'\n], function($, _, Backbone, Router){\n\n var initialize = function(){\n $(document).read...
javascript
chosen
[ { "from": "system", "value": "Create an HTTP with a coordinator.\n" }, { "from": "human", "value": "#!/usr/bin/env/node\n\n/*\n\n Provide a command-line interface for `reconfigure`.\n ___ greeting, usage ___ en_US ___\n usage: node.bin.js\n\n ___ serve, usage ___ en_US ___\n usage: node bi...
javascript
chosen
[ { "from": "system", "value": "Add output variable to CLI\n" }, { "from": "human", "value": "var argv = require('minimist')(process.argv.slice(2))\n\nif (!argv.length || argv.h || argv.help) {\n console.log(help())\n}\n\nfunction help () {\n return [\n 'Usage:',\n ' matrix-bundler [entry...
javascript
chosen
[ { "from": "system", "value": "Update service worker URLs to cache\n" }, { "from": "human", "value": "let CACHE_NAME = 'order-splitter-cache-%%GULP_INJECT_VERSION%%';\nlet urlsToCache = ['/', '/main.js'];\n\nself.addEventListener('install', function(event) {\n event.waitUntil(\n caches.open(C...
javascript
chosen
[ { "from": "system", "value": "Check for optional CSS path before inspecting it\n" }, { "from": "human", "value": "const { readFileSync } = require('fs');\nconst { join, isAbsolute } = require('path');\n\nconst LAYOUTS_DIR = join(__dirname, '..', 'layouts');\nconst THEMES_DIR = join(__dirname, '....
javascript
chosen
[ { "from": "system", "value": "Simplify the repo param as review comment\n" }, { "from": "human", "value": "// Copyright 2015, EMC, Inc.\n\n'use strict';\n\nmodule.exports = {\n friendlyName: 'Install Ubuntu',\n injectableName: 'Task.Os.Install.Ubuntu',\n implementsTask: 'Task.Base.Os.In...
javascript
chosen
[ { "from": "system", "value": "Use err.code ENOENT to check for existence\n" }, { "from": "human", "value": "const fs = require('fs');\n\nconst dirExists = (directory) => {\n return new Promise((resolve, reject) => {\n fs.stat(directory, function(err, stats) {\n if (err) {\n if (e...
javascript
chosen
[ { "from": "system", "value": "Fix jQuery for selecting active tab\n" }, { "from": "human", "value": "$(document).ready(function(){\n\t$.urlParam = function(name){\n\t var results = new RegExp('[\\\\?&]' + name + '=([^&#]*)').exec(decodeURIComponent(window.location.href));\n\t if (results==...
javascript
chosen
[ { "from": "system", "value": "Use trailing if last param starts with a semicolon\n" }, { "from": "human", "value": "let MessageTags = require('./messagetags');\n\nmodule.exports = class IrcMessage {\n constructor(command, ...args) {\n this.tags = Object.create(null);\n this.pref...
javascript
chosen
[ { "from": "system", "value": "Undo merge conflict fix with the correct code\n" }, { "from": "human", "value": "Handlebars.registerHelper('department_code', function (id) {\n return new Handlebars.SafeString(Yacs.models.departments.store.id[id].code);\n});\n\nHandlebars.registerHelper('range', f...
javascript
chosen
[ { "from": "system", "value": "Add parameter to send url parameter if running on Staging server\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport iframePhone from 'iframe-phone';\nvar phone;\n\nexport default class ZoomChallenge extends Component {\n\...
javascript
chosen
[ { "from": "system", "value": "Add Promise polyfill to Demo\n" }, { "from": "human", "value": "import React from 'react';\nimport { render } from 'react-dom';\nimport { combineReducers, createStore, applyMiddleware } from 'redux';\nimport thunk from 'redux-thunk';\nimport { Provider } from 'react...
javascript
chosen
[ { "from": "system", "value": "Use CSS to position maintenance banner\n" }, { "from": "human", "value": "import $ from 'jquery';\n\n/**\n * Show the maintenance mode message to store administrators\n * @param maintenanceMode\n */\nexport default function (maintenanceMode = {}) {\n const header...
javascript
chosen
[ { "from": "system", "value": "Refactor method to have an explicit list of special words\n" }, { "from": "human", "value": "define([\n 'extensions/views/table/table'\n],\n function (Table) {\n\n var HelpUsageTable = Table.extend({\n\n capitalizeFirstWord: function(string) {\n ret...
javascript
chosen
[ { "from": "system", "value": "Revert \"Use window.stringsLanguage by default if fulfilled\"\n\nThis reverts commit bf8c61e6c9b6206fc496488cd6faced7f12dd5c5.\n" }, { "from": "human", "value": "$(document).ready(function() {\n if (window.taskData) {\n var taskInstructionsHtml = $('#taskIntro')...
javascript
chosen
[ { "from": "system", "value": "Allow http and https protocols when copying math\n" }, { "from": "human", "value": "module.exports = {\n allowedTags: [\n 'div',\n 'img',\n 'br'\n ],\n allowedAttributes: {\n img: ['src', 'alt']\n },\n allowedSchemes: ['dat...
javascript
chosen
[ { "from": "system", "value": "Remove IIFE and initialization script.\n" }, { "from": "human", "value": "(function(window, document, undefined) {\n \"use strict\";\n\n require.config({\n paths: {\n // Libraries\n \"jquery\": \"../../libraries/jquery/jquery\",\n \"hljs\": \"../...
javascript
chosen
[ { "from": "system", "value": "Apply coloring by indentation level.\n" }, { "from": "human", "value": "// ==UserScript==\n// @name HackerNews Comment Coloring\n// @namespace https://github.com/PauliusLabanauskis\n// @version 0.1\n// @include http://news.ycombinator.com/*\n// @inc...
javascript
chosen
[ { "from": "system", "value": "Fix switch statement wrongly assuming WATCH_STEP is an integer number\n" }, { "from": "human", "value": "import m from \"./module\";\nimport cm from \"./changing-module\";\n\nit(\"should flag harmony modules correctly\", function() {\n\tm.should.be.eql(\"module\" + ...
javascript
chosen
[ { "from": "system", "value": "Define enum values in model\n" }, { "from": "human", "value": "/**\n * Movie Model\n * Interacts with the database to retrieve movie data\n * @copyright 2013 Jeremy Worboys\n */\n\nmodule.exports.define = function(db) {\n\n return db.define('movie', {\n ti...
javascript
chosen
[ { "from": "system", "value": "Update the implementation of the removeItem function.\n" }, { "from": "human", "value": "// helper.js\n//\n// a collection of helper and convenience functions for PickSix\n\n(function() {\n\n /** Array Extensions **/\n\n // Array Remove - By John Resig (MIT Licens...
javascript
chosen
[ { "from": "system", "value": "Remove support for Webpack 3.x and prior from `WatchTimestampsPlugin`.\n" }, { "from": "human", "value": "const fs = require('fs');\n\n/** A Webpack plugin to refresh file mtime values from disk before compiling.\n * This is used in order to account for SCSS-genera...
javascript
chosen
[ { "from": "system", "value": "Build get single project api\n" }, { "from": "human", "value": "var pivotal = require(\"../libs/pivotal\");\nvar _ = require('lodash');\nvar inspect = require('eyes').inspector({ stream: null });\n\nmodule.exports = {\n projects: function(req, res, next){\...
javascript
chosen
[ { "from": "system", "value": "Add a connection error handler\n" }, { "from": "human", "value": "var test = require('tape')\nvar mongojs = require('../')\n\ntest('connect non existing db', function (t) {\n var db = mongojs('mongodb://1.0.0.1:23/aiguillage?connectTimeoutMS=100', ['a'])\n\n db.ru...
javascript
chosen
[ { "from": "system", "value": "Add a route displaying connecting Android devices\n" }, { "from": "human", "value": "const express = require('express');\nconst installer = require('./installer');\n\nconst app = express();\n\napp.get('/install/:hockeyAppId', (req, res) =>\n installer.getMyApp(req....
javascript
chosen
[ { "from": "system", "value": "Mark blocked functions as such for easier testing.\n" }, { "from": "human", "value": "(function () {\n var fibers = Npm.require('fibers');\n var future = Npm.require('fibers/future');\n\n blocking = function(obj, fun) {\n if (fun == null) {\n fun = obj;\n...
javascript
chosen
[ { "from": "system", "value": "Fix node js production test\n" }, { "from": "human", "value": "global.expect = require('chai').expect;\nglobal.goog = {\n require: function() {}\n}\nrequire('../dist/javascript.util-nodejs.js');\n" }, { "from": "gpt", "value": "global.expect = require...
javascript
chosen
[ { "from": "system", "value": "test: Set log level to LOG_DEBUG\n\nTests aren't being run on Travis (always 0/0) trying to figure out why.\n" }, { "from": "human", "value": "// Karma configuration\n\n// base path, that will be used to resolve files and exclude\nbasePath = '';\n\n// list of files ...
javascript
chosen
[ { "from": "system", "value": "Change to filters now that can-has prebaked\n" }, { "from": "human", "value": "$(document).ready(function() {\n function NavBarModel() {\n var self = this;\n self.filters = ko.observableArray();\n };\n\n var nbm = new NavBarModel();\n ko.ap...
javascript
chosen
[ { "from": "system", "value": "Add switch for debug mode\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar glob = require('glob');\nvar path = require('path');\nvar test = require('tape');\n\nvar paradise = require('../index');\n\nvar specDir = path.join(__dirname, ...
javascript
chosen
[ { "from": "system", "value": "Add semicolon as first character\n\nTo be better protected against other bad javascript code." }, { "from": "human", "value": "/**\n * jQuery if-else plugin\n *\n * Creates if(), else() and fi() methods that can be used in\n * a chain of methods on jQuery objects\n ...
javascript
chosen
[ { "from": "system", "value": "Fix blank screen when MetaMask is not installed\n" }, { "from": "human", "value": "import { observable } from 'mobx';\nimport { getWeb3 } from '../utils/blockchainHelpers'\n\nclass Web3Store {\n\n\t@observable web3;\n\t@observable curAddress\n\t@observable accounts ...
javascript
chosen
[ { "from": "system", "value": "Remove bad example of anchored tooltip, in favor of the on in <IconButton>.\n" }, { "from": "human", "value": "import React from 'react';\nimport Tooltip from 'src/Tooltip';\n\nimport Icon from 'src/Icon';\nimport anchored from 'src/mixins/anchored';\n\nfunction Too...
javascript
chosen
[ { "from": "system", "value": "Use exec instead of spawn\n" }, { "from": "human", "value": "// Dependencies\nvar ChildProcess = require(\"child_process\")\n , Spawn = ChildProcess.spawn\n , Ul = require(\"ul\")\n ;\n\nfunction Diable(path, exec, options) {\n\n // Diable(options);\n if (t...
javascript
chosen
[ { "from": "system", "value": "Fix false positive on value isEmpty\n" }, { "from": "human", "value": "import isNil from 'ramda/src/isNil';\nimport isEmpty from 'ramda/src/isEmpty';\n\nconst validate = val => {\n if (isNil(val)) {\n return true;\n }\n\n if (isEmpty(val)){\n return false;...
javascript
chosen
[ { "from": "system", "value": "Add parseInt to find method\n" }, { "from": "human", "value": "import React from 'react'\nimport { connect } from 'react-redux'\n\nconst LeadDetail = (props) => {\n if (props.lead) {\n return (\n <div>\n <h1>Lead Details</h1>\n {props.lead.nam...
javascript
chosen
[ { "from": "system", "value": "Refresh page after user creation\n\n\nFormer-commit-id: 375fb1e0b2c00dd37d17c20ce9a7abb68163176f" }, { "from": "human", "value": "function viewUsers(view) {\n\n getUsers(\n success = function (data) {\n //console.log(data);\n populateUsersTable(data);\...
javascript
chosen
[ { "from": "system", "value": "Clear value the \"right\" way with material-ui\n" }, { "from": "human", "value": "import React from 'react';\nimport TextField from 'material-ui/lib/text-field';\n\nexport default class ZipCodeEntry extends React.Component {\n constructor(props) {\n super(props)...
javascript
chosen
[ { "from": "system", "value": "Add log message display in spec\n" }, { "from": "human", "value": "/* @flow */\n\nimport 'babel-polyfill'\nimport path from 'path'\n\nimport { Builder } from '../src/main'\nimport type { Message } from '../src/types'\n\ndescribe('Builder', () => {\n let builder: Bu...
javascript
chosen
[ { "from": "system", "value": "Use chromedriver instead of phantomjs" }, { "from": "human", "value": "exports.config = {\n params: {\n baseUrl: {\n osio: 'https://openshift.io/',\n username: 'testuser@redhat.com'\n }\n },\n useAllAngular2AppRoots: true,\n getPageTimeou...
javascript
chosen
[ { "from": "system", "value": "Use styleReader to generate standardOptions\n" }, { "from": "human", "value": "var docxReader = require(\"./docx-reader\");\nvar DocumentConverter = require(\"./document-to-html\").DocumentConverter;\nvar htmlPaths = require(\"./html-paths\");\nvar documentMatchers ...
javascript
chosen