conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Test that it calls to callback\n" }, { "from": "human", "value": "var cmm = require(\"__buttercup/classes/commands/command.cmm.js\");\n\nmodule.exports = {\n setUp: function(cb) {\n this.command = new cmm();\n (cb)();\n }\n};\n" }, { "fro...
javascript
chosen
[ { "from": "system", "value": "Use async action creators in timer form\n" }, { "from": "human", "value": "import { connect } from 'react-redux'\nimport { createTimer } from '../actions/actions'\n\nimport TimerForm from '../Components/TimerForm'\n\nconst mapStateToProps = state => {\n return {\n ...
javascript
chosen
[ { "from": "system", "value": "Adjust starting frequency to be more fun.\n" }, { "from": "human", "value": "/** Global variables for processing.js access **/\nvar waveSpeed = 3;\nvar timestep = 0.3\nvar w = 0.3;\nvar w2 = 0.45;\nvar playing = false;\n\n/** Page setup **/\n$(document).ready(functi...
javascript
chosen
[ { "from": "system", "value": "Add new action : fetchData\n" }, { "from": "human", "value": "import \"babel-polyfill\"\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { createStore, applyMiddleware } from 'redux'\nimport createSagaMiddleware from 'redux-saga'\n\nimport Coun...
javascript
chosen
[ { "from": "system", "value": "Add a delay to browserSync\n" }, { "from": "human", "value": "module.exports = {\n\t// browser: 'google chrome',\n\topen: false,\n\tfiles: ['dist/*.css', 'dist/*.js', 'dist/*.html'],\n\tserver: {\n\t\tbaseDir: './dist',\n\t},\n\tnotify: false,\n}\n" }, { "fr...
javascript
chosen
[ { "from": "system", "value": "Update notification service timestamp format\n" }, { "from": "human", "value": "const EventEmitter = require( \"events\" );\n\n/*\n * Simple Notifivation Service\n */\nexport class Notifications extends EventEmitter {\n\n constructor() {\n super();\n ...
javascript
chosen
[ { "from": "system", "value": "Remove defaultSource for shot image\n" }, { "from": "human", "value": "'use strict';\n\nvar React = require('react-native');\nvar {\n Image,\n PixelRatio,\n StyleSheet,\n Text,\n TouchableHighlight,\n View\n} = React;\n\nvar getImage = require('./helpers/getIm...
javascript
chosen
[ { "from": "system", "value": "Edit test to es6 syntax\n" }, { "from": "human", "value": "var expect = require('chai').expect;\n\ndescribe('Main', function() {\n var arr;\n\n // roda todas as vezes, antes de CADA bloco\n beforeEach(function() {\n arr = [1, 2, 3];\n });\n\n // testar tipos...
javascript
chosen
[ { "from": "system", "value": "Delete comments from bundle of js\n" }, { "from": "human", "value": "const merge = require('webpack-merge');\nconst common = require('./webpack.common.js');\n\nconst CleanWebpackPlugin = require('clean-webpack-plugin');\n\nmodule.exports = merge(common, {\n mode: '...
javascript
chosen
[ { "from": "system", "value": "Move 'open all' link to same line as bug lings.\n\nRework JS a bit more.\n" }, { "from": "human", "value": "\"use strict\";\n\n\nvar bugRe = /\\bbug (\\d+)\\b/i;\nvar bugURL = 'https://bugzilla.mozilla.org/show_bug.cgi?id=';\n\n\nfunction getBugIds() {\n let bugI...
javascript
chosen
[ { "from": "system", "value": "Use our ButtonGroup component instead of a div with custom styling\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport Box from '../box';\nimport cx from 'classnames';\nimport theme from './th...
javascript
chosen
[ { "from": "system", "value": "Set gonzales-pe syntax based on the file extension. Throw an error if trying to process a file not of type css, scss, sass, or less.\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar Q = require('kew');\n\nvar gonzales...
javascript
chosen
[ { "from": "system", "value": "Fix Typo in Farsi Translations\n" }, { "from": "human", "value": "export default {\n at: {\n select: {\n placeholder: 'انتخاب کنید',\n notFoundText: 'موردی یافت نشد'\n },\n modal: {\n okText: 'تایید',\n cancelText: 'لغو'\n },\n pa...
javascript
chosen
[ { "from": "system", "value": "Load configuration from current directory\n" }, { "from": "human", "value": "var moment = require('moment');\n\nvar debug = require('debug')('cli:rank');\nvar config = require('../../config.json');\nvar talks = require('libtlks').talk;\nvar rank = require('librank')...
javascript
chosen
[ { "from": "system", "value": "Add health update packet code\n" }, { "from": "human", "value": "module.exports = {\n // Packet constants\n PLAYER_START: \"1\",\n PLAYER_ADD: \"2\",\n PLAYER_ANGLE: \"2\",\n PLAYER_UPDATE: \"3\",\n PLAYER_ATTACK :\"4\",\n LEADERBOAD: \"5\",\n ...
javascript
chosen
[ { "from": "system", "value": "Allow more symbols in links.\n" }, { "from": "human", "value": "function Resolve(stage, text){\n\tif(text == null) {\n\t\treturn '';\n\t}\n\n\ttext = text.replace(Resolve.rxExternalLink,\n\t\t'<a href=\"$1\" class=\"external-link\" target=\"_blank\" rel=\"nofollow\"...
javascript
chosen
[ { "from": "system", "value": "Make config file optional by default.\n" }, { "from": "human", "value": "// Adapted from https://github.com/tsantef/commander-starter\n\nvar fs = require('fs');\nvar path = require('path');\nrequire('json5/lib/register')\n\nmodule.exports = function commandLoader(pr...
javascript
chosen
[ { "from": "system", "value": "Use a specific (currently latest) version of datasources.txt\n\nThis version includes the KNApSAcK and ChEMBL compound IDs." }, { "from": "human", "value": "/* @module config */\n\nvar config = {\n // TODO see note in main.js regarding CORS\n baseIri: 'http://poin...
javascript
chosen
[ { "from": "system", "value": "Update logic for setting name from package.\n" }, { "from": "human", "value": "function create(req, next) {\n var opts = req.argv\n , pkg = opts.pkg\n , clazz;\n\n var defname = 'program';\n name = opts.name || defname;\n var clazz = opts.clazz || require(...
javascript
chosen
[ { "from": "system", "value": "Add section to course in db.\n" }, { "from": "human", "value": "Template.addSection.events({\n 'click #add-section-button': function (event, template) {\n console.log('Adding section to course.');\n }\n});\n" }, { "from": "gpt", "value": "Te...
javascript
chosen
[ { "from": "system", "value": "Increment scores with left/right shift keys\n" }, { "from": "human", "value": "import React from 'react'\n\nexport default class Player extends React.Component {\n render() {\n const { id, player, onPlayerScored } = this.props\n\n return (\n <div classNa...
javascript
chosen
[ { "from": "system", "value": "Use global version from './package.json' file.\n" }, { "from": "human", "value": "import React from 'react'\nimport { search } from 'cerebro-tools'\nimport icon from '../icon.png'\n\n// Settings plugin name\nconst NAME = 'Cerebro Version'\n\n// Settings plugins in t...
javascript
chosen
[ { "from": "system", "value": "Disable source map for production\n" }, { "from": "human", "value": "const path = require('path')\nconst webpack = require('webpack')\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\n\nmodule.exports = {\n context: __dirname,\n devtool: 'source-map',\n\n...
javascript
chosen
[ { "from": "system", "value": "Add some links to docs, and learn to draw a red circle.\n" }, { "from": "human", "value": "(function() {\n // see http://benalman.com/news/2010/11/immediately-invoked-function-expression/\n var Game = function(canvasId) {\n var canvas = document.get...
javascript
chosen
[ { "from": "system", "value": "Fix a typo in the issue count print statement\n\nTwo typos actually, issue->issues and label->length.\n" }, { "from": "human", "value": "import fetchAllPages from './fetchAllPages.js';\n\nconst token = process.argv[2];\nif (!token) {\n throw new Error('Provide a PA...
javascript
chosen
[ { "from": "system", "value": "Update activity table to include a boolean for active or not\n" }, { "from": "human", "value": "'use strict';\nvar db = require('./database');\nvar Sequelize = require('sequelize');\n\nmodule.exports = function(){\n var User = db.define('Users', {\n userId: {typ...
javascript
chosen
[ { "from": "system", "value": "Allow loading images from buffers" }, { "from": "human", "value": "var Canvas = require('canvas'),\n Image = Canvas.Image,\n fs = require('graceful-fs');\n\nmodule.exports = {\n createCanvas: function(width, height) {\n return new Canvas(width, height);\...
javascript
chosen
[ { "from": "system", "value": "Fix var name bug; Dedup RFC menu items\n" }, { "from": "human", "value": "/**\n * Parse text, return RFCs\n *\n * @param text String Content you want IETF RFC identifiers pulled out of\n *\n * @return Array The list of RFC numbers as strings. Ex: [\"2616\", \"2068\"...
javascript
chosen
[ { "from": "system", "value": "Remove version from minified js name\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n jshint: {\n // define the files...
javascript
chosen
[ { "from": "system", "value": "Update the test with the expected files\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright (c) 2016 The IBM Research Emergent Solutions authors. All rights reserved.\n * This code may only be used under the MIT style license found at https://ibmresear...
javascript
chosen
[ { "from": "system", "value": "Add request matching for occet-strean and for webm\n" }, { "from": "human", "value": "(function(console,$runtime,$declarativeWebRequest,$pageAction,$tabs){\n\t\"use strict\";\n\n\tfunction installRequestFilter(){\n\t\t$declarativeWebRequest.onRequest.removeRules(und...
javascript
chosen
[ { "from": "system", "value": "Rework Redis connection to support callback on connect.\n" }, { "from": "human", "value": "/*eslint no-console: [\"error\", { allow: [\"log\"] }] */\n\n// dependencies --------------------------------------------------\nimport Redis from 'ioredis';\nimport config fr...
javascript
chosen
[ { "from": "system", "value": "Allow user remove uploaded image\n" }, { "from": "human", "value": "(function ($) {\n $(window).load(function(){\n\n var store = window.hologram.store;\n\n window.hologram(document.getElementsByClassName('hologram-area')[0], {\n uploadUrl: Drupal.setting...
javascript
chosen
[ { "from": "system", "value": "Return promise instead of done\n\nIt appears that if you return a promise to gulp, gulp waits on the promise and catches the failed promise. By return the promise AND calling done, task completion was getting called twice.\n" }, { "from": "human", "value": "var _ = ...
javascript
chosen
[ { "from": "system", "value": "Use circles for points instead of markers\n" }, { "from": "human", "value": "var L = require('leaflet'),\n map = L.map('map', { attributionControl: false }),\n Repository = require('./repository'),\n Sidebar = require('./sidebar.js'),\n Projections = req...
javascript
chosen
[ { "from": "system", "value": "Remove jupyter-devinstall from the package list\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\"use strict\";\n\nimport {install} from './install';\n\nlet orgRepos = [\n 'pip:ipython/traitlets',\n 'pip:ipython/ipython',\n 'pip:jupyter/jupyter_core...
javascript
chosen
[ { "from": "system", "value": "Fix a typo which caused the whole script crashed" }, { "from": "human", "value": "var React = require('react');\n\nexport default class Progress extends React.component {\n\n render() {\n\n let completed = +this.props.completed;\n if (completed === NaN || com...
javascript
chosen
[ { "from": "system", "value": "Fix broken node < 5\n" }, { "from": "human", "value": "import postcss from 'postcss';\nimport {mergeWith} from 'lodash';\n\nfunction hasVar(str) {\n\treturn str.indexOf('var(');\n}\n\nfunction resolveValue(value, maps) {\n\tif (hasVar(value) === -1) {\n\t\treturn va...
javascript
chosen
[ { "from": "system", "value": "Remove node_modules from CSS requires\n" }, { "from": "human", "value": "require('../node_modules/github-markdown-css/github-markdown.css')\nrequire('../node_modules/codemirror/lib/codemirror.css')\n\nrequire('codemirror')\nrequire('codemirror/mode/javascript/javasc...
javascript
chosen
[ { "from": "system", "value": "Remove \"polar\" category from smith trace\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'scattersmith',\n basePlotModule: require('../../plots/smith'),\n categories: ['polar', 'symbols', 'showLegen...
javascript
chosen
[ { "from": "system", "value": "Fix an error when the arguments are complete\n" }, { "from": "human", "value": "var Runner = require('./runner').Runner,\n _ = require('underscore');\nvar argv = require('optimist')\n .string('a')\n .string('w')\n .string('p')\n .string('u')\n .arg...
javascript
chosen
[ { "from": "system", "value": "Set server listen to 0.0.0.0\n" }, { "from": "human", "value": "import Express from 'express';\nimport path from 'path';\nimport webpack from 'webpack';\nimport webpackDevMiddleware from 'webpack-dev-middleware';\nimport webpackHotMiddleware from 'webpack-hot-middle...
javascript
chosen
[ { "from": "system", "value": "Drop `Object.freeze()` for prototype of `StyleSheet` objects\n" }, { "from": "human", "value": "import Decl from './decl'\n\nconst proto = Object.freeze({\n addRule(selector, decl) {\n this._root.nest(selector, decl)\n return this\n },\n\n export() {\n r...
javascript
chosen
[ { "from": "system", "value": "Add String.random (used in token generation)\n" }, { "from": "human", "value": "//////////////////////////\n// Utils functions file //\n//////////////////////////\n\n'use strict';\n\n/**\n * JS Date -> MySQL DateTime\n * @return {string} SQL compliant datetime\n */\...
javascript
chosen
[ { "from": "system", "value": "Update test to include FactoryGuy\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\n\nmoduleForComponent('noteworthy-and-popular-project', 'Integration | Component | noteworthy ...
javascript
chosen
[ { "from": "system", "value": "Fix tagsyo query to lower case subreddit name\n" }, { "from": "human", "value": "function fixTagsyoLink() {\r\n var subMatch = /\\/r\\/([a-zA-Z_0-9\\-]+)/.exec(window.location.href);\r\n if (!subMatch) {\r\n return;\r\n }\r\n var subName = subMatch[1];\r\n ...
javascript
chosen
[ { "from": "system", "value": "Add example code and tidy up other parts of file\n" }, { "from": "human", "value": "/*\tAuthor:\n\t\tTMW - (Author Name Here)\n*/\n\n// Create a closure to maintain scope of the '$' and TMW\n(function (TMW, $) {\n\n\t$(function() {\n\t\t// Any globals go here in CAP...
javascript
chosen
[ { "from": "system", "value": "Remove user password from req.user\n" }, { "from": "human", "value": "let passport = require('passport');\nlet LocalStrategy = require('passport-local').Strategy;\nlet bcrypt = require('bcrypt-nodejs');\nlet _ = require('lodash');\nlet uuid = require('uuid/v1');\n\n...
javascript
chosen
[ { "from": "system", "value": "Throw error at invalid inputs\n" }, { "from": "human", "value": "/**\n * Created by Umayr Shahid on 4/28/16.\n */\n\n'use strict';\n\nconst ParenthesisRegex = /\\([^()\"]*(?:\"[^\"]*\"[^()\"]*)*\\)/;\nconst Dictionary = Object.freeze({\n 'AND': '&&',\n 'OR': '||'\...
javascript
chosen
[ { "from": "system", "value": "Fix title of swagger api\n\nUsed swagger options from different project (shame on me). Change title\nto ‘Microbrew.it Log Server’.\n" }, { "from": "human", "value": "'use strict';\n\nconst Glue = require('glue');\nconst Package = require('../package.json');\n\nconst...
javascript
chosen
[ { "from": "system", "value": "Check for correct palette type and map to color objects in classify function\n" }, { "from": "human", "value": "const fetchQueryColors = require('./bing').fetchQueryColors;\nconst createDefaultPalette = require('./palette').createDefaultPalette;\nconst matchTermToCo...
javascript
chosen
[ { "from": "system", "value": "Add shape tests to main testacular run.\n\nrherlitz/GooEngine#51\n" }, { "from": "human", "value": "require.config({\n paths: {\n \"goo\": \"src/goo\",\n \"test\": \"test\"\n },\n waitSeconds: 5\n });\nrequire(['test/mathTest'], function(math...
javascript
chosen
[ { "from": "system", "value": "Fix preview from not updating.\n" }, { "from": "human", "value": "const React = require('react')\n\nconst IFrame = ({ css, html, id }) => {\n const content = '<style>' + css + '</style>' + html\n return React.createElement('iframe', {\n id,\n src: 'data:text...
javascript
chosen
[ { "from": "system", "value": "Add same comment to dialog.jsx.\n" }, { "from": "human", "value": "console.log( \"==== simpread focus setting load ====\" )\r\n\r\nimport Dialog, { getDialogBackground } from 'dialog'\r\n\r\nfunction Render() {\r\n ReactDOM.render(\r\n <Dialog />,\r\n ...
javascript
chosen
[ { "from": "system", "value": "Read credentials from the command directory.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\n/**\n * Binary to run the main server.\n * (C) 2015 Alex Fernández.\n */\n\n// requires\nvar stdio = require('stdio');\nvar Log = require('log');\nv...
javascript
chosen
[ { "from": "system", "value": "Add Pomodoro and remove pomodoro functionality\n" }, { "from": "human", "value": "// @flow\nimport React, { Component } from \"react\";\nimport { connect } from \"react-redux\";\nimport { addTask } from \"../actions/task\";\nimport type { actionType } from \"../redu...
javascript
chosen
[ { "from": "system", "value": "Allow setting cell style on isolate override\n" }, { "from": "human", "value": "/**\n * Focus on a single presentation.\n */\nds.models.transform.Isolate = function(options) {\n 'use strict'\n\n var self =\n limivorous.observable()\n .extend(ds.mod...
javascript
chosen
[ { "from": "system", "value": "Switch to using fatebus for publishing\n" }, { "from": "human", "value": "const postal = require('postal');\nconst logger = require('logger');\nconst md5 = require('md5');\n\nlet rawWeaponDataMD5;\n\nfunction onLoadHandler(response) {\n logger.log('weaponDataRefres...
javascript
chosen
[ { "from": "system", "value": "Add functionality for removing any element\n" }, { "from": "human", "value": "\"use strict\";\r\n/*\r\n * A very basic PriorityQueue implementation.\r\n * FIXME: Implement as a binary heap for speed.\r\n */\r\n\r\nclass PriorityQueue {\r\n // cmp_fn compares a to...
javascript
chosen
[ { "from": "system", "value": "Allow no return from run\n" }, { "from": "human", "value": "\"use strict\";\r\n\r\nconst runall = async function(commands, state, model) {\r\n for (let idx = 0 ; idx != commands.length ; ++idx) {\r\n const cm = commands[idx];\r\n if (cm.command.chec...
javascript
chosen
[ { "from": "system", "value": "Resolve includeDir relative to the project context" }, { "from": "human", "value": "var Async = require('async'),\n Fs = require('fs'),\n Glob = require('glob'),\n Path = require('path'),\n RawSource = require('webpack-core/lib/RawSource');\n\nmodule.exp...
javascript
chosen
[ { "from": "system", "value": "Use pseudorandom characters in generateId\n" }, { "from": "human", "value": "const env = require('../lib/environment');\nconst crypto = require('crypto');\nconst mongoose = require('mongoose');\nconst opts = env.get('mongo');\n\nconst authOpts = {};\n\nif (opts.pass...
javascript
chosen
[ { "from": "system", "value": "Fix test for browser warning preprocessor\n" }, { "from": "human", "value": "define(['licensing/controllers/preprocessors/partial_experience_warning'],\nfunction (preprocessor) {\n describe(\"whatever\", function () {\n afterEach(function () {\n $('#global-...
javascript
chosen
[ { "from": "system", "value": "Update comments in Photo model\n" }, { "from": "human", "value": "// grab the things we need\nvar mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\n// create a schema\nvar photoSchema = new Schema({\n title: String,\n slug: String,\n status: Strin...
javascript
chosen
[ { "from": "system", "value": "Remove leftovers after logic cleanup\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function () {\n\tvar map, iterator, result;\n\tif (typeof Map !== 'function') return false;\n\tif (String(Map.prototype) !== '[object Map]') return false;\n\ttr...
javascript
chosen
[ { "from": "system", "value": "Make it possible to chain if's" }, { "from": "human", "value": "/**\n * jQuery if-else plugin\n *\n * Creates if(), else() and fi() methods that can be used in\n * a chain of methods on jQuery objects\n * \n * @author Vegard Løkken <vegard@headspin.no>\n * @copyrigh...
javascript
chosen
[ { "from": "system", "value": "Fix bug when getting 'Unauthorized'\n" }, { "from": "human", "value": "function NewsControl() {\n var self = this;\n\n self.init = function() {\n // Make sure we can log without breaking old browsers\n if (typeof(window.console) === 'undefined') ...
javascript
chosen
[ { "from": "system", "value": "Add conditional in case no settings exist.\n" }, { "from": "human", "value": "Drupal.behaviors.jqPlot = function(context) {\n var replace = ['renderer', 'markerRenderer', 'labelRenderer', 'parseX',\n 'parseY', 'scrapeSingle', 'scrapeMultiple', 'processSeries'];\...
javascript
chosen
[ { "from": "system", "value": "Fix getter if no date found\n" }, { "from": "human", "value": "define(\n [\n 'jquery',\n 'backbone',\n 'underscore',\n 'moment'\n ],\n function ($, Backbone, _, moment) {\n \"use strict\";\n\n return Backbone.Model....
javascript
chosen
[ { "from": "system", "value": "Allow some theming via URL\n" }, { "from": "human", "value": "// @flow\n\nimport tinycolor from 'tinycolor2';\n\nconst BASE_COLOR = tinycolor('aliceblue')\n .spin(40)\n .toHexString();\nconst BASE_COLOR2 = tinycolor('aliceblue')\n .spin(10)\n .toHexString();\nco...
javascript
chosen
[ { "from": "system", "value": "Fix Missed CSS Band-aid to BlessCSS\n" }, { "from": "human", "value": "import yargs from 'yargs';\nimport { version } from '../../package.json';\n\nexport default function appendCommon() {\n yargs.usage(`CSS Band Aid v${version}`.magenta + ` - Tools to ensure CSS f...
javascript
chosen
[ { "from": "system", "value": "Fix some warnings about playerlist\n" }, { "from": "human", "value": "import React from 'react'\nimport PlayerListRow from './PlayerListRow'\nimport UserColor from './UserColor'\nimport UserName from './Username'\nimport './PlayerList.css'\n\nconst colors = [\n 'fi...
javascript
chosen
[ { "from": "system", "value": "Disable source mapping to speed up build time\n" }, { "from": "human", "value": "var pkg = require('./package.json');\nvar node_modules = __dirname + '/node_modules';\nvar ExtractTextPlugin = require('extract-text-webpack-plugin');\nvar environment = process.env.NOD...
javascript
chosen
[ { "from": "system", "value": "Create final willow-main.js under dist/\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\n\n// sass-loader needs this\nrequire('es6-promise').polyfill();\n\nmodule.exports = {\n entry: [\n 'webpack-hot-middl...
javascript
chosen
[ { "from": "system", "value": "Create shared global js/css via webpack\n" }, { "from": "human", "value": "// webpack.config.js\nvar Encore = require('@symfony/webpack-encore');\n\nEncore\n // directory where all compiled assets will be stored\n .setOutputPath('web/assets/js/')\n // what'...
javascript
chosen
[ { "from": "system", "value": "Add Redux and React Redux as external dependencies\n" }, { "from": "human", "value": "'use strict'\nvar webpack = require('webpack')\n\nvar reactExternal = {\n root: 'React',\n commonjs2: 'react',\n commonjs: 'react',\n amd: 'react'\n}\n\nmodule.exports = {\n e...
javascript
chosen
[ { "from": "system", "value": "Add error listeners to socket server\n" }, { "from": "human", "value": "var ws = require('nodejs-websocket');\n\n/**\n * Triggers when connections is established\n * @param connection\n * @private\n */\nfunction _onConnection(connection) {\n connection.on('close', ...
javascript
chosen
[ { "from": "system", "value": "Update interface implementation in baseSocial\n" }, { "from": "human", "value": "var _ = require('lodash');\n\n/**\n * Create base social instance\n * @param {Object} [_config]\n * @constructor\n */\nfunction BaseSocial(_config) {\n this._config = {};\n\n _.forOwn...
javascript
chosen
[ { "from": "system", "value": "Remove trailing comma, thanks @scothis\n" }, { "from": "human", "value": "define({\n\tplugins: [\n\t\t{ module: 'wire/debug' },\n\t\t{ module: 'wire/dojo/pubsub' }\n\t],\n\t// Create a logger object, in this case an AlertLogger\n\tlogger: {\n\t\tcreate: 'test/test1/...
javascript
chosen
[ { "from": "system", "value": "Undo - some expectation expects this port.\n" }, { "from": "human", "value": "'use strict';\n\nvar express = require('express'),\n\tconstants = require('../../app/config/constants'),\n\tconfig = require('../../app/config/config'),\n\tshould = require('should'),\n\tc...
javascript
chosen
[ { "from": "system", "value": "Clear input field when receiving" }, { "from": "human", "value": "//= require action_cable\n//= require_self\n//= require_tree .\n\nthis.App = {};\n\nApp.cable = ActionCable.createConsumer();\n\nApp.messages = App.cable.subscriptions.create('MessagesChannel', {\n r...
javascript
chosen
[ { "from": "system", "value": "Add footnotes extension to showdown\n\nrefs 1318\n- based on Markdown Extra https://michelf.ca/projects/php-markdown/extra/\n- allows [^n] for automatic numbering based on sequence\n" }, { "from": "human", "value": "/* global Showdown, Handlebars, html_sanitize*/\ni...
javascript
chosen
[ { "from": "system", "value": "Fix controller name after merge\n" }, { "from": "human", "value": "'use strict';\n// This file contains controllers of base pages attributes: header, footer, body, common menu and so on\n\n(function() {\n angular.module('ncsaas')\n .controller('HeaderContoller',...
javascript
chosen
[ { "from": "system", "value": "Add middleware to convert true/false query parameters to respective boolean values\n" }, { "from": "human", "value": "var Express = require('express');\nvar FS = require('fs');\nvar HTTP = require('http');\n\nrequire('../lib/config');\n\nvar app = Express();\nvar se...
javascript
chosen
[ { "from": "system", "value": "[update] Rename skip function to identity for clarity\n" }, { "from": "human", "value": "/**\n * Store\n * Used to provide default values for a store configuration\n */\n\nlet skip = i => i\n\nfunction Store (config, id) {\n // Fold configuration over self\n for (...
javascript
chosen
[ { "from": "system", "value": "Fix Some Typo and Add Validation to Subcampaign.Js\n\n" }, { "from": "human", "value": "module.exports = function (campaign) {\n \n // Should Add Some Validation Methods\n\n campaign.beforeRemote('prototype.__create__setting', function (ctx, modelInstance, next) ...
javascript
chosen
[ { "from": "system", "value": "Add endtime class to endtime element\n" }, { "from": "human", "value": "import Remarkable from 'remarkable';\n\nconst markdown = (text) => {\n var md = new Remarkable();\n return {\n __html: md.render(text)\n };\n};\n\nconst Event = ({ title, start_time, end_t...
javascript
chosen
[ { "from": "system", "value": "Remove event listeners if the analysis tab is not active and add them otherwise.\n" }, { "from": "human", "value": "/// </// <reference path=\"data_functions.js\" />\n\nfunction getAnalysisNavtab() {\n return document.getElementsByClassName(\"nav\")[0].getElementsB...
javascript
chosen
[ { "from": "system", "value": "chore: Add tagPrefix option to test\n" }, { "from": "human", "value": "import EsaQuiver from './esa-quiver';\n\nconst config = {\n\tesaTeam: process.env['ESA_CURRENT_TEAM'],\n\tesaToken: process.env['ESA_ACCESS_TOKEN'],\n\tquiverDir: process.env['QUIVER_NOTEBOOK_DIR...
javascript
chosen
[ { "from": "system", "value": "Add inputs plugin to computation.\n" }, { "from": "human", "value": "'use strict';\n\nconst pkg = require('../package.json');\nconst localRunner = require('./local');\nconst remoteRunner = require('./remote');\n\nmodule.exports = {\n name: pkg.name,\n version: pkg...
javascript
chosen
[ { "from": "system", "value": "Move callback to return a 201 status code\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar nodemailer = require('nodemailer');\n\n// create reusable transporter object using the default SMTP transport\nvar smt...
javascript
chosen
[ { "from": "system", "value": "Change to host+port from domain\n" }, { "from": "human", "value": "var global = {\n domain: 'http://subdomain.yourdomain.com/',\n secretUrlSuffix: 'putSomeAlphanumericSecretCharsHere'\n};\n\nvar projects = [\n {\n repo: {\n owner: 'yourbitbucketusername',...
javascript
chosen
[ { "from": "system", "value": "Add signUp action reducer to root reducer\n" }, { "from": "human", "value": "import { combineReducers } from 'redux';\nimport { routerReducer } from 'react-router-redux';\nimport { reducer as formReducer } from 'redux-form';\n\nconst rootReducer = combineReducers({\...
javascript
chosen
[ { "from": "system", "value": "Set default output dir to output_data\n" }, { "from": "human", "value": "'use strict';\n\nconst childProcess = require('child_process');\nconst fs = require('fs');\n\nmodule.exports = function(type) {\n process.argv.shift();\n process.argv.shift();\n var pa...
javascript
chosen
[ { "from": "system", "value": "Add button that navigate to login 3 from login 2" }, { "from": "human", "value": "import React from 'react';\nimport {View, Text, StyleSheet} from \"react-native\";\nimport Button from \"react-native-button\";\nimport {Actions} from \"react-native-router-flux\";\n\n...
javascript
chosen
[ { "from": "system", "value": "Configure an explicit timeout for Mocha\n" }, { "from": "human", "value": "exports.config = {\n host: 'selenium',\n\n specs: [\n './tests/acceptance/specs/**/*.spec.js'\n ],\n\n maxInstances: 10,\n capabilities: [{\n browserName: 'chrome'\n }],\n\n sync...
javascript
chosen
[ { "from": "system", "value": "Update to have it Uppercase (changed)" }, { "from": "human", "value": "// ==UserScript==\n// @name Anchor tags in Central\n// @namespace http://central.tri.be/\n// @version 0.1\n// @description Adds anchor tags to some links in central\n// @author ...
javascript
chosen
[ { "from": "system", "value": "Make event handler passive for better scrolling\n" }, { "from": "human", "value": "import icons from './generated/icons.js';\nimport { draw } from './draw.js';\n\nfunction initIcons(state) {\n const $right = $('#right');\n\n $.each(icons, (index, icon) => {\n c...
javascript
chosen
[ { "from": "system", "value": "Add rtl css file for minification\n" }, { "from": "human", "value": "module.exports = {\n all: {\n files: {\n 'dist/css/binary.min.css': ['src/css/external/**/*.css', 'dist/css/binary.css']\n }\n }\n};" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Fix test failure from upstream change in convert-source-map.\n\nSee conversation in https://github.com/babel/babel/pull/5302 for\ndetails.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar x = 0;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9...
javascript
chosen