Skip to content

Instantly share code, notes, and snippets.

View mhanberg's full-sized avatar
🏎️
Vroom

Mitchell Hanberg mhanberg

🏎️
Vroom
View GitHub Profile
function toggleTheme() {
const theme = window.localStorage.getItem("theme");
if (theme === "light") {
setTheme("#262b2f", "white", "🌝", "dark");
} else {
setTheme("white", "#262b2f", "🌚", "light");
}
}
" .vimrc
" Enable persistent undo
set undofile
" Use a temporary directory to store undo files
set undodir=~/.tmp
export ERL_AFLAGS="-kernel shell_history enabled"
> for each desired change, make the change easy (warning: this may be hard), then make the easy change
for each new tool you use, make the tool easy to use (warning: this may be hard), then easily use the tool
Some text that you want to save to a gist,
but don't want to save to your computer.
.flash-container {
@apply flex flex-col flex-1 absolute;
top: 4rem;
right: 5rem;
}
.flash {
@apply max-w-sm rounded-r border-l-3 shadow p-4 mb-4 inline-block relative;
unwrap-last-commit() {
git reset --soft HEAD~1
git reset
}
# pbpaste - paste from your macOS clipboard
# jsonlint - linting tool for JSON. `-p` will format the input
# less - standard unix pager
$ pbpaste | jsonlint -p | less
module Interceptors
class StagingServerEmailInterceptor
def self.delivering_email(email)
email.to = "[email protected]"
email.subject = "(TEST) " + email.subject
end
end
end
# This function will print out the net lines added
# in your current changes or in a given commit
netlines() {
git --no-pager diff --numstat $1 | awk '{sum += ($1 - $2)} END{print sum;}'
}
$ netlines
-200