Skip to content

Instantly share code, notes, and snippets.

View ciriarte's full-sized avatar
🏴‍☠️

Carlos Iriarte ciriarte

🏴‍☠️
View GitHub Profile
public class ModuleRegistrationConvention : IRegistrationConvention {
#region IRegistrationConvention Members
public void Process(Type type, StructureMap.Configuration.DSL.Registry registry) {
// only interested in non abstract concrete types that have a matching named interface
if (type.IsAbstract || !type.IsClass || type.GetInterface("IModule") == null)
return;
System.Diagnostics.Debug.WriteLine("Found {0} {1}", type.Name, type.Assembly);
registry.AddType(typeof(IModule), type);
}
@ciriarte
ciriarte / FastDelegate.h
Created August 15, 2011 16:58
Fast Delegate by Dong Clugston
// FastDelegate.h
// Efficient delegates in C++ that generate only two lines of asm code!
// Documentation is found at http://www.codeproject.com/cpp/FastDelegate.asp
//
// - Don Clugston, Mar 2004.
// Major contributions were made by Jody Hagins.
// History:
// 24-Apr-04 1.0 * Submitted to CodeProject.
// 28-Apr-04 1.1 * Prevent most unsafe uses of evil static function hack.
// * Improved syntax for horrible_cast (thanks Paul Bludov).
@ciriarte
ciriarte / rvm.sh
Created June 28, 2011 18:40
rvm's installer
case "$(uname)" in
Darwin|FreeBSD)
archive_md5="$(/sbin/md5 -q "${archive}")"
;;
OpenBSD)
archive_md5="$(/bin/md5 -q "${archive}")"
;;
Linux|*)