Useful WordPress snippets I've collected from various sources and used on several sites.
There are probably plugins that do all the same things.
Add as a submodule or just download and add to your theme. E.g. if you
cloned/copied into lib/snippets/
in your theme, add this to your
functions.php
:
require_once get_template_directory() . '/lib/snippets/update-nag.php';