conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add method to check is content is in another collection\n\n\nFormer-commit-id: b5590a20f5a01e0fbe3aa4a856e6450a12d5cf8f\nFormer-commit-id: 7c42e5bbf445bfffb43de66ed823417c51d6e4df\nFormer-commit-id: 2675c6ef54e4d1ad9118400029a8ead243f426e9" }, { "from": "human", "va...
javascript
chosen
[ { "from": "system", "value": "Make the alarm list in Vitrage Topology view related to the selected entity\n\nChange-Id: I1de754ada13262ffa0f7a76de2c1b390f31a36f6\nstory: #2004725\ntask: # 28763\n" }, { "from": "human", "value": "angular\n .module('horizon.dashboard.project.vitrage')\n .direct...
javascript
chosen
[ { "from": "system", "value": "Use mocked sended and receiver with nodemock\n" }, { "from": "human", "value": "var assert = require('chai').assert;\nvar nodemock = require('nodemock');\n\nvar Connection = require('../lib/backend-adaptor').Connection;\n\nsuit('Connection', function() {\n var conn...
javascript
chosen
[ { "from": "system", "value": "Test added for example in documentation\n\n{ animal: 'dog', action: 'fetch' }\n" }, { "from": "human", "value": "// Mocha Specification Cases\n\nconst assert = require('assert');\nconst fetchJson = require('./node-fetch-json.js');\n\n/////////////////////////////...
javascript
chosen
[ { "from": "system", "value": "webview/katex: Add hack so `\\frac` lines don't disappear.\n\nKaTeX `.frac-line`s don't show up on some of our Android test devices\nand emulators. (This seems to be a perennial problem for KaTeX. See\nthe commit-internal comments for references.)\n\nResolve this by forcing all...
javascript
chosen
[ { "from": "system", "value": "Test type checking of wrapped function\n" }, { "from": "human", "value": "'use strict';\nvar assert = require('assert');\nvar callbackify = require('./');\n\nit('should make a sync function pass return to a callback', function () {\n\tfunction sum (a, b) { return a ...
javascript
chosen
[ { "from": "system", "value": "Improve the default mock behaviour\n\nIt previously just returned an empty object which isn't very useful.\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function() {\n\n function Client() {\n }\n\n Client.prototype.write = function mockWr...
javascript
chosen
[ { "from": "system", "value": "Add 2DBar chart -by jarrick\n" }, { "from": "human", "value": "var FeedsModel = require(\"./../models\").Feeds;\nexports.list = function (req, res) {\n\n var result=[];\n FeedsModel\n .find({FromType: '微博'})\n .count(function (err, weibofeeds) ...
javascript
chosen
[ { "from": "system", "value": "Update use() function. Use local config\n" }, { "from": "human", "value": "\"use strict\";\nglobal.use = function (path) {\n return require('./' + path);\n};\n\nconst Dominion = use('core/server');\nconst Message = use('core/mes...
javascript
chosen
[ { "from": "system", "value": "Add a web server so heroku has something to return\n" }, { "from": "human", "value": "// Copyright (c) 2016 Alejandro Blanco <alejandro.b.e@gmail.com>\n// MIT License\n\nconst bot = require('./src/bggBot');\n" }, { "from": "gpt", "value": "// Copyright (...
javascript
chosen
[ { "from": "system", "value": "Remove test bar csl json\n" }, { "from": "human", "value": "define(['modules/converters/MusicCSLJson/BarModel_CSLJson', 'modules/core/BarModel'], function(BarModel_CSLJson, BarModel) {\n\treturn {\n\t\trun: function() {\n\t\t\ttest(\"BarModel_CSLJson\", function(ass...
javascript
chosen
[ { "from": "system", "value": "Tidy up and test commit\n" }, { "from": "human", "value": "var cheerio = require('cheerio');\n\nfunction parseResultBody(body) {\n $ = cheerio.load(body);\n\n var headings = resultsToArray($, 'div[id^=win0divGPSSR_CLSRSLT_WRK_GROUPBOX2]');\n var classesPerH...
javascript
chosen
[ { "from": "system", "value": "Use a standard database location\n" }, { "from": "human", "value": "// leveldb-driver-test.js\n//\n// Testing the leveldb driver\n//\n// Copyright 2012, StatusNet Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this...
javascript
chosen
[ { "from": "system", "value": "Fix test for posts reducer requesting posts\n" }, { "from": "human", "value": "import { expect } from 'chai';\nimport posts from '../../src/js/store/reducers/posts';\nimport {\n addPost,\n requestPosts,\n receivePosts,\n} from '../../src/js/store/actions/posts';\...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary node_modules/** from sandbox\n" }, { "from": "human", "value": "module.exports = function (config) {\n 'use strict'\n\n config.set({\n files: [\n { pattern: 'data/*.js', mutated: true, included: false },\n { pattern: 'lib/*.js', mut...
javascript
chosen
[ { "from": "system", "value": "Fix Add MW Deployment not working\n\nThe correct variable holding the reference to the file is `filePath`\ninstead of just `file`.\n" }, { "from": "human", "value": "ManageIQ.angular.app.controller('mwAddDeploymentController', MwAddDeploymentController);\n\nMwAddDep...
javascript
chosen
[ { "from": "system", "value": "Correct file to use two spaces\n" }, { "from": "human", "value": "process.env._TESTEM_CONFIG_JS_RAN = true;\n\nmodule.exports = {\n \"framework\": \"qunit\",\n \"test_page\": \"tests/index.html?hidepassed\",\n \"disable_watching\": true,\n \"launch_in_ci...
javascript
chosen
[ { "from": "system", "value": "Update jest config to let ts-jest process JS modules\n\n- no longer uses babel-jest, although the aim is to let ts-jest pass it to that afterwards\n" }, { "from": "human", "value": "const externalTsModules = require('./build//external').externalTsModules\n\nconst ex...
javascript
chosen
[ { "from": "system", "value": "Use babel and commonjs plugin for rollup\n" }, { "from": "human", "value": "import resolve from 'rollup-plugin-node-resolve'\n\nexport default {\n input: 'src/index.js',\n output: {\n file: 'lib/index.js',\n format: 'cjs'\n },\n plugins: [resolve()]\n}\n" ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Minor Formatting Changes for Is OUTC Datetime Test\"\n\nThis reverts commit b63874aca26d4af2ba071bdfd0b03d2da9304fcb.\n" }, { "from": "human", "value": "var assert = require(\"assert\");\n\nvar dateFormat = require(\"./../lib/dateformat\");\n\ndescribe(\"is...
javascript
chosen
[ { "from": "system", "value": "Add isPrime function to Pernicious\n" }, { "from": "human", "value": "var Pernicious = function(){}\n\nPernicious.prototype.is_pernicious = function (num) {\n num.toString(10)\n};\n\n\nPernicious.prototype.isPrime = function(number){\n \n}\n\nmodule.exports = Pern...
javascript
chosen
[ { "from": "system", "value": "Add custom config for notifier catcher\n" }, { "from": "human", "value": "/* @flow */\nimport EmailSmtpProvider from './email/smtp'\n// Types\nimport type {ChannelType} from '../index'\nimport type {EmailRequestType} from '../models/notification-request'\n\nexport d...
javascript
chosen
[ { "from": "system", "value": "Modify app to expect IP/Port from .config, or use Cloud9 Port/IP if none found.\n" }, { "from": "human", "value": "module.exports = function(app) {\n var mongoose = require('mongoose'); // require mongoose (for mongodb integration\n var fs = require('fs'); // nece...
javascript
chosen
[ { "from": "system", "value": "Set discord status on ready instead.\n" }, { "from": "human", "value": "const MessageHandler = require(\"./MessageHandler.js\");\nvar appConfig = require(\"./config.json\");\nvar Discord = require('discord.io');\n\n// Create Discord Bot (based on token in config)\nv...
javascript
chosen
[ { "from": "system", "value": "Use .tpl as the confdir\n" }, { "from": "human", "value": "// tpl - a general purpose template cli\n// (c) 2011 Paul Vorbach. Licensed under MIT.\n;(function() {\n\nvar fs = require('fs');\nvar path = require('path');\n\nvar append = require('append');\nvar confdir ...
javascript
chosen
[ { "from": "system", "value": "Stop DevTools to open on startup\n" }, { "from": "human", "value": "const {app, BrowserWindow} = require('electron')\nconst path = require('path')\nconst url = require('url')\n\nlet win\n\nfunction createWindow () {\n\twin = new BrowserWindow({width: 800, height: 60...
javascript
chosen
[ { "from": "system", "value": "Fix up some spacing in the main module file.\n" }, { "from": "human", "value": "var EventEmitter=require('events').EventEmitter;\nvar midi=require('./build/default/midi_addon');\nmidi.input.prototype.__proto__=EventEmitter.prototype;\nmodule.exports=midi;\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Add additional sample gpx files and a means to select the file and the track via request parameter.\n" }, { "from": "human", "value": "requirejs.config({\n\n\tpaths: {\n\t\tjquery: \"http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min\",\n\t\tasync: \"lib/a...
javascript
chosen
[ { "from": "system", "value": "Use select instead of focusing.\n" }, { "from": "human", "value": "(() => {\n 'use strict';\n\n const addressEl = document.getElementsByClassName('address')[0];\n function copyAddress() {\n const email = atob('IGN0ZXJlZmlua29AZ21haWwuY29tIA==').trim();\n\n ...
javascript
chosen
[ { "from": "system", "value": "Replace deprecated use of `bw.openDevTools`\n" }, { "from": "human", "value": "var app = require('app'); // Module to control application life.\nvar BrowserWindow = require('browser-window'); // Module to create native browser window.\n\n// Report crashes to our s...
javascript
chosen
[ { "from": "system", "value": "Add also the method to the health data\n" }, { "from": "human", "value": "const got = require('got');\n\nmodule.exports = data => {\n if (typeof data === 'string') {\n data = { url: data };\n }\n data.method = data.method || 'get';\n return {\n check: () =...
javascript
chosen
[ { "from": "system", "value": "Add support for 2020 ECMAScript version\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n\tparserOptions: {\n\t\tecmaVersion: 2018,\n\t\tsourceType: 'module'\n\t},\n\n\tplugins: ['import'],\n\n\trules: {\n\t\t'prefer-object-spread': 1,\n\t\t'p...
javascript
chosen
[ { "from": "system", "value": "Fix settings update when unknown theme is stored\n" }, { "from": "human", "value": "\"use strict\";\n\nimport socket from \"../socket\";\nimport upload from \"../upload\";\nimport store from \"../store\";\n\nsocket.once(\"configuration\", function(data) {\n\tstore.c...
javascript
chosen
[ { "from": "system", "value": "Fix linting tests for symlinked node_modules\n" }, { "from": "human", "value": "'use strict';\n\nconst lint = require('mocha-eslint');\n\nlint([\n 'index.js',\n 'addon',\n 'addon-test-support',\n 'app',\n 'bin',\n 'config',\n 'lib',\n 'node-tests',\n 'tests...
javascript
chosen
[ { "from": "system", "value": "Add scanner serial to view\n" }, { "from": "human", "value": "function(doc) {\n if (doc.type === \"child\" && doc.scan_status !== 'scan_complete' && doc.domain === \"uth-rhd\") {\n emit([doc.domain, 'VH014466XK', doc.exam_number, doc.scan_time], doc._id);\...
javascript
chosen
[ { "from": "system", "value": "Change all calls to https\n" }, { "from": "human", "value": "//Various Spark config parameters\n\nvar apiHostSandbox = 'sandbox.spark.autodesk.com/api/v1',\n\tapiHostProduction = 'api.spark.autodesk.com/api/v1',\n\tapiHost = ENVIRONMENT === 'production' ? apiHostPro...
javascript
chosen
[ { "from": "system", "value": "Reconnect websocket on disconnect; a bit of a refactor\n" }, { "from": "human", "value": "var config = require('config');\nvar WebSocket = require(\"ws\");\n\nmodule.exports = (function() {\n\tif (!config.websocket) {\n\t\tconsole.error(\"Websocket not configured\")...
javascript
chosen
[ { "from": "system", "value": "Move JS Collapse sidebar to theme\n" }, { "from": "human", "value": "/**\n * Created by tofid on 25.02.15.\n */\n\n/**\n * Scroll to element\n * @param element\n */\nfunction scrollTo(element, duration) {\n duration = duration || 500;\n $('html, body').animate...
javascript
chosen
[ { "from": "system", "value": "Test: Call loadConfig method in beforeEach so test can check if called\n" }, { "from": "human", "value": "import {Configure} from '../src/configure';\n\nclass HttpStub {\n get(url) {\n\n }\n}\n\nclass EventStub {\n\n}\n\ndescribe('the main configure.js singlet...
javascript
chosen
[ { "from": "system", "value": "Add newlines to amd shim\n\nThe closing newline is necessary when the module we're shimming has a trailing comment.\n" }, { "from": "human", "value": "'use strict';\nvar stew = require('broccoli-stew');\n\nmodule.exports = function shimAmd(tree, nameMapping) {\n re...
javascript
chosen
[ { "from": "system", "value": "Check and then use the same.." }, { "from": "human", "value": "var fs = require('fs');\n\n// Require given configuration\nif (fs.existsSync(__dirname + '/config/data.js')) {\n exports = module.exports = require('./config/data.js');\n}\nelse {\n exports = module.ex...
javascript
chosen
[ { "from": "system", "value": "Add information for paddles, players, and ball.\n" }, { "from": "human", "value": "'use strict';\n\nvar canvas = document.querySelector('canvas');\nvar context = canvas.getContext('2d');\n" }, { "from": "gpt", "value": "'use strict';\n\nvar canvas = docu...
javascript
chosen
[ { "from": "system", "value": "Remove an unused property set.\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2019 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfoam.CLASS({\n package: 'foam.layout',\n name: 'Section',\n require...
javascript
chosen
[ { "from": "system", "value": "Use an if statement for rounding delay counter rather than modulo\n" }, { "from": "human", "value": "/**\n * @depends ../core/AudioletNode.js\n */\n\nvar Delay = new Class({\n Extends: AudioletNode,\n initialize: function(audiolet, maximumDelayTime, delayTime)...
javascript
chosen
[ { "from": "system", "value": "Use SeatsMap type in loadSeats signature.\n" }, { "from": "human", "value": "/* @flow */\nimport type { Action } from './types';\nimport type { SeatData } from '../types';\n\n\nexport function loadSeats(seats: { [id: string]: SeatData }): Action {\n return { type: ...
javascript
chosen
[ { "from": "system", "value": "Stop pollution of global namespace.\n" }, { "from": "human", "value": "$(document).ready(function() {\n\tnumber = Math.floor((Math.random() * 5)) + 1;\n\t$('body').css('background-image', 'url(backgrounds/' + number + '.jpg)');\n\t$('.wrapper').delay(500).fadeIn(100...
javascript
chosen
[ { "from": "system", "value": "Remove some console.logs from the server side\n" }, { "from": "human", "value": "Meteor.methods({\n updateDoc (name, text, clientId) {\n console.log(arguments)\n Pads.upsert(\n { name },\n { $set: { text, lock: { time: (new Date).getTime(), clientId...
javascript
chosen
[ { "from": "system", "value": "Allow for passing an ETag for convenience\n" }, { "from": "human", "value": "'use strict';\n\nvar angular = require('angular');\nmodule.exports = httpEtagInterceptorFactory;\n\nhttpEtagInterceptorFactory.$inject = ['queryStringify'];\n\nfunction httpEtagInterceptorF...
javascript
chosen
[ { "from": "system", "value": "Remove bootstrap.js from being added into frontend\n" }, { "from": "human", "value": "//= require jquery\n//= require jquery_ujs\n//= require cookies\n//= require rails-timeago\n//= require bootstrap\n//= require_self\n" }, { "from": "gpt", "value": "//=...
javascript
chosen
[ { "from": "system", "value": "Rename functions to minimize verbosity\n" }, { "from": "human", "value": "// Place all the behaviors and hooks related to the matching controller here.\n// All this logic will automatically be available in application.js.\n// You can use CoffeeScript in this file: h...
javascript
chosen
[ { "from": "human", "value": "Add ajax call for background text and copy and paste method to create dynamic text background\n" }, { "from": "gpt", "value": "$( document ).ready(function() {\n $(\"body\").hide(0).delay(100).fadeIn(2200);\n\n //AJAX call for dynamic text background data\n $.ajax...
javascript
chosen
[ { "from": "system", "value": "Enable ReactiveTable filter for residentIds field\n" }, { "from": "human", "value": "Template.activitiesTableResidentNamesFilter.onRendered(function () {\n // Render Bootstrap select widget on resident filter\n $('#resident-filter').selectpicker();\n});\n\nTemplat...
javascript
chosen
[ { "from": "system", "value": "Use correct type for id\n" }, { "from": "human", "value": "// model schema for articles\nvar mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\nvar articleSchema = Schema({\n feed_id: { type: Number, ref: 'Feed' },\n url: {type: String, unique: ...
javascript
chosen
[ { "from": "system", "value": "Put focus on search field on UI reset\n\nSigned-off-by: Kaustav Das Modak <ba1ce5b1e09413a89404909d8d270942c5dadd14@yahoo.co.in>\n" }, { "from": "human", "value": "(function () {\n\n // Add behaviour for option buttons\n app(function (api) {\n\n var res...
javascript
chosen
[ { "from": "system", "value": "Add editable option to the timeline\n" }, { "from": "human", "value": "/* global Calendar, vis */\n\n(function() {\n \"use strict\";\n\n var calendar = new Calendar();\n calendar.init(document.getElementById('visualization'),\n {\n height: \"100vh\"...
javascript
chosen
[ { "from": "system", "value": "Test for wrappers of modifiers\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n chai = require('chai'),\n expect = chai.expect,\n fs = require('fs'),\n styleguide = require('../lib/styleguide');\n\ndescribe('KSS parser', function() {\n\n var jso...
javascript
chosen
[ { "from": "system", "value": "Add jquery to global require\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n\nrequire.config({\n baseUrl: \"..\",\n \n paths: {\n 'jasmine': 'test/lib/jasmine-2.0.0/jasmine',\n 'jasmine-html': 'test/lib/jasmine-2.0.0/jasmine-...
javascript
chosen
[ { "from": "system", "value": "Replace trackSelector with getTrack function\n\nThe IDs being used by Google seem to be in flux, this tries the new ID\nfirst before falling back to the old one.\n" }, { "from": "human", "value": "'use strict';\n\n/* global Connector */\n\nConnector.playerSelector =...
javascript
chosen
[ { "from": "system", "value": "Use some instead of filter\n" }, { "from": "human", "value": "var cp = require('child_process');\nvar join = require('path').join;\nvar walk = require('walk');\nvar mochaBin = join(__dirname, '..', 'node_modules', '.bin', 'mocha');\nvar _ = require('underscore');\n\...
javascript
chosen
[ { "from": "system", "value": "Clear Travis env after test.\n" }, { "from": "human", "value": "\nvar detect = require(\"../lib/detect\");\nvar execSync = require('child_process').execSync;\nif (!execSync) {\n var exec = require('execSync').exec;\n var execSync = function(cmd){\n return exec(...
javascript
chosen
[ { "from": "system", "value": "Support for parsing PHP extensions\n" }, { "from": "human", "value": "const external = require('../helpers').external\n\nmodule.exports.composerurl = composerurl\nfunction composerurl (moduleName) {\n if (moduleName.split('/').length === 1) {\n // composer packa...
javascript
chosen
[ { "from": "system", "value": "Fix percentage recalculation when both votes are zero\n" }, { "from": "human", "value": "var app = angular.module('catsvsdogs', []);\nvar socket = io.connect({transports:['polling']});\n\nvar bg1 = document.getElementById('background-stats-1');\nvar bg2 = document.g...
javascript
chosen
[ { "from": "system", "value": "Set initial EVL applications query to month\n" }, { "from": "human", "value": "define([\n 'vehicle-licensing/collections/services',\n 'extensions/views/timeseries-graph/timeseries-graph',\n 'extensions/views/tabs',\n 'extensions/views/graph/headline',\n],\n fun...
javascript
chosen
[ { "from": "system", "value": "[storybook] Read port and enabled status from configuration\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/* eslint-disable no-process-exit, no-console */\nconst path = require('path')\nconst express = require('express')\nconst middleware = require('@kad...
javascript
chosen
[ { "from": "system", "value": "Add connect() description in RexsterClient tests\n" }, { "from": "human", "value": "var should = require('should');\n\nvar grex = require('../index.js');\nvar _ = require(\"lodash\");\nvar RexsterClient = require('../src/rexsterclient.js');\n\n\nvar defaultOption...
javascript
chosen
[ { "from": "system", "value": "Delete and search with error message\n" }, { "from": "human", "value": "require('should');\nvar utils = require(process.cwd()+'/test/utils/test-commons');\nvar GoatDB = require('../index.js');\n\nvar db = GoatDB(utils.testDirectory, utils.options);\n\ndescribe('DELE...
javascript
chosen
[ { "from": "system", "value": "Stop failing to compile under nodejs\n" }, { "from": "human", "value": "(function(prefix, tenyr_state){\nvar ENVIRONMENT_IS_NODE = typeof process === 'object';\nvar ENVIRONMENT_IS_WEB = typeof window === 'object';\nvar ENVIRONMENT_IS_WORKER = typeof importScripts ==...
javascript
chosen
[ { "from": "system", "value": "Use redux-logger if not in production mode.\n" }, { "from": "human", "value": "const { createStore, applyMiddleware } = require('redux')\nconst thunk = require('redux-thunk')\nconst rootReducer = require('../reducers')\n\nmodule.exports = (preloadedState) => {\n co...
javascript
chosen
[ { "from": "system", "value": "Use string for activity id\n" }, { "from": "human", "value": "const password = (state = [], action) => {\n\n switch (action.type) {\n\n case 'ADD_ACTIVITY':\n\n // Apply password transformation\n\n let activity = {\n title: action.value,\n ...
javascript
chosen
[ { "from": "system", "value": "Add optional username & password parameters to login helper.\n" }, { "from": "human", "value": "/**\n * Helper methods and variables for capser test suite.\n */\n\n// Define the url for all tests.\nvar url = casper.cli.get('url');\n\n// Set default viewport for all ...
javascript
chosen
[ { "from": "system", "value": "Move browser page load to a before step\n" }, { "from": "human", "value": "var Mocha = require('mocha');\n\nmodule.exports = function (browser, dashboard, suite, config) {\n\n suite.addTest(new Mocha.Test('exists', exists));\n\n var modules = Mocha.Suite.create(su...
javascript
chosen
[ { "from": "system", "value": "Make preview URLs include trailing slash when slug is given\n\n- the trailing slash isn't shown usually\n- slash added when a slug is given to be more correct\n" }, { "from": "human", "value": "/*\nExample usage:\n{{gh-url-preview prefix=\"tag\" slug=theSlugValue ta...
javascript
chosen
[ { "from": "system", "value": "Add sourcemaps because error messages are annoying atm.\n" }, { "from": "human", "value": "const\n\t{ mix } = require('laravel-mix'),\n\twebpack = require('webpack');\n\nmix\n\t.webpackConfig({\n\t\tplugins: [\n\t\t\tnew webpack.ProvidePlugin({\n\t\t\t\t$: 'jquery',...
javascript
chosen
[ { "from": "system", "value": "Add notify in git wrapper [ci skip]\n" }, { "from": "human", "value": "var Q = require('q');\nvar _ = require('lodash');\nvar spawn = require('child_process').spawn;\n\nmodule.exports = function(args, options) {\n var deferred = Q.defer();\n\n options =...
javascript
chosen
[ { "from": "system", "value": "Fix publishing the current tag\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict'\n\nvar childProcess = require('child_process')\n , fs = require('fs')\n , packageJson = JSON.parse(fs.readFileSync('./package.json'))\n , version = packageJson.v...
javascript
chosen
[ { "from": "system", "value": "Support for \"file\" attribute. (ck101)\n" }, { "from": "human", "value": "(function(){\n var imgs = document.getElementsByTagName('img');\n var imgs_size = imgs.length;\n var url;\n\n for (var i = 0; i < imgs_size; i++) {\n var el = imgs[i];\n\n ...
javascript
chosen
[ { "from": "system", "value": "Update child fn name to onItemSelect from clickHandler\n" }, { "from": "human", "value": "import {Dropdown} from 'reactjs-components';\nimport React from 'react';\n\nimport Icon from './Icon';\n\nconst getMenuItems = (children) => {\n return [\n {\n classNa...
javascript
chosen
[ { "from": "system", "value": "Fix removed Sprockets 4.x defaults\n\nPut link_tree ../images back with 4.x defaults as the two 3.x lines are\nthe only difference from the 4.x default manifest\n" }, { "from": "human", "value": "// Compatible with Sprockets 3.x defaults to avoid breaking existing a...
javascript
chosen
[ { "from": "system", "value": "Remove the space after the function keyword.\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar assert = require('yeoman-generator').assert;\nvar helpers = require('yeoman-generator').test;\nvar os = require('os');\n\ndescribe('iron...
javascript
chosen
[ { "from": "system", "value": "Fix test to not expect plugins to be defined\n" }, { "from": "human", "value": "\n'use strict';\n\nconst isPlainObj = require( 'is-plain-obj' );\n\ntest( 'index.js', () => {\n\n const config = require( '../index.js' );\n\n expect( isPlainObj( config ) ).toBe( true...
javascript
chosen
[ { "from": "system", "value": "Handle missing projects properly in file-count script\n\nGitOrigin-RevId: 5968fc3c6646a6e75b2b84440d59d9c0cbcead5e\n" }, { "from": "human", "value": "const readline = require('readline')\nconst ProjectEntityHandler = require('../app/src/Features/Project/ProjectEntit...
javascript
chosen
[ { "from": "system", "value": "Throw full error to prevent incorrect truncation\n" }, { "from": "human", "value": "// @flow\n\nimport execa from 'execa';\nimport R from 'ramda';\nimport { getSshConfig } from '../config/getSshConfig';\n\nexport async function runSshCommand({\n command,\n identit...
javascript
chosen
[ { "from": "system", "value": "Add a console warning when balance check fails\n" }, { "from": "human", "value": "import {getBalance} from 'bitcoin/blockexplorerRpc'\nimport {setBalance} from 'redux/actions'\n//\n// Update wallet balance once every 10 minutes\nconsole.log('walletUpdateInterval', p...
javascript
chosen
[ { "from": "system", "value": "Fix a dumb mistake that broke the all-posts page\n" }, { "from": "human", "value": "import moment from 'moment';\nimport { addCallback } from 'meteor/vulcan:core';\n\n// Add 'after' and 'before' properties to terms which can be used to limit posts in time.\nfunction...
javascript
chosen
[ { "from": "system", "value": "Add support for Apollo Engine schemaTag in addition to apiKey\n" }, { "from": "human", "value": "import { getSetting } from '../../modules/settings.js';\n// see https://github.com/apollographql/apollo-cache-control\nexport const engineApiKey = process.env.ENGINE_API...
javascript
chosen
[ { "from": "system", "value": "[Build] Test for CSS file in webpack.prod\n" }, { "from": "human", "value": "const { resolve } = require('path');\nconst webpack = require('webpack');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\nconst ExtractTextPlugin = require(\"extract-text-webpac...
javascript
chosen
[ { "from": "system", "value": "Fix Translate HOC imbrication for tests\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport { connect } from 'react-redux';\nimport RaisedButton from 'material-ui/RaisedButton';\nimport ContentSave from 'material-ui/svg-ic...
javascript
chosen
[ { "from": "system", "value": "Disable hot reloading in test environment\n" }, { "from": "human", "value": "import path from 'path'\nimport fs from 'fs'\n\nconst root = path.join(__dirname, '..')\nconst src = path.join(root, 'src')\nconst dist = path.join(root, 'dist')\n\nconst prod = process.env...
javascript
chosen
[ { "from": "system", "value": "Remove devDependencies and scripts from distribution package.json\n" }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\nconst pkg = require('../package.json');\n\nconst copyFileSync = (source, dest) => {\n const content = fs.r...
javascript
chosen
[ { "from": "system", "value": "Update tags when new comments are left.\n" }, { "from": "human", "value": "import React from 'react'\nimport { connect } from 'react-redux'\nimport { FormattedMessage } from 'react-intl'\n\nimport { openCommentThreads, acceptSelection } from 'redux/actions.js'\n\nfu...
javascript
chosen
[ { "from": "system", "value": "Revert \"add regex generator for object to delete (e.g. '_deprecated': {})\"\n\nThis reverts commit 2774e638e9ffc9ccbfc8db911767d0929910f04b.\n" }, { "from": "human", "value": "'use strict';\n\n/*\n * Browserify transform that strips meta attributes out of the plotl...
javascript
chosen
[ { "from": "system", "value": "Fix travis-ci: forgot to change url in unittests\n" }, { "from": "human", "value": "'use strict';\nexports.config = {\n allScriptsTimeout: 11000,\n\n specs: [\n '*.js'\n ],\n\n capabilities: {\n 'browserName': 'chrome'\n },\n\n baseUrl: 'http://localhost...
javascript
chosen
[ { "from": "system", "value": "Use alert showing user is now logged out.\n" }, { "from": "human", "value": "import React from \"react\";\nimport Login from './Login';\n\nconst LoggedOut = ({auth}) => (\n <div>\n You have been logged out.\n <Login auth={auth}/>\n </div>\n);\n\n...
javascript
chosen
[ { "from": "system", "value": "Add the unit test for domains\n\nChange-Id: I4f64bfa9d019544a2ae41b2be7fc23ab12c843bf\n" }, { "from": "human", "value": "/**\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License. Yo...
javascript
chosen
[ { "from": "system", "value": "Fix source maps for ts files\n" }, { "from": "human", "value": "const common = require('./webpack.common.js')\n// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')\n\nmodule.exports = {\n ...common,\n // plugins: [\n // new BundleAnalyzerPlugi...
javascript
chosen
[ { "from": "system", "value": "Add suppliers feature TO SQUASH\n" }, { "from": "human", "value": "/* eslint no-debugger: 0 */\nimport { combineReducers } from 'redux';\n\nimport auth from './auth';\nimport signupCreateReducer from './signup/create';\nimport signupCompleteReducer from './signup/co...
javascript
chosen
[ { "from": "system", "value": "Convert node list to array\n" }, { "from": "human", "value": "const focusableSelectors = [\n 'input',\n 'select',\n 'a[href]',\n 'textarea',\n 'button',\n '[tabindex]'\n];\n\nconst getFocusableNodesInElement = el => {\n const focusableNodes = el.querySelector...
javascript
chosen
[ { "from": "system", "value": "Enable domain config only for sqlserver\n" }, { "from": "human", "value": "import mysql from './mysql';\nimport postgresql from './postgresql';\nimport sqlserver from './sqlserver';\nimport cassandra from './cassandra';\n\n\n/**\n * List of supported database client...
javascript
chosen
[ { "from": "system", "value": "Use convenience localStorage functions from Backbone\n" }, { "from": "human", "value": "define([\n 'backbone',\n 'ui'\n], function (Backbone, Ui) {\n\n var AppRouter = Backbone.Router.extend({\n routes: {\n // Define some URL routes\n '': 'home',\n ...
javascript
chosen
[ { "from": "system", "value": "Put Raleigh-Durham on the map (literally)\n" }, { "from": "human", "value": "\n$(document).ready(function(){\n \t$(\".us_map\").mapael({\n\t\tmap : {\n\t\t\tname : \"usa_states\",\n\t\t\tcssClass : \"map\",\n\t\t\ttooltip : {\n\t\t\t\tcssClass : \"mapTooltip\" //cla...
javascript
chosen