Skip to content

Instantly share code, notes, and snippets.

@JM-Mendez
JM-Mendez / machine.js
Last active May 26, 2020 14:42
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@JM-Mendez
JM-Mendez / print_background_colors.css
Created May 26, 2020 11:55
#CSS snippet to enable printing background colors and images to pdf in chrome
html body {
-webkit-print-color-adjust: exact;
}
@JM-Mendez
JM-Mendez / responsive-video.css
Created September 2, 2019 01:21 — forked from jaicab/responsive-video.css
Pure CSS solution for embed videos with an aspect ratio of 16:9
.video-container {
position: relative;
padding-bottom: 56.25%; /*16:9*/
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
@JM-Mendez
JM-Mendez / fresh-chrome.sh
Created August 26, 2019 16:24 — forked from stuartsierra/fresh-chrome.sh
Launch new instances of Google Chrome on OS X with isolated cache, cookies, and user config
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@JM-Mendez
JM-Mendez / selection-command.js
Created May 28, 2019 00:31 — forked from erquhart/selection-command.js
Text selection commands for Cypress.io
/**
* Credits
* @Bkucera: https://github.com/cypress-io/cypress/issues/2839#issuecomment-447012818
* @Phrogz: https://stackoverflow.com/a/10730777/1556245
*
* Usage
* ```
* // Types "foo" and then selects "fo"
* cy.get('input')
* .type('foo')
@JM-Mendez
JM-Mendez / reader.js
Created December 13, 2018 01:20 — forked from dypsilon/reader.js
Example usage of the reader monad.
/**
* This short program will encrypt the user password
* and insert a new record into a mock database.
*/
const Reader = require('fantasy-readers');
const R = require('ramda');
const crypto = require('crypto');
// our mock database
const database = [
@JM-Mendez
JM-Mendez / npm-scripts-for-docker.md
Last active June 29, 2018 00:22 — forked from duluca/npm-scripts-for-docker.md
[npm scripts for docker] #Docker

These are generic npm scripts that you can copy & paste into your package.json file as-is and get access to convinience scripts to manage your Docker images all in one place.

Looking for npm scripts for AWS ECS? Go here!

Watch the video: Do More With Less JavaScript

Docker Containers for Static or Angular/React/Vue/etc SPA Websites

@JM-Mendez
JM-Mendez / GIF-Screencast-OSX.md
Last active June 29, 2018 00:22 — forked from dergachev/GIF-Screencast-OSX.md
[GIF-Screencast-OSX] Screencast to animated #GIF #OSX

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@JM-Mendez
JM-Mendez / .zshrc
Created March 16, 2018 22:00 — forked from bmhatfield/.zshrc
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);
@JM-Mendez
JM-Mendez / iterm2-solarized.md
Last active June 29, 2018 00:20 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo #powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k