conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add some testing gulp tasks\n" }, { "from": "human", "value": "var gulp = require( \"gulp\" ),\n jshint = require( \"gulp-jshint\" ),\n coffee = require( \"gulp-coffee\" );\n\ngulp.task( \"compile\", function () {\n gulp.src( \"./index.coffee\" )\n ....
javascript
chosen
[ { "from": "system", "value": "Add compressed style to sass build\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar gulpUtil = require('gulp-util');\n\nvar gulpIf = require('gulp-if');\nvar browserSync = require('browser-sync').create();\nvar uglify ...
javascript
chosen
[ { "from": "system", "value": "Switch basic app back to using perspective camera\n" }, { "from": "human", "value": "window.addEvent(\"domready\", function() {\n var BasicApp = new Class({\n Extends: App,\n initialize: function(element, options) {\n this.parent(element,...
javascript
chosen
[ { "from": "system", "value": "Add some spacing to post install message\n" }, { "from": "human", "value": "#! /usr/bin/env node\nconsole.log('Install hooks by running the following command from your repo root:');\nconsole.log(' ./node_modules/.bin/affiance install');\n" }, { "from": "gpt...
javascript
chosen
[ { "from": "system", "value": "Remove unused dom node generator.\n" }, { "from": "human", "value": "// Example of running gg in node\n\nvar d3 = require('d3');\nvar _ = require('underscore');\nvar gg = require('./gg.js');\n\nvar linechart = gg.gg({\n layers: [\n { geometry: 'line', mapp...
javascript
chosen
[ { "from": "system", "value": "Allow li tags in trail description\n" }, { "from": "human", "value": "var sanitizeHtml = require('sanitize-html');\n\nmodule.exports = {\n\tsanitize: function (dirty, restricted) {\n\t\tif (dirty) {\n\t\t\tvar clean = sanitizeHtml(dirty, restricted ? {allowedTags: ...
javascript
chosen
[ { "from": "system", "value": "Fix error callback with no return\n" }, { "from": "human", "value": "const driver = require('../drivers/' + process.env.IAAS + '/driver');\n\nmodule.exports = {\n\n _initialized: false,\n\n init: function(callback) {\n\n return driver.init((err) => {\n\n i...
javascript
chosen
[ { "from": "system", "value": "Fix recursive call for sortNum filter\n" }, { "from": "human", "value": " 'use strict';\n\n/**\n * @ngdoc filter\n * @name SubSnoopApp.filter:sortnum\n * @function\n * @description\n * # sortnum\n * Filter in the SubSnoopApp.\n */\nangular.module('SubSnoopApp')\n ....
javascript
chosen
[ { "from": "system", "value": "Allow Inverting Scrolling Indicator on Page Basis\n\nAllow page types to set an `invertIndicator` attribute on the page\nelement to control whether the scrolling indicator should be\ninverted. Determined by presence of `invert` css class on page element\nby default.\n" }, {...
javascript
chosen
[ { "from": "system", "value": "Revert \"mapped actions to dispatch\"\n\nThis reverts commit 499dd4856650c0c4bde580c70ef6d46749fd2f48.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { selectBook } from '../actions/index'...
javascript
chosen
[ { "from": "system", "value": "Set base path for ace\n" }, { "from": "human", "value": "\nhqDefine('app_manager/js/download_index_main',[\n 'jquery',\n 'underscore',\n 'ace-builds/src-min-noconflict/ace',\n 'app_manager/js/download_async_modal',\n 'app_manager/js/source_files',\n\n...
javascript
chosen
[ { "from": "system", "value": "Add is_ignore_case and is_including_href fields to bitfield definition\n" }, { "from": "human", "value": "/**\n * Peer\n */\nvar WordPeer = function () \n{\n\tnew DbPeer();\n};\nWordPeer.prototype = new DbPeer();\n\nWordPeer.getInstance = function () \n{\n\tif (Word...
javascript
chosen
[ { "from": "system", "value": "Add theme switcher dev utility.\n" }, { "from": "human", "value": "/* global sauce */\n\nwindow.sauce = window.sauce || {};\n\nsauce.ns = function(ns, callback) {\n let offt = sauce;\n for (const x of ns.split('.')) {\n if (!offt[x]) {\n offt...
javascript
chosen
[ { "from": "system", "value": "Rename assetPath to match the template\n" }, { "from": "human", "value": "var express = require('express'),\n routes = require(__dirname + '/app/routes.js'),\n app = express(),\n port = (process.env.PORT || 3000);\n\n// Application settings\napp.engine('htm...
javascript
chosen
[ { "from": "system", "value": "Add Middleware to serve static assets\n" }, { "from": "human", "value": "var express = require('express'),\n bodyParser = require('body-parser'),\n routes = require(__dirname + '/app/routes.js'),\n app = express(),\n port = (process.env.PORT || 3000);\n\...
javascript
chosen
[ { "from": "system", "value": "Add new bucket list item\n" }, { "from": "human", "value": "import React from 'react';\nimport Layout from '@theme/Layout';\n\nfunction BucketList() {\n return (\n <Layout>\n <div className=\"container padding-vert--lg\">\n <div className=\"row\">\n ...
javascript
chosen
[ { "from": "system", "value": "Add backgrounds to common declarations\n\nbackgroundSize, backgroundRepeat, & backgroundPosition" }, { "from": "human", "value": "\nconst commonDeclarations = {\n boxSizing: [\n 'border-box'\n ],\n\n display: [\n 'block',\n 'inline-block',\n 'inline',...
javascript
chosen
[ { "from": "system", "value": "Use 4 as minToWrap prop\n" }, { "from": "human", "value": "const React = require('react');\nconst Changes = require('./Changes');\n\n/**\n * Render an entire diff from a state.\n * @type {React}\n */\nconst RichDiff = React.createClass({\n propTypes: {\n c...
javascript
chosen
[ { "from": "system", "value": "Remove unused DYNO variable\nThis variable was provided by heroku when the project first started.\n" }, { "from": "human", "value": "(function() {\n return {\n librato: {\n email: process.env.LIBRATO_EMAIL,\n token: process.env.LIBRATO_TOKEN,\n ta...
javascript
chosen
[ { "from": "system", "value": "Fix more secure crypto comment\n" }, { "from": "human", "value": "var mongoose = require('mongoose'),\n\tcrypto = require('crypto'),\n\n\tSchema = mongoose.Schema,\n\n\tUser = new Schema({\n\t\tusername: {\n\t\t\ttype: String,\n\t\t\tunique: true,\n\t\t\trequired: t...
javascript
chosen
[ { "from": "system", "value": "Add env browser for browser globals support\n" }, { "from": "human", "value": "const baseRules = [\n 'eslint:recommended',\n].concat([\n '../src/rules/ava',\n '../src/rules/best-practices',\n '../src/rules/errors',\n '../src/rules/es6',\n '../src/r...
javascript
chosen
[ { "from": "system", "value": "Fix pluralisation for missing keys\n" }, { "from": "human", "value": "import i18next from 'i18next'\nimport t from './t'\n\n// Formats a pluralized string\nconst tPlural = (messages, options = {}) => {\n if (!Number.isInteger(options.count)) {\n console.error('[...
javascript
chosen
[ { "from": "system", "value": "Hide notification before redirecting to login\n\nCloses #514\n" }, { "from": "human", "value": "import { put, takeEvery } from 'redux-saga/effects';\nimport { push } from 'react-router-redux';\nimport { FETCH_ERROR } from '../../actions/fetchActions';\n\nexport defa...
javascript
chosen
[ { "from": "system", "value": "Return blank if length is more than 39.\n" }, { "from": "human", "value": "var url = require('url');\nvar express = require('express');\nvar router = express.Router();\nvar request = require(\"request\");\nrouter.get('/', function (req, res) {\n res.render('index...
javascript
chosen
[ { "from": "system", "value": "Use entity from SirenEntityMixin instead of fetch/parsing itself\n" }, { "from": "human", "value": "import {PolymerElement} from '@polymer/polymer/polymer-element.js';\nimport {SirenEntityMixin} from './siren-entity-mixin.js';\nimport {html} from '@polymer/polymer/l...
javascript
chosen
[ { "from": "system", "value": "Set explicit caching when watching\n" }, { "from": "human", "value": "var path = require('path');\nvar webpackConfig = require('../webpack.config.js');\n\nvar defaultResolve = webpackConfig.resolve;\n\nfunction noddyClone(obj) {\n return JSON.parse(JSON.stringify(o...
javascript
chosen
[ { "from": "system", "value": "Add actual test cases for the Search component\n" }, { "from": "human", "value": "/* eslint-env mocha */\n\nconst { expect } = require('chai')\n\ndescribe('<Search />', () => {\n it('should pass', () => {\n expect(1 + 1 === 2).to.be.true\n })\n})\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Test passing for slow CI.\n" }, { "from": "human", "value": "'use strict'\n\nconst t = require('tap')\nconst split = require('split2')\nconst path = require('path')\nconst childProcess = require('child_process')\nconst helper = require('./helper')\n\nconst lines = [...
javascript
chosen
[ { "from": "system", "value": "Add parseInt for Wercker ports\n" }, { "from": "human", "value": "module.exports = {\n host: process.env['WERCKER_RETHINKDB_HOST'] || 'localhost',\n port: process.env['WERCKER_RETHINKDB_PORT'] || 28015,\n authKey: '',\n buffer: 2,\n max: 5,\n fake_...
javascript
chosen
[ { "from": "system", "value": "Handle the case where no gapi object exists.\n\nThis can happen when sharing has been disabled.\n\nFixes #61.\n" }, { "from": "human", "value": "function googleJSClientLoaded() {\n gapi.client.load('urlshortener', 'v1', makePermalink);\n}\n\nfunction shortenURL(u...
javascript
chosen
[ { "from": "system", "value": "Add auto refresh start/stop actions\n" }, { "from": "human", "value": "import { receiveWeekNumber, fetchWeekNumber } from './weekNumber';\nimport {\n requestNewRelicErrors,\n receiveNewRelicErrors,\n fetchNewRelicErrors,\n} from './newRelicErrors';\nimport {\n r...
javascript
chosen
[ { "from": "system", "value": "Increase the @office limit to 15 minutes instead of 10\n" }, { "from": "human", "value": "const _ = require('lodash');\nconst members = require('../lib/members');\nconst get_presence_device = require('../lib/presence');\n\nconst createMention = username => `@${usern...
javascript
chosen
[ { "from": "system", "value": "Improve nav bar for mabile\n" }, { "from": "human", "value": "\r\n$('#home-nav-wrap').height($('#home-nav').height());\r\n$('#home-nav').affix({\r\n offset: $('#home-nav').position()\r\n});\r\n\r\n// $(document).ready(function() {\r\n// var width = $(window)....
javascript
chosen
[ { "from": "system", "value": "Add returnToTab option to PageConfigurationFileSelectionHandler\n\nBy default one returns to the files tab after selecting a file to be\nused in a page. This option allows to specify a different tab to\nreturn to.\n" }, { "from": "human", "value": "pageflow.PageConf...
javascript
chosen
[ { "from": "system", "value": "Fix dep. warnings in Jest config\n" }, { "from": "human", "value": "module.exports = {\n collectCoverage: true,\n collectCoverageFrom: ['src/index.tsx'],\n globals: {\n 'ts-jest': { tsConfigFile: require.resolve('../../tsconfig.test.json') }\n },\n moduleFil...
javascript
chosen
[ { "from": "system", "value": "Fix global uncaughtException event listener\n" }, { "from": "human", "value": "\nglobal.process.removeAllListeners();\n\nglobal.process.on( \"uncaughtException\", function( err ) {\n\tconsole.log( \"Uncaught exception:\", err );\n\n\t// do nothing if window was full...
javascript
chosen
[ { "from": "system", "value": "Print host and port to console.\n" }, { "from": "human", "value": "try {\n require('newrelic');\n} catch (e) {\n if ( e.code === 'MODULE_NOT_FOUND') {\n console.log('Run npm install without the --no-optional flag to install \"newrelic\"!');\n } else ...
javascript
chosen
[ { "from": "system", "value": "Add banner for js file\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar concat = require('gulp-concat');\nvar uglify = require('gulp-uglify');\nvar sourcemaps = require('gulp-sourcemaps');\nvar rename = require(\"gulp-rename\");\n\ngulp.task('scri...
javascript
chosen
[ { "from": "system", "value": "Move from getChecksum to getId\n" }, { "from": "human", "value": "core.Module(\"test.Kernel\",\n{\n init : function() {\n core.io.Script.load(\"script/test-\" + jasy.Env.getChecksum() + \".js\");\n }\n});\n" }, { "from": "gpt", "value": "core.Module...
javascript
chosen
[ { "from": "system", "value": "Deal with undefined and null values\n" }, { "from": "human", "value": "'use strict';\n\nvar Immutable = require('immutable');\n\nvar slice = Array.prototype.slice;\n\nvar partial = function (func) {\n var boundArgs = slice.call(arguments, 1);\n\n return function (...
javascript
chosen
[ { "from": "system", "value": "Remove language pair from counts\n" }, { "from": "human", "value": "var _ = require('underscore'),\n SHORT = _.template('Languages: jw.org: <%= jworg.total %>, <%= jworg.hasWebContent %> L1+, <%= jworg.isSign %> SLs, <%= jworg.isRTL %> RTL, <%= jworg.isSignWithWe...
javascript
chosen
[ { "from": "system", "value": "Fix newlines in converted html\n" }, { "from": "human", "value": "const Promise = require('bluebird')\nconst readFile = Promise.promisify(require('fs').readFile)\nconst showdown = require('showdown')\n\nclass MarkdownRenderer {\n constructor (callback) {\n this....
javascript
chosen
[ { "from": "system", "value": "Update regex for new error format\n\nCloses #34\n" }, { "from": "human", "value": "import Prism from \"prismjs\";\n\nexport function configureRustErrors(gotoPosition) {\n Prism.languages.rust_errors = { // eslint-disable-line camelcase\n 'warning':/warning:.*\\n...
javascript
chosen
[ { "from": "system", "value": "Refactor get line order functionality into its own function.\n" }, { "from": "human", "value": "$(function() {\n $('#answerQuestion').click(function(e) {\n var lineOrders = $('#lines').sortable('toArray', {attribute: 'lineNum'});\n\n var ans = [];\n...
javascript
chosen
[ { "from": "system", "value": "Clean up and document Contractor class\n" }, { "from": "human", "value": "var crypto = require('crypto');\n\nmodule.exports =\n class Contractor {\n constructor(firstName, lastName, isResident, privateEmail, override) {\n this.firstName = firstName;\n ...
javascript
chosen
[ { "from": "system", "value": "Move ProxyStore creation to tabris._init method\n\nCreating the ProxyStore inside _init ensures a fresh ProxyStore\nwhen _init is called again to reset a tabris mock in tests.\n\nChange-Id: I443047400cb6168afe92b9718b3d7ac581afb69e\n" }, { "from": "human", "value": ...
javascript
chosen
[ { "from": "system", "value": "Remove cache bust, except for debug\n" }, { "from": "human", "value": "// For any third party dependencies, like jQuery, place them in the lib folder.\n\n// Configure loading modules from the lib directory,\n// except for 'app' ones, which are in a sibling\n// direc...
javascript
chosen
[ { "from": "system", "value": "Fix from phone number for US/Canadian messages.\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://m...
javascript
chosen
[ { "from": "system", "value": "Fix GetById should return 404\n\nShould return 404 when the organization resource doesn't exists\n" }, { "from": "human", "value": "'use strict';\n\nconst Boom = require('boom');\nconst Organization = require('../model/Organization');\n\nconst internals = {};\n\nint...
javascript
chosen
[ { "from": "system", "value": "Hide button to delete the first form of the formset\n" }, { "from": "human", "value": "// django-dynamic-formset fixes for bootstrap 3\n\n(function($) {\n $(document).ready(function(){\n function fixDeleteRow ($deleteClickable) {\n // Move .dele...
javascript
chosen
[ { "from": "system", "value": "Update tests up to status code change\n" }, { "from": "human", "value": "'use strict';\n\nvar expect = require('expect.js');\n\nexports.successResponseCallback = function successResponseCallback(cb, close) {\n return function testSuccessResp(res) {\n res.setEnco...
javascript
chosen
[ { "from": "system", "value": "Add search and path to anchor links selector\n" }, { "from": "human", "value": "import { createSelector } from 'reselect';\n\nconst getRouteSections = state => state.route.sections || [];\n\nexport const getAnchorLinks = createSelector(getRouteSections, sections =>\...
javascript
chosen
[ { "from": "system", "value": "Add cookieParser and session to express setup\n" }, { "from": "human", "value": "var path = require('path'),\n express = require('express'),\n http = require('http'),\n mongoose = require('mongoose'),\n config = require('./config');\n\nvar app = express(...
javascript
chosen
[ { "from": "system", "value": "Remove calling first time publish manually\n" }, { "from": "human", "value": "/* global Meteor, Mongo */\n\nimport Join from './Join';\nimport Store from './Store';\nimport { startPublishWorker, stopPublishWorker } from './worker';\n\nconst server = {};\n\nfunction ...
javascript
chosen
[ { "from": "system", "value": "Fix issue where blank params returns malformed array entries.\n" }, { "from": "human", "value": "const PARAM_PATTERN = /(\\#|\\?)/\n\nexport default function parseURL(string) {\n const [urlBase, paramDelimiter = \"\", paramString = \"\"] = string.split(PARAM_PATTER...
javascript
chosen
[ { "from": "system", "value": "Fix unmerged content from last commit\n" }, { "from": "human", "value": "import { applyMiddleware, combineReducers, compose, createStore } from 'redux';\nimport userReducer from './reducers/userReducer.js';\nimport applicationReducer from './reducers/applicationRedu...
javascript
chosen
[ { "from": "system", "value": "Add explicit resolve in webpack\n" }, { "from": "human", "value": "var path = require('path');\nvar SRC_DIR = path.join(__dirname, '/client/src');\nvar DIST_DIR = path.join(__dirname, '/client/dist');\n\nmodule.exports = {\n entry: `${SRC_DIR}/index.jsx`,\n output...
javascript
chosen
[ { "from": "system", "value": "Add HouseInventory.jsx to be compiled\n" }, { "from": "human", "value": "var path = require('path');\nvar SRC_DIR = path.join(__dirname, '/client/src');\nvar DIST_DIR = path.join(__dirname, '/client/dist');\n\nmodule.exports = {\n entry: {\n index: `${SRC_DIR}/i...
javascript
chosen
[ { "from": "system", "value": "Fix resolved file paths and exclude node_modules\n\nSince I’m no longer using beartime-core, nothing in node_modules/ needs\nto be compiled.\n" }, { "from": "human", "value": "var path = require('path')\nvar webpack = require('webpack')\n\nmodule.exports = {\n entr...
javascript
chosen
[ { "from": "system", "value": "Add matter, generate and help commands to switch\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar pkg = require('../package.json');\n\nvar docopt = require('docopt').docopt;\nvar updateNotifier = require('update-notifier');\n\nupdateN...
javascript
chosen
[ { "from": "system", "value": "Change spacing in js file\n" }, { "from": "human", "value": "$(document).ready(function() {\n // This is called after the document has loaded in its entirety\n // This guarantees that any elements we bind to will exist on the page\n // when we try to bind to them...
javascript
chosen
[ { "from": "system", "value": "Fix task name on gulp for test\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst gMocha = require('gulp-mocha');\n\ngulp.task('travis', travis);\n\nfunction travis() {\n gulp.src('lib/**/*.test.js', {read: false})\n\t\t .pipe(gMocha());\n}\n...
javascript
chosen
[ { "from": "system", "value": "Add configration for storage providers\n" }, { "from": "human", "value": "var MONGODB_URL = process.env.MONGODB_URL || null;\n\nif (MONGODB_URL) {\n module.exports = {\n db: {\n name: 'db',\n connector: 'loopback-connector-mongodb',\n url: MONGODB...
javascript
chosen
[ { "from": "system", "value": "Rename gulp task js-lint to lint\n" }, { "from": "human", "value": "var src = ['src/**', 'sw/**'];\nvar deployDir = 'docs';\n\nvar gulp = require('gulp');\nvar clean = require('gulp-clean');\nvar jshint = require('gulp-jshint');\n\ngulp.task('default', ['copy']);\n\...
javascript
chosen
[ { "from": "system", "value": "Add build step before pushing to gh-pages.\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp-help')(require('gulp'));\nvar initGulpTasks = require('react-component-gulp-tasks');\nvar ghPages = require('gulp-gh-pages');\n\n\n/**\n * Task co...
javascript
chosen
[ { "from": "system", "value": "Add preventDefault on clicks on the 'edit' button next to the theme toggle in the page action popup. Without it, clicking edit actually toggles whether or not the theme is enabled which is incorrect.\n" }, { "from": "human", "value": "// Adds toggle for custom theme...
javascript
chosen
[ { "from": "system", "value": "Remove dependency to a removed task\n" }, { "from": "human", "value": "\"use strict\";\nvar gulp = require('gulp');\nrequire('require-dir')('./tasks');\nvar args = require('yargs').argv;\nvar git = require('gulp-git');\n\ngulp.task('default', function() {\n console...
javascript
chosen
[ { "from": "system", "value": "Fix avatar on other pages.\n\nThe styling wasn't being set on the parent container so you ended up\nwith weird things.\n" }, { "from": "human", "value": "// @flow\n\nimport React, {Component} from 'react'\nimport resolveRoot from '../../desktop/resolve-root'\nimport...
javascript
chosen
[ { "from": "system", "value": "Make sure loading indicator displays over the top of the finalise modal\n" }, { "from": "human", "value": "import { DARK_GREY } from './colors';\n\nexport const loadingIndicatorStyles = {\n loadingIndicatorContainer: {\n position: 'absolute',\n top: 0,\n l...
javascript
chosen
[ { "from": "system", "value": "Use constant for better understandability.\n" }, { "from": "human", "value": "var elements = document.getElementsByTagName('*');\n\nfor (var i = 0; i < elements.length; i++) {\n var element = elements[i];\n\n for (var j = 0; j < element.childNodes.length; j++)...
javascript
chosen
[ { "from": "system", "value": "Test examples (test session tomorrow morning)\n" }, { "from": "human", "value": "window.addEventListener('DOMContentLoaded', function() {\n\tQUnit.test(\"Hello test\", function(assert) {\n\t assert.ok(1 == \"1\", \"Passed!\");\n\t});\n});" }, { "from": "gpt...
javascript
chosen
[ { "from": "system", "value": "Change development label to dev to match NODE_ENV\n" }, { "from": "human", "value": "\nconst config = {\n\n development: {\n client: 'sqlite3',\n connection: {\n filename: './db/dev.sqlite3'\n }\n },\n\n staging: {\n client: 'postgresql',\n co...
javascript
chosen
[ { "from": "system", "value": "Break when lines are long\n" }, { "from": "human", "value": "import fs from 'fs'\n\nexport const formats = {\n base (message) {\n const results = message.split('\\n').map((line, i) => {\n if (i === 0 && line.length >= 51) throw new Error('Subject must be 50...
javascript
chosen
[ { "from": "system", "value": ":new: Add basic provider triggering logic\n" }, { "from": "human", "value": "'use babel'\n\nimport {CompositeDisposable} from 'atom'\nimport {provider as validateProvider} from './validate'\nimport Commands from './commands'\nimport IntentionsView from './view'\n\ne...
javascript
chosen
[ { "from": "system", "value": "Use iOS cache instead of tmp\n" }, { "from": "human", "value": "/**\n * @title Open - cordova.plugins.bridge.open\n * @overview Open documents with compatible apps.\n * @copyright © 2014 cordova-bridge\n * @license GPLv2\n * @author Carlos Antonio\n*/\n\nvar exec = ...
javascript
chosen
[ { "from": "system", "value": "Add debug tool to count waves\n" }, { "from": "human", "value": "var tickWave = require('./tickWave')\n\nmodule.exports = function (state, dt) {\n // Parameters\n // state\n // dt\n // simulation time, seconds\n //\n\n // To avoid huge wave of particle...
javascript
chosen
[ { "from": "system", "value": "Set styled-jsx for link styling\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\n\nconst LinkWrapper = (props) => {\n const style = {\n padding: 0,\n margin: 0\n };\n return (\n <p style={style}>\n { props.children }\n ...
javascript
chosen
[ { "from": "system", "value": "Remove leftover logging in test" }, { "from": "human", "value": "var Enum = require('../../core/Enum');\n\ndescribe('Enum', function () {\n it('should create an enum and provide a lookup function', function () {\n var myEnum = Enum(['a', 'b', 'c']);\n console...
javascript
chosen
[ { "from": "system", "value": "Use strict mode in all js files\n" }, { "from": "human", "value": "var React = require('react'),\n createClass = require('create-react-class'),\n DaysView = require('./DaysView'),\n MonthsView = require('./MonthsView'),\n YearsView = require('./YearsView'),\n T...
javascript
chosen
[ { "from": "system", "value": "Add test of delay option\n" }, { "from": "human", "value": "// test/stubbatti.js\n\n/* global describe, it, afterEach, beforeEach */\n\n'use strict';\n\nvar exec = require('child_process').exec;\nvar expect = require('chai').expect;\n\nvar Stubbatti = require('../sr...
javascript
chosen
[ { "from": "system", "value": "Add config for M+ dungeons\n" }, { "from": "human", "value": "export default {\n name: 'Dungeons',\n background: undefined, // TODO: Set up\n bosses: {\n AtalDazar: require('./AtalDazar').default,\n },\n};\n" }, { "from": "gpt", "value": "export d...
javascript
chosen
[ { "from": "system", "value": "Add extra errors, start to move away from common-errors\n" }, { "from": "human", "value": "const MessageAlreadySentError = require('./MessageAlreadySentError')\nconst MessageFailedError = require('./MessageFailedError')\nconst PluginDoesNotExistError = require('./Pl...
javascript
chosen
[ { "from": "system", "value": "Add admins of subscribed groups to /users/whoami\n\nIt's the same info we send out in a /timelines/groupname response\n(in the `users` object). We need it in /whoami for the \"feed selector\"\n(list of recipients we can post to).\n" }, { "from": "human", "value": "i...
javascript
chosen
[ { "from": "system", "value": "Drop exit handler used by node versions <4\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nlet didSend = false;\n\n// Node 0.10 does not have 'beforeExit'\n// process.send is synchronous on 0.10 and 0.12\nprocess.on('exit', function sendCovereageOnExit() {...
javascript
chosen
[ { "from": "system", "value": "Fix issue with loading missing JS file\n" }, { "from": "human", "value": "//= require jquery\n//= require jquery_ujs\n//= require foundation\n//= require refile\n//= require lodash\n//= require jquery.flash\n//= require jquery.turbolinks\n//= require turbolinks\n//=...
javascript
chosen
[ { "from": "system", "value": "Fix js bundle output path\n" }, { "from": "human", "value": "var path = require('path')\nvar webpack = require('webpack')\n\nmodule.exports = {\n devtool: 'cheap-module-eval-source-map',\n entry: [\n 'webpack-hot-middleware/client',\n './index'\n ],\n outp...
javascript
chosen
[ { "from": "system", "value": "Correct loaders with latest webpack beta\n" }, { "from": "human", "value": "const autoprefixer = require('autoprefixer');\nconst path = require('path');\nconst webpack = require('webpack');\n\nmodule.exports = {\n entry: [\n path.resolve(__dirname, './src/main')...
javascript
chosen
[ { "from": "system", "value": "Set webpack mode to production always\n" }, { "from": "human", "value": "const path = require('path');\n\nmodule.exports = {\n entry: './src/index.ts',\n output: {\n path: path.resolve(__dirname + '/dist'),\n filename: 'index.js',\n librar...
javascript
chosen
[ { "from": "system", "value": "Use webpack to minify built files\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n\tentry: './src/jtml.js',\n\tdevtool: 'source-map',\n\toutput: {\n\t\tpath: './lib',\n\t\tfilename: 'jtml.js',\...
javascript
chosen
[ { "from": "system", "value": "Fix order for gulp modules - in task compile-sass\n" }, { "from": "human", "value": "/**\n * Compile scss files listed in the config\n */\n'use strict';\n\nconst gulp = require('gulp');\nconst notify = require('gulp-notify');\nconst gulpif = require('gulp-if');\ncon...
javascript
chosen
[ { "from": "system", "value": "Add 'isDeleted' field to User schema\n" }, { "from": "human", "value": "module.exports = (db, Sequelize) => {\n const User = db.define('users', {\n id: {\n type: Sequelize.INTEGER,\n autoIncrement: true,\n primaryKey: true,\n },\n firstName:...
javascript
chosen
[ { "from": "system", "value": "Fix duplicate Map import that was breaking tests.\n" }, { "from": "human", "value": "import React from 'react';\nimport logo from './logo.svg';\nimport '../styles/App.css';\nimport { Map } from './Map';\n\nimport RenderMapContainer from '../containers/RenderMapConta...
javascript
chosen
[ { "from": "system", "value": "Handle key up/down to control commands\n" }, { "from": "human", "value": "'use strict'\n\nconst ui = require('../lib/ui')\nconst ipc = require('electron').ipcRenderer;\n\nfunction getFilePath() {\n if (ui.getCurrent() != undefined) {\n return ui.getCurrent().get...
javascript
chosen
[ { "from": "system", "value": "Use lz-string in localStorage set and get" }, { "from": "human", "value": "var recipes = null;\nvar recipe_images = null;\nvar favs = [];\nvar interval_ready_id = null;\nvar registered = false;\nvar last_updated = \"1984-01-01\";\nvar application_started = false;\nv...
javascript
chosen
[ { "from": "system", "value": "Add documentation to the deployment script\n" }, { "from": "human", "value": "import git from 'simple-git';\nimport config from './webpack.config.babel.js';\n\n// Remote repositories for deploying the site. These can only be pushed to with\n// proper authorization.\...
javascript
chosen
[ { "from": "system", "value": "Change the example address to freenode to match the README.\n" }, { "from": "human", "value": "var IRC = require('../');\n\nvar bot = new IRC.Client('5.39.86.47', 6667, false, 'prawnsbot', 'prawnsbot', {});\nbot.connect();\nbot.on('registered', function() {\n\tconso...
javascript
chosen
[ { "from": "system", "value": "Use Events instead of custom dispatcher\n" }, { "from": "human", "value": "import $ from 'jquery';\nimport * as Backbone from 'backbone';\nimport dispatcher from '../helpers/dispatcher';\n\nclass SearchBoxView extends Backbone.View {\n\n get el() { return '#search-...
javascript
chosen
[ { "from": "system", "value": "Return how many bytes were compressed in response header.\n" }, { "from": "human", "value": "const request = require('request')\nconst sharp = require('sharp')\n\nconst QUALITY = 40\n\nmodule.exports = (context, req, res) => {\n const imageUrl = req.query.url\n if...
javascript
chosen
[ { "from": "system", "value": "Make live queries read only\n" }, { "from": "human", "value": "import { operationType } from 'orbit-common/lib/operations';\n\nexport default Ember.ArrayProxy.extend({\n _orbitCache: null,\n _query: null,\n _identityMap: null,\n\n init() {\n this._super();\n\...
javascript
chosen
[ { "from": "system", "value": "Hide Android keyboard on open window and open when user select it\n" }, { "from": "human", "value": "exports.setupMenu = function(options) {\n if ( options.title !== null ) {\n $.lblText.setText(options.title);\n }\n\n if ( options.noSearch ) {\n ...
javascript
chosen