Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / visuallyHidden.css
Created June 7, 2020 22:06
Accessibly hide text elements (mainly useful for section headers)
/* https://a11yproject.com/posts/how-to-hide-content/ */
.visually-hidden {
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
white-space: nowrap; /* added line */
@JM-Mendez
JM-Mendez / antialias.css
Created June 7, 2020 22:46
Fix light font on dark text if it looks bold
antialias {
-moz-osx-font-smoothing: grayscale,
-webkit-font-smoothing: antialiased,
}

Using JSDOC-Based TypeScript

Get Started

Choose your editor

  • WebStorm, Rider
    • Partial support, not enough intelli hints
    • Toggle on TypeScript language service
  • VSCode
@JM-Mendez
JM-Mendez / App.js
Created June 30, 2020 13:09 — forked from aislanmaia/App.js
Example for how to enable hot-reload with xstate and use-machine libraries and an example project.
import React, { useContext } from "react";
import Dashboard from "./Dashboard";
import Login from "./Login";
import AppContext from "./AppContext";
export default () => {
const { machine, error } = useContext(AppContext);
console.log("executing App component...");
return (
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@JM-Mendez
JM-Mendez / autopush.zsh
Created July 9, 2020 20:16
Autopush git repo on every commit
# adapted from https://stackoverflow.com/a/28042939
branch_name=$(git symbolic-ref --short HEAD)
retcode=$?
# Only push if branch_name was found (my be empty if in detached head state)
if [ $retcode -eq 0 ] ; then
#Only push if branch_name does not end with the non-push suffix
if [[ $branch_name != 'dev' && $branch_name != 'master' ]] ; then
echo
@JM-Mendez
JM-Mendez / cmder.md
Created November 3, 2020 14:36 — forked from nickautomatic/cmder.md
Setting up Cmder to use bash by default

Set up cmder to use msysgit / bash by default

  • Install cmder_mini (msysgit is already installed, so no need for full version)
  • In Cmder, open settings: Win + Alt + P
  • Under Startup > Tasks, add a task called {bash} with the following settings:
    • Task parameters (set icon):
      • For Cmder icon: /icon "%CMDER_ROOT%\cmder.exe"
      • For Git icon: /icon "C:\Program Files (x86)\Git\etc\git.ico"
    • Commands (open Git's bash shell):
  • "C:\Program Files (x86)\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%