A collection of useful codes and examples