conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Allow boot from uncompressed vmlinux\n\nDecompressing the kernel can take a few seconds. To aid development\nspeed, JorConsole now checks for vmlinux.bin and uses that instead of\nvmlinux.bin.bz2, allowing for a faster boot.\n\nTo enable this faster boot:\n cd jor1k-sysroot/or...
javascript
chosen
[ { "from": "system", "value": "Support cb & promises together ✌️\n" }, { "from": "human", "value": "'use strict'\n\nconst pify = require('pify')\nconst async = require('async')\n\nconst EXCLUDE_METHODS = [ 'apply', 'memoize', 'log', 'dir', 'noConflict' ]\n\nfunction remove (arr, element) {\n con...
javascript
chosen
[ { "from": "system", "value": "Make serving static files just a wee bit more robust\n" }, { "from": "human", "value": "'use strict';\n\nvar express = require('express');\nvar app = express();\n\napp.use(express.static('app'));\n\napp.listen(8000, function () {\n console.log('Listening on port 80...
javascript
chosen
[ { "from": "system", "value": "Clarify missing output file error\n" }, { "from": "human", "value": "var React = require('react');\nvar evaluate = require('eval');\n\nfunction ReactToHtmlWebpackPlugin(destPath, srcPath) {\n this.srcPath = srcPath;\n this.destPath = destPath;\n}\n\nReactToHtmlWeb...
javascript
chosen
[ { "from": "system", "value": "Stop logspam from statebus server\n" }, { "from": "human", "value": "var bus = require('statebus').serve({file_store: false})\nvar serve = (route, file) => bus.http.get(route, (r, res) => res.sendFile(__dirname + file))\n\nserve('/janus.js', '/janus.js')\nserve('/ha...
javascript
chosen
[ { "from": "system", "value": "Trim unnecessary interactive prop from tooltip\n" }, { "from": "human", "value": "import React from 'react';\nimport {Tooltip} from 'reactjs-components';\n\nimport Icon from '../Icon';\n\nconst FormGroupContainer = (props) => {\n let removeButton = null;\n if (pro...
javascript
chosen
[ { "from": "system", "value": "Fix mixin error\nAdd an empty string alternative to avoid mixin error when a form field is left empty during submission\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n // Hide the form\n addNewQuestion...
javascript
chosen
[ { "from": "system", "value": "Increase font size on skills chart labels on users-show component\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n tagName: 'span',\n didInsertElement: function() {\n var thinking = (this.get('user.think...
javascript
chosen
[ { "from": "system", "value": "Fix typo in error message\n" }, { "from": "human", "value": "/**\n * Module dependencies\n */\n\nvar _ = require('@sailshq/lodash');\n\n/**\n * Give Waterline UsageErrors from blueprints a toJSON function for nicer output.\n */\n\nmodule.exports = function(err, req)...
javascript
chosen
[ { "from": "system", "value": "Build Windows binaries in dist folder\n" }, { "from": "human", "value": "var fs = require('fs')\nvar exec = require('child_process').exec\n\n// get our version\nvar pack = JSON.parse(fs.readFileSync('package.json', 'utf-8'))\nvar version = pack.version\n\nconsole.lo...
javascript
chosen
[ { "from": "system", "value": "Add line and column number to comment-no-loud failing tests\n\nThese were missed previously.\n" }, { "from": "human", "value": "import rule, { ruleName, messages } from \"..\";\n\ntestRule(rule, {\n ruleName,\n config: [true],\n syntax: \"scss\",\n\n accept: [\n...
javascript
chosen
[ { "from": "system", "value": "Fix radio children not appearing\n" }, { "from": "human", "value": "import Inferno from 'inferno';\nimport Component from 'inferno-component';\n\nimport Option from './Option';\nimport Radio from './Radio';\nimport Chrome from '../../modules/chrome';\n\nexport defau...
javascript
chosen
[ { "from": "system", "value": "Refresh libraries when showing panel again\n" }, { "from": "human", "value": "'use babel';\n\nimport {registerCommands, unregisterCommands} from './commands';\nimport {libraryAddCommand} from './library_add';\nimport {libraryMigrateCommand} from './library_migrate';...
javascript
chosen
[ { "from": "system", "value": "Add worflow validation to prevent user replacement assumptions\n" }, { "from": "human", "value": "(function( $ ) {\n $.fn.searchify = function() {\n return this.each(function() {\n $(this).autocomplete({\n source: $(this).data(\"s...
javascript
chosen
[ { "from": "system", "value": "Add Swagger doc route to fetch Swagger docs\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * config/router.js\n * \n * Bootstraps all Express routing.\n */\n\nconst express = require('express');\n\nmodule.exports.bootstrap = (app) => {\n let api = requir...
javascript
chosen
[ { "from": "system", "value": "Test if <TextInputRow> passing unknown props to its inner <input>\n" }, { "from": "human", "value": "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { mount } from 'enzyme';\n\nimport TextInputRow, { PureTextInputRow, BEM } from '../T...
javascript
chosen
[ { "from": "system", "value": "Convert existing knownIDs objects into arrays" }, { "from": "human", "value": "exports.checkDeletedIDs = function(knownIDs, returnedIDs) {\n if (knownIDs && returnedIDs) {\n var newIDs = [],\n repeatedIDs = {},\n removedIDs = [];\n\n ...
javascript
chosen
[ { "from": "system", "value": "Fix test for nodejs v11 or higher\n\nFix test for nodejs v11 or higher" }, { "from": "human", "value": "'use strict';\n\nconst rewire = require('rewire');\nconst sinon = require('sinon');\n\ndescribe('debug', () => {\n const debug = require('../../../lib/plugins/he...
javascript
chosen
[ { "from": "system", "value": "Disable survey in test runner, which was making the tests fail.\n" }, { "from": "human", "value": "var assert = require('assert');\nvar config = require(\"../config/specs\");\nvar geoServer = require(\"../geojson-server\");\nvar helper = require(\"....
javascript
chosen
[ { "from": "system", "value": "Make find() less sensitive to the arguments\n" }, { "from": "human", "value": "'use strict';\n\n\n// iterates through array calling iterator on each element.\n// stops as soon as iterator return non-falsy value, and returns this value\n//\nmodule.exports.find = func...
javascript
chosen
[ { "from": "system", "value": "Allow to run build from studio for cra.\n" }, { "from": "human", "value": "'use strict';\n\nconst rekitCore = require('rekit-core');\nconst spawn = require('child_process').spawn;\n\nfunction runBuild(io) {\n const prjRoot = rekitCore.utils.getProjectRoot();\n ret...
javascript
chosen
[ { "from": "system", "value": "Make use of percentage calculator module\n" }, { "from": "human", "value": "\nmodule.exports.calculate = function (workloadReports) {\n var capacities = []\n workloadReports.forEach(function (report) {\n var capacityPercentage\n var reductionPercentage\n ...
javascript
chosen
[ { "from": "system", "value": "Fix csp test on node\n" }, { "from": "human", "value": "var parseTests = require( './samples/parse' );\n\nQUnit.module( 'Ractive.parse()' );\n\nparseTests.forEach( function ( test ) {\n\n\t// disable for tests unless explicitly specified\n\t// we can just test the s...
javascript
chosen
[ { "from": "system", "value": "Make extension compatible with Firefox\n" }, { "from": "human", "value": "import q from 'q';\n\n/* global chrome */\nexport default {\n get() {\n const deferred = q.defer();\n\n chrome.storage.sync.get({\n enabled: true,\n language: 'auto'\n }, r...
javascript
chosen
[ { "from": "system", "value": "Update cache interface to ES6\n" }, { "from": "human", "value": "/**\n * A Cache can store values to key.\n * @returns {Cache}\n * @constructor\n */\nfunction Cache() {\n if(!(this instanceof Cache)) {\n return new Cache();\n }\n}\n\n/**\n * Get the value for t...
javascript
chosen
[ { "from": "system", "value": "Add header to stats table.\n" }, { "from": "human", "value": "import { ToastsComponent } from \"../toasts/toasts.component.js\";\n\nexport class StatsTemplate {\n static update(render, { symbol = \"\" } = {}) {\n if (!symbol) {\n render`\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug that make go back in browserhistory to fail\n" }, { "from": "human", "value": "var React = require('react');\nvar Link = require('react-router').Link;\nvar Login = require('./sidebar/login');\nvar Highscore = require('./sidebar/highscore');\n\nmodule.exports...
javascript
chosen
[ { "from": "system", "value": "Add test for full heading copy / paste\n" }, { "from": "human", "value": "/* bender-tags: editor,unit */\n/* bender-ckeditor-plugins: clipboard,autoid */\n/* bender-include: _helpers/pasting.js */\n/* global assertPasteEvent */\n\n'use strict';\n\n(function() {\n b...
javascript
chosen
[ { "from": "system", "value": "Set Android's document.readyState to 'interactive' during DOMContentLoaded event\n\nThis is how it should be, according to:\nhttp://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html\n" }, { "from": "human", "value": "// Copyright (c) 2013 The Chromiu...
javascript
chosen
[ { "from": "system", "value": "Revert to `secureProxy` cookies flag.\n\nThe `secureProxy` flag is for when you have an insecure connection\nbetween your load balanacer / proxy and app server, but still\nwant to send secure https cookies. It's deprecated so we'll have\nto do some work to make it possible to d...
javascript
chosen
[ { "from": "system", "value": "Allow access to assets in node_modules\n\nThe Server (root/server.js) will serve static files from the\nnode_modules/ directory.\n" }, { "from": "human", "value": "/**\n* Serves Static files\n*/\n\n\n// Module imports\nvar http = require(\"http\");\nvar express = re...
javascript
chosen
[ { "from": "system", "value": "Load the project entries when displaying the project details\n" }, { "from": "human", "value": "var trexControllers = angular.module('trexControllers', []);\n\ntrexControllers.controller('ProjectListCtrl', ['$scope', '$http',\n function($scope, $http) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use app.listen instead of http.createServer\n" }, { "from": "human", "value": "var http = require('http');\nvar app = require('./app');\n\nmodule.exports = http.createServer(app).listen(app.get('port'), function() {\n console.log(\"Express server listening on po...
javascript
chosen
[ { "from": "system", "value": "Remove --profile tag from debugging\n" }, { "from": "human", "value": "//https://nvbn.github.io/2015/06/19/jekyll-browsersync/\nvar gulp = require('gulp');\nvar shell = require('gulp-shell');\nvar browserSync = require('browser-sync').create();\n\n// Task for buildi...
javascript
chosen
[ { "from": "system", "value": "Add nodemon to main gulp dev task\n" }, { "from": "human", "value": "var gulp = require( 'gulp' )\nvar fs = require( 'fs' )\n\nfs.readdirSync( __dirname + '/gulp' ).forEach( function( task ) {\n require( './gulp/' + task )\n})\n\ngulp.task( 'dev', [ 'watch:js', '...
javascript
chosen
[ { "from": "system", "value": "Use require() because of json file.\n" }, { "from": "human", "value": "// Renames package name for Github Package Registry\n// https://stackoverflow.com/questions/58347746/automating-the-build-and-publish-process-with-github-actions-and-github-package\n// based off ...
javascript
chosen
[ { "from": "system", "value": "[Server][Router] Update mapping route declarations using newly created middlewares.\n" }, { "from": "human", "value": "const express = require('express')\nconst router = express.Router()\n\nconst instrumentMappingsController = require('../../controllers').instrument...
javascript
chosen
[ { "from": "system", "value": "Remove partner program from nav\n" }, { "from": "human", "value": "module.exports = {\n head: require('./sections/head'),\n benefits: require('./sections/benefits'),\n features: require('./sections/features'),\n slides: require('./sections/supported-hardware'),\...
javascript
chosen
[ { "from": "system", "value": "Add alt attribute to etalab logo\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport { translate } from 'react-i18next'\n\nimport Container from '../../container'\nimport Social from './social'\nimport Sitemap fro...
javascript
chosen
[ { "from": "system", "value": "Use XHTML break tag in Urban_dictionary Spice.\n" }, { "from": "human", "value": "// `ddg_spice_urban_dictionary` is a callback function that gets\n// \"urban dictionary cool\" or \"urban dictionary ROTFL.\"\n\n// Note: This plugin can display adult content and prof...
javascript
chosen
[ { "from": "system", "value": "Change version number to 0.2.x\n" }, { "from": "human", "value": "/**\n * Configuration for denkmap application\n */\nExt.define('Denkmap.util.Config', {\n singleton: true,\n\n config: {\n /**\n * @cfg {String} version Current version number of ...
javascript
chosen
[ { "from": "system", "value": "Move game specific JS into its own script.\n" }, { "from": "human", "value": "\n$(function() {\n\n socket = io.connect(':9000', {\n transports: ['websocket', 'htmlfile', 'xhr-multipart',\n 'xhr-polling', 'jsonp-polling']\n });\n\n ...
javascript
chosen
[ { "from": "system", "value": "Make file spinner same size as all others on site\n" }, { "from": "human", "value": "var $ = require('jquery');\nvar m = require('mithril');\n\n\nfunction Panel(title, header, inner, args, selected) {\n panel = m.component(Panel, title, header, inner, args);\n ...
javascript
chosen
[ { "from": "system", "value": "Work around bug in Safari styling of search input fields.\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file ...
javascript
chosen
[ { "from": "system", "value": "Watch files, but consider example working on plunkr\n" }, { "from": "human", "value": "const browserSync = require('browser-sync');\nconst path = require('path');\nconst url = require('url');\n\nconst server = browserSync.create();\nserver.init({\n port: 3000,\n ...
javascript
chosen
[ { "from": "system", "value": "Remove prod appUrl trailing slash.\n" }, { "from": "human", "value": "/**\n * Production environment settings\n *\n * This file can include shared settings for a production environment,\n * such as API keys or remote database passwords. If you're using\n * a versio...
javascript
chosen
[ { "from": "system", "value": "Remove local registry link in dev mode.\n" }, { "from": "human", "value": "'use strict';\n\n// Development specific configuration\n// ==================================\nmodule.exports = {\n // MongoDB connection options\n\n mongo: {\n uri: 'mongodb://localhost...
javascript
chosen
[ { "from": "system", "value": "Fix the date picker to show the year till the current year plus one.\n\n--HG--\nextra : rebase_source : 251155a2af486272154e6eb5e993859fc4fd0650\n" }, { "from": "human", "value": "jQuery(\n function () {\n jQuery('.datetime-pick').datetimepicker();\n jQuery('...
javascript
chosen
[ { "from": "system", "value": "Setup: Allow setup page itself to be accessed before app is setup.\n" }, { "from": "human", "value": "require.config({\n paths: {\n 'kvstore': '../app/kvstore_backbone/lib/kvstore'\n }\n});\n\n// If the app hasn't been setup, redirect to the setup page\...
javascript
chosen
[ { "from": "system", "value": "Append random hex string to campaign tag for uniqueness\n" }, { "from": "human", "value": "/**\n * Handles posting one or more new message via POTC.\n */\n\nvar async = require('async');\nvar map = require('lodash.map');\nvar partial = require('lodash.partial');\n\n...
javascript
chosen
[ { "from": "system", "value": "Update style coding for demo app main container\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nimport { createStore, combineReducers, compose } from 'redux';\nimport { Provider } from 'react-redux';\n\nimport { reduxComponentStateSto...
javascript
chosen
[ { "from": "system", "value": "Disable `console` warnings for test harness\n" }, { "from": "human", "value": "'use strict';\n\nconst { EventEmitter } = require('events');\nconst { Server } = require('http');\nconst handler = require('serve-handler');\nconst childProcess = require('child_process')...
javascript
chosen
[ { "from": "system", "value": "Add default port for HAProxy\n" }, { "from": "human", "value": "var fork = require('child_process').fork;\nvar async = require('async');\nvar amountConcurrentUsers = process.argv[2] || 200;\nvar host = process.argv[3] || 'http://localhost';\nvar initialPort = proces...
javascript
chosen
[ { "from": "system", "value": "Add missing tick to upgrade message\n" }, { "from": "human", "value": "import fs from \"fs\";\nimport path from \"path\";\nimport logger from \"./cliLogger\";\nimport readFileSyncStrip from \"./readFileSyncStrip\";\nimport { compareVersions } from \"./utils\";\n\nmo...
javascript
chosen
[ { "from": "system", "value": "Update modules fixture to always include autoActivated modules in active list.\n" }, { "from": "human", "value": "/**\n * Modules datastore fixtures.\n *\n * Site Kit by Google, Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"...
javascript
chosen
[ { "from": "system", "value": "Comment about why snake case used for config file\n" }, { "from": "human", "value": "// @flow\n\n// TODO: Type the rest of the config\nexport type ConfigFile = {\n +api?: string,\n +branches?: string,\n +customer?: number,\n +git_url?: string,\n +openshift?: nu...
javascript
chosen
[ { "from": "system", "value": "Fix issue with request body size being set too low.\n" }, { "from": "human", "value": "'use strict';\n\nvar app = require('express')();\nvar config = require('../config');\n\nif(config.env == 'development') {\n\tapp.use(require('morgan')({ format: 'dev' }));\n}\n...
javascript
chosen
[ { "from": "system", "value": "Change database name and collection name in json2mongo.\n" }, { "from": "human", "value": "\nvar MongoClient = require('mongodb').MongoClient,\n fs = require('fs');\n\nvar datafile = './data/capacityregions.json';\nvar data = JSON.parse(fs.readFileSync(datafile))...
javascript
chosen
[ { "from": "system", "value": "Save mouse position on right click\n" }, { "from": "human", "value": "chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {\n\tif (request == \"getCurrentLocation\") {\n\t\tlatlon = document.getElementsByClassName('olControlMousePosition')...
javascript
chosen
[ { "from": "system", "value": "Test for getting container service ip.\n" }, { "from": "human", "value": "\"use strict\";\n\nconst Environment = require('../environment/environment');\nconst Loader = require(\"../terminal-utils/async_loader\");\n\nmodule.exports = {\n description : \"Create new e...
javascript
chosen
[ { "from": "system", "value": "Tweak landing page to forward to user's home properly\n" }, { "from": "human", "value": "FlowRouter.route('/', {\n name: 'landing',\n action: function() {\n if (Meteor.user()) {\n FlowRouter.go('user-home', Meteor.userId());\n }\n }\n})\n\nFlowRouter.r...
javascript
chosen
[ { "from": "system", "value": "Make allowSearch default to true\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n var buttons = {\n root: 'Home',\n edit: 'Edit',\n select: 'Select',\n deselect: 'Deselect',\n goToSubitems: 'Go to subitems',\n addSubitems: 'Ad...
javascript
chosen
[ { "from": "system", "value": "Upgrade for improved sequencing mechanism\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n requestProvider: {\n parent: 'danf:dependencyInjection.contextProvider',\n properties: {\n interface: 'danf:http.request'\n...
javascript
chosen
[ { "from": "system", "value": "Add a preferences menu item which open the new browser window\n" }, { "from": "human", "value": "export var editMenuTemplate = {\n label: 'Edit',\n submenu: [\n { label: \"Undo\", accelerator: \"CmdOrCtrl+Z\", selector: \"undo:\" },\n { label: \"...
javascript
chosen
[ { "from": "system", "value": "Set one line tab titles to default false\n" }, { "from": "human", "value": "import PhotonColors from 'static/lib/photon.css';\n\nconst {\n blue60: tabColor,\n yellow50: otherWindowTabColor,\n red60: recentlyClosedTabColor,\n ink70: bookmarkColor,\n purple70: hi...
javascript
chosen
[ { "from": "system", "value": "Extend domino capabilities by findBy and render\n" }, { "from": "human", "value": "support.dom = {};\n\nsupport.dom.Base = pageflow.Object.extend({\n initialize: function($el) {\n this.$el = $el;\n }\n});\n\nsupport.dom.Base.classMethods = function(Constructor)...
javascript
chosen
[ { "from": "system", "value": "Use execute script to reload page rather than chrome.tabs.reload() as chrome.runtime.reload() causes the previous operation to abort.\n" }, { "from": "human", "value": "const filesInDirectory = dir => new Promise (resolve =>\n\n dir.createReader ().readEntries (e...
javascript
chosen
[ { "from": "system", "value": "Fix format in linechat code\n" }, { "from": "human", "value": "import React, {Component} from 'react';\nimport {connect} from 'react-redux';\nimport {Avatar, Chip} from 'material-ui';\n\nconst mapStateToProps = (state, ownProps) => ({\n line: ownProps.line,\n user...
javascript
chosen
[ { "from": "system", "value": "Fix creation test for Playbook 2.0\n" }, { "from": "human", "value": "/*global describe, beforeEach, it*/\n'use strict';\n\nvar path = require('path');\nvar helpers = require('yeoman-generator').test;\n\n\ndescribe('playbook', function () {\n beforeEach(function...
javascript
chosen
[ { "from": "system", "value": "Use window to access requirejs" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst { getOwner, get } = Ember;\n\n/**\n * Unsee a requirejs module if it exists\n * @param {String} module The requirejs module name\n */\nfunction requireUnsee(module) {...
javascript
chosen
[ { "from": "system", "value": "Update the doc for using NPM Token." }, { "from": "human", "value": "import {stripIndent} from 'common-tags';\n\nexport default {\n id: \"private-npm-packages\",\n title: \"Private NPM Packages\",\n content: stripIndent`\n If you are using private NPM repos or...
javascript
chosen
[ { "from": "system", "value": "fix: Add Visit Web Page button in form\n" }, { "from": "human", "value": "// Copyright (c) 2019, Frappe Technologies and contributors\n// For license information, please see license.txt\n\nfrappe.ui.form.on('Website Route Meta', {\n\trefresh: function(frm) {\n\t\tfr...
javascript
chosen
[ { "from": "system", "value": "Add hook to fire up when all images are loaded\n" }, { "from": "human", "value": "export default class World {\n constructor() {\n // Object that will hold loaded images\n this.images = {};\n\n // Provides image loading functionalities\n this.image = {p...
javascript
chosen
[ { "from": "system", "value": "Fix console output bug in history\n" }, { "from": "human", "value": "(function()\n{\n angular\n .module('history')\n .controller('HistoryController', HistoryController);\n\n HistoryController.$inject = ['$scope', '$state', 'localStorage', 'HistoryService', '...
javascript
chosen
[ { "from": "system", "value": "Watch main file for RequireJS configuration changes.\n" }, { "from": "human", "value": "module.exports = {\n sass: {\n files: [\"scss/**/*.{scss,sass}\"],\n tasks: [\"lint:css\", \"sass:compile\", \"test:css\"]\n },\n js: {\n files: [\"js/**/*.js\", \"te...
javascript
chosen
[ { "from": "system", "value": "Remove calls to absent superclass methods\n\nThe false god, Best Practice, strikes again.\n" }, { "from": "human", "value": "import BreadcrumbSegment from '../../../components/BreadcrumbSegment';\nimport MesosStateStore from '../../../stores/MesosStateStore';\n\ncla...
javascript
chosen
[ { "from": "system", "value": "Use function errorHandler for htmlPreproc\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar browserSync = require('browser-sync');\n\nvar $ = require('gulp-load-plugins')();\n\nmodule.exports = function(options) {\n gulp.task('mar...
javascript
chosen
[ { "from": "system", "value": "Add leftNavButton and rightNavButton support in markup for Ti.UI.iPad.Popover. Easy peesy.\n" }, { "from": "human", "value": "var _ = require('../../../lib/alloy/underscore')._;\n\nexports.parse = function(node, state) {\n\t_.extend(state, {\n\t\tproxyPropertyDefini...
javascript
chosen
[ { "from": "system", "value": "Exclude Slideshow from javascript concatenation." }, { "from": "human", "value": "//= require_directory ./AbstractDocument\r\n//= require_directory ./BrowserWidget\r\n//= require_directory ./BusyWidget\r\n//= require_directory ./ComponentStateManager\r\n//= require_...
javascript
chosen
[ { "from": "system", "value": "Handle Create and Updates in Reducer\n" }, { "from": "human", "value": "/**\n * Created by taha on 9/10/17.\n */\nimport * as types from '../actions/actionTypes';\nimport initialState from './initialState';\n\nexport default function courseReducer(state = initialSta...
javascript
chosen
[ { "from": "system", "value": "Verify secret using password and realm.\n" }, { "from": "human", "value": "exports = module.exports = function(directory) {\n\n return function(clientID, secret, cb) {\n directory.query(clientID, function(err, client) {\n if (err) { return cb(err); }\n ...
javascript
chosen
[ { "from": "system", "value": "fix(email): Remove flash until author required bug is fixed\n" }, { "from": "human", "value": "export function ifNoUserRedirectTo(url, message, type = 'errors') {\n return function(req, res, next) {\n const { path } = req;\n if (req.user) {\n return next...
javascript
chosen
[ { "from": "system", "value": "Add escapeExpression to the apply line helper\n" }, { "from": "human", "value": "import Ember from \"ember\";\n\nexport default Ember.Helper.helper(function(value) {\n value = new Ember.Handlebars.SafeString(value[0] || \"\").string;\n value = value.replace(/(\\r\...
javascript
chosen
[ { "from": "system", "value": "Fix module resolution for npm-link'd packages\n" }, { "from": "human", "value": "module.exports = {\n test: /\\.es6\\.js$|\\.js$|\\.jsx$/,\n exclude: /node_modules/,\n loader: 'babel',\n query: {\n presets: [\n 'es2015-native-modules',\n 'stage-2',\...
javascript
chosen
[ { "from": "system", "value": "fixed: Use methods rather than properties\n" }, { "from": "human", "value": "import BaseSyntax from './base.js';\n\n/**\n * The class to define the TemplateElement syntax\n *\n * @class TemplateElement\n */\nexport default\nclass TemplateElement extends BaseSyntax {...
javascript
chosen
[ { "from": "system", "value": "Remove livereload script tag removing\n\nRemoving the script tags does not remove the code from running, so this\nhas no value.\n" }, { "from": "human", "value": "const injectLivereload = () => {\n const script = document.createElement(\"script\")\n script.setAttr...
javascript
chosen
[ { "from": "system", "value": "Replace lorem ipsum in footer\n" }, { "from": "human", "value": "// @flow\n\nimport React from 'react';\nimport cx from 'classnames';\nimport RandomQuote from '../RandomQuote';\n\n// CSS\nimport styles from './Footer.css';\nimport { hiddenOnMobile } from 'app/styles...
javascript
chosen
[ { "from": "system", "value": "Fix UI bug with loader\n" }, { "from": "human", "value": "define(\n [\n 'text!templates/index.html',\n 'backbone',\n 'underscore'\n ],\n function (template, Backbone, _) {\n \"use strict\";\n\n return Backbone.View.extend(...
javascript
chosen
[ { "from": "system", "value": "Fix displaying undefined for episode.\n" }, { "from": "human", "value": "angular.module('proxtop').controller('MainController', ['$scope', 'ipc', '$state', 'notification', '$mdToast', function($scope, ipc, $state, notification, $mdToast) {\n ipc.on('check-login',...
javascript
chosen
[ { "from": "system", "value": "Save the rule set after adding a skill\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n model(params) {\n return this.store.findRecord('rule-set', params.rule_set_id);\n },\n\n actions: {\n createSkill()...
javascript
chosen
[ { "from": "system", "value": "Fix foldable menu only shown on second click glitch.\n" }, { "from": "human", "value": "function toggleMenu()\n{\n var menu = document.getElementById('main_menu');\n if (menu.style.display == \"none\") {\n menu.style.display = \"block\";\n } else {\n...
javascript
chosen
[ { "from": "system", "value": "Make karma pick up only PhantomJS when on Travis CI\n" }, { "from": "human", "value": "module.exports = function(config) {\n config.set({\n frameworks: [ 'hydro' ],\n singleRun: true,\n browsers: [\n 'PhantomJS',\n 'Chrome',\n 'Firefox',\n ...
javascript
chosen
[ { "from": "system", "value": "Add code coverage to karma\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 files: [\n 'public/javascripts/...
javascript
chosen
[ { "from": "system", "value": "Add revertUnchanged command, because it's not uncommon.\n" }, { "from": "human", "value": "/*jshint node:true*/\n\"use strict\";\n\nvar exec = require(\"child_process\").exec;\n\nfunction runCommand(command, args, done) {\n if(typeof args === \"function\") {\n ...
javascript
chosen
[ { "from": "system", "value": "Add static decorator for action namespace.\n\nThe namespace might be more clear setting w/ a decorator as it is more metadata than actual property of the action class.\n" }, { "from": "human", "value": "import App from \"./App\";\n\nexport default class Action {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove old express listen line that causes a server error.\n" }, { "from": "human", "value": "module.exports = function(app) {\n var mongoose = require('mongoose'); // require mongoose (for mongodb integration\n var fs = require('fs'); // necessary to read from fi...
javascript
chosen
[ { "from": "system", "value": "Set up dynamic port number\n" }, { "from": "human", "value": "const express = require('express');\nconst app = express();\nconst portNumber = 3000;\n\nconst bodyParser = require('body-parser');\nconst cookieParser = require('cookie-parser')\nif (process.env.NODE_ENV...
javascript
chosen
[ { "from": "system", "value": "Revert the resetFeatureFlag command as tests were breaking\n" }, { "from": "human", "value": "/* eslint-disable */\nimport '@cypress/code-coverage/support'\n\nrequire('./commands')\n\nbeforeEach(() => {\n cy.resetFeatureFlags()\n})\n\nafter(() => {\n cy.task('gene...
javascript
chosen
[ { "from": "system", "value": "Allow randomized size and position for enemies\n" }, { "from": "human", "value": "/**\n * enemy.js\n *\n * Manages creation and properties for our enemy object\n */\n\n// Alias our enemy object\nvar enemy = game.objs.enemy;\n\n/**\n * Enemy object factory\n *\n * @r...
javascript
chosen
[ { "from": "system", "value": "Disable dnode/weak for failing to install on travis.\n" }, { "from": "human", "value": "var phantom = require('phantom')\n\nimport Element from './element';\n\nclass GhostJS {\n constructor () {\n }\n\n async open (url) {\n \treturn new Promise(resolve => {\n \...
javascript
chosen