Skip to content

Instantly share code, notes, and snippets.

@JM-Mendez
JM-Mendez / kill_ports.shell
Last active April 5, 2021 18:18
Kill ports on #windows
netstat -ano | findstr :<yourPortNumber>
taskkill /F /PID <typeyourPIDhere>
@JM-Mendez
JM-Mendez / frankenraw.zsh-theme
Last active December 2, 2020 04:54 — forked from cravacuore/raw.zsh-theme
Zsh 'raw' theme [ZSH theme] #zsh #theme
# Copied and modified from https://dev.to/cravacuore/comment/i7g0
# Inspired by making a mixture the following themes:
# robbyrussell + arrow + lambda
# changing some colors and elements positions
local ret_status="%(?:%{$fg_bold[grey]%}λ :%{$fg_bold[red]%} λ )"
# ellipsis https://github.com/ohmyzsh/ohmyzsh/issues/7525#issuecomment-456074298
PROMPT=' ${ret_status}%{$fg[magenta]%}%c %{$fg[black]%}git:(%{$fg[cyan]%}%30>...>$(git_current_branch)%>>%{$fg[black]%}$(parse_git_dirty)%{$reset_color%} ➤ %{$reset_color%}'
@JM-Mendez
JM-Mendez / mklink.psm1
Created November 19, 2020 01:07 — forked from jpoehls/mklink.psm1
Native PowerShell wrapper for MKLINK.
@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%
@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
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@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 (

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 / 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,
}
@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 */