Automatically setup environmental vars when `cd`ing into a specific directory
With many webapps depending on environmental vars for things like authentication and environment-specific config, it can be a pain to get those vars setup on a local dev machine. A common pattern is to provide a default when the variable is missing.
I like to avoid putting passwords in source code, so I went searching for a way to auto-setup the vars upon entering a directory in terminal. After a hint at chpwd from #zsh I landed on wayneeseguin's gist serving that very purpose. I forked it to add a tiny improvement based on another suggestion from the #zsh folks, and ended up with this simple solution in my ~/.zshrc.
Now I can toss a .set_env in any directory, add it to .gitignore and have a quick, clean way of setting up my ENV.

