Skip to content

Instantly share code, notes, and snippets.

View tho-graf's full-sized avatar

Thomas Graf tho-graf

View GitHub Profile
@philib
philib / .fzf_git.zsh
Last active March 27, 2023 07:46
add git support to fzf with key bindings. `source` this script in your .zshrc to activate key bindings.
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --multi --ansi --reverse --keep-right --no-sort --height 100% "$@" --border
}
_gf() {
is_in_git_repo || return
@OliverJAsh
OliverJAsh / foo.md
Last active September 4, 2023 15:31
`Option` vs non-`Option`

Option vs non-Option

Option<T> non-Option (T | undefined)
accessing property userOption.map(user => user.age) userNullish?.age
calling a method userOption.map(user => user.fn()) userNullish?.fn()
providing fallback ageOption.getOrElse(0) ageNullish ?? 0
filter ageOption.filter(checkIsOddNumber) `ageNull