Codes from "Essential JavaScript Design Patterns" by Addy Osmani