conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change default diagramType for ASCII to SENSEIS_ASCII\n" }, { "from": "human", "value": "/**\n * ASCII book generator methods, for implementing gpub.book.Gen\n * interface.\n */\ngpub.book.ascii.generator = {\n generate: function(spec) {\n var view = this.option...
javascript
chosen
[ { "from": "system", "value": "Add color schemes to color selection options \n\nColor selection scheme can accept color schemes (eg chainindex)\r\nscheme = NGL.ColormakerRegistry.addSelectionScheme([[\"red\", \"1-10\"],[\"sstruc\",\"11-30\"]],\"myScheme\")" }, { "from": "human", "value": "/**\n *...
javascript
chosen
[ { "from": "system", "value": "Support third party Promise library\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (actions, context) {\n return input => {\n const promise = new Promise(resolve => resolve(input));\n\n return decoratePromise(promise, actions);\...
javascript
chosen
[ { "from": "system", "value": "Remove a bit of console output junk\n" }, { "from": "human", "value": "'use strict';\n\nvar knexConfig = require('./knex-config.js');\nvar knex = require('knex')(knexConfig[process.env.HAL_ENV]);\nvar bookshelf = require('bookshelf')(knex);\n\nconsole.log('Top of bo...
javascript
chosen
[ { "from": "system", "value": "Create select with hook up to store\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Control from './Control';\n\nclass Select extends Control {\n static propTypes = {\n className: PropTypes.string,\n ...
javascript
chosen
[ { "from": "system", "value": "Use console.dir instead of console.log\n" }, { "from": "human", "value": "/* eslint-disable no-console */\nimport chalk from 'chalk';\n\nexport function logConfig(caption, config) {\n console.log(chalk.cyan(caption));\n console.log(JSON.stringify(config, null, 2))...
javascript
chosen
[ { "from": "system", "value": "Rename env.data -> env.current_user; Set locale.\n" }, { "from": "human", "value": "\"use strict\";\n\n\n/*global nodeca, _*/\n\n\nvar me_in_fields = [\n '_uname',\n 'locale'\n];\n\n\n// fetch current user info\n// fired before each controllers\nnodeca.filters.bef...
javascript
chosen
[ { "from": "system", "value": "Add CMYK and CMYKA kinds\n" }, { "from": "human", "value": "// Shortcuts for common image kinds\n\nexport const BINARY = 'BINARY';\nexport const GREYA = 'GREYA';\nexport const RGBA = 'RGBA';\nexport const RGB = 'RGB';\nexport const GREY = 'GREY';\n\n" }, { "...
javascript
chosen
[ { "from": "system", "value": "Fix exporting issue, removed the glorious window ref.\n" }, { "from": "human", "value": "/**\n * Translate keys like laravel helper method trans\n *\n * @param {String} key the translation key to translate\n * @param {Object} [params={}] the params to incl...
javascript
chosen
[ { "from": "system", "value": "Add support for multiple schemas\n" }, { "from": "human", "value": "\"use strict\";\n\nvar requestHelper = require('./request-helper');\n\nvar jsonSchema = require('jsonschema');\n\n/**\n * Returns an express middleware function that validates the request body\n * o...
javascript
chosen
[ { "from": "system", "value": "Allow falsy values to be passed as defaults\n" }, { "from": "human", "value": "module.exports = {\n safe: function (thing, path, otherwise) {\n thing = (typeof thing === 'object' && thing != null) ? thing : {};\n var props = path.split('.');\n if (props.le...
javascript
chosen
[ { "from": "system", "value": "Add last event of the day\n" }, { "from": "human", "value": "import React from 'react'\nimport Chronodex from './src/Chronodex.jsx'\n\nlet events = [\n [9, 10, 'Email'],\n [10, 12, 'Meeting'],\n [12, 13, 'Lunch'],\n [13, 15, 'Meeting'],\n [15, 16, 'Coffee'],\n ...
javascript
chosen
[ { "from": "system", "value": "Handle an error where data chunks from camera could be undefined\n" }, { "from": "human", "value": "var os = require('os');\nvar io = require('socket.io-client');\n\n// The Castle address is loaded dynamically and passed to this script as an argument\nvar socket = i...
javascript
chosen
[ { "from": "system", "value": "Add messaging suite to Anvil config.\n" }, { "from": "human", "value": "/*\n * Appcelerator Titanium Mobile\n * Copyright (c) 2011-2012 by Appcelerator, Inc. All Rights Reserved.\n * Licensed under the terms of the Apache Public License\n * Please see the LICENSE in...
javascript
chosen
[ { "from": "system", "value": "Add ability to use wrap and mapping\n\n" }, { "from": "human", "value": "import {\n RepeatWrapping,\n NearestFilter,\n LinearMipMapLinearFilter,\n TextureLoader,\n Vector2\n} from 'three';\n\nconst loader = new TextureLoader();\n\nexport class TextureModule {\n...
javascript
chosen
[ { "from": "system", "value": "Fix redusers like & dislike\n" }, { "from": "human", "value": "import createReducer from 'borex-reducers/createReducer';\nimport actionCreator from 'borex-actions/actionCreator';\nimport setMetaStatic from 'borex-actions/setMetaStatic';\n\nimport initialState from '...
javascript
chosen
[ { "from": "system", "value": "Return title and color-coded price\n" }, { "from": "human", "value": "#! /usr/bin/env node\n\n/*\n * gog-scraper\n * Copyright (c) 2016 Jeff Minnear\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nvar program = require('commander');\nvar request = requi...
javascript
chosen
[ { "from": "system", "value": "Use one regex instead of 3\n" }, { "from": "human", "value": "\nvar http = require('http');\nvar cheerio = require('cheerio');\n\nexports.translate = function(text, lang, trans, cb){\n http.get('http://tyda.se/search/'+text+'?lang%5B0%5D='+lang+'&lang%5B1%5D='+tran...
javascript
chosen
[ { "from": "system", "value": "Fix issue where task list appears above search result\n" }, { "from": "human", "value": "var React = require('react'),\n StateMixin = require('../mixins/app-StateMixin'),\n SearchBox = require('../components/app-SearchBox'),\n TaskList = require('../compone...
javascript
chosen
[ { "from": "system", "value": "Test packager functionality using generic Down\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = require('./abstract/test')\n\nif (!module.parent) {\n var test = require('tape')\n var packager = require('./')\n var leveldown = require('leveldown...
javascript
chosen
[ { "from": "system", "value": "Fix duplicate linking with iframes.\n" }, { "from": "human", "value": "window.addEventListener(\"load\", function(e) {\n var run = function() {\n var document = content.document;\n var reGist = /^https?\\:\\/\\/gist\\.github\\.com\\/(\\d*)/i,\n reRel =...
javascript
chosen
[ { "from": "system", "value": "Fix node assets with fastboot\n" }, { "from": "human", "value": "/* eslint-disable */\n'use strict';\n\nmodule.exports = {\n name: 'ember-flatpickr',\n included: function(app) {\n let cssPath = 'themes/';\n if(app.options && app.options.flatpickr && app.opti...
javascript
chosen
[ { "from": "system", "value": "Add placeholder 'auth' property to the main object\n" }, { "from": "human", "value": "var debug = require( 'debug' )( 'wpcom-vip' );\nvar request = require( './lib/util/request' );\n\n// Modules\n\n\nfunction WPCOM_VIP( token ) {\n this.req = new Reques...
javascript
chosen
[ { "from": "system", "value": "Return unary fn as is and remove redundant checks\n" }, { "from": "human", "value": "module.exports = function cu(fn) {\n 'use strict';\n var args = [].slice.call(arguments);\n\n if ('function' !== typeof fn) throw new Error('auto-curry: Invalid parameter. First ...
javascript
chosen
[ { "from": "system", "value": "Enable CORS ignore orgin header\n" }, { "from": "human", "value": "const Hapi = require('@hapi/hapi');\nconst routes = require('./routes');\nconst auth = require('./auth');\n\nmodule.exports = async (elastic, config, cb) => {\n const server = new Hapi.Server({ port...
javascript
chosen
[ { "from": "system", "value": "Add `publicDir` option to plugin options\n" }, { "from": "human", "value": "import { readdirSync, lstatSync } from 'fs';\nimport { resolve } from 'path';\nimport { init } from './server/init';\nimport { replaceInjectedVars } from './server/lib/replace_injected_vars'...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"debugging the ios directory issue\"\"\n\nThis reverts commit 7842f28f4f2209b9a9ccaf8be1b00170109a2fec.\n" }, { "from": "human", "value": "#!/usr/bin/env node\nconst yargs = require('yargs');\n\nyargs\n.usage('$0 command')\n.command('all', 'run all ...
javascript
chosen
[ { "from": "system", "value": "Use opn to open demo site in a browser on start.\n" }, { "from": "human", "value": "var express = require('express'),\n app = express();\n\napp.use( express.static( __dirname + '/public' ) );\n\nvar server = app.listen(3000, function() {\n console.log('Listeni...
javascript
chosen
[ { "from": "system", "value": "Add flag option `start-hot` and apply env\n\n* Add flag option `start-hot` to server.js\r\n\r\n* Apply env to `start-hot` mode of server.js\r\n" }, { "from": "human", "value": "/* eslint-disable no-console */\n/**\n * Setup and run the development server for Hot-Mod...
javascript
chosen
[ { "from": "system", "value": "Allow CROS (via adding headers)\n" }, { "from": "human", "value": "const path = require('path');\nconst express = require('express');\nconst logger = require('winston');\nconst passport = require('passport');\nconst bodyParser = require('body-parser');\nconst bearer...
javascript
chosen
[ { "from": "system", "value": "Fix an issue where the scores would not show if a user left the page, then returned using the browser's back/forward buttons (since the form values would be saved, but the DOM not updated by our logic).\n" }, { "from": "human", "value": "var fields = ['skin', 'locat...
javascript
chosen
[ { "from": "system", "value": "Use plupload.dev.js instead of full, as it contains fixes for PUT option.\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-plupload',\n\n included: function (app) {\n this._super.included(app);\n ...
javascript
chosen
[ { "from": "system", "value": "Add isPrivate flag to user\n" }, { "from": "human", "value": "import { USER_ROLES } from '../constants';\n\nconst { ADMIN_ROLE, MEMBER_ROLE } = USER_ROLES;\n\nexport const hasPaidMail = ({ Subscribed }) => Subscribed & 1;\nexport const hasPaidVpn = ({ Subscribed }) ...
javascript
chosen
[ { "from": "system", "value": "Rename cli var to yargs\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar pkg = require('../package.json')\nvar cli = require('yargs');\nvar updateNotifier = require('update-notifier');\n\nupdateNotifier({ pkg }).no...
javascript
chosen
[ { "from": "system", "value": "fix: Copy version after lint, support `'`\n\n" }, { "from": "human", "value": "\"use strict\";\nexports.__esModule = true;\nvar fs = require(\"fs\");\n\n\n// read in the /index.ts\n\n// use regex to find a console log for printing the version and update it for the n...
javascript
chosen
[ { "from": "system", "value": "Use assert.ok() instead of assert.equals()\n" }, { "from": "human", "value": "var assert = require('assert');\n\ndescribe('linter', function () {\n var linter = require('../../lib/linter');\n\n describe('lint', function () {\n it('should return array of...
javascript
chosen
[ { "from": "system", "value": "Change embedded join link to direct klicker.uzh.ch domain" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport { compose, withProps } from 'recompose'\nimport QRCode from 'qrcode.react'\nimport { withRouter } from 'n...
javascript
chosen
[ { "from": "system", "value": "Disable chrome sandboxing on travis\n" }, { "from": "human", "value": "/* eslint-env node */\nmodule.exports = {\n test_page: 'tests/index.html?hidepassed',\n disable_watching: true,\n launch_in_ci: [\n 'Chrome'\n ],\n launch_in_dev: [\n 'Chrome'\n ],\n ...
javascript
chosen
[ { "from": "system", "value": "Remove Firefox from CI as it is problematic\n" }, { "from": "human", "value": "module.exports = {\n framework: 'mocha',\n 'test_page': 'tests/index.html?hidepassed&coverage',\n 'disable_watching': true,\n 'launch_in_ci': [\n 'Chrome'\n ],\n 'launch_in_dev':...
javascript
chosen
[ { "from": "system", "value": "Clear email address field after email is sent\n" }, { "from": "human", "value": "$( document ).ready(function(){\n $('#add_to_calendar').click(function(e){\n e.preventDefault();\n var $form = $(this).closest('form');\n $.ajax({\n url: '/emails',\n ...
javascript
chosen
[ { "from": "system", "value": "Fix virtual scrolling for table with local data.\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport { connect } from 'react-redux';\nimport { getContext, mapProps, compose } from 'recompose';\n\nimport { visibleRowIdsSelector, class...
javascript
chosen
[ { "from": "system", "value": ":art: Clean up front matter plugin logic\n" }, { "from": "human", "value": "'use strict';\n\nconst through = require('through2');\nconst gutil = require('gulp-util');\nconst fm = require('front-matter')\n\nconst PluginError = gutil.PluginError;\nconst PLUGIN_NAME = ...
javascript
chosen
[ { "from": "system", "value": "Use CodeMirror RequireMode instead of getScript.\n\n1) this will not get the mode if already on the page\n2) this will work when IPython is run with a prefix.\n" }, { "from": "human", "value": "$([IPython.events]).on('notebook_loaded.Notebook', function(){\n // a...
javascript
chosen
[ { "from": "system", "value": "Fix test for cancel redirect and close app\n" }, { "from": "human", "value": "describe('menuCtrl tests', function() {\n describe('instantiation and scope tests', function() {\n var $httpBackend, $rootScope, createController;\n beforeEach(function() {\n m...
javascript
chosen
[ { "from": "system", "value": "Add function to write when timer begins to the active cell." }, { "from": "human", "value": "function onOpen() {\n var spreadsheet = SpreadsheetApp.getActive();\n spreadsheet.addMenu('Time Tracking', [{ \"name\": 'Lauch Timer', \"functionName\": 'launchTimer_'}]);...
javascript
chosen
[ { "from": "system", "value": "Fix conflicting model in tests with the api-umbrella-config module.\n\nI'm not sure why this didn't happen before, but I think it might be\nrelated to getting the api-umbrella-config module bumped and on the same\nversion of mongoose as the router and gatekeeper.\n\nThis could ...
javascript
chosen
[ { "from": "system", "value": "Use console.error in gulp test task\n" }, { "from": "human", "value": "var exec = require('child_process').exec;\nvar gulp = require('gulp');\n\ngulp.task('test', function() {\n var path = './node_modules/mocha-phantomjs/bin/mocha-phantomjs';\n var command = '/tes...
javascript
chosen
[ { "from": "system", "value": "Remove stylint from gulp watch\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar stylus = require('gulp-stylus');\nvar stylint = require('gulp-stylint');\nvar concat = require('gulp-concat');\nvar uglify = require('gulp-uglify');\n\nvar stylFiles =...
javascript
chosen
[ { "from": "system", "value": "[NF] Make 'gulp test' depends on 'gulp jshint'.\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar jshint = require('gulp-jshint');\nvar stylish = require('jshint-stylish');\n\ngulp.task('jshint', function() {\n return gulp.src(['*...
javascript
chosen
[ { "from": "system", "value": "Add gulp command for running server\n" }, { "from": "human", "value": "var browserify = require('browserify');\nvar gulp = require('gulp');\nvar glob = require('glob');\nvar reactify = require('reactify');\nvar source = require('vinyl-source-stream');\nvar shell = r...
javascript
chosen
[ { "from": "system", "value": "Add lint and test to default gulp task\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n\tjshint = require('gulp-jshint'),\n\tmocha = require('gulp-mocha');\n\ngulp.task('default', function () {\n\t// place code for your default task here\n});\n\ngulp...
javascript
chosen
[ { "from": "system", "value": "Fix paths in watch gulp task\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n concat = require('gulp-concat'),\n rename = require('gulp-rename'),\n uglify = require('gulp-uglify'),\n gulpif = require('gulp-if'),\n react = require('gulp...
javascript
chosen
[ { "from": "system", "value": "Set sass output style to compressed\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp'),\n browserify = require('browserify'),\n transform = require('vinyl-transform'),\n uglify = require('gulp-uglify'),\n sourcemaps = require(...
javascript
chosen
[ { "from": "system", "value": "Add dangling comma to fix linting\n" }, { "from": "human", "value": "import mongoose from 'mongoose';\nconst Schema = mongoose.Schema;\n\nconst todoSchema = new Schema({\n text: { type: 'String', required: true },\n completed: { type: 'Boolean', required: true },\...
javascript
chosen
[ { "from": "system", "value": "Set a more sensible default\n" }, { "from": "human", "value": "global.simulatency = {}\n\nglobal.simulatency.timeout = 100\n\ninject(Meteor.server.stream_server.server._events, 'connection', function (args, done) {\n inject(args[0], 'write', function (args, done) {...
javascript
chosen
[ { "from": "system", "value": "Add checks for input and textarea elements, as they do not inherit styles.\n" }, { "from": "human", "value": "var darkColor;\nvar lightColor;\n\nself.port.on(\"colors\", function(colors) {\n darkColor = colors[0];\n lightColor = colors[1];\n checkElementCon...
javascript
chosen
[ { "from": "system", "value": "Add assert to prevent regression\n" }, { "from": "human", "value": "'use strict';\nconst assertJump = require('./helpers/assertJump');\n\nvar Ownable = artifacts.require('../contracts/ownership/Ownable.sol');\n\ncontract('Ownable', function(accounts) {\n let ownabl...
javascript
chosen
[ { "from": "system", "value": "Add better object output on dashboard\n" }, { "from": "human", "value": "$(document).foundation();\n\n$('#all_username').keydown(function(event) {\n if (event.keyCode == 13) {\n var reportAPI = \"http://localhost:5000/v1/api/watson/data/\"+$(\"#all_username\...
javascript
chosen
[ { "from": "system", "value": "Enhance product type for bookable items\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\nvar Objectid = mongoose.Schema.Types.ObjectId;\n\nvar ProductTypeSchema = new Schema({\n\tname: { type: Strin...
javascript
chosen
[ { "from": "system", "value": "Fix for test in IE. Conditions were passing, but due to IE's JS implementation of named functions, it didn't recognise the equality test as equal. Further info in test.\n" }, { "from": "human", "value": "/*jslint*/\n\n(function(){\n\n var testElement = '<div id=\...
javascript
chosen
[ { "from": "system", "value": "Move over to Data.Graph compliant types." }, { "from": "human", "value": "// Register ContentNode types (including meta information).\n\nContentNode.types = {\n \"document\": {\n name: \"Document\",\n allowedChildren: [\"section\"],\n properties: [\n ...
javascript
chosen
[ { "from": "system", "value": "Allow one field payload on method links.\n" }, { "from": "human", "value": "var $ = require('jquery');\n\n$(document).ready(function() {\n var $body = $('body');\n\n // Allow links to specify a HTTP method using `data-method`\n $('[data-method]').on('click', func...
javascript
chosen
[ { "from": "system", "value": "Add more tests to getClosest\n\n- add a regression test to check if old interface is kept\n (no options)\n- add a positive test to timeout option\n" }, { "from": "human", "value": "/*global describe, it */\n'use strict';\n\nvar assert = require('assert'),\n fs =...
javascript
chosen
[ { "from": "system", "value": "Add some hooks to get access in development mode\n" }, { "from": "human", "value": "/*jslint browser: true*/\n/*global require, define */\n\n/**\n * @module app\n */\ndefine('app', ['yaga'], function (Yaga) {\n 'use strict';\n window.Yaga = Yaga;\n});\n\nrequi...
javascript
chosen
[ { "from": "system", "value": "Fix encoding of characters like (\n" }, { "from": "human", "value": "var crypto = require('crypto')\n , qs = require('querystring')\n ;\n\nfunction sha1 (key, body) {\n return crypto.createHmac('sha1', key).update(body).digest('base64')\n}\n\nfunction hmacsign (h...
javascript
chosen
[ { "from": "system", "value": "Set getPageTimeout to 60 seconds\n" }, { "from": "human", "value": "// Protractor configuration file, see link for more information\n// https://github.com/angular/protractor/blob/master/docs/referenceConf.js\n\n/*global jasmine */\nvar SpecReporter = require('jasmin...
javascript
chosen
[ { "from": "system", "value": "Update AudioChannel start to accept start frequency and delay\n" }, { "from": "human", "value": "gAudio = (function(context) {\r\n AudioChannel = function() {\r\n this.gain = context.createGain();\r\n this.gain.gain.value = 0;\r\n this.gain.connect(context...
javascript
chosen
[ { "from": "system", "value": "Hide components if user is logged\n" }, { "from": "human", "value": "import React from 'react';\nimport { BrowserRouter as Router, Route, Switch } from 'react-router-dom';\n\n// =========== Components ===========\nimport App from '../components/app';\nimport NotFoun...
javascript
chosen
[ { "from": "system", "value": "Set initial data/text values from URL param\n" }, { "from": "human", "value": "/* globals $, symbols */\n\n// Disable form submission (eg. via Enter key)\n$('form').submit(false)\n\n$('textarea, input, select').on('change keyup', function () {\n updateQrCode()\n})\...
javascript
chosen
[ { "from": "system", "value": "Add new contact to DB from POST request\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\n/* Note: this is boilerplate and has NOT been implemented yet */\nrouter.get('/', function(req,res,next){\n res.render('c...
javascript
chosen
[ { "from": "system", "value": "Enable mirage on production for now\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n i18n: {\n defaultLocale: 'en',\n },\n emblemOptions: {\n blueprints: false\n },\n mod...
javascript
chosen
[ { "from": "system", "value": "Fix syntax error in backend\n" }, { "from": "human", "value": "'use strict'\n\nimport angular from 'angular'\nimport ngMockE2E from 'angular-mocks/ngMockE2E'\n\nlet status\n\nexport default angular.module('payment.backend', [\n ngMockE2E\n])\n.value('backend', {\n ...
javascript
chosen
[ { "from": "system", "value": "Add acknowledgement about command processing\n" }, { "from": "human", "value": "import commands from './commands';\nimport { client as slackClient } from './slack';\n\nconst TEAM_DOMAIN = process.env.SLACK_TEAM_DOMAIN;\nconst TOKEN = process.env.SLACK_COMMAND_TOKEN;...
javascript
chosen
[ { "from": "system", "value": "Update no-console rule for Ember\n\nEmber is getting rid of the logger, which really was just a thing wrapper around the console and existed to patch up cross-browser inconsistencies. So, modify the rule so we can use console directly for warnings and errors, but we still assum...
javascript
chosen
[ { "from": "system", "value": "Change vue router to use history mode\n" }, { "from": "human", "value": "import Vue from 'vue';\nimport Router from 'vue-router';\nimport FileManager from 'components/file-manager/FileManager';\nimport Content from 'components/editor-viewer/Content';\n\nVue.use(Rout...
javascript
chosen
[ { "from": "system", "value": "test(themeSpec): Add tests for error in setTheme\n" }, { "from": "human", "value": "import { expect } from 'chai';\n\nimport {\n setTheme,\n setStoredThemeObservable,\n} from '../../../src/notebook/epics/theming';\n\ndescribe('setTheme', () => {\n it('creates an ...
javascript
chosen
[ { "from": "system", "value": "Add email and name fields to the database User model\n" }, { "from": "human", "value": "// models/shift.js\n\nstart();\nfunction start () {\n 'use strict';\n\n const mongoose = require('mongoose');\n \n const ItemSchema = new mongoose.Schema({\n username: { t...
javascript
chosen
[ { "from": "system", "value": "Add an option to show the location of where hidden links point to.\n" }, { "from": "human", "value": "export const CLASSNAME = 'list-graph';\n\nexport const SCROLLBAR_WIDTH = 6;\nexport const COLUMNS = 5;\nexport const ROWS = 5;\n\n// An empty path is equal to inlin...
javascript
chosen
[ { "from": "system", "value": "Add explicit use strict for node v4\n" }, { "from": "human", "value": "/**\n * @file stat.js\n * @license MIT\n * @copyright 2017 Karim Alibhai.\n */\n\nconst fs = require('fs')\nconst chalk = require('chalk')\nconst solver = require('solver')\n\nconst tools = proce...
javascript
chosen
[ { "from": "system", "value": "Add sensor native module methods\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2020\n */\n\nimport Realm from 'realm';\n\nexport class Sensor extends Realm.Object {}\n\nSensor.schema = {\n name: 'Sensor',\n primaryKe...
javascript
chosen
[ { "from": "system", "value": "Make sure the random gif dashboard block is the first one\n" }, { "from": "human", "value": "YUI.add('dp-dashboardblockrandomgifplugin', function (Y) {\n\n Y.namespace('DP');\n\n Y.DP.DashboardBlockRandomGifPlugin = Y.Base.create('dpDashboardBlockRandomGifPlug...
javascript
chosen
[ { "from": "system", "value": "Add Proptypes and expand previewslist" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nimport VideoPreview from './VideoPreview';\n\n\nclass VideoPreviewsList extends Component {\n render() {\n return (\n <div></div>\n );\n ...
javascript
chosen
[ { "from": "system", "value": "Add target blank for anchors in paragraph block.\n" }, { "from": "human", "value": "export const sizing = (textSize, align) => ({\n p: {\n props: {\n size: textSize,\n margin: 'small',\n align,\n style: {\n marginTop: 0,\n },\n ...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Add function to handle new ripple notifications\n" }, { "from": "human", "value": "var Ripple = require('ripple-lib')\nvar request = require('request')\n\nvar address = process.env.RIPPLE_ADDRESS || 'rwqhRo41zXZKooNbDNUqQ5dTRrQPQ1BDF7'\nvar lastTxId = proc...
javascript
chosen
[ { "from": "system", "value": "Add html to scrollEl param to fix FF\n" }, { "from": "human", "value": "//smooth-scroller.js\n\n(function($) {\n $.fn.smoothScroller = function(options) {\n options = $.extend({}, $.fn.smoothScroller.defaults, options);\n var el = $(this);\n\n $(options.sc...
javascript
chosen
[ { "from": "system", "value": "Use GitHub link shortener for comment link\n\nThis makes the link a bit easier to copy/paste, but more importantly\nreduces the line width to a more manageable size.\n" }, { "from": "human", "value": "Package.describe({\n summary: \"JavaScript.next-to-JavaScript-of...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix popper close after clicking <u-menu>\n" }, { "from": "human", "value": "import MSinglex from '../m-singlex.vue';\n\nexport const UMenu = {\n name: 'u-menu',\n groupName: 'u-menu-group',\n childName: 'u-menu-item',\n extends: MSinglex,\n prop...
javascript
chosen
[ { "from": "system", "value": "Use canvas width/height for futureproofing" }, { "from": "human", "value": "const jpegThumbnail = dataUrl => new Promise((resolve, reject) => {\n const image = new Image();\n image.onload = () => {\n const canvas = document.createElement('canvas');\n ...
javascript
chosen
[ { "from": "system", "value": "Add border stroke to shape\n" }, { "from": "human", "value": "(function(){\n var tilingEl = document.getElementById('penrose-tiling')\n , outerRadius = 0.9\n , innerRadius = outerRadius * Math.sin(18 * Math.PI / 180)\n , top = innerRadius\n , bottom = -...
javascript
chosen
[ { "from": "system", "value": "Change base path for dummy\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'dummy',\n environment: environment,\n baseURL: '/',\n locationType: 'auto',\n EmberENV: {...
javascript
chosen
[ { "from": "system", "value": "Change tweet post message: post url instead\n" }, { "from": "human", "value": "'use strict'\nconst config = require(__dirname + '/config.js');\nconst Twit = require('twit');\nconst HC = require('node-hipchat');\n\nlet twitter = new Twit({\n consumer_key: config['tw...
javascript
chosen
[ { "from": "system", "value": "Complete the compass methods and handle watchID\n\nAdd clearWatch() wrapper;\r\nAdd getCurrent() wrapper;\r\nPass watchID throw resolve() in watchHeading() wrapper;" }, { "from": "human", "value": "angular.module('ngCordova.plugins.deviceOrientation', [])\n\n.factor...
javascript
chosen
[ { "from": "system", "value": "Clean up tags in SRT files on import\n" }, { "from": "human", "value": "const parseTime = (s) => {\n const re = /(\\d{2}):(\\d{2}):(\\d{2}),(\\d{3})/;\n const [, hours, mins, seconds, ms] = re.exec(s);\n return 3600*(+hours) + 60*(+mins) + (+seconds) + 0.001*(+ms...
javascript
chosen
[ { "from": "system", "value": "fix(ipc): Set default activity state better when load activities\n" }, { "from": "human", "value": "import ACTIVITIY_STATUS from './activityStatus'\nconst IPCAdapter = require('electron-ipc-adapter')\n\nconst ipcRenderer = window.require('electron').ipcRenderer\n\nc...
javascript
chosen
[ { "from": "system", "value": "Add transition on PostItem component\n" }, { "from": "human", "value": "import styled from 'styled-components'\nimport { Link } from 'gatsby'\n\nexport const PostItemTitle = styled.h1`\n ${props => props.theme.Home_PostTitle}\n margin-bottom: 0.8rem;\n color: var...
javascript
chosen
[ { "from": "system", "value": "Revert \"Quick fix for wrong image urls in e18 templates\"\n\nThis reverts commit 2d07bb6ede72f5069d8c297586505ada4bc15eef.\n\nWill be implemented differently in 4.3 with change in html code (which requires\nall view cache entries to be deleted)\n" }, { "from": "human",...
javascript
chosen
[ { "from": "system", "value": "Add first example of shouldJS\n" }, { "from": "human", "value": "describe('Users', function() {\n\n describe('Creation', function () {\n\n context('When creating a new user', function() {\n it('Should have an id', function() {\n some_guy = new mocks....
javascript
chosen
[ { "from": "system", "value": "Use view \"title\" as default tab title.\n" }, { "from": "human", "value": "/**\n * @class SMITHY/DojoBorderView\n * View implementation for Dojo Tab Container to support smithy \"tabs\"\n * layout mode.\n */\ndefine([\n \"../declare\",\n \"dijit/layout/TabCon...
javascript
chosen
[ { "from": "system", "value": "Add Authorization header to Access-Control-Allow-Headers\n\n" }, { "from": "human", "value": "import { load as configLoader } from '../config';\n\n\nconst config = configLoader();\n\nexport const originMiddleware = async (ctx, next) => {\n ctx.response.set('Access-...
javascript
chosen
[ { "from": "system", "value": "Set storeWrapper false by default\n" }, { "from": "human", "value": "module.exports = {\n stylePrefix: 'comp-',\n\n wrapperId: 'wrapper',\n\n wrapperName: 'Body',\n\n // Default wrapper configuration\n wrapper: {\n removable: false,\n copyable: false,\n ...
javascript
chosen