This sample explores the idea that middlewares can be injected into an http.Handler
instead of wrapping it.
The current model is:
type mwf func(http.Handler) http.Handler
func oldRecoverer(h http.Handler) http.Handler {
semver -> ver ("-" pre)? ("+" build)?; | |
ver -> num "." num "." num; | |
pre -> (alnum | num):"."; | |
build -> (alnum | \d+):"."; | |
num -> "0"|[1-9]\d*; | |
alnum -> [-A-Za-z0-9]* [-A-Za-z] [-A-Za-z0-9]*; |
Add this snippet to your .*shrc
.
gx() {(
set -e
# If working tree dirty bar staged content...
if git status --porcelain | grep -v '^. ' >/dev/null; then
echo "⮑ Temporarily stashing unstaged and untracked content."
git stash push --keep-index --include-untracked
unstash() {
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"github.com/anzx/envelope-compose-go/internal/rpc/wasm/client/gowasmer" | |
) |
-- https://gist.github.com/marcelocantos/91d14aa9f51c76cd7903439afb74f22a | |
logger = require("hs.logger").new("init", "debug") | |
-- bind binds keys more conveniently. Input should be some variant of "⌥⌘⇧-k". | |
function bind(bindings) | |
for input, char in pairs(bindings) do | |
local modifiers = {} | |
for code, key in pairs({["⌥"]="alt", ["⌘"]="cmd", ["⇧"]="shift"}) do | |
if input:find(code) then | |
table.insert(modifiers, key) |