A very good mixin originally authored by Mark Mintel.