Skip to content

Instantly share code, notes, and snippets.

View brookinc's full-sized avatar

Brook McEachern brookinc

View GitHub Profile
@noseratio
noseratio / purge-node-modules.cmd
Last active May 27, 2024 12:36
Delete node_modules recursively on Windows
@echo off
set folders=node_modules
echo This will delete all [%folders%] folders recursively and cannot be undone.
choice /t 10 /d n /c yn /m "Press Y to continue, N to stop"
if %errorLevel% neq 1 goto :EOF
for /d /r . %%D in (%folders%) do if exist "%%~fD\" (echo %%D && rd "%%~fD" /s /q)
@brookinc
brookinc / .gitconfig
Last active February 22, 2023 16:16
Git config settings that I like to reuse.
[alias]
add-branch = "!f(){ git fetch origin $1 && git branch $1 FETCH_HEAD && git checkout $1; }; f"
alias = "!f(){ git config --global alias.$1 \"$2\"; }; f"
aliases = config --get-regexp ^alias\\.
aliasverbose = "!sh -c '[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1' -"
br = branch --contains
cherry-pick-external = "!f(){ git --git-dir=$1/.git format-patch -k -1 --stdout $2 | git am -3 -k; }; f"
cleanup = gc
cleanup-slow = gc --aggressive
curr-branch = symbolic-ref --short HEAD
@staltz
staltz / introrx.md
Last active July 4, 2024 10:11
The introduction to Reactive Programming you've been missing