a set of tricks for building small javascript functionalities