As usual for a mix of sharing and also remembering for the future, here are some useful scripts I run each week to keep my laptop fresh and updated:
# brew
brew update && brew upgrade && brew upgrade — cask && brew cleanup
# gems
# download rbenv each: https://github.com/rbenv/rbenv-each
rbenv each -v gem cleanup && rbenv each -v gem pristine — all && rm -rf tmp/cache
# yarn
# check how much memory yarn cache is using: du -sh $(yarn cache dir)
yarn cache clean
# docker
docker-compose down && docker image prune && docker system prune && docker system prune — volumes && docker-compose pull && docker-compose up name-of-dependencies
docker-compose down && docker-compose pull && docker-compose up name-of-dependencies