Skip to content

Instantly share code, notes, and snippets.

View revgum's full-sized avatar
🍕
🥇

Josh Gum revgum

🍕
🥇
View GitHub Profile
@revgum
revgum / zsh-history-search.md
Created December 10, 2020 16:20
ohmyzsh history substring search

With ohmyzsh installed, and two plugins history and history-substring-search enabled, the following key binding provides the means for search for commands you've previously typed.

You can type a part of the command you're looking to use then press the up-arrow or down-arrow key on the keyboard repeatedly to search through your history for the command you need.

First make sure ~/.zshrc includes;

plugins=(
    history
 history-substring-search
@revgum
revgum / autoload-node.md
Last active November 22, 2021 19:27
Auto install node version on directory change in zsh

Here's a handy function to add to your ~/.zshrc configuration, add it to the bottom of this file. When you change directory to one that has an .nvmrc file, NVM will automatically download and install that version of Node.

Be sure you have NVM installed, and the NVM_DIR is pointing at the proper directory per your installation.

export NVM_DIR="/usr/local/Cellar/nvm/0.37.0"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
# place this after nvm initialization!
autoload -U add-zsh-hook
@revgum
revgum / Dockerfile
Created July 8, 2020 15:04 — forked from kesor/Dockerfile
Compile DENO on Alpine (w/MUSL C)
FROM rust:alpine
RUN apk add --no-cache \
bash \
binutils-gold \
ca-certificates \
clang \
curl \
g++ \
git \
@revgum
revgum / machine.js
Last active March 20, 2020 13:51
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@revgum
revgum / Dockerfile
Last active February 27, 2022 15:41
Lucky Framework Docker Development
FROM revgum/lucky
RUN mkdir /data
WORKDIR /data
ADD . /data
EXPOSE 5000
@revgum
revgum / gist:0c0f6d383eee7499a92e24d8fa714fbd
Created May 22, 2018 15:24
karabiner-elements tilde fix for 64-keyboard
// in ~/.config/karabiner/assets/complex_modifications/shift_esc.json
{
"title": "Shift + Esc to ~",
"rules": [
{
"description": "Shift + Esc to ~",
"manipulators": [
{
"type": "basic",
@revgum
revgum / .zshrc
Last active April 27, 2020 17:19
.zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/joshgum/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@revgum
revgum / git_prune_branches
Created April 22, 2017 14:51 — forked from aarti/git_prune_branches
Delete unused git branches
→ git remote prune origin
→ git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
# Remember to do this from the master branch
# If you run it from a feature branch the master branch gets deleted.
→ git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
Deleted branch master (was 644eb76).
You can recheckout master branch
→ git checkout -b master origin/master
### Keybase proof
I hereby claim:
* I am revgum on github.
* I am revgum (https://keybase.io/revgum) on keybase.
* I have a public key whose fingerprint is B476 DF90 EB42 BBE7 ECDE 9795 01B7 9938 4AFD 634F
To claim this, I am signing this object: