Various ruby classes and code snippets