Just snippets of code I've found useful for SugarCRM