Fixing Homebrew permissions
Here's a quick fix for permissions errors when using Homebrew (High Sierra+):
sudo chown -R $(whoami) $(brew --prefix)/*
This is essentially a dumping ground for little snippets — usually of code or command-line tricks — that I've found useful.
Here's a quick fix for permissions errors when using Homebrew (High Sierra+):
sudo chown -R $(whoami) $(brew --prefix)/*
If you find yourself getting out-of-memory errors when running composer install
or composer update
, here's a quick and simple way to run it to avoid that:
php -d memory_limit=-1 /usr/local/bin/composer
Here's a quick and elegant way of generating a random string in JavaScript:
[...Array(10)].map(i=>(~~(Math.random()*36)).toString(36)).join('')