Add local_caller method
Sometimes you want a stack trace of what chain of methods invoked
wherever you are right now. `caller` does this, but it also includes
things like library and irb/pry frames in the stack. Often what I want
is the stack frames from whatever code is in the current code base.
`local_caller` uses the current directory as a proxy for "current code
base". It `select`s the frames that contain `Dir.pwd` which leaves us
with a nice, small stack trace.
This is on `Kernel` so it can be uses anywhere.
This will copy any string to my macOS clipboard:
It works by creating a new output stream that pipes directly into the
`pbcopy` command using `IO.popen`. `popen` stands for "pipe open" and is
similar to the standard C `popen(3)` function. Imagine it's just like
`$stdout` but you can attach a command to it really easily.
It invokes `popen` with a block and simply `puts` the string into it.
Using a block argument automatically closes the IO.
Big shoutout to the Avdi Grimm and his https://graceful.dev/ videos for
teaching me about open pipe (which looks like `open("|command")`
instead), and postmodern for teaching me that `popen` is the better
choice because it shows more intention than `open("|command")`:
Clean up postgres config
Timing and auto output was annoying. I also moved the history from the home folder to ~/.config/psql
Turn off autocomplete in irb
Alphabetize install directories
Fix pkg_config path
It was pointing to a directory that doesn't exist and causing problems with crystal
Disable bindkey "^R" to fix fzf
fzf history search was not working because I was overwriting the ^R keybinding with:
bindkey "^R" history-incremental-search-backward
Commenting that out made it work again.
Pass -a to exa
With my previous `ll` alias, I passed the -a flag to show all files
including hidden. I missed seeing those so I'm adding it back.
Rework paths, again
Puts homebrew paths before the system paths. This ensures that homebrew packages take precedence over system ones.
Add vim/dot-vim/.netrwhist to gitignore
The motivation here was to get `.git/safe/../../bin` before asdf paths so local project commands go before global ones. This also gave me an excuse to organize and clarify my path setup.