Some (hopefully) useful C snippets