useful .net code used in various projects