Skip to content

Instantly share code, notes, and snippets.

Mike Fielden MikeFielden

Block or report user

Report or block MikeFielden

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MikeFielden
MikeFielden / entity_colors.md
Last active Oct 2, 2018
Entity colors and icons
View entity_colors.md

EntityTypes colors

Material color palette — COSMIC

Cosmic Web Colors

EntityType primary accent icon
Artifacts #81c784 #81c784 #388E3C #388E3C fal fa-file-alt
Activities #4dd0e1 #4dd0e1 #0097a7 #0097a7 fal fa-stopwatch
Vehicles #FFD54F #FFD54F #FFA000 #FFA000 fal fa-rocket
@MikeFielden
MikeFielden / cy_example.js
Last active Nov 15, 2017
Cypress.io example spec
View cy_example.js
//
// **** Kitchen Sink Tests ****
//
// This app was developed to demonstrate
// how to write tests in Cypress utilizing
// all of the available commands
//
// Feel free to modify this spec in your
// own application as a jumping off point
View ParallelMiddlewares
function parallel(middlewares) {
return function (req, res, next) {
async.each(middlewares, function (mw, cb) {
mw(req, res, cb);
}, next);
};
}
app.use(parallel([
getUser,
@MikeFielden
MikeFielden / merge.js
Created Jul 8, 2015
Array merge native
View merge.js
var array1 = [1, 2, 3];
var array2 = [4, 5, 6];
Array.prototype.push.apply(array1, array2);
console.log(array1); // is: [1, 2, 3, 4, 5, 6]
View debounce.js
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
@MikeFielden
MikeFielden / index.js
Last active Oct 9, 2015
Enum-like structure in es2015
View index.js
const shapeType = {
triangle: new Symbol()
};
// Demo func
function getArea(shape, options) {
var area = 0;
switch (shape) {
case shapeType.triangle:
View remove_all_docker_images.sh
docker rmi $(docker images -q)
@MikeFielden
MikeFielden / stop_and_remove_all_containers.sh
Last active Aug 29, 2015
Stop and Remove all Docker containers
View stop_and_remove_all_containers.sh
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
#Single line
docker rm -f $(docker ps -a -q)
View designer.html
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
View designer.html
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
You can’t perform that action at this time.