conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove related link if yamb deleted\n" }, { "from": "human", "value": "\"use strict\";\n\n// yamb.prototype.remove()\n\nmodule.exports = function(symbl, flags, opts) {\n return function *remove() {\n if (!this[symbl].id) {\n // TODO: fix error message\n ...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix bug that personFinder used unfiltered list\n\n" }, { "from": "human", "value": "export default function getList(data, orm, inputValue) {\n let retVal = [];\n if (Array.isArray(orm.groups)) {\n orm.groups.forEach(({ key, show }) => {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the if statement syntax" }, { "from": "human", "value": "'use strict';\n\nvar ect = require('ect');\n\nexports.name = 'ect';\nexports.outputFormat = 'html';\nexports.compile = function(str, options) {\n if (!options) {\n options = {};\n }\n if (!options.ro...
javascript
chosen
[ { "from": "system", "value": "Allow add-on to be nested.\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar path = require('path');\nvar Funnel = require('broccoli-funnel');\n\nmodule.exports = {\n name: 'ember-cli-bourbon',\n blueprintsPath: function() {\n ret...
javascript
chosen
[ { "from": "system", "value": "Hide scrollbar when scroll reaches the bottom of the page\n" }, { "from": "human", "value": "var globalOffset = require(\"global-offset\");\n\nmodule.exports = function(element) {\n var offset = globalOffset(element),\n scrollbar = document.createElement(\"div\"...
javascript
chosen
[ { "from": "system", "value": "Make front page redirect to wiki\n" }, { "from": "human", "value": "if (Meteor.isServer) {\n Meteor.startup(function () {\n // Validate that the config file contains the data we need.\n validateSettings();\n\n // Create our DNS zone for PowerDNS, if necess...
javascript
chosen
[ { "from": "system", "value": ":bug: Sort object by keys to avoid problems with 'addEmptyDays' util\n" }, { "from": "human", "value": "// Count duplicate keys within an array\n// ------------------------------------------------------------\nmodule.exports = function(array) {\n if(array.length ==...
javascript
chosen
[ { "from": "system", "value": "Create node in binary search tree program\n" }, { "from": "human", "value": "// Program that creates a binary search tree: each node has up to two children, and all left descendants of a node is less than or equal to the node and all right descendants are greater th...
javascript
chosen
[ { "from": "system", "value": "Improve the compatibility with older versions of node\n" }, { "from": "human", "value": "'use strict';\n\nconst buble = require('buble');\n\nclass BrunchBuble {\n constructor({ plugins: { buble } }) {\n this.config = buble || {};\n }\n\n compile({ data }) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use ES5 functions instead of arrow functions" }, { "from": "human", "value": "var data = require('./data');\nvar accounting = require('accounting');\n\nvar CurrencyFormatter = function() {\n this.defaultCurrency = {\n symbol: '',\n thousandsSeparator: ',',\n ...
javascript
chosen
[ { "from": "system", "value": "Adjust to ts2dart change of filename handling.\n" }, { "from": "human", "value": "var chalk = require('chalk');\nvar gutil = require('gulp-util');\nvar spawn = require('gulp-spawn');\nvar through = require('through2');\nvar ts2dart = require('ts2dart');\nvar which =...
javascript
chosen
[ { "from": "system", "value": "Add to the sample apps ul\n" }, { "from": "human", "value": "\r\nconsole.log('loading electron-updater-sample-plugin...')\r\n\r\nfunction plugin(context) {\r\n\tconsole.log('loaded electron-updater-sample-plugin!')\r\n}\r\n\r\nmodule.exports = plugin" }, { "...
javascript
chosen
[ { "from": "system", "value": "Remove '/r/' from reddit board list\n" }, { "from": "human", "value": "import fs from 'fs'\nexport function parseBoardList(boardList) {\n // console.log(JSON.stringify(boardList))\n try {\n boardList.data.children\n } catch (e) {\n log.error(`...
javascript
chosen
[ { "from": "system", "value": "Set options in connect (serverless)\n" }, { "from": "human", "value": "'use strict'\n\nconst mongoose = require('mongoose')\nconst { ApolloServer } = require('apollo-server-lambda')\nconst { UnsignedIntResolver, UnsignedIntTypeDefinition, DateTimeResolver, DateTimeT...
javascript
chosen
[ { "from": "system", "value": "Load new apiUrl module in ac module base\n" }, { "from": "human", "value": "var config = require('./config'),\n rest = require('./rest'),\n projects = require('./projects');\n\nmodule.exports.init = function () {\n\n /**\n * Load config variables as env...
javascript
chosen
[ { "from": "system", "value": "Debug deployment and setting of node env variables\n" }, { "from": "human", "value": "if (process.env.NODE_ENV !== 'production') require('../../secrets');\nconst neo4j = require('neo4j-driver').v1;\n\nif (process.env.NODE_ENV === 'production') {\n const graphDb = n...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect import of modules n commonjs env\n" }, { "from": "human", "value": "(function (root, factory) {\n 'use strict';\n /* global define, module, require */\n\n if (typeof define === 'function' && define.amd) { // AMD\n define(['./lib/Dice', ...
javascript
chosen
[ { "from": "system", "value": "Remove astToFunction from JavaScript code\n" }, { "from": "human", "value": "import query from './query.pegjs';\n\nexport function parseToAst (string) {\n return query.parse(string);\n}\n\nconst opfunc = {\n '<=': function (x, y) {\n return x <= y;\n },\n\n '...
javascript
chosen
[ { "from": "system", "value": "Add unpack() to the public interface\n" }, { "from": "human", "value": "let Scanner = require('./lib/scanner.js');\nlet Parser = require('./lib/parser.js');\nlet Packer = require('./lib/packer.js');\n\nmodule.exports = {\n scan: Scanner.scan,\n parse: Parser.p...
javascript
chosen
[ { "from": "system", "value": "Change example code to use new API.\n" }, { "from": "human", "value": "var Connection = require('../lib/tedious').Connection;\nvar Request = require('../lib/tedious').Request;\n\nvar options = {};\n\nvar connection = new Connection('192.168.1.210', 'test', 'test', o...
javascript
chosen
[ { "from": "system", "value": "Add check for NaN in parseInt native code.\n" }, { "from": "human", "value": "const _elm_node$core$Native_Global = function () {\n const Err = _elm_lang$core$Result$Err\n const Ok = _elm_lang$core$Result$Ok\n\n\n // parseInt : Int -> String -> Result Decode...
javascript
chosen
[ { "from": "system", "value": "Fix e2e tests for ShowView\n" }, { "from": "human", "value": "/*global describe,it,expect,$$,element,browser,by*/\ndescribe('ShowView', function () {\n 'use strict';\n\n var hasToLoad = true;\n beforeEach(function() {\n if (hasToLoad) {\n ...
javascript
chosen
[ { "from": "system", "value": "Return null of param not found\n" }, { "from": "human", "value": "import URI from 'urijs';\n\n/**\n * Return a URL parameter.\n */\nconst getUrlParameter = function(url, param, type) {\n const uri = new URI(url),\n query = URI.parseQuery(uri.query());\n\...
javascript
chosen
[ { "from": "system", "value": "Fix race condition between updating project before creating corresponding published project\n" }, { "from": "human", "value": "exports.seed = function(knex, Promise) {\n return Promise.join(\n knex('publishedProjects').insert({\n title: 'sinatra-contrib',\n...
javascript
chosen
[ { "from": "system", "value": "Fix jquery scope once again, in integration test 🔨\n\nFor some reason ember 2.9.0 and above has some serious problems with\nthe previously used scope. This should fix a broken build.\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember...
javascript
chosen
[ { "from": "system", "value": "Switch doc to closure compiler templating\n" }, { "from": "human", "value": "/**\n * Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}\n *\n * @module turf/featurecollection\n * @category helper\n * @param {Feature} features input Fe...
javascript
chosen
[ { "from": "system", "value": "Allow underscores and hyphens in Youtube video ID\n\nFixes #122\n" }, { "from": "human", "value": "/**\n * Helper functions\n */\n'use strict';\n\nmodule.exports = {\n\tparseVideoUrl(url) {\n\t\tfunction getIdFromUrl(url, re) {\n\t\t\tlet matches = url.match(re);\n\...
javascript
chosen
[ { "from": "system", "value": "Set topic based on routing key.\n" }, { "from": "human", "value": "function Message(queue, message, headers, deliveryInfo) {\n // Crane uses slash ('/') separators rather than period ('.')\n this.queue = deliveryInfo.queue.replace(/\\./g, '/');\n this.headers = {...
javascript
chosen
[ { "from": "system", "value": "Modify test for approximate equality\n\nA change in Node 12 means that the test value we were previously using differs from the new result by `2.7755575615628914e-17`." }, { "from": "human", "value": "var chai = require('chai');\nvar assert = chai.assert;\nvar TestD...
javascript
chosen
[ { "from": "system", "value": "Fix an issue to show code without language option\n" }, { "from": "human", "value": "/*global Showdown */\n\n'use strict';\n\nangular.module('memoFilters', [])\n .filter('markdown', function ($sce) {\n // var converter = new Showdown.converter({ extensions: ['gi...
javascript
chosen
[ { "from": "system", "value": "Simplify pass through of CHECK_SYNTACTIC_ERRORS" }, { "from": "human", "value": "var ts = require('typescript');\nvar process = require('process');\nvar IncrementalChecker = require('./IncrementalChecker');\nvar CancellationToken = require('./CancellationToken');\n\...
javascript
chosen
[ { "from": "system", "value": "Use expanded style in rendered css\n" }, { "from": "human", "value": "let fs = require('fs');\nlet mkdirp = require('mkdirp');\nlet sass = require('node-sass');\n\nsass.render({\n file: 'sass/matter.sass',\n}, function (renderError, result) {\n if (renderError) {\...
javascript
chosen
[ { "from": "system", "value": "Use `Number.isNaN` when it's available.\n" }, { "from": "human", "value": "'use strict';\n\n\nfunction isNothing(subject) {\n return (undefined === subject) || (null === subject);\n}\n\n\nfunction isObject(subject) {\n return ('object' === typeof subject) && (null...
javascript
chosen
[ { "from": "system", "value": ":bug: Send a ping on worker init\nThis fixes non-shared workers\n" }, { "from": "human", "value": "'use babel'\n\nimport {Disposable, CompositeDisposable} from 'sb-event-kit'\nimport Communication from 'sb-communication'\n\nclass Exchange {\n constructor(worker) {\...
javascript
chosen
[ { "from": "system", "value": "Fix lifecycle events to satisfy recommendations\n" }, { "from": "human", "value": "import ClickOutsideMixin from './mixin';\nimport Component from '@ember/component';\nimport { on } from '@ember/object/evented';\nimport { next, cancel } from '@ember/runloop';\nimpor...
javascript
chosen
[ { "from": "system", "value": "Use range-start_end instead of range_start-end in the URL. Looks a little better to me.\n" }, { "from": "human", "value": "\nexport function parseRangeFilters(stringValue = '') {\n if (!stringValue) {\n return [];\n }\n return stringValue.split('~').map(s => {...
javascript
chosen
[ { "from": "system", "value": "Set maxAge of two hours on session cookie\n" }, { "from": "human", "value": "const express = require('express');\nconst cors = require('cors');\nconst session = require('express-session');\nconst bodyParser = require('body-parser');\n\nconst authMiddleware = require...
javascript
chosen
[ { "from": "system", "value": "Make the volume control finer grained.\n" }, { "from": "human", "value": "$(document).ready(function() {\n var sendingVol = false;\n var volChange = false;\n\n function send_slider_volume() {\n if (sendingVol || !volChange) return;\n var curVol = $(\"#maste...
javascript
chosen
[ { "from": "system", "value": "Optimize sending data from worker\n\nWhen transferable list is specified, postingMessage to worker doesn't copy data.\r\nSince ctm.js references original data, we can specify original stream to be transferred back to the main thread." }, { "from": "human", "value": ...
javascript
chosen
[ { "from": "system", "value": "Move script tag below content\n" }, { "from": "human", "value": "import React, { Fragment } from 'react';\nimport Head from 'next/head';\nimport { Header, RaffleContainer } from '../components';\n\nexport default () => (\n <Fragment>\n <Head>\n <meta httpEq...
javascript
chosen
[ { "from": "system", "value": "Split copy part to a function\n" }, { "from": "human", "value": "window.addEventListener('load', function(){\n 'use strict';\n\n // Get elements\n var title = document.getElementById('page_title');\n var url = document.getElementById('page_url');\n var copyTitl...
javascript
chosen
[ { "from": "system", "value": "Fix bug introduced in merge\n" }, { "from": "human", "value": "/*\n * Copyright 2015 Caleb Brose, Chris Fogerty, Rob Sheehy, Zach Taylor, Nick Miller\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in...
javascript
chosen
[ { "from": "system", "value": "Update locale to use object notation\n" }, { "from": "human", "value": "'use strict';\n\n// Load our requirements\nconst i18n = require('i18n'),\n path = require('path'),\n logger = require('../log');\n\n// Variables\nlet localeDir = path.resolve(__base + ...
javascript
chosen
[ { "from": "system", "value": "Remove Rx as a direct dependency\n" }, { "from": "human", "value": "import Rx from 'rx';\nimport Cycle from '@cycle/core';\nimport CycleDOM from '@cycle/dom';\n\nfunction main() {\n return {\n DOM: Rx.Observable.interval(1000)\n .map(i => CycleDOM.h(\n ...
javascript
chosen
[ { "from": "system", "value": "Add boundaries to game board\n" }, { "from": "human", "value": "/**\n * game-board.js\n *\n * Maintain game board object properties\n */\n\n// Alias our game board\nvar gameBoard = game.objs.board;\n\n/**\n * Main game board factory\n *\n * @returns {object}\n */\nv...
javascript
chosen
[ { "from": "system", "value": "Solve Word Count in JS\n" }, { "from": "human", "value": "// super ugly but I'm tired\nvar Words = function() {};\n\nWords.prototype.count = function(input) {\n var wordArray = normalize(input.replace(/[\\n\\t]/g, ' ').trim()).split(' ');\n var result = {};\n\n t...
javascript
chosen
[ { "from": "system", "value": "[TASK] Add helper.js to grunt watch\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n grunt.config.merge({\n connect: {\n server: {\n options: {\n base: {\n path: 'build',\n options: {\n ...
javascript
chosen
[ { "from": "system", "value": "Move from `expandFiles` to grunt 0.4's `expand`\nThis largely fixes 0.4 compatibility for me" }, { "from": "human", "value": "module.exports = function(grunt) {\"use strict\";\n\n var Builder = require('../').Builder;\n\n grunt.registerMultiTask(\"spritesheet\...
javascript
chosen
[ { "from": "system", "value": "Sort posts by submitted timestamp\n" }, { "from": "human", "value": "var postsData = [\n\t{\n\t\ttitle: 'Introducing Telescope',\n\t\turl: 'http://sachagreif.com/introducing-telescope/'\n\t},\n\t{\n\t\ttitle: 'Meteor',\n\t\turl: 'http://meteor.com'\n\t},\n\t{\n\t\tt...
javascript
chosen
[ { "from": "system", "value": "Use platform EOL for newlines\n\n- Fixes test for Windows\n" }, { "from": "human", "value": "\"use babel\";\n\n// const { dialog } = require(\"electron\").remote;\nconst { existsSync } = require(\"fs\");\nimport { _loadNotebook } from \"../lib/import-notebook\";\nim...
javascript
chosen
[ { "from": "system", "value": "Remove HTTP as part of POST handler response" }, { "from": "human", "value": "'use strict';\n\nconst BaseHandler = require('./BaseHandler');\nconst ERRORS = require('../constants').ERRORS;\nconst EVENT_ENDPOINT_CREATED = require('../constants').EVENT_ENDPOINT_CREATE...
javascript
chosen
[ { "from": "system", "value": "Fix syntax error, rename manifest\n" }, { "from": "human", "value": "const webpack = require('webpack')\nconst path = require('path')\nconst Dotenv = require('dotenv-webpack')\nconst ChunkManifestPlugin = require('chunk-manifest-webpack-plugin')\nconst WebpackChunkH...
javascript
chosen
[ { "from": "system", "value": "Fix iframe info receiver using wrong url\n" }, { "from": "human", "value": "'use strict';\n\nvar inherits = require('inherits')\n , EventEmitter = require('events').EventEmitter\n , JSON3 = require('json3')\n , XHRLocalObject = require('./transport/sender/xhr-loc...
javascript
chosen
[ { "from": "system", "value": "Fix lint issues in JS\n" }, { "from": "human", "value": "import ariatiseForm from '../../utils/ariatiseForm';\nimport { togglisePasswords } from '../../utils/passwordHelper';\nimport validateOrgSelection from '../shared/my_org';\nimport { isValidText } from '../../u...
javascript
chosen
[ { "from": "system", "value": "Add routing for specified repos\n" }, { "from": "human", "value": "'use strict';\n\nangular\n .module('visualizerApp', [\n 'ngRoute',\n 'angularFileUpload',\n 'angularMoment',\n 'angularPeity'\n ])\n .config(function ($routeProvider) {\n $routeProv...
javascript
chosen
[ { "from": "system", "value": "Align the variables slightly differently.\n" }, { "from": "human", "value": "define(['chai', 'mocha', 'samples/fortytwo'], function(chai, mocha, fortytwo) {\n 'use strict';\n var expect = chai.expect;\n describe('fortytwo', function() {\n it('should return for...
javascript
chosen
[ { "from": "system", "value": "Add intiialize method to InMemoryEventBusReceiver\n" }, { "from": "human", "value": "var inherit = require(\"../../inherit\");\nvar CommonEventBusReceiver = require(\"../common/receiver\");\nvar InMemoryEventBus;\n\ninherit(InMemoryEventBusReceiver, C...
javascript
chosen
[ { "from": "system", "value": "Include libraries for transformation with Jest\n" }, { "from": "human", "value": "// https://github.com/thymikee/jest-preset-angular#brief-explanation-of-config\nmodule.exports = {\n preset: 'jest-preset-angular',\n roots: ['src'],\n coverageDirectory: 'reports',...
javascript
chosen
[ { "from": "system", "value": "Fix markdown style load error\n" }, { "from": "human", "value": "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See L...
javascript
chosen
[ { "from": "system", "value": "Increase nightmare action timeout on CI for e2e tests\n" }, { "from": "human", "value": "export const ENTER_UNICODE = '\\u000d';\nexport const SIMPLE_TEST_TIMEOUT = 10 * 1000;\nconst NIGHTMARE_ACTION_TIMEOUT = (process.env.CIRCLECI ? 4 : 2) * 1000;\nexport const NIG...
javascript
chosen
[ { "from": "system", "value": "Move setState logic on new tweet to component method\n" }, { "from": "human", "value": "'use strict';\n\nvar React = require('react');\nvar io = require('socket.io-client');\nvar TwitterStreamList = require('./stream-list');\n\nvar TwitterStreamApp = React.createCla...
javascript
chosen
[ { "from": "system", "value": "Call \"routeToState\" on page's ready()\n" }, { "from": "human", "value": "/**\n * @class CM_Page_Abstract\n * @extends CM_Component_Abstract\n */\nvar CM_Page_Abstract = CM_Component_Abstract.extend({\n\n /** @type String */\n _class: 'CM_Page_Abstract',\n\n /**...
javascript
chosen
[ { "from": "system", "value": "Improve error handling of config functions\n" }, { "from": "human", "value": "'use strict'\n\nconst { addGenErrorHandler } = require('../errors')\n\nconst { getParams } = require('./params')\nconst { stringifyConfigFunc } = require('./tokenize')\n\n// Process config...
javascript
chosen
[ { "from": "system", "value": "Use optimized jQuery from Google APIs" }, { "from": "human", "value": "// ==UserScript==\n// @name Lighthouse Inline Image Attachments\n// @namespace headinsky.dk\n// @description Show image attachments for Lighthouse tickets inline\n// @include ...
javascript
chosen
[ { "from": "system", "value": "Implement parameters for GET request\n" }, { "from": "human", "value": "const ex = require('../util/express');\nconst pdfCore = require('../core/pdf-core');\n\nconst getRender = ex.createRoute((req, res) => {\n const opts = {\n // TODO: add all params here\n };...
javascript
chosen
[ { "from": "system", "value": "Add space between comment summary and @see" }, { "from": "human", "value": "import * as React from \"react\";\nimport {BuildSnapshot} from \"./BuildSnapshot\";\nimport {Wrapper} from \"./Wrapper\";\n\n/**\n * Container Component for BuildSnapshots.\n * \n * @param {...
javascript
chosen
[ { "from": "system", "value": "Add method to move a module on top of others\n" }, { "from": "human", "value": "(function(app) {\n 'use strict';\n\n var jCore = require('jcore');\n var helper = app.helper || require('../helper.js');\n var Module = app.Module || require('./module.js');\n\n var...
javascript
chosen
[ { "from": "system", "value": "Save cropped image on submit and not by clicking on the button." }, { "from": "human", "value": "(function($) {\n function init_editor(e) {\n var editor = $(e);\n var selector = editor.data('selector');\n editor.cropit({\n imageSta...
javascript
chosen
[ { "from": "system", "value": "Use object spread operator instead of Object.assign\n" }, { "from": "human", "value": "import { LOAD_PAGE, LOAD_PAGE_REQUEST } from '../actions/constants'\n\nconst initialState = {\n page: 1,\n photos: [],\n loading: true\n}\n\nexport default function (state = in...
javascript
chosen
[ { "from": "system", "value": "Set log level to ERROR\n" }, { "from": "human", "value": "import { InjectionToken } from 'yabf'\n\nimport { LOG_LEVEL } from '../services'\n\nexport const OPTION_PATH_FILE_TOKEN = new InjectionToken()\n\nexport const APP_LOG_LEVEL_TOKEN = new InjectionToken()\nexpor...
javascript
chosen
[ { "from": "system", "value": "Support an array of arguments.\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar os = require('os');\nvar path = require('path');\nvar crypto = require('crypto');\nvar commands = require('./commands.json');\n\n/**\n * Look up the ...
javascript
chosen
[ { "from": "system", "value": "Fix missing transition variable in map overlay.\n" }, { "from": "human", "value": "(function($) {\n\n if (!$.cookie('first_time_visitor')) {\n $.cookie('first_time_visitor', true, { expires: 1000, path: '/' });\n\n var $overlayWrapper = $('.overlay-wrapper');...
javascript
chosen
[ { "from": "system", "value": "Fix for sending XML before async call returns\n" }, { "from": "human", "value": "\"use strict\";\n\nvar BlogController = require('./controllers/blog');\nvar BloggerController = require('./controllers/blogger');\nvar RSS = require('rss');\n\nexports.serveRoutes = fun...
javascript
chosen
[ { "from": "system", "value": "Fix index check in `removeDefaultCapability`.\n" }, { "from": "human", "value": "import Oasis from \"oasis\";\nimport { services } from \"conductor/services\";\nimport { copy } from \"conductor/lang\";\nimport { a_indexOf } from \"oasis/shims\";\n\nfunction Conducto...
javascript
chosen
[ { "from": "system", "value": "[TASK] Make sure the example App modules render method returns the module\n" }, { "from": "human", "value": "/**\n * Defines a dummy module\n *\n * @module Modules/Module\n */\n\nvar App;\n\n/**\n * App\n * @param el\n * @constructor\n */\nApp = function(el) {\n\t'u...
javascript
chosen
[ { "from": "system", "value": "Fix help message on wrong calls\n\nThis fixes the display of usage information when the program is called\nwithout arguments.\n" }, { "from": "human", "value": "'use strict';\nvar path = require('path');\nvar program = require('commander');\n\nvar jsdoctest = requir...
javascript
chosen
[ { "from": "system", "value": "Print key on click (try 5 - button)\n" }, { "from": "human", "value": "function displayKeys() {\n\n // Retrieve all keyPairs\n var sql = \"select K.name from key K\";\n\n dbRetrieve(sql, [], function(res) {\n\n // Populate key list\n var html ...
javascript
chosen
[ { "from": "system", "value": "Use a for loop, because ES3 browsers don't have \"reduce\"\n" }, { "from": "human", "value": "\"use strict\";\n\n// modified from https://github.com/es-shims/es6-shim\nvar keys = Object.keys || require('object-keys');\n\nvar assignShim = function assign(target, sour...
javascript
chosen
[ { "from": "system", "value": "refactor(~): Make compile use mote's compile" }, { "from": "human", "value": "'use strict';\n\nvar mote = require('mote');\n\nexports.name = 'mote';\nexports.outputFormat = 'html';\n\nexports.compile = function (str, options) {\n return mote.compile(str);\n};\n" ...
javascript
chosen
[ { "from": "system", "value": "Move checkNumber function to the buttom of class implementation.\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2016, Christopher Ramírez\n * All rights reserved.\n *\n * This source code is licensed under the MIT license.\n */\n\n'use strict'\n\nconst val...
javascript
chosen
[ { "from": "system", "value": "Add draggable attr to <img>s and set it to false\n" }, { "from": "human", "value": "Emoji = {};\n\nEmoji.baseImagePath = '/packages/davidfrancisco_twemoji/img/';\n\nEmoji.convert = function (str) {\n if (typeof str !== 'string') {\n return '';\n }\n\n ...
javascript
chosen
[ { "from": "system", "value": "Check for process.stdin.isTTY when run directly\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict'; /*jslint node: true, es5: true, indent: 2 */\n\nvar Parser = exports.Parser = require('./parser');\nvar Stringifier = exports.Stringifier = require(...
javascript
chosen
[ { "from": "system", "value": "Resolve ONLY file:// deps relative to package root, everything else CWD\n" }, { "from": "human", "value": "\"use strict\"\nvar fs = require(\"fs\")\nvar path = require(\"path\")\nvar dz = require(\"dezalgo\")\nvar npa = require(\"npm-package-arg\")\n\nmodule.exports...
javascript
chosen
[ { "from": "system", "value": "Multiply inner circle coefficient by .95 to ensure a stroke remains\n" }, { "from": "human", "value": "'use strict'\n\nvar svg = require('virtual-dom/virtual-hyperscript/svg')\nvar bezier = require('bezier-easing')\nvar Size = require('create-svg-size')\nvar Circle ...
javascript
chosen
[ { "from": "system", "value": "Extend existing keydown handler, instead of overriding it\n" }, { "from": "human", "value": "const onepass = require(\"onepass\")({\n bundleId: \"com.sudolikeaboss.sudolikeaboss\"\n});\n\nexports.decorateTerm = (Term, { React }) => {\n return class extends React.C...
javascript
chosen
[ { "from": "system", "value": "Fix AMD / UMD problems." }, { "from": "human", "value": "(function(root, factory) {\n \n if (typeof define === 'function' && define.amd) {\n \n define(['backbone', 'underscore', 'backbone.paginator'], function(Backbone, Underscore, PageableCollec...
javascript
chosen
[ { "from": "system", "value": "Allow passing in a title\n" }, { "from": "human", "value": "#! /usr/bin/env node\n\nvar opts = require('optimist').argv\nvar through = require('through2');\n\nfunction indexhtmlify(opts) {\n var s = through(function onwrite(chunk, enc, cb) {\n s.push(chunk...
javascript
chosen
[ { "from": "system", "value": "Use Array.reduce to compute how much to delete\n" }, { "from": "human", "value": "const Automerge = require('automerge')\n\nfunction applyCodeMirrorChangeToAutomerge(state, findList, change, cm) {\n const startPos = cm.indexFromPos(change.from)\n\n if (change.to.l...
javascript
chosen
[ { "from": "system", "value": "Add some text to try out ci setup\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport logo from './logo.svg'\nimport './App.css'\n\nclass App extends Component {\n render() {\n return (\n <div className=\"App\">\n <hea...
javascript
chosen
[ { "from": "system", "value": "Define UrlHelper meta-data on the class instead of the prototype.\n" }, { "from": "human", "value": "// DecentCMS (c) 2015 Bertrand Le Roy, under MIT. See LICENSE.txt for licensing details.\n'use strict';\n\nfunction UrlHelper(scope) {\n this.scope = scope;\n}\nUrl...
javascript
chosen
[ { "from": "system", "value": "Add test for the endpoint method\n" }, { "from": "human", "value": "describe('traffic', function() {\n beforeEach(function() {\n window.matrix.settings = {\n profileId: ''\n };\n subject = window.matrix.traffic;\n });\n it('has initial points', fun...
javascript
chosen
[ { "from": "system", "value": "Add spec for new keyCapture modifier handling\n" }, { "from": "human", "value": "\"use strict\";\n\ndescribe('keyCapture', function() {\n beforeEach(module('arethusa.core'));\n\n describe('onKeyPressed', function() {\n it('calls the given callback', inject(func...
javascript
chosen
[ { "from": "system", "value": "Remove polyfills from the specHelper temporarily (as it fixes a weird bug)\n" }, { "from": "human", "value": "require.config({\n paths:{\n jquery: \"vendor/assets/javascripts/jquery/jquery-1.7.2.min\",\n jsmin: \"vendor/assets/javascripts/jsmin\",\n polyfi...
javascript
chosen
[ { "from": "system", "value": "Check BF condition every minute\n" }, { "from": "human", "value": "import { useEffect, useState } from 'react';\nimport { isBlackFridayPeriod } from 'proton-shared/lib/helpers/blackfriday';\n\nconst EVERY_TEN_MINUTES = 10 * 60 * 1000;\n\nconst useBlackFriday = () =>...
javascript
chosen
[ { "from": "system", "value": "Move slice variable assignment out of loop\n" }, { "from": "human", "value": "var isPatched = false;\n\nif (isPatched) return console.log('already patched');\n\nfunction addColor(string, name) {\n var colors = {\n green: ['\\x1B[32m', '\\x1B[39m'],\n red: ['\...
javascript
chosen
[ { "from": "system", "value": "Move documark-cache dependency to top of the document. Check for head container\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar sass = require('node-sass');\n\nmodule.exports = function dmpSass ($, document, do...
javascript
chosen
[ { "from": "system", "value": "Test to see if colors package works\n" }, { "from": "human", "value": "\nvar postcss = require('postcss'),\n colors = require('color');\n\nmodule.exports = postcss.plugin('postcss-lowvision', function () {\n return function (css) {\n css.walkDecls('colo...
javascript
chosen
[ { "from": "system", "value": "Use module.exports instead of return\n" }, { "from": "human", "value": "'use strict'\n\nconst driver = require('node-phantom-simple')\n\nfunction genPromiseFunc(originalFunc) {\n return function () {\n const _args = Array.prototype.slice.call(arguments)\n con...
javascript
chosen
[ { "from": "system", "value": "Include datasources key in latest reference.\n" }, { "from": "human", "value": "var fs = require('fs'),\n path = require('path');\n\n// Load all stated versions into the module exports\nmodule.exports.version = {};\n\n['2.0.0', '2.0.1', '2.0.2', '2.1.0', '2.1.1',...
javascript
chosen
[ { "from": "system", "value": "Fix typo and remove some illogical code\n" }, { "from": "human", "value": "\"use strict\";\n\n// Return the panorama ID\nvar getPanoID = function(string) {\n\tlet value = decodeURIComponent(string).match(\"^https:\\/\\/.*\\!1s(.*)\\!2e.*$\");\n\n\tif (value === null...
javascript
chosen