Skip to content

Instantly share code, notes, and snippets.

@jakowicz
jakowicz / .mica
Last active May 16, 2024 12:56
Mac Idempotent Configuration Amazingness - MICA
function vscode_install() {
plugin=$1
if [ -x "$(command -v code)" ]; then
code --install-extension $plugin
fi
}
#################
# Install Xcode command line tools
Unshamelessly stolen from : https://stackoverflow.com/a/37720002
Which unshameless stole it from : http://elweb.co/making-iterm-2-work-with-normal-mac-osx-keyboard-shortcuts/
For this and other shortcuts go to preference -> profile -> keys, add the following shortcuts
# Move one word to the left
⌥← : Send Escape Sequence Esc+ b
# Move one word to the right
⌥→ : Send Escape Sequence Esc+ f
@jakowicz
jakowicz / .terraform-glory
Last active December 5, 2018 17:34
When your provider doesn't understand dependencies :(
alias taa="terraform apply -auto-approve"
alias tda=""terraform destroy -auto-approve"
function taaa {
run=${1:-1}
echo '------------------------'
print "APPLY NUMBER: $run"
echo '------------------------'
while true; do echo `lsof -i -n -P | grep 6379 | wc -l` - `date`; sleep 1; echo ""; done
defmodule Redis do
def get_conn do
{_, redis} = Redix.start_link host: Application.get_env(:auth, :redis_host),
port: Application.get_env(:auth, :redis_port)
redis
end
def kill_conn(redis_conn) do
redis_conn |> Redix.stop
end
#!/bin/bash
function changeDir() {
foo=$(getRandomDir '/*/')
while [ 1 == 1 ]; do
if [ "$foo" != "" ]; then
builtin cd $foo 2> /dev/null
foo=$(getRandomDir '*/')
else