conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add 'use strict' for node 4.x compat\n" }, { "from": "human", "value": "const browsers = [\n 'last 1 Chrome versions',\n 'last 1 Firefox versions',\n 'last 1 Safari versions'\n];\n\nconst isCI = !!process.env.CI;\nconst isProduction = process.env.EMBER_ENV === 'p...
javascript
chosen
[ { "from": "system", "value": "Test one and two level flatten\n" }, { "from": "human", "value": "import flattenDeep from \"../flattenDeep\"\n\ndescribe(\"flattenDeep\", () => {\n it(\"returns a non nested array as is\", () => {\n expect(flattenDeep([5, \"a\"])).toEqual([5, \"a\"]);\n ...
javascript
chosen
[ { "from": "system", "value": "Add delete method on document datastore\n" }, { "from": "human", "value": "import createDocumentStore from '@sanity/document-store'\nimport client from 'part:@sanity/base/client'\nimport {omit} from 'lodash'\nimport {Observable} from 'rxjs'\nconst serverConnection =...
javascript
chosen
[ { "from": "system", "value": "Fix bug in commented example" }, { "from": "human", "value": "/*\n Automatically instantiates modules based on data-attributes\n specifying module file-names.\n*/\n\nconst moduleElements = document.querySelectorAll('[data-module]')\n\nfor (var i = 0; i < moduleEle...
javascript
chosen
[ { "from": "system", "value": "Change random range to size of collection" }, { "from": "human", "value": " GNU nano 2.2.6 File: test.js ...
javascript
chosen
[ { "from": "system", "value": "Fix bug: can not modify the images of the slideshow\n" }, { "from": "human", "value": "'use strict';\n\nimport { Entity } from 'draft-js';\n\nexport function replaceAtomicBlock (editorState, blockKey, value) {\n\tconst content = editorState.getCurrentContent();\n\tc...
javascript
chosen
[ { "from": "system", "value": "Add dev server status checking for testing safety\n" }, { "from": "human", "value": "import {PROTOCOL, LOCATION, PORT} from '../../shared/constants'\nimport http from 'http'\n\nconst options = {\n\thost: '',\n\tpath: '/data',\n\tport: `${PORT}`,\n\tmethod: 'POST',\n...
javascript
chosen
[ { "from": "system", "value": "Add missing 'process' global for settings tests\n" }, { "from": "human", "value": "const chai = require('chai')\nconst { expect } = chai\nconst SandboxedModule = require('sandboxed-module')\n\ndescribe('Settings', function() {\n describe('s3', function() {\n it(...
javascript
chosen
[ { "from": "system", "value": "Add filteredPosts as computed, add animations to list\n" }, { "from": "human", "value": "import Vue from 'vue';\n\nimport { postsResource } from 'src/util/resources';\nimport template from './posts.html';\n\nexport default Vue.extend({\n template,\n\n data() {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove comment list from video view\n\n- It doesn't work anymore and will belong on performances instead\n" }, { "from": "human", "value": "import * as _ from 'lodash'\nimport React from 'react'\nimport {connect} from 'react-redux'\nimport {compose, withProps} from ...
javascript
chosen
[ { "from": "system", "value": "Put back changes in observer after unsuccessful commit.\n" }, { "from": "human", "value": "const expect = require('chai').expect;\n\nimport { TopicObserver } from \"../topic-observer\";\n\ndescribe('topic observer', () => {\n\n const observer = new TopicObserver(...
javascript
chosen
[ { "from": "system", "value": "Compress true dans les options de cssnext\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar plumber = require('gulp-plumber');\nvar postcss = require('gulp-postcss');\nvar cssnext = require('cssnext');\n\nmodule.exports = function() {\n var proc...
javascript
chosen
[ { "from": "system", "value": "Disable login in debug mode\n" }, { "from": "human", "value": "module.exports = function(req, res, next){\n if (req.session.is_login) return next();\n\n var base = req.app.locals.base,\n redirect = req.url.substring(base.length);\n\n res.redirect(base + 'login...
javascript
chosen
[ { "from": "system", "value": "Change stats server database name (from codebrag to codebrag_stats)\n" }, { "from": "human", "value": "var MongoClient = require('mongodb');\n Q = require('q');\n\nfunction initialize(callback) {\n var connect = Q.denodeify(MongoClient.connect);\n var dbInitial...
javascript
chosen
[ { "from": "system", "value": "Add simple authentication support for doc fetch\n\nResolves:\nhttps://github.com/joffrey-bion/livedoc/issues/82\n" }, { "from": "human", "value": "// @flow\nimport { push } from 'react-router-redux';\nimport { apply, call, put, takeLatest } from 'redux-saga/effects'...
javascript
chosen
[ { "from": "system", "value": "Support facets in the url that don't exist yet\n\nFor example, the page first loads with a domain=Vivaldi facet\nin the URL. But there is no such domain, because domains are\nnot loaded for another .1 second. So the facet is in the URL\nbut not the search bar. With this fix, wh...
javascript
chosen
[ { "from": "system", "value": "Fix regexp extracting `repositoryId` for GitHub if it contains dot\n" }, { "from": "human", "value": "import { parse as parseUrl } from 'url';\n\nimport _ from 'lodash';\n\nconst KNOWN_REPOSITORIES = {\n 'github.com': parsedRepositoryUrl => {\n const repos...
javascript
chosen
[ { "from": "system", "value": "Rename variables to avoid conflict.\n" }, { "from": "human", "value": "'use strict';\n\nconst menu = require('../common/menu');\nconst banner = require('../common/banner');\nconst donate = require('../common/donate');\nconst microgrants = require('../common/microgra...
javascript
chosen
[ { "from": "system", "value": "Add OCS API header per default\n\nRelieve @PVince from having to write it all the time ;-)\n" }, { "from": "human", "value": "$(document).on('ajaxSend',function(elm, xhr) {\n\txhr.setRequestHeader('requesttoken', oc_requesttoken);\n});" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Fix click event handler so it works under firefox\n" }, { "from": "human", "value": "'use strict';\n\nTemplate.notification.helpers({\n notificationColor: function(notificationType) {\n return Notifications.getNotificationClass(notificationType);\n }\n}...
javascript
chosen
[ { "from": "system", "value": "Add photo to avatar if possible\n" }, { "from": "human", "value": "import React from 'react'\nimport { ScrollView, View } from 'react-native'\nimport { List, ListItem, SearchBar } from 'react-native-elements'\nimport PropTypes from 'prop-types'\n\nfunction PersonLis...
javascript
chosen
[ { "from": "system", "value": "Check if requestAnimationFrame exists (for travis)\n" }, { "from": "human", "value": "\nTinytest.add(\n 'Loader - Load all critical files first',\n function (test) {\n var scripts = document.getElementsByTagName('script');\n scripts = Array.prototype.slice.c...
javascript
chosen
[ { "from": "system", "value": "Define LibraryAuthor schema for testing\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar sugar = require('../lib/mongoose-sugar');\n\nvar schema = sugar.schema(mongoose);\nvar ref = sugar.ref;\nvar refs = sugar.refs;\nvar unique = sugar.un...
javascript
chosen
[ { "from": "system", "value": "Add title to emojify component\n\nAlso throw shallowCompare into shouldComponentUpdate\n" }, { "from": "human", "value": "import React from 'react';\nimport Emoji from '../../lib/Emoji';\n\nclass Emojify extends React.Component {\n static propTypes = {\n text: R...
javascript
chosen
[ { "from": "system", "value": "Clear files and add file row.\n" }, { "from": "human", "value": "// Complete JS code.\nconsole.log('start');\n\nvar BASE_URL = \"http://localhost:6969/api\";\nvar $ = require(\"cash-dom\");\nvar nanoajax = require(\"nanoajax\");\nvar saveAs = require('file-saver').s...
javascript
chosen
[ { "from": "system", "value": "fix: Fix assistive access error detection\n" }, { "from": "human", "value": "import { ERROR_OCCURED, RESET_ERRORS } from '../actions/errors'\n\nconst initialState = {\n error: null,\n assistiveAccessDisabled: false\n}\n\nexport default function errors(state = init...
javascript
chosen
[ { "from": "system", "value": "Switch node example to es6\n" }, { "from": "human", "value": "/*jshint node:true */\n\"use strict\";\n\nvar fs = require(\"fs\"),\n util = require(\"util\"),\n mp3Parser = require(__dirname + \"/../../main\"),\n pathToMp3 = process.argv[2],\n toArrayBuff...
javascript
chosen
[ { "from": "system", "value": "Fix class name in order to get correct user name\n" }, { "from": "human", "value": "window.onload = function(){\n if(document.getElementsByTagName('tspan').length > 0){\n run();\n }\n function run(){\n var elements = document.getElementsByTagName('tspan');\...
javascript
chosen
[ { "from": "system", "value": "Add prop to batteryLevel emit on prop instance. Only for API synchronicity between prop and service event handlers.\n" }, { "from": "human", "value": "var eventTypes = require('../uuids').ballEventNotification;\n\nfunction activateNotificationEvents(prop, ballNotifi...
javascript
chosen
[ { "from": "system", "value": "Use event for loading annotations\n" }, { "from": "human", "value": "\nclass TickBar {\n constructor(annotator){\n this.annotator = annotator;\n\n // Create the element\n this.$tickBar = $(\"<div class='annotator-tickbar'></div>\");\n ...
javascript
chosen
[ { "from": "system", "value": "Add node cluster to app.\n" }, { "from": "human", "value": "var express = require('express');\nvar http = require('http');\nvar mongoose = require('mongoose');\nvar kue = require('kue');\n\nvar ds = require('./lib/data-store');\n\n// Connect to MongoDB\nmongoose.con...
javascript
chosen
[ { "from": "system", "value": "Add \"why\" comment for internalKeyIsDown\n" }, { "from": "human", "value": "import React, { useEffect, useState } from \"react\";\nimport AudioNode from \"./AudioNode\";\n\nexport default function KeyboardKey({ keyboardKey, keyType = \"letter-key\" }) {\n const [k...
javascript
chosen
[ { "from": "system", "value": "Add jitter to ajax responses\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar express = require('express');\nvar simpleFsRest = require('simple-fs-rest');\nvar app = express();\n\n// Link the REST Service to anything under /api. ex: /api/users/\napp.use('...
javascript
chosen
[ { "from": "system", "value": "Fix connect string for Heroku\n" }, { "from": "human", "value": "const path = require('path');\nconst express = require('express');\nconst winston = require('winston');\n\nconst app = express();\nconst PORT = process.env.PORT || 3000;\n\napp.use('/dist', express.sta...
javascript
chosen
[ { "from": "system", "value": "Call the mongo connect method with the current configuration.\n" }, { "from": "human", "value": "'use strict';\n\nvar app = require('./server'),\n environment = process.env.NODE_ENV,\n getConfig = require('./config/config').getConfig,\n configPath = './conf...
javascript
chosen
[ { "from": "system", "value": "Remove prop mapper from auth wrapper\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport hoistStatics from 'hoist-non-react-statics'\nimport isEmpty from 'lodash.isempty'\n\nconst defaults = {\n Au...
javascript
chosen
[ { "from": "system", "value": "Allow to reverse sort columns in projects list\n" }, { "from": "human", "value": "var trexControllers = angular.module('trexControllers', []);\n\ntrexControllers.controller('ProjectListCtrl', ['$scope', '$http',\n function($scope, $http) {\n $http.get('/ap...
javascript
chosen
[ { "from": "system", "value": "Check to see if we're collaborating properly.\n" }, { "from": "human", "value": "var controllers = OPAL.module('opal.controllers', [\n\t'ngCookies',\n\t'opal.services',\n\t'ui.event',\n\t'ui.bootstrap',\n 'ngProgressLite',\n 'mgcrea.ngStrap.typeahead',\n 'm...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary login during build model frontend test\n" }, { "from": "human", "value": "casper.test.begin('build model', function suite(test) {\n casper.start('http://localhost:5000', function() {\n this.page.viewportSize = { width: 1920, height: 1080...
javascript
chosen
[ { "from": "system", "value": "Stop the server if MongoDB is not started\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar config = require('config');\nvar semver = require('semver')\n\n// configure mongodb\nmongoose.connect(config.mongodb.connectionString || '...
javascript
chosen
[ { "from": "system", "value": "Update slash command to not intefere with native search\n" }, { "from": "human", "value": "var express = require('express');\nvar Global = require('../global');\nvar search = require('../commands/search');\n\nvar router = express.Router();\n\nrouter.post('/*', funct...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix outputPath in default config\n" }, { "from": "human", "value": "'use babel'\n\nimport {Template} from 'string-templates'\n\nexport const CONFIG_FILE_NAME = '.ucompilerrc'\n\nexport const DEFAULT_IGNORED = [\n 'node_modules',\n 'bower_components',\n 'cov...
javascript
chosen
[ { "from": "system", "value": "Allow single argument calls to methods\n" }, { "from": "human", "value": "/* TODO:\n Cache individual objects, like ATTR and NTH simple selectors.\n Reorder pseudos so that the ones with highest overhead (like :hover) come last.\n*/\n\n\n/** @define {boolean} */\n...
javascript
chosen
[ { "from": "system", "value": "Remove unary and binary restrictions.\n" }, { "from": "human", "value": "'use strict'\n\nconst fs = require('fs-extra')\nconst globby = require('globby')\nconst path = require('path')\nconst pify = require('pify')\n\n/*-----------------------------------------------...
javascript
chosen
[ { "from": "system", "value": "Add functionality for server to respond to POST request to /inventory by querying the database and returning the result\n" }, { "from": "human", "value": "var express = require('express');\nvar bodyParser = require('body-parser');\nvar db = require('../database/inde...
javascript
chosen
[ { "from": "system", "value": "Use path.join to fix relative files path\n" }, { "from": "human", "value": "import recursiveReadSync from 'recursive-readdir-sync';\nimport minimatch from 'minimatch';\n\nexport default function getFiles(path, exclude = []) {\n const files = recursiveReadSync(path)...
javascript
chosen
[ { "from": "system", "value": "Add confirmation dialog to close order." }, { "from": "human", "value": "\"use strict\";\n\n(function () {\n angular\n .module(\"argo\")\n .controller(\"Orders\", Orders);\n\n Orders.$inject = [\"toastService\", \"ordersService\"];\n function ...
javascript
chosen
[ { "from": "system", "value": "Make sure `didDestroyElement` hook is called" }, { "from": "human", "value": "import { set } from 'ember-metal/property_set';\nimport Component from 'ember-views/components/component';\nimport { moduleFor, RenderingTest } from '../../utils/test-case';\n\nmoduleFor('...
javascript
chosen
[ { "from": "system", "value": "Add todo flag for removing firebase auth from default user model\n\n" }, { "from": "human", "value": "import { auth } from '@/config/firebase';\n// import store from '@/config/store';\n\nexport default function User(user = {}) {\n this.uid = user.uid || null;\n th...
javascript
chosen
[ { "from": "system", "value": "Remove commented code not used.\n\n\nFormer-commit-id: 5abc3a92a3e5581965cae00d7d71705c553308c8" }, { "from": "human", "value": "setupFlorence();\n\n\n//forms field styling markup injection\n//$('select:not(.small)').wrap('<span class=\"selectbg\"></span>');\n//$('s...
javascript
chosen
[ { "from": "system", "value": "Implement simulateProgress() for example page\n" }, { "from": "human", "value": "angular.module('progressButtonDemo', ['progressButton'])\n\t.controller('ProgressButtonsCtrl', function($scope) {\n\t\t$scope.generate = function(button) {\n\t\t\tbutton.progressTimed(3...
javascript
chosen
[ { "from": "system", "value": "Update array tree example for testing\n" }, { "from": "human", "value": "\n(function ($) {\n \"use strict\";\n $(document).ready(init);\n\n // Tree array testing function\n function init($) {\n createArrayTree();\n// createOther();\n }\n\n function creat...
javascript
chosen
[ { "from": "system", "value": "Twitch: Support the HTML 5 player, as well as the old Flash player.\n" }, { "from": "human", "value": "function onKeyPress(key) {\n var player = null;\n var objs = document.querySelectorAll(\"object\");\n for (var i = 0; i < objs.length; i++) {\n if(...
javascript
chosen
[ { "from": "system", "value": "Fix invalid column error in membership seeder\n" }, { "from": "human", "value": "module.exports = {\n up: (queryInterface) => {\n return queryInterface.bulkInsert('Memberships',\n [\n {\n memberId: '75b936c0-ba72-11e7-84e1-058ffffd96c5',\n ...
javascript
chosen
[ { "from": "system", "value": "Add validations for gender and year\n" }, { "from": "human", "value": "import { createValidator, required, email } from '../../utils/validation'\n\nexport default createValidator({\n name: [required],\n email: [required, email],\n phone_number: [required],\n sla...
javascript
chosen
[ { "from": "system", "value": "ENYO-3171: Remove irrelevant text from sample\n\nEnyo-DCO-1.1-Signed-off-by: Stephen Choi <stephen.choi@lge.com>\n" }, { "from": "human", "value": "var\n\tkind = require('enyo/kind');\n\nvar\n\tDragAvatar = require('enyo/DragAvatar'),\n\tEnyoImage = require('enyo/Im...
javascript
chosen
[ { "from": "system", "value": "Use all args as input string\n" }, { "from": "human", "value": "var input = process.argv[2]\n\n// https://stackoverflow.com/questions/5878682/node-js-hash-string#comment15839272_11869589\nvar hash = require('crypto').createHash('md5').update(input).digest(\"hex\")\n...
javascript
chosen
[ { "from": "system", "value": "Set webpack loaders for .coffee\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\n\n/**\n * This is the Webpack configuration file for local development.\n */\nmodule.exports = {\n devtool: 'eval',\n\n entry: [\n ...
javascript
chosen
[ { "from": "system", "value": "Copy more files to the out dir for package\n" }, { "from": "human", "value": "'use strict';\nvar gulp = require('gulp');\nvar ts = require('gulp-typescript');\nvar concat = require('gulp-concat');\nvar sourcemaps = require('gulp-sourcemaps');\nvar merge = require('m...
javascript
chosen
[ { "from": "system", "value": "Use - instead of _ when converting filename in file upload\n" }, { "from": "human", "value": "Ext2.ns('Kwc.Basic.DownloadTag');\nKwc.Basic.DownloadTag.Panel = Ext2.extend(Ext2.Panel, {\n initComponent: function() {\n Kwc.Basic.DownloadTag.Panel.superclass....
javascript
chosen
[ { "from": "system", "value": "Fix crashing bug: Compare Libya\n" }, { "from": "human", "value": "import { createSelector } from 'reselect';\nimport isEmpty from 'lodash/isEmpty';\nimport {\n parseSelectedLocations,\n getSelectedLocationsFilter,\n addSelectedNameToLocations\n} from 'selectors/...
javascript
chosen
[ { "from": "system", "value": "Make babel-load safer when use other environment like gulp\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n devtool: 'source-map',\n entry: [\n './src/index'\n ],\n output: {\n path: ...
javascript
chosen
[ { "from": "system", "value": "Test export of ClientStrategy, with alias to ConsumerStrategy.\n" }, { "from": "human", "value": "var vows = require('vows');\nvar assert = require('assert');\nvar util = require('util');\nvar oauth = require('passport-http-oauth');\n\n\nvows.describe('passport-http...
javascript
chosen
[ { "from": "system", "value": "Test deeply nested properties with undefined element\n" }, { "from": "human", "value": "\nvar _ = require('../index.js'),\n test = require('tape');\n\ntest('pluck: maintains original pluck after extension', function (t) {\n t.plan(1);\n\n var base = [\n ...
javascript
chosen
[ { "from": "system", "value": "Add action for adding collection.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';\n\nexport default Ember.Route.extend(AuthenticatedRouteMixin, {\n model(para...
javascript
chosen
[ { "from": "system", "value": "Fix the grunt base path\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.loadNpmTasks('grunt-contrib-uglify');\n grunt.loadNpmTasks('grunt-shell-spawn');\n grunt.initConfig({\n pkg: {\n main: grunt.file.readJSON(\"../src/packa...
javascript
chosen
[ { "from": "system", "value": "Use copy instead of create\n" }, { "from": "human", "value": "/*\n\tExample usage:\n\n\tvar A = Class(function() {\n\t\t\n\t\tvar defaults = {\n\t\t\tfoo: 'cat',\n\t\t\tbar: 'dum'\n\t\t}\n\n\t\tthis.init = function(opts) {\n\t\t\topts = std.extend(opts, defaults)\n\...
javascript
chosen
[ { "from": "system", "value": "Fix the last error by specifying expect:true in the eslint global setting\n" }, { "from": "human", "value": "module.exports = {\n root: false,\n plugins: ['markdown'],\n globals: {\n expect: false\n },\n rules: {\n 'no-unused-vars': 0,\n 'no-undef': 0\...
javascript
chosen
[ { "from": "system", "value": "Update <Form /> simulate behavior\n" }, { "from": "human", "value": "import React from 'react';\nimport { shallow } from 'enzyme';\n\nimport Form from '../index';\n\nconst renderComponent = (props = {}) => shallow(\n <Form {...props} />\n);\n\ndescribe('<Form />', ...
javascript
chosen
[ { "from": "system", "value": "Make Ace save the user's code on failures\n" }, { "from": "human", "value": "$(document).ready(function() {\n\n configureDataTables();\n configureCodeBox();\n\n});\n\nfunction configureDataTables(){\n\n $('#problem-table').dataTable( {\n \"iDisplayLength...
javascript
chosen
[ { "from": "system", "value": "Fix double messaging for multi opening\n" }, { "from": "human", "value": "// Author: Daniel G (oscar-daniel.gonzalez@hp.com)\n\n// Reserved for comms\nchrome.runtime.onMessage.addListener(function(msg)\n{\n alert(\"Popup - Yo I got a message!\");\n console.debug(m...
javascript
chosen
[ { "from": "system", "value": "Support absolute urls in ios icon meta\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = appleLinkTags;\n\nvar hasTarget = require('./has-target');\n\nfunction appleLinkTags(manifest, config) {\n if (manifest.apple === false) {\n return [];\n ...
javascript
chosen
[ { "from": "system", "value": "Add default require directives for jquery" }, { "from": "human", "value": "// Place your application-specific JavaScript functions and classes here\n// FIXME: Tell people how Sprockets and Coffe works\n" }, { "from": "gpt", "value": "// Place your applic...
javascript
chosen
[ { "from": "system", "value": "Fix native features check under node" }, { "from": "human", "value": "(function(global) {\n global.NativeFeatures = {\n Promise: !!global.Promise,\n Symbol: !!global.Symbol,\n Map: !!global.Map,\n Set: !!global.Set\n };\n}(this));\n" }, { "from...
javascript
chosen
[ { "from": "system", "value": "Convert Transform to ES class." }, { "from": "human", "value": "import { toArray, Class } from './lib/objects';\nimport { uuid } from './lib/uuid';\n\n/**\n Transforms represent a set of operations that are applied against a\n source. After a transform has been appl...
javascript
chosen
[ { "from": "system", "value": "Enforce regexp to start and end with an integer\n" }, { "from": "human", "value": "var async = require('async');\nvar _ = require('lodash');\n\n/**\n * pollCount - return the sum of all votes for a poll\n *\n * @param {Object} args requires pollId\n * @return {Obje...
javascript
chosen
[ { "from": "system", "value": "Hide navbar links if user not authenticated\n" }, { "from": "human", "value": "import React from 'react';\nimport { connect } from 'react-redux';\nimport { Link } from 'react-router-dom';\n\nimport { logoutUser } from '../../redux/actions';\n\nconst NavBar = ({ isAu...
javascript
chosen
[ { "from": "system", "value": "Connect to state and actions, refactor conditional rendering and logout\n" }, { "from": "human", "value": "import React from 'react'\nimport {NavLink} from 'react-router-dom'\nimport Auth from '../auth/authenticator'\nimport '../styles/Navbar.css'\n\n\nfunction logo...
javascript
chosen
[ { "from": "system", "value": "Add option for adding a callback\n" }, { "from": "human", "value": "'use strict';\n\nvar minify = require('html-minifier').minify;\n\nfunction minifyHTML(opts) {\n if (!opts) opts = {};\n\n function minifier(req, res, next) {\n\n var sendMinified = func...
javascript
chosen
[ { "from": "system", "value": "Remove .js from the require" }, { "from": "human", "value": "const { assert } = require('chai');\n\nconst KeyCode = require('./dist/keycode.cjs.js');\nconst { defineTests } = require('./dist/test-definitions.cjs');\n\n// Tests for Node (Common JS) Module.\ndefineTes...
javascript
chosen
[ { "from": "system", "value": "Test is queriesReady is available\n" }, { "from": "human", "value": "import { chai } from 'meteor/practicalmeteor:chai';\nimport { setup, breakdown } from './setup';\n\nconst { TemplateInstance } = Blaze;\n\ndescribe('setup', function () {\n beforeEach(function () ...
javascript
chosen
[ { "from": "system", "value": "Add likeFilter helper method for easy filtering as per query string\n" }, { "from": "human", "value": "import knex from 'knex';\n// import pg from 'pg';\n\nimport config from './config';\n\n// Use ssl by default\n// pg.defaults.ssl = true;\n\nexport default knex(con...
javascript
chosen
[ { "from": "system", "value": "Use arrow function in CRON file\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Cron config that gives you an opportunity\n * to run scheduled jobs.\n *\n * The cron format consists of:\n * [MINUTE] [HOUR] [DAY OF MONTH] [MONTH OF YEAR] [DAY OF WEEK] [YE...
javascript
chosen
[ { "from": "system", "value": "Change some data and typo\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst CFonts = require('cfonts')\nconst args = require('../libs/args')\nconst prompt = require('../libs/prompt')\nconst Whale = require('../index')\n\nprompt.then((answer) => {\n CF...
javascript
chosen
[ { "from": "system", "value": "Add `-v` and `--version` flags\n\nCloses #18\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar path = require('path');\nvar findup = require('findup-sync');\nvar minimist = require('minimist');\nvar resolve = require('resolve').sync;\n\nvar logger = requ...
javascript
chosen
[ { "from": "system", "value": "Add parameter to be compatible with old template\n\nSince angular 1.3, the global controller constructor are not allowed. https://github.com/angular/angular.js/commit/3f2232b5a181512fac23775b1df4a6ebda67d018\r\nAddition of this code to be compatible with some custom templates."...
javascript
chosen
[ { "from": "system", "value": "Add \"Edit\" button to Add Payment Review screen\n" }, { "from": "human", "value": "import React from 'react';\nimport PaddedView from '@ui/PaddedView';\nimport BackgroundView from '@ui/BackgroundView';\nimport SavedPaymentReviewForm from '@ui/forms/SavedPaymentRevi...
javascript
chosen
[ { "from": "system", "value": "Test footer while logged in\n" }, { "from": "human", "value": "\n\"use strict\";\n\ndescribe('Footer component', () => {\n let element = undefined;\n let $rootScope = undefined;\n let $compile = undefined;\n\n let mod = angular.module('tests.footer', [])...
javascript
chosen
[ { "from": "system", "value": "Use `npm test' to run test in grunt\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(grunt) {\n var path = require('path');\n var shell = require('shelljs');\n\n var bin = ['node_modules', '.bin'].join(path.sep);\n\n var lsc ...
javascript
chosen
[ { "from": "system", "value": "Make the ASCII keyCode unique for the Signature object\n" }, { "from": "human", "value": "$(document).ready(function() {\n $(document).keyup(function(e) {\n var tag = e.target.tagName.toLowerCase();\n if (tag != 'input' && tag != 'textarea' && tag !...
javascript
chosen
[ { "from": "system", "value": "Set snapshot to fixed date rather than using today\n" }, { "from": "human", "value": "import React from \"react\";\n\nimport { shallow } from \"enzyme\";\nimport toJson from \"enzyme-to-json\";\n\nimport moment from \"moment\";\n\nimport DateSlider from \"../src/Dat...
javascript
chosen
[ { "from": "system", "value": "Remove border from search input\n" }, { "from": "human", "value": "import React from 'react';\nimport styled, { css } from 'styled-components';\nimport PropTypes from 'prop-types';\nimport { transitionOpacity } from 'mixins';\nimport HeaderButton from 'components/He...
javascript
chosen
[ { "from": "system", "value": "Update webpack to include json\n" }, { "from": "human", "value": "\n/**\n * Base webpack config, extended by ./Build based on options.\n * See ../gulpfile.babel.js for usage.\n */\nexport default {\n progress: true, // Shows progress when compiling o...
javascript
chosen
[ { "from": "system", "value": "Replace createSession with OTSession in example app\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nimport { createSession } from '../../src'\nimport ConnectionStatus from './ConnectionStatus';\nimport Publisher from './Publisher';\ni...
javascript
chosen
[ { "from": "system", "value": "Switch to new search panel after it is created\n" }, { "from": "human", "value": "App.GlossaViewport = Ext.extend(App.GlossaViewportUi, {\n initComponent: function() {\n // Property to keep track of SearchPanel instances for query building\n this.searchPanels...
javascript
chosen
[ { "from": "system", "value": "Add a note about why Chai must be bundled despite having a module entrypoint.\n" }, { "from": "human", "value": "/**\n * This is the entrypoint for the Chai bundle used as part of the test\n * environment. Chai is only distributed as Common JS, so it must be bundled...
javascript
chosen
[ { "from": "system", "value": "Remove code overriding default jasmine timeout interval\n" }, { "from": "human", "value": "/**\n * Created by pivotal on 5/19/17.\n */\nrequire('dotenv').config()\n\n\ndescribe('chrome extension is loaded properly when feature tests run', function () {\n beforeEach...
javascript
chosen
[ { "from": "system", "value": "Fix App jest test because it is otherwise always green no matter what is in find()\n" }, { "from": "human", "value": "import { shallowMount } from '@vue/test-utils';\nimport App from '@/App';\n\n// see https://vue-test-utils.vuejs.org/guides/using-with-vue-router.ht...
javascript
chosen
[ { "from": "system", "value": "Use single quotes to reflect the existing conversion\n" }, { "from": "human", "value": "var kickass = require('../index');\n\nvar params = {\n q: 'test',\n field:'seeders',\n order:'desc'\n}\n\ndescribe('kickass', function(){\n it('should contain an array of t...
javascript
chosen
[ { "from": "system", "value": "Switch from string templates to file templates\n" }, { "from": "human", "value": "define(['underscore'], function(_){\n var templates = {\n pull: '\\\n <a target=\"_blank\" href=\"<%- pull.url() %>\" class=\"list-group-item pull\">\\\n <h4 class=...
javascript
chosen