conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add error recovery for wrongly formatted sshKeys\n" }, { "from": "human", "value": "// @flow\n\nconst logger = require('../logger');\nconst R = require('ramda');\nconst sshpk = require('sshpk');\nconst bodyParser = require('body-parser');\n\nconst toFingerprint = ss...
javascript
chosen
[ { "from": "system", "value": "Fix year_breadcrumb in Gobierto Indicators\n" }, { "from": "human", "value": "//= require ./app/init\n//= require_tree ./app\n" }, { "from": "gpt", "value": "//= require ./app/init\n//= require_tree ./app\n\n$(document).on('turbolinks:load', function() {...
javascript
chosen
[ { "from": "system", "value": "Edit templateUrl value. Add require, link values. Add nwCategoryItemDirective.\n" }, { "from": "human", "value": "// js/directives/nw-category-item.directive\n\n(function() {\n \"use strict\";\n\n angular.module(\"NoteWrangler\")\n .directive(\"nwCategoryItem\...
javascript
chosen
[ { "from": "system", "value": "Hide ITS messages for now unless `showITS` url param\n\nUntil we get sensible messages from ITS, their demo ones are not\nhelpful. Thy can be seen using `?showITS=true` in the url.\n" }, { "from": "human", "value": "import Immutable from 'seamless-immutable';\nimpor...
javascript
chosen
[ { "from": "system", "value": "Fix <FormErrorList/> always looking at `base` field\n" }, { "from": "human", "value": "import React from \"react\"\n\nexport default class FormErrorList extends React.Component {\n displayName = \"Frig.FormErrorList\"\n\n static defaultProps = {\n // This is th...
javascript
chosen
[ { "from": "system", "value": "Refactor dependant-selector further and (conditionally) update TomSelect if present\n\nI'm also introducing a convention here of adding a `private` comment to visually demarcate which methods are meant to be part of the public interface of the class and which aren't. The method...
javascript
chosen
[ { "from": "system", "value": "Add additional check for empty pages" }, { "from": "human", "value": "\nvar HangarXPLOR = HangarXPLOR || {};\n\n// Pre-process all the items in a document, then load the next page, or render the UI\nHangarXPLOR.ProcessPage = function($page, pageNo)\n{\n var $items ...
javascript
chosen
[ { "from": "system", "value": "Switch to an import of transit colors from util module.\n" }, { "from": "human", "value": "let transitServiceColor = {\n 'CORE - METRORAIL': 'red',\n 'CORE - METRORAPID': '#f24d6e',\n 'CORE - LIMITED': '#649dce',\n 'CORE - RADIAL': '#5190c8',\n 'CORE - FEEDER':...
javascript
chosen
[ { "from": "system", "value": "Disable new test failing since 79748e3f7ced.\n\nTBR=titzer@chromium.org\nTEST=mjsunit/compiler/opt-next-call-turbo\n\nReview URL: https://codereview.chromium.org/862533002\n\nCr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#26143}\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Make `stdio` a global, point `runtime.stdio` to it\n" }, { "from": "human", "value": "// Copyright 2014-2015 runtime.js project authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with ...
javascript
chosen
[ { "from": "system", "value": "[components] Fix wrong order of extending defaults\n" }, { "from": "human", "value": "import React from 'react'\n\nexport default function Styleable(Component, defaultStyles) {\n function Styled(props) {\n const {styles, ...rest} = props // eslint-disable-line r...
javascript
chosen
[ { "from": "system", "value": "Add JS for close alerts\n" }, { "from": "human", "value": ";(function($) {\n\n /*\n @name : checkRadio\n @function : check or uncheck checkbox & radio inputs\n @params : no params\n */\n function checkRadio() {\n if($('input[type...
javascript
chosen
[ { "from": "system", "value": "Remove FRG specific functionality from show-hide controller\n" }, { "from": "human", "value": "import { Controller } from \"@hotwired/stimulus\";\nimport { Transition } from \"./utils/transition\";\n\nexport default class ShowHideController extends Controller {\n s...
javascript
chosen
[ { "from": "system", "value": "Make the HLTV search escape uri fragments\n" }, { "from": "human", "value": "'use strict';\n\nvar request = require( 'request' );\n\nmodule.exports = {\n baseUrl : 'http://www.hltv.org/?pageid=255&res=5&team=1&term=',\n search : function( searchPhrase, callbac...
javascript
chosen
[ { "from": "system", "value": "Add a message to indicate the server is listening\n" }, { "from": "human", "value": "var server = require('../server');\n\nserver.listen(3000);\n" }, { "from": "gpt", "value": "var server = require('../server');\n\nserver.listen(3000);\nconsole.log('List...
javascript
chosen
[ { "from": "system", "value": "Replace \"int\" variable name with \"integer\"\n\nSome compilers break because int is a reserved (unused) word in JS\n\nCloses #1, Closes #2\n" }, { "from": "human", "value": "'use strict'\n\nvar isInteger = require('is-integer')\n\nmodule.exports = function parseIn...
javascript
chosen
[ { "from": "system", "value": "Remove error handling for now.\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar Stream = require('stream');\n\nfunction statdir(dir, names, cb) {\n var entries = [];\n\n names.forEach(function(name) {\n var relName = ...
javascript
chosen
[ { "from": "system", "value": "feature: Add dangling underscore exceptions for elasticsearch results\n" }, { "from": "human", "value": "module.exports = {\n\textends: 'airbnb-base',\n\tplugins: [\n\t\t'mocha',\n\t],\n\tenv: {\n\t\tnode: true,\n\t\tmocha: true,\n\t},\n\trules: {\n\t\tstrict: [0, '...
javascript
chosen
[ { "from": "system", "value": "Change namespace name to Coolblue\n" }, { "from": "human", "value": "\"use strict\";\n\nvar Hapi = require(\"hapi\");\nvar halacious = require(\"halacious\");\nvar fs = require(\"fs\");\nvar MongoDbConnection = require(\"./lib/services/mongoDb\");\n\nconst config = ...
javascript
chosen
[ { "from": "system", "value": "Remove body on injected style so html tag can be used" }, { "from": "human", "value": "module.exports = function(source) {\n this.cacheable();\n\n if (this.resource.split('/').indexOf('views') < 0) {\n return source;\n }\n\n var viewName = this.resource.split...
javascript
chosen
[ { "from": "system", "value": "Add comments for dev and clear codes.\n" }, { "from": "human", "value": "function r() {\n\tvar strings = arguments[0];\n\tvar values = Array.prototype.slice.call(arguments, 1);\n\t\n\t// concentrate strings and interpolations\n\tvar str = strings.raw.reduce(function...
javascript
chosen
[ { "from": "system", "value": "Call contentFor when we are nested\n\nFrom the frontend or elsewhere contentFor doesn't get called\nautomatically when it is this deep in the tree. We can force it to get\ncalled like this.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n na...
javascript
chosen
[ { "from": "system", "value": "Fix bug: dont use obs[0] as first obstacle\n\nShould check if obstacle is in front of tRex\n" }, { "from": "human", "value": "var ai = ai || {}; //!< @namespace ai\n\nai.init = function(){\n setInterval(\"ai._mainLoop();\", 1000 / 120);\n setInterval(\"api.keepPl...
javascript
chosen
[ { "from": "system", "value": "Make goMap a directive of type A\n" }, { "from": "human", "value": "goog.provide('go_map_directive');\n\ngoog.require('go');\n\ngoModule.directive('goMap',\n /**\n * @return {angular.Directive} The directive specs.\n */\n function() {\n return {\n...
javascript
chosen
[ { "from": "system", "value": "Make pseudonym service not lean\n\n" }, { "from": "human", "value": "const service = require('feathers-mongoose');\nconst Pseudonym = require('./model');\nconst hooks = require('./hooks');\n\nmodule.exports = function () {\n\tconst app = this;\n\tconst options = {\n...
javascript
chosen
[ { "from": "system", "value": "Fix a missed details -> field switchover\n" }, { "from": "human", "value": "\"use strict\";\n\nvar m = require(\"mithril\"),\n\n id = require(\"./id\"),\n hide = require(\"./hide\"),\n label = require(\"./label\"),\n \n css = require(\"./type...
javascript
chosen
[ { "from": "system", "value": "Add window size and devicePixelRatio to platform sample output\n\nEnyo-DCO-1.1-Signed-Off-By: Ben Combee (ben.combee@palm.com)\n" }, { "from": "human", "value": "enyo.kind({\n\tname: \"enyo.sample.PlatformSample\",\n\tkind: \"FittableRows\",\n\tclasses: \"enyo-fit p...
javascript
chosen
[ { "from": "system", "value": "fix: Allow section name to be separated easier\n\nNow there's a slash for parsing. Maybe this should be split up somehow.\n" }, { "from": "human", "value": "const _ = require('lodash');\n\nmodule.exports = function parseSectionName(sectionName, name = '') {\n const...
javascript
chosen
[ { "from": "system", "value": "Add class active to first tabs link\n" }, { "from": "human", "value": "export default function normalizeTabControllerClick() {\n\tconst hashLinks = document.querySelectorAll(\".js-tabs-control a[href^='#']\");\n\tconst firstLink = document.querySelector('.js-tabs-co...
javascript
chosen
[ { "from": "system", "value": "Remove superfluous variable, improve documentation" }, { "from": "human", "value": "// Adds toggle for custom theme to Page Action.\n//\n// This file *only* controls that toggle, \n// the logic behind enabling/disabling the theme is found in\n// core/js/customThemeH...
javascript
chosen
[ { "from": "system", "value": "Allow accessing I18n in jst files during test\n" }, { "from": "human", "value": "const jstPlugin = require('rollup-plugin-jst');\nconst jst = jstPlugin();\n\nmodule.exports = {\n process(data, id) {\n return jst.transform(data, id).replace('export default', 'mod...
javascript
chosen
[ { "from": "system", "value": "[desk-tool] Remove Ink on Pane items\n" }, { "from": "human", "value": "import styles from './styles/PaneItem.css'\nimport listStyles from './styles/ListView.css'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport Ink from 'react-ink'\nimport {St...
javascript
chosen
[ { "from": "system", "value": "Add autohide example for StatusIcon\n" }, { "from": "human", "value": "import React from 'react';\n\nimport StatusIcon from '@ichef/gypcrete/src/StatusIcon';\nimport DebugBox from 'utils/DebugBox';\n\nexport default {\n title: '@ichef/gypcrete|StatusIcon',\n c...
javascript
chosen
[ { "from": "human", "value": "Check all checkboxes working in pools\n" }, { "from": "gpt", "value": "/*$(document).ready(function() {\n /!*$(\"ul#tabs li\").click(function(e){\n if (!$(this).hasClass(\"active\")) {\n var tabNum = $(this).index();\n var nthChild = t...
javascript
chosen
[ { "from": "system", "value": "Fix checkAuth to make it work with componentWillReceiveProps\n" }, { "from": "human", "value": "import React from 'react';\nimport {connect} from 'react-redux';\nimport {pushState} from 'redux-router';\n\nexport function requireAuthentication(Component) {\n\n cla...
javascript
chosen
[ { "from": "system", "value": "Fix /destroy_all_the_things endpoint, state are lower case\n" }, { "from": "human", "value": "var express = require('express');\nvar kue = require('kue');\nvar Bot = require('../models/bot');\n\nvar router = express.Router();\n\n/* GET home page. */\nrouter.get('/',...
javascript
chosen
[ { "from": "system", "value": "Remove grunt concat, not used by default, causes errors\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n\t// 1. All configuration goes here \n\tgrunt.initConfig({\n\t\tpkg: grunt.file.readJSON('package.json'),\n\n\t\tless: {\n\t\t\tdevelopme...
javascript
chosen
[ { "from": "system", "value": "Use UTC time in date-helper\n" }, { "from": "human", "value": "// a helper to render a date in milliseconds since epoch as something a normal\n// human can understand\n\nvar Handlebars = require('handlebars');\nvar moment = require('moment');\n\n/**\n * Parameters: ...
javascript
chosen
[ { "from": "system", "value": "[Fix] Add Inherit Image type element from item\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../../templates/components/bricks-grid/item';\n\nconst { Component, on } = Ember;\n\nexport default Component.extend({\n layout,\n\n s...
javascript
chosen
[ { "from": "system", "value": "Use jQuery ajax request instead of fetch\n\n`fetch` doesn't work with URLs without a protocol.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport fetch from \"ember-network/fetch\";\nimport ENV from '../config/environment'\n\nexport default Ember....
javascript
chosen
[ { "from": "system", "value": "Fix browserify 'pack' pipeline replacement\n\nResolves failing test in a9d7d7ca\n\nCloses #46\n" }, { "from": "human", "value": "'use strict';\n\nvar bpack = require('browser-pack');\nvar fs = require('fs');\nvar path = require('path');\nvar xtend = require('xtend')...
javascript
chosen
[ { "from": "system", "value": "TASK: Remove flattern of font task\n\n... to make sub-font-folders possible\n" }, { "from": "human", "value": "'use strict';\n\nif (!config.tasks.fonts) {\n\treturn false;\n}\n\nlet paths = {\n\tsrc: path.join(config.root.base, config.root.src, config.tasks.fonts.sr...
javascript
chosen
[ { "from": "system", "value": "Use process.env.PORT if it exists.\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\n\n// Serve assets in /public\nvar path = require('path');\napp.use(express.static(path.join(__dirname, '../client')));\n\n// Body parsing f...
javascript
chosen
[ { "from": "system", "value": "Include requested URL as part of error object.\n" }, { "from": "human", "value": "function WmataApiError(msg, statusCode){\n this.name = 'WmataApiError';\n this.msg = msg || '';\n this.statusCode = statusCode;\n}\n\nWmataApiError.prototype = Error.prototype...
javascript
chosen
[ { "from": "system", "value": "Add sequence key to make sorting easier (w/ thanks to @curiousdannii)\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar readline = require('readline');\nvar bcv_parser = require('bible-passage-reference-parser/js/tr_bcv_parser').bcv_parser;\nvar bcv = ne...
javascript
chosen
[ { "from": "system", "value": "Refactor courseware javascript, add support for dropdowns." }, { "from": "human", "value": "(function (win, $) {\n\n 'use strict';\n\n win.Courseware = {\n run: function() {\n /**\n * Hide alert boxes on clicks\n */\n $(\".alert-box\").del...
javascript
chosen
[ { "from": "system", "value": "Make create multiple specification more specific\n" }, { "from": "human", "value": "var is = require('is-js');\n\n\nmodule.exports = function(sugar, models, assert) {\n return function createMultipleAuthors(cb) {\n var firstAuthor = {name: 'foo'};\n ...
javascript
chosen
[ { "from": "system", "value": "Load error after main no longer issue. If the issue persists despite the fix, run 'bundle install' in rubymine and try again. It should work at this point.\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which w...
javascript
chosen
[ { "from": "system", "value": "Correct order of javascripts (copied from 3.0).\n" }, { "from": "human", "value": "// Place your application-specific JavaScript functions and classes here\n// This file is automatically included by javascript_include_tag :defaults\n//= require prototype\n//= requir...
javascript
chosen
[ { "from": "system", "value": "Print json to console if a table isn't suitable.\n\nAlso remove redundant comment.\n" }, { "from": "human", "value": "/**\n * The sitespeed.io coach (https://www.sitespeed.io/coach)\n * Copyright (c) 2016, Peter Hedenskog, Tobias Lidskog\n * and other contributors\n...
javascript
chosen
[ { "from": "system", "value": "Remove ads script from the build\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/javascript...
javascript
chosen
[ { "from": "system", "value": "Document year filter spec and only attempt to use it with 4 digit values\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('occupied.filters', ['occupied.services'])\n\n /**\n * Filter to insert adjusted/ filled-in values for {city}, {popula...
javascript
chosen
[ { "from": "system", "value": "Replace custom ArrayBuffer converter with Buffer.from\n" }, { "from": "human", "value": "function arrayBufferToBuffer(ab) {\n const buffer = new Buffer(ab.byteLength);\n const view = new Uint8Array(ab);\n for (var i = 0; i < buffer.length; ++i) buffer[i] = view[i...
javascript
chosen
[ { "from": "system", "value": "Remove commented out, unused code.\n" }, { "from": "human", "value": "import dateUtil from './date-util';\n\nconst dateMap = {\n days: 1,\n weeks: 7\n};\n\nexport default function({ referenceDate, back, forward, scale = 'days' }) {\n // The \"1\" here accounts fo...
javascript
chosen
[ { "from": "system", "value": "Use Facebook Graph API v8.0" }, { "from": "human", "value": "const Facebook = require('fb').Facebook;\nconst fs = require('fs');\n\nconst config = require('../config')('social').facebook;\n\nlet fb = new Facebook();\nfb.setAccessToken(config.accessToken);\n\nfunctio...
javascript
chosen
[ { "from": "system", "value": "Add indent to body of Wrapper" }, { "from": "human", "value": "import * as React from \"react\";\nimport {Wrapper} from \"./Wrapper\";\nimport {BuildSnapshot} from \"./BuildSnapshot\";\n\n/**\n * Container Component for BuildSnapshots.\n * \n * @param {*} props inpu...
javascript
chosen
[ { "from": "system", "value": "Simplify the configuration of jshint.\n" }, { "from": "human", "value": "\n'use strict';\n\nvar gulp = require('gulp'),\n jasmine = require('gulp-jasmine'),\n TerminalReporter = require('jasmine-terminal-reporter'),\n reporters = require('jasmine-reporters'...
javascript
chosen
[ { "from": "system", "value": "Allow replaceItems to be edited with options\n\nCurrently cannot change the default replaceItems setting" }, { "from": "human", "value": "export default function makeDefaultState (servicePath, options) {\n const { idField, autoRemove, paginate, enableEvents, prefer...
javascript
chosen
[ { "from": "system", "value": "Comment out a console log\n" }, { "from": "human", "value": "angular\n .module('app')\n .directive('modal', ['$compile', '$templateCache', 'pageService',\n function($compile, $templateCache, pageAPI) {\n return {\n scope: true,\n compile: fun...
javascript
chosen
[ { "from": "system", "value": "Update <input> size on load\n" }, { "from": "human", "value": "/*globals Panel*/\n'use strict'\n\n/**\n * Handle our custom text input implementation\n * The main reason we need this is to allow the user copy the resulting\n * query as text\n * @param {HTMLElement} ...
javascript
chosen
[ { "from": "system", "value": "Add build world, Lesson 7\n" }, { "from": "human", "value": "// Preloader.js\n\nBunnyDefender.Preloader = function (game) {\n this.preloadBar = null;\n this.titleText = null;\n this.ready = false;\n};\n\nBunnyDefender.Preloader.prototype.preload = function () {\n...
javascript
chosen
[ { "from": "system", "value": "Load models based on url\n" }, { "from": "human", "value": "\n/*\n * GET home page.\n */\n\nvar model = require('../public/data/model.json');\nvar partner = require('../public/data/partner.json');\n\nexports.index = function(req, res){\n if (req.path == '/') {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix reporting false positives of IP\n" }, { "from": "human", "value": "var bot = require('..');\nvar irc = require('irc');\nvar wikipedia = new irc.Client('irc.wikimedia.org','civilservant',{\n port:6667,channels:['#en.wikipedia']\n})\n\nwikipedia.addListener('mess...
javascript
chosen
[ { "from": "system", "value": "Add call and apply methods\n" }, { "from": "human", "value": "var extend = require('./extend');\nvar create = require('./create');\nvar noop = function () {};\n\nvar Obstruct = {\n constructor: noop,\n extend: extend,\n create: create\n};\n\nmodule.exports = Obst...
javascript
chosen
[ { "from": "system", "value": "Move service map building logic into aws-sdk-apis\n" }, { "from": "human", "value": "var AWS = require('./core');\nvar fs = require('fs');\n\nvar apiRoot = __dirname + '/../node_modules/aws-sdk-apis/apis';\n\n// load symlinks file for API versions that have been rem...
javascript
chosen
[ { "from": "system", "value": "Fix imports to work with Rollup\n" }, { "from": "human", "value": "import React, {Component as ReactComponent} from \"react\";\nimport {computed} from \"mobx\";\nimport {observer} from \"mobx-react\";\nimport {use, bind_all_react_component_methods} from \"tide/utils...
javascript
chosen
[ { "from": "system", "value": "Fix build for Ember 1.10.0\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport config from './config/environment';\n\nvar Router = Ember.Router.extend({\n location: config.locationType\n});\n\nexport default Router.map(function() {\n});\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Add an action to notify that a TAP assert is done\n" }, { "from": "human", "value": "export const someAction = () => ({\n type: 'SOMETHING'\n})\n" }, { "from": "gpt", "value": "export const TAP_ASSERT_DONE = 'TAP_ASSERT_DONE'\n\nexport const tapAssertDo...
javascript
chosen
[ { "from": "system", "value": "Remove karma-commonjs settings for avoiding error.\n\n- If you require commonjs modules, Add settings below:\n - Add `commonjs` to `frameworks`.\n ```\n frameworks: [\"jasmine\", 'commonjs'],\n ```\n - Add `preprocessors` and `commonjsPreprocessor` setting.\n ```\...
javascript
chosen
[ { "from": "system", "value": "Tweak seajs.find test case for recent modification\n" }, { "from": "human", "value": "define(function(require) {\n\n var test = require('../../test')\n\n require('./a-xx')\n require('./b-xx')\n\n\n test.assert(seajs.find('a-xx.js').name === 'a', seajs.find(\"a-x...
javascript
chosen
[ { "from": "system", "value": "Add reducer of async function for test\n" }, { "from": "human", "value": "import { combineReducers } from 'redux'\n\nfunction todos(state = [], action) {\n switch (action.type) {\n case 'ADD_TODO':\n return state.concat([ action.text ])\n ...
javascript
chosen
[ { "from": "system", "value": "Put the colon next to the name, moron\n" }, { "from": "human", "value": "/**\n * Module Name: imgur\n * Description: Various imgur functionality\n */\n\nvar _ = require('underscore')._,\n request = require('request');\n\nvar imgur = function(dbot) {\n this.api...
javascript
chosen
[ { "from": "system", "value": "Remove console logs from tests\n" }, { "from": "human", "value": "/* @flow */\n\nimport 'src/index';\nimport '../../tests/common';\n\nwindow.opener.console.warn('loaded fallback page');\n\nimport { $mockEndpoint, patchXmlHttpRequest } from 'sync-browser-mocks/src/xh...
javascript
chosen
[ { "from": "system", "value": "Add ID & HASH in CardController\n" }, { "from": "human", "value": "\n// ----------------------------------------------------------------\n// Card Class\n\nclass CardModel extends SwitchModel {\n constructor({\n name,\n lsKeyView,\n triggerSelector,\n sw...
javascript
chosen
[ { "from": "system", "value": "Enable task addition to the database\n" }, { "from": "human", "value": "angular.module('MainApp')\n .controller('FabControl', ($mdToast, $mdDialog, $scope, addToDB) => {\n $scope.addNew = (ev) => {\n $mdDialog.show({\n controller: DialogController,...
javascript
chosen
[ { "from": "system", "value": "Add id attribute to check for playerIsCaptain\n" }, { "from": "human", "value": "import React from 'react'\n\n// TODO: This should all be organized somehow...\n\nconst isProduction = process.env.NODE_ENV === 'production'\n\nexport const createUrl = url => (\n isP...
javascript
chosen
[ { "from": "system", "value": "Stop encoding the jwtSigningKey as base64\n" }, { "from": "human", "value": "\"use strict\";\n\nconst isCi = require('is-ci');\n\nconst jwtSigningKey = process.env.jwtSigningKey ? new Buffer(process.env.jwtSigningKey, 'base64') : '' ;\n\nconst dbConfig = {\n host: ...
javascript
chosen
[ { "from": "system", "value": "Allow vars to be used before definition, that's just how JS ticks.\n" }, { "from": "human", "value": "module.exports = {\n 'rules': {\n // enforce or disallow variable initializations at definition\n 'init-declarations': 0,\n // disallow the catch clause p...
javascript
chosen
[ { "from": "system", "value": "Fix codemirror include for built version of examples.\n" }, { "from": "human", "value": "yepnope([\n {\n test : (navigator.appVersion.indexOf(\"MSIE\") != -1 && parseFloat(navigator.appVersion.split(\"MSIE\")[1]) < 9),\n // Load for IE < 9\n yep : [\n ...
javascript
chosen
[ { "from": "system", "value": "Throw an error if no name is provided." }, { "from": "human", "value": "/* @flow */\n\nimport GitStore from './git-store'\n\nexport default class BranchesViewModel {\n gitStore: GitStore;\n\n constructor (gitStore: GitStore) {\n this.gitStore = gitStore\n }\n\...
javascript
chosen
[ { "from": "system", "value": "Add functionality to edit user's notifications settings\n" }, { "from": "human", "value": "$(function(){\n $('#update_user_settings').click(function(event){\n event.preventDefault();\n var url = event.target.href\n $('#edit_user_modal').modal({\n remo...
javascript
chosen
[ { "from": "system", "value": "Fix bug about showing totals.\n" }, { "from": "human", "value": "'use strict';\n\n/*\n * SummaryBar\n *\n * Summary header for record list\n */\nimport React, { PropTypes, Component } from 'react';\nimport { FormattedMessage } from 'react-intl';\n\nimport messages f...
javascript
chosen
[ { "from": "system", "value": "Add get, getAll and setUserState methods\n" }, { "from": "human", "value": "import { get } from '../utilities/get';\n\nexport default class user {\n\n static get(email) {\n return get(`/zebedee/permission?email=${email}`)\n .then(response => {\n...
javascript
chosen
[ { "from": "system", "value": "Add initiliaze function for specific model definition\n" }, { "from": "human", "value": "export default class Model {\n\tconstructor(props = {}, options = {}) {\n\t\tthis.props = props;\n\t\tthis.options = options;\n\t\tconsole.log('Base model constructor', props);\...
javascript
chosen
[ { "from": "system", "value": "Comment out Mongo connection for now\n" }, { "from": "human", "value": "\nvar mongoose = require(\"mongoose\");\nmongoose.connect('mongodb://localhost:27017/stw6');\n\n// create instance of Schema\nvar mongoSchema = mongoose.Schema;\n// create schema\nvar use...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix the specific chars not shown on post data\n" }, { "from": "human", "value": "(() => {\n\n \"use strict\";\n\n let settings = {\n baseurl: \"\",\n accessToken: \"\",\n };\n\n chrome.storage.sync.get(settings, function(storage) {\n settings.base...
javascript
chosen
[ { "from": "system", "value": "Update domain mappings for live\n" }, { "from": "human", "value": "module.exports = {\n 'hello.firefox.com': 'localhost:8080',\n 'mozilla.com': 'localhost:8081',\n 'owncloud.com': 'localhost:8082'\n};" }, { "from": "gpt", "value": "module.exports = {\...
javascript
chosen
[ { "from": "system", "value": "Remove call to seneca as it's no longer needed, will remove soon\n" }, { "from": "human", "value": "'use strict';\n\nvar express = require('express');\n\n/**\n * Main application file\n */\n\n// Set default node environment to development\nprocess.env.NODE_ENV = pro...
javascript
chosen
[ { "from": "system", "value": "UPDATE accounts instead of group related. Template still refuses to render properly\n" }, { "from": "human", "value": "'use strict'\n\nlet GroupMenuView = Backbone.View.extend({\n\n tagName: \"div\",\n\n className: \"panel-body\",\n\n initialize: function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add support for partial JSON messages from the server.\n" }, { "from": "human", "value": "'use strict';\n\nvar React = require('react');\nvar WebSocket = require('ws');\n\nmodule.exports = React.createClass({\n\n propTypes: {\n url: React.PropTypes.string....
javascript
chosen
[ { "from": "system", "value": "Add edit for sections table\n" }, { "from": "human", "value": "module.exports = {\n\theaders: ['Codigo', 'Clase', 'Periodo', 'Catedratico'],\n\trows: [\n\t\t{ type: 'label', props: { text: obj => obj.Code } },\n\t\t{ type: 'label', props: { text: obj => obj.Class.N...
javascript
chosen
[ { "from": "system", "value": "Add registration button to landing page\n" }, { "from": "human", "value": "// Landing page for AAF.\n\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nconst Landing = (props) => {\n return (\n <div>\n <h1>Landing page</h1>\n <ul...
javascript
chosen
[ { "from": "system", "value": "Add logic to handle cases of colorblindness or noncolorblindness\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nclass Result extends Component {\n render() {\n return(\n <div htmlClass=\"results\">\n <p>The answers pr...
javascript
chosen
[ { "from": "system", "value": "Replace depreciated AudioElement with MediaElement in zoom example" }, { "from": "human", "value": "'use strict';\n\n// Create an instance\nvar wavesurfer = Object.create(WaveSurfer);\n\n// Init & load audio file\ndocument.addEventListener('DOMContentLoaded', functi...
javascript
chosen
[ { "from": "system", "value": "Allow running the frontend on different hostnames\n" }, { "from": "human", "value": "const url = process.env.NODE_ENV === 'production' ? '/api' : 'http://localhost:3123/api'\n\nexport async function getLatestTest () {\n const response = await window.fetch(url)\n c...
javascript
chosen
[ { "from": "system", "value": "Disable animations during Capybara tests sooner to improve reliability.\n\nOur previous approach wasn't disabling the animations soon enough (it\nwas waiting until all external resources had loaded), and our callback\nfor disabling jQuery's animations was never being called.\n"...
javascript
chosen
[ { "from": "system", "value": "Normalize path names for Windows support\n" }, { "from": "human", "value": "\n// This allows you to alias a package with the default package. We need this\n// because the extension depends on `can/` modules and those will not normalize\n// correctly without this.\nm...
javascript
chosen
[ { "from": "system", "value": "Set token lifetime to 27 days to be safe.\n" }, { "from": "human", "value": "const fs = require('fs')\nconst path = require('path')\nconst moment = require('moment')\nconst cli = require('commander')\nconst config = require('../apiConfig')\n\ncli.parse(process.argv)...
javascript
chosen
[ { "from": "system", "value": "Add cookie jar to requests\n\nHopefully, this solves an issue I have with New York Times never\nresolving to an actual page\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = metadata;\n\nvar cheerio = require('cheerio');\nvar Promise = require('...
javascript
chosen
[ { "from": "system", "value": "Add failing spec for errback\n" }, { "from": "human", "value": "/*global describe,before,it,expect,after */\n\nvar promiseMe = require(\"../index.js\");\n\ndescribe(\"promise-me basics\", function() {\n it(\"changes a callback to then\", function() {\n exp...
javascript
chosen