conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Revert \"Remove Windows build for ia32 arch\"\n\nThis reverts commit ec504d074f02783b8e90ec149437e08f7d647bed.\n" }, { "from": "human", "value": "'use strict';\n\nconst gulp = require('gulp');\nconst { build } = require('electron-builder');\nconst config = require('...
javascript
chosen
[ { "from": "system", "value": "Set default port to 3000\n" }, { "from": "human", "value": "/**\n * Created by aram on 2/14/17.\n */\nvar config = {};\nconfig.messages = {};\nconfig.web = {};\nconfig.messages.initialMessage = \"update\";\nconfig.messages.waitMessage = \"updating...\";\nconfig.mess...
javascript
chosen
[ { "from": "system", "value": "Add new test pending dependencies.\n" }, { "from": "human", "value": "'use strict';\nvar path = require('path');\nvar assert = require('yeoman-assert');\nvar helpers = require('yeoman-test');\n\n\ndescribe('pc simple ruby app', function(){\n describe('default', fun...
javascript
chosen
[ { "from": "system", "value": "Make default grunt task build entire app\n\nChange-Id: I0f3ccabd86f69c6f402b69c34addceb653398038\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n\n cedict: { 'cedict.js'...
javascript
chosen
[ { "from": "system", "value": "Change globals lets to vars\n" }, { "from": "human", "value": "const API_BASE = '/api/v1';\n\nlet MANIFEST = {\n 'greeting.list'() {\n return 'greetings';\n }\n};\n\nexport default function(endpoint) {\n var args = Array.prototype.slice.call(argument...
javascript
chosen
[ { "from": "system", "value": "Add delay to authorize so that client_id is not undefined\n" }, { "from": "human", "value": "var auth = new OAuth2('viame', {\n client_id: '3slsfzrsluzze7qs74n442wpy',\n client_secret: 'cjmym83dwlewqqk06bvg6x06g'\n});\n\nauth.authorize(function() {\n // Ready...
javascript
chosen
[ { "from": "system", "value": "Check type, set package name, splitted into different functions\n" }, { "from": "human", "value": "writeln('package main');\nwriteln('')\nwriteln('const (')\nfor(var k in data) {\n writeln('\\t'+k+' = \"'+data[k]+'\"')\n}\nwriteln(')')\n" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Replace double with single quotes\n" }, { "from": "human", "value": "function pybossaNotify(msg, category, fadeOut=false){\n if (category === undefined) {\n category = \"info\";\n }\n var html = $(`<div class=\"alert alert-${category} fade\">` \n ...
javascript
chosen
[ { "from": "system", "value": " Fix bug: viewer callbacks minification not fully described\n" }, { "from": "human", "value": "/**\n * @typedef {{boot:function(), update:function()}}\n * @name ViewerCallbacks\n * @property {function} boot\n * @property {function} update\n * @property {function} be...
javascript
chosen
[ { "from": "system", "value": "Update mobile config to be dark theme\n" }, { "from": "human", "value": "App.setPreference('BackgroundColor', '#fff');\n\nApp.setPreference('DisallowOverscroll', 'true');\nApp.setPreference('webviewbounce', 'false');\n\nApp.setPreference('StatusBarOverlaysWebView', ...
javascript
chosen
[ { "from": "system", "value": "Add wp-org-connection as a default extension.\n\n" }, { "from": "human", "value": "const defaults = [\n {\n name: 'general-app-extension-worona',\n namespace: 'generalApp',\n },\n {\n name: 'starter-app-theme-worona',\n namespace: 'starterTheme',\n }...
javascript
chosen
[ { "from": "system", "value": "Correct the details being given to conversion events\n" }, { "from": "human", "value": "'use strict';\n\n// Load requirements\nconst engine = require('../engine');\n\n// Configures and runs the conversion task\nmodule.exports = {\n\n run: function(job) {\n retur...
javascript
chosen
[ { "from": "system", "value": "Add code to do iterative Ackermann function" }, { "from": "human", "value": "function Pair(m, n) {\n this.m = m;\n this.n = n;\n}\n\nfunction step(m, n) {\n return step(new Pair(m, n));\n}\n\nfunction step(pair) {\n\n}\n\nvar first = new Pair(1,2);\n\nconsole.log...
javascript
chosen
[ { "from": "system", "value": "Add better canvas metrics calculation\n" }, { "from": "human", "value": "(function() {\n\t'use strict';\n\n\tvar scaleFactor,\n\t canvas = document.getElementById('canvas'),\n\t ctx = canvas.getContext('2d'),\n\t CANVAS_DEFAULT_WIDTH = 640,\n\t CANVAS_DE...
javascript
chosen
[ { "from": "system", "value": "Replace `var` with `let` to increase code consistency\n" }, { "from": "human", "value": "import generator from \"./generator_function.js\";\nimport asyncGenerator from \"./async_generator_function\";\n\nit('should correctly import generator function', () => {\n\texp...
javascript
chosen
[ { "from": "system", "value": "Fix path to options index page\n" }, { "from": "human", "value": "\nchrome.runtime.onInstalled.addListener(function(details) {\n if (details.reason === 'install') {\n chrome.tabs.create({url: `chrome-extension://${chrome.runtime.id}/src/options.html`});\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug when JWT was expired\n" }, { "from": "human", "value": "import jwt from 'jsonwebtoken';\nimport { PubSub } from 'graphql-subscriptions';\n\nimport User from '../components/users/models';\n\nexport const pubsub = new PubSub();\n\nconst { JWT_SECRET } = proces...
javascript
chosen
[ { "from": "system", "value": "Fix browser-compability issues with scrolling and submitting\n" }, { "from": "human", "value": "$(function() {\n var socket = io.connect('/');\n var poemContainer = $('#poem-edit-header');\n var poemId = poemContainer.data('poem-id');\n var linesContainer = $('#...
javascript
chosen
[ { "from": "system", "value": "Update the virtual output test file to take some time between messages so the results are visible.\n" }, { "from": "human", "value": "var midi = require(\"../build/default/midi.node\");\n\nvar output = new midi.output();\noutput.openVirtualPort(\"node-midi Virtual O...
javascript
chosen
[ { "from": "system", "value": "Make sure we catch React warnings even before it's used\n\nReact 16 is now throwing a warning when requestAnimationFrame is not present\nwhen requiring the module.\n" }, { "from": "human", "value": "/*\n * @fileoverview Test helpers.\n *\n * The modules imported her...
javascript
chosen
[ { "from": "system", "value": "Add page for poster videos\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Helmet } from 'react-helmet';\n\nclass PosterVideos extends Component {\n render() {\n return (\n <div>\n <Helmet>\n <title>Pos...
javascript
chosen
[ { "from": "system", "value": "Disable test suite on React component\n" }, { "from": "human", "value": "import { expect } from 'chai'\nimport path from 'path'\nimport React from 'react'\nimport TestUtils from 'react-addons-test-utils'\n\nimport WebpackIsomorphicTools from 'webpack-isomorphic-tool...
javascript
chosen
[ { "from": "system", "value": "Add an optional way to limit concurrency\n" }, { "from": "human", "value": "import {Observable} from 'rx';\n\nexport function asyncMap(array, selector) {\n return Observable.from(array)\n .map((k) => \n Observable.defer(() => \n Observable.fromPromis...
javascript
chosen
[ { "from": "system", "value": "Fix routes, add new ones\n" }, { "from": "human", "value": "var Cosimg = require('../models/cosimg');\nvar express = require('express');\nvar router = express.Router();\n\n//retrieve all\nrouter.route('/cosimg').get(function (req, res) {\n\tCosimg.find({}).exec(func...
javascript
chosen
[ { "from": "system", "value": "Simplify signed byte calc to a unsigned one" }, { "from": "human", "value": "\nonmessage = function(e) {\n var command = e.command;\n var packed = command.compressedBytes;\n var buf_length = packed.length;\n var buf_pos = 0;\n var buf = new Uint8Array(buf);\n ...
javascript
chosen
[ { "from": "system", "value": "Create and confirm photo upload\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\n// TODO: Fix 'testing'. Unique filename required\n// TODO: Fix route\n// TODO: Fix userId and groupId\n// TODO: Fix to post\nroute...
javascript
chosen
[ { "from": "system", "value": "Make graph and score optional\n" }, { "from": "human", "value": "WebApp.connectHandlers.use(\"/package\", function (request, response) {\n var pkgName = request.url.split('/')[1];\n\n Meteor.call('getPackageParams', pkgName, {graph: true}, function (err, params) {...
javascript
chosen
[ { "from": "system", "value": "Index on production_companies and account\n" }, { "from": "human", "value": "var mongoose = require('mongoose')\n\nvar classification = {\n author: String,\n buyer: {_id: mongoose.Schema.Types.ObjectId, name: String},\n billing: {_id: mongoose.Schema.Types.Object...
javascript
chosen
[ { "from": "system", "value": "Use Meteor.Collection for backward compatibility\n" }, { "from": "human", "value": "MethodStore = [];\nTestData = new Mongo.Collection('tinytest-data');\nTestData2 = new Mongo.Collection('tinytest-data-2');" }, { "from": "gpt", "value": "MethodStore = []...
javascript
chosen
[ { "from": "system", "value": "Change permissions and add ability to make jobs\n" }, { "from": "human", "value": "var artistController = require('../controllers/artist-controller');\nvar genreController = require('../controllers/genre-controller');\n\nmodule.exports = function(app, passport) {\n ...
javascript
chosen
[ { "from": "system", "value": "Check the course cache against the keys of the course cache\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar Promise = require(\"bluebird\")\n\nvar time = require('../helpers/time')\n\nwindow.courseCache = {}\n\nfunction getCourse(clbid) {\n\treturn...
javascript
chosen
[ { "from": "system", "value": "Implement an array class for clicked tabs\n" }, { "from": "human", "value": "export default function normalizeTabControllerClick() {\n\tconst hashLinks = document.querySelectorAll(\".js-tabs-control a[href^='#']\");\n\tconst firstLink = document.querySelector('.js-t...
javascript
chosen
[ { "from": "system", "value": "[bugfix] Replace fetch with ajax service\n" }, { "from": "human", "value": "import { inject as service } from '@ember/service';\nimport DS from 'ember-data';\nimport config from 'dummy/config/environment';\n\nexport default DS.Adapter.extend({\n\n namespace: `${con...
javascript
chosen
[ { "from": "system", "value": "Fix query handling in wizard scene\n" }, { "from": "human", "value": "const { Markup } = require('telegraf');\nconst { WizardScene } = require('telegraf-flow');\n\nconst artistWizard = new WizardScene('artistWizard',\n (ctx) => {\n ctx.reply(\n 'Send me the...
javascript
chosen
[ { "from": "system", "value": "Use `kebabeCase` instead of lowerCase\n\n* Because lowerCase converts `null piece` from `NullPiece`,\n but kebabCase converts `null-piece` from `NullPiece`.\n* this method is called for css class name, so more recommendable kebabeCase.\n" }, { "from": "human", "val...
javascript
chosen
[ { "from": "system", "value": "Add sitemap plugin for docs\n" }, { "from": "human", "value": "var pkg = require('./package.json');\n\nmodule.exports = {\n // Documentation for GitBook is stored under \"docs\"\n root: './docs',\n title: 'GitBook Documentation',\n\n // Enforce use of Gi...
javascript
chosen
[ { "from": "system", "value": "Fix compat with latest RN master\n\nThe code in the Shape constructor assumes that `SvgTouchableMixin` contains only functions but [this](https://github.com/facebook/react-native/blob/master/Libraries/Components/Touchable/Touchable.js#L904) was added which breaks this assumptio...
javascript
chosen
[ { "from": "system", "value": "Add exit condition to map if child is not defined\n" }, { "from": "human", "value": "import classNames from 'classnames/dedupe';\nimport React from 'react';\n\nimport FieldError from './FieldError';\nimport Util from '../../utils/Util';\n\nconst FormGroup = (props) ...
javascript
chosen
[ { "from": "system", "value": "Add EventEmitter to file collector\n" }, { "from": "human", "value": "/*\n * Files Module\n */\nvar path = require(\"path\"),\n fs = require(\"fs\");\n\nfunction file (path) {\n // Get information about the file\n // Name\n // Size\n // Created\n /...
javascript
chosen
[ { "from": "system", "value": "Return out of search function early if no search provided\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\n\nrouter.get('/search', function(req, res, next) {\n if (!req.query.hasOwnProperty(\"inp\")) {\n ...
javascript
chosen
[ { "from": "system", "value": "Test of bulk document insertion works\n" }, { "from": "human", "value": "import {Router} from 'express';\nimport {connection} from '../db/couch';\nimport {ResponseBuilder} from '../api/response';\n\nconst users = connection.db.use('users');\n\n/**\n * The authentica...
javascript
chosen
[ { "from": "system", "value": "Remove limit from ember post API calls\n\nref #3004\n\n- this is unnecessary and causing bugs\n" }, { "from": "human", "value": "import styleBody from 'ghost/mixins/style-body';\nimport AuthenticatedRoute from 'ghost/routes/authenticated';\n\nvar paginationSettings ...
javascript
chosen
[ { "from": "system", "value": "Enable `trust proxy` setting in ExpressJS.\n" }, { "from": "human", "value": "const _ = require('lodash')\nconst glob = require('glob')\nconst bodyParser = require('body-parser')\nconst cookieParser = require('cookie-parser')\n\nconst config = require(`${process.cwd...
javascript
chosen
[ { "from": "system", "value": "Refactor check for IE9 console.\n\nThat way the additional IE9 checking code\nwill be stripped out in production.\n" }, { "from": "human", "value": "function warn(message) {\n if (window.console && (typeof console.warn === 'function')) {\n console.warn(message);...
javascript
chosen
[ { "from": "system", "value": "Add caveat for Ember 1.11 testing\n" }, { "from": "human", "value": "module.exports = {\n scenarios: [\n {\n name: 'Ember 1.11.3',\n dependencies: {\n 'ember': '1.11.3'\n }\n },\n {\n name: 'Ember 1.12.0',\n dependencies: {\...
javascript
chosen
[ { "from": "system", "value": "Use process.cwd() to serve static files\n" }, { "from": "human", "value": "var express = require('express'),\n bodyParser = require('body-parser'),\n session = require('express-session'),\n passport = require('passport'),\n jwt = require('jwt-simple');\n...
javascript
chosen
[ { "from": "system", "value": "Use modified version of chriso/validator isCreditCard function\n" }, { "from": "human", "value": "'use strict';\n\nvar stringValidator = require('validator');\n\nexports = module.exports = {\n validator: function (val) {\n if (val) {\n return stringValidato...
javascript
chosen
[ { "from": "system", "value": "Add 'Q' as a hotkey for panning\n" }, { "from": "human", "value": "/*globals svgEditor, svgCanvas*/\n/*jslint eqeq: true*/\n/*\n * ext-panning.js\n *\n * Licensed under the MIT License\n *\n * Copyright(c) 2013 Luis Aguirre\n *\n */\n \n/* \n\tThis is a very basic S...
javascript
chosen
[ { "from": "system", "value": "Set HTTPS for map tiles service\n" }, { "from": "human", "value": "export const NODE_ENV_PRODUCTION = process.env.NODE_ENV === 'production';\nexport const gaTrackingId = 'UA-97591265-1';\n\nexport const locale = 'en-US';\n\nexport const gameConfig = {\n timeout: 15...
javascript
chosen
[ { "from": "system", "value": "Replace typekit script with css\n" }, { "from": "human", "value": "export default ({children, links, typekitKey, title, gaKey, appContent, styletronSheets, meta}) => {\n return (\n <html lang=\"en\">\n <head>\n <title>{title}</title>\n {meta ? meta.map(attrs =>...
javascript
chosen
[ { "from": "system", "value": "Create a camera using options with callbacks, not just an id\n" }, { "from": "human", "value": "var cameraman = null;\n\nfunction CameraMan(id) {\n var _self = this;\n this.id = id;\n\n this.getApp = function () {\n var name = _self.id;\n retu...
javascript
chosen
[ { "from": "system", "value": "Add a delay for 1 second to /articles requests\n" }, { "from": "human", "value": "import jsonServer from 'json-server';\nimport db from './db';\n\nconst port = 3004;\n\nconst server = jsonServer.create();\nconst router = jsonServer.router(db());\n\n// default middle...
javascript
chosen
[ { "from": "system", "value": "Return 404 if room is not found or errs out\n" }, { "from": "human", "value": "//\r\n// Transcript Controller\r\n//\r\n\r\n'use strict';\r\n\r\nvar _ = require('lodash');\r\n\r\nmodule.exports = function() {\r\n var app = this.app,\r\n core = this.core,\r\...
javascript
chosen
[ { "from": "system", "value": "Fix for title bug, only happens at pageload, not before.\n" }, { "from": "human", "value": "(function (document, window, undefined) {\n // First, check if we have to do anything\n if (window.location.href.match(/\\/compare\\//i)) {\n // Get the title an...
javascript
chosen
[ { "from": "system", "value": "Add more detail to output\n" }, { "from": "human", "value": "'use strict'\n\nlet productInCart = ['ของเล่น','ข้าวสาร','กระทะเกาหลี'];\n\nconsole.log(productInCart);\nconsole.log(productInCart[0]);\nconsole.log(productInCart[1]);\nconsole.log(productInCart[2]);\n// c...
javascript
chosen
[ { "from": "system", "value": "Make Webpack builds export correctly and use umd.\n" }, { "from": "human", "value": "const _ = require('lodash');\nconst path = require('path');\nconst WebpackConfig = require('./webpack.config');\n\nmodule.exports = (entry, output) => {\n return _.merge({}, Webpac...
javascript
chosen
[ { "from": "system", "value": "Add timeout and fix logic\n" }, { "from": "human", "value": "let counter = (function(value = 0) {\n\n const getValue = function() {\n return value;\n }\n\n const changeBy = function (n) {\n if (isNaN(n)) {\n throw `${n} is not a number`;\n }\n va...
javascript
chosen
[ { "from": "system", "value": "ADD solution for day 3_2\n" }, { "from": "human", "value": "const fs = require('fs')\nconst input = fs.readFileSync('2020/day3/day3.txt', 'utf8')\nconst lines = input.split(/\\r?\\n/)\nlet width = lines[0].length, result = 0, index = 0\nfor (let line of lines) {\n ...
javascript
chosen
[ { "from": "system", "value": "Store pretty printed version of cassete\n" }, { "from": "human", "value": "var mkdirp = require('mkdirp');\nvar fs = require('fs');\nvar getDirName = require('path').dirname;\n\nfunction serialize(response) {\n return {\n status: response.status,\n statusText...
javascript
chosen
[ { "from": "system", "value": "Save selected workspace state into store\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport { View, ListView, StyleSheet } from 'react-native'\nimport { Actions } from 'react-native-router-flux'\nimport WorkspaceRow from './Workspace...
javascript
chosen
[ { "from": "system", "value": "Change port to port 80\n" }, { "from": "human", "value": "// require('dotenv').config();\nconst bodyParser = require('body-parser');\nconst metadata = require('../package.json');\nconst compression = require('compression');\nconst express = require('express');\ncons...
javascript
chosen
[ { "from": "system", "value": "Support /blog/id/{id} redirect to /blog/{id}\n" }, { "from": "human", "value": "export function setupRedirects(server) {\n\n server.route({\n method: 'GET',\n path: '/blog/modified/{year}',\n handler: function (request, reply) {\n reply.redirect(`/blo...
javascript
chosen
[ { "from": "system", "value": "Use express built-in json body middleware instead of doing the parsing work ourselves.\n" }, { "from": "human", "value": "module.exports = function (req, res, next, callback) {\n let ctype = req.get('Content-Type')\n let done = false\n if (ctype !== 'application/...
javascript
chosen
[ { "from": "system", "value": "Fix adding google maps file in landing logic\n" }, { "from": "human", "value": "\"use strict\";\n\nconst gulp = require('gulp'),\n\trename = require('gulp-rename'),\n\tconcat = require('gulp-concat'),\n\tbabel = require('gulp-babel'),\n\tngAnnotate = require('gulp-n...
javascript
chosen
[ { "from": "system", "value": "Use new syntax for getting the babel polyfill\n" }, { "from": "human", "value": "/* global require, module */\nvar EmberApp = require('ember-cli/lib/broccoli/ember-app');\n\nmodule.exports = function(defaults) {\n var env = EmberApp.env() || 'development';\n var i...
javascript
chosen
[ { "from": "system", "value": "Fix seconds rounding up instead of truncating\n" }, { "from": "human", "value": "$(function () {\n $('.time').each(function (i, el) {\n if ($.trim(el.innerHTML) === '0') {\n el.innerHTML = '-';\n } else {\n el.innerHTML = numeral(el.innerHTML).forma...
javascript
chosen
[ { "from": "system", "value": "Build schema by passing commentDescriptions\n" }, { "from": "human", "value": "import { parse } from 'graphql';\nimport { validate } from 'graphql/validation';\nimport { buildASTSchema } from 'graphql/utilities/buildASTSchema';\nimport { GraphQLError } from 'graphql...
javascript
chosen
[ { "from": "system", "value": "Add validation rule for status_code\n" }, { "from": "human", "value": "\"use strict\";\n\nconst valid_uri = require(\"valid-url\").isUri;\nconst mongoose = require(\"mongoose\");\nmongoose.Promise = global.Promise;\n\nconst Schema = mongoose.Schema;\n\nmodule.expor...
javascript
chosen
[ { "from": "system", "value": "Switch the image if there is a change in the DOM.\n" }, { "from": "human", "value": "(function () {\n document.querySelectorAll('img').forEach(function (img) {\n chrome.storage.sync.get(null, function (items) {\n if (items.data) {\n ...
javascript
chosen
[ { "from": "system", "value": "Support newer xregexp for JS where XRegExp is imported as default\n" }, { "from": "human", "value": "const reader = require('readline').createInterface(process.stdin, null);\nconst XRegExp = require('xregexp').XRegExp;\nconst counts = new Map();\n\nreader.on('line',...
javascript
chosen
[ { "from": "system", "value": "Comment out the SemesterDetail log\n" }, { "from": "human", "value": "import * as React from 'react'\nimport * as Immutable from 'immutable'\nimport {State} from 'react-router'\nimport {isCurrentSemester} from 'app/helpers/isCurrent'\n\nlet SemesterDetail = React.cr...
javascript
chosen
[ { "from": "system", "value": "Implement phase 1 of semester detail\n" }, { "from": "human", "value": "import * as React from 'react'\nimport {State} from 'react-router'\n\nlet SemesterDetail = React.createClass({\n\tmixins: [State],\n\trender() {\n\t\treturn React.createElement('div', null, JSON...
javascript
chosen
[ { "from": "system", "value": "Work around missing buffer functions in the browser.\n" }, { "from": "human", "value": "/* jshint browserify: true */\n\n'use strict';\n\n/**\n * Shim entry point for browserify.\n *\n * It only exposes the part of the API which can run in the browser.\n *\n */\n\nv...
javascript
chosen
[ { "from": "system", "value": "Add test for the required arg.\n" }, { "from": "human", "value": "var assert = require('assert');\nvar test = require('mocha').test;\nvar markdown = require('..');\n\ntest('.toHtml', function(done) {\n var testCases = [\n {\n args: { markdown: '# Hello', ou...
javascript
chosen
[ { "from": "system", "value": "Chore: Make warning about package-lock.json more clear\n" }, { "from": "human", "value": "// eslint-disable-next-line import/no-unresolved, import/extensions\nimport { danger, warn } from 'danger';\n\nconst packageChanged = danger.git.modified_files.includes('packag...
javascript
chosen
[ { "from": "system", "value": "Add dev server log level\n" }, { "from": "human", "value": "process.env.NODE_ENV = process.env.NODE_ENV || 'development';\n\nconst config = require('./shared');\nconst eslint = require('./loaders/eslint');\n\nconfig.module.rules.unshift(eslint);\n\nmodule.exports = ...
javascript
chosen
[ { "from": "system", "value": "Add BL4 to Tier Shift mod\n" }, { "from": "human", "value": "exports.BattleScripts = {\n\tinit: function () {\n\t\tfor (var i in this.data.Pokedex) {\n\t\t\tvar tier = '';\n\t\t\tvar adjustment = 0;\n\t\t\t// mega evolutions get the same stat boost as their base for...
javascript
chosen
[ { "from": "system", "value": "Remove unused test helpers for templates testing\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n function FakeKeyEvent(key) {\n this.keyCode = key;\n this.preventDefault = function() {};\n this.stopPropagation = function() {};\n }\n\...
javascript
chosen
[ { "from": "system", "value": "Check for eslint instead of jshint\n" }, { "from": "human", "value": "/*global describe, before, it*/\n'use strict';\n\nvar path = require('path');\nvar assert = require('yeoman-assert');\nvar helpers = require('yeoman-test');\n\ndescribe('angular with gulp and brow...
javascript
chosen
[ { "from": "system", "value": "Refactor to send argument to second variable\n" }, { "from": "human", "value": "import React from 'react';\nimport FloatingActionButton from 'material-ui/FloatingActionButton';\nimport TextField from 'material-ui/TextField';\nimport RaisedButton from 'material-ui/Ra...
javascript
chosen
[ { "from": "system", "value": "Add caching to github mocks\n" }, { "from": "human", "value": "// githubMock\n// Used to mock requests to GitHub with FS\n// for testing environment\n\nvar fs = require( 'fs' );\n\nmodule.exports = {\n getRepo : function ( pkg, callback ) {\n // Hit the wapm.jso...
javascript
chosen
[ { "from": "system", "value": "Fix an occurence of 'chromium' that didn't get changed to 'chrome'\n\nReview URL: http://codereview.chromium.org/115049\n\ngit-svn-id: http://src.chromium.org/svn/trunk/src@15486 4ff67af0-8c30-449e-8e8b-ad334ec8d88c\n\nFormer-commit-id: 2f9a1ff18cd8a495b94dfe9104aa56a2697c3534...
javascript
chosen
[ { "from": "system", "value": "Change join button colour to blue.\n" }, { "from": "human", "value": "import '../css/ListItem.css';\nimport React, { Component, PropTypes } from 'react';\nimport Button from './Button';\n\nexport default class ListItem extends Component {\n render() {\n const {\...
javascript
chosen
[ { "from": "system", "value": "Fix typos in Project definition.\n" }, { "from": "human", "value": "/**\n * A project is a collection of handlers\n**/\nvar Project = exports.Project = function(name, author) {\n this.name = name;\n this.author = author;\n this.handlers = {};\n this.hand...
javascript
chosen
[ { "from": "system", "value": "Add some extra redirect logic for root path\n" }, { "from": "human", "value": "const TYPES = [\n 'communities',\n 'featured-users',\n 'recent',\n 'recommended',\n 'trending',\n]\n\nconst getComponents = (location, cb) => {\n cb(null, require('../../containers/...
javascript
chosen
[ { "from": "system", "value": "Add support for 16-bit fixed point" }, { "from": "human", "value": "define(function() {\n\n 'use strict';\n \n return {\n fromInt32: function(i32) {\n var frac = 0;\n for (var i = 0; i < 16; i++) {\n if (i32 & (0x8000 >> i)) {\n frac ...
javascript
chosen
[ { "from": "system", "value": "Add unicode to test data generator.\n" }, { "from": "human", "value": "function generateData(rows) {\n var data = [];\n for (var i = 0; i < rows; ++i) {\n data.push({\n \"id\": \"#\" + (i + 1),\n \"created_at\": new Date().toDateSt...
javascript
chosen
[ { "from": "system", "value": "Move done argument to the right place\n" }, { "from": "human", "value": "\"use strict\";\n\nvar chai = require(\"chai\");\nchai.use(require(\"chai-subset\"));\nvar expect = chai.expect;\nvar util = require(\"util\");\nvar libtidy = require(\"../\");\n\ndescribe(\"Hi...
javascript
chosen
[ { "from": "system", "value": "Disable Postgres cache by default\n" }, { "from": "human", "value": "/**\n * Base class for Postgres repositories\n * @module arpen/repositories/postgres\n */\nconst path = require('path');\nconst BaseRepository = require('./base');\n\n/**\n * Repository base class\...
javascript
chosen
[ { "from": "system", "value": "Use textAlign left by default.\n" }, { "from": "human", "value": "import DocumentNode from './DocumentNode'\n\n/**\n A base class for all text-ish nodes, such as Paragraphs, Headings,\n Prerendered, etc.\n*/\nclass TextNode extends DocumentNode {\n\n getTextPath(...
javascript
chosen
[ { "from": "system", "value": "Fix className var in initDefinition\n" }, { "from": "human", "value": "var checkValidator = function(\n validator, fieldName, className\n) {\n if (!Match.test(\n validator,\n Match.OneOf(Astro.FieldValidator, [Astro.FieldValidator])\n )) {\n throw new Ty...
javascript
chosen
[ { "from": "system", "value": "Transform OAuth errors so they can be used by HTML templates" }, { "from": "human", "value": "'use strict';\n\n/**\n * Translates user creation errors into an end-user friendly userMessage\n * @param {*} err\n */\nfunction oktaErrorTransformer(err) {\n if (err && e...
javascript
chosen
[ { "from": "system", "value": "Check whether element has tag type instead of whether name exists\n" }, { "from": "human", "value": "var Issue = require('../issue');\n\nmodule.exports = {\n name: 'table-req-header',\n on: ['tag'],\n filter: ['table'],\n desc: [\n'If set, each `table` t...
javascript
chosen
[ { "from": "system", "value": "Make everything async for processing files\n" }, { "from": "human", "value": "const {Initializer, api} = require('actionhero');\n\nmodule.exports = class FileWatcherInitializer extends Initializer {\n constructor() {\n super();\n this.name = 'file-w...
javascript
chosen
[ { "from": "system", "value": "Print out the size of the copied files\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar config = require('../config').copy\n\ngulp.task('copy', function() {\n\tvar copyFile = function(paths) {\n\t\tvar sourcePath = paths[0];\n\t\tvar destPath = pa...
javascript
chosen
[ { "from": "system", "value": "Update order of sinin chai and jquery for Phanton test as well\n" }, { "from": "human", "value": "module.exports = function(config) {\n config.set({\n basePath: '',\n frameworks: ['mocha', 'chai-jquery', 'jquery-2.1.0', 'chai', 'sinon-chai', 'fixture'],\n ...
javascript
chosen
[ { "from": "system", "value": "Hide webpack build information when running karma\n" }, { "from": "human", "value": "// Reference: http://karma-runner.github.io/0.12/config/configuration-file.html\nmodule.exports = function karmaConfig (config) {\n config.set({\n frameworks: [\n // Refere...
javascript
chosen
[ { "from": "system", "value": "Change coverage folder to /lib\n" }, { "from": "human", "value": "module.exports = function(config) {\n config.set({\n basePath: '',\n frameworks: ['jasmine', 'browserify'],\n files: [\n 'test/*'\n ],\n reporters: ['progress', 'coverage'],\n ...
javascript
chosen
[ { "from": "system", "value": "Make the script self starting\n" }, { "from": "human", "value": "/*jslint node: true */\n'use strict';\nvar cluster = require('cluster');\nvar netflow = require('node-netflowv9');\nvar numCPUs = require('os').cpus().length;\nvar NetFlowStorage = require('./lib/NetFl...
javascript
chosen
[ { "from": "system", "value": "Add function to send contact form" }, { "from": "human", "value": "$(document).ready(function() {\n\n BVB.init();\n\n $(document).on(\"click\", \"#menu a\", function() {\n href = $(this).attr(\"href\");\n window.location.hash = href;\n });\n\n $(document)....
javascript
chosen