View gist:2351063
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addRequire(target) { | |
while(target.next){ target = target.next; } | |
function requireArguments() { | |
var args = requireArguments.args; | |
for(var i = 0; i != args.length; ++i) { | |
require(arguments[i], args[i]); | |
} | |
return requireArguments.next.apply(this, arguments); | |
} | |
requireArguments.args = /\((.*?)\)/.exec(target.toString())[1].replace(' ','').split(','); |
View gist:4488313
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NUnit.Framework; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
namespace NUnitBehavesLike | |
{ | |
public interface IThingamabob | |
{ |
View EntitySupport.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class EntitySupport | |
{ | |
class IdentityGetter<TEntity> | |
{ | |
public readonly static Func<TEntity,int> Instance = GetIdentityGetter<TEntity>(); | |
} | |
public static Func<TEntity,int> GetIdentityGetter<TEntity>() | |
{ | |
var id = typeof(TEntity).GetMembers() |
View ACE-Bio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Torbjörn is a organizational debugger, developer, architect, hugger and | |
collector of ideas.He has a deep belief in the untapped potential of folks | |
and the power of mutually meeting needs to improve the way work works. | |
Manager by day @drunkcod by night. |
View table-emptying-order.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with tab(object_id, level, ref_id) as ( | |
select t.object_id, 0, null | |
from sys.tables t | |
where t.type = 'U' | |
union all | |
select fk.parent_object_id, level + 1, t.object_id | |
from tab t | |
inner join sys.foreign_keys fk on fk.referenced_object_id = t.object_id | |
) | |
select |
View fake-vs-stub.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* using FakeItEasy and Cone */ | |
interface ICandy { } | |
interface ICandyShop | |
{ | |
ICandy GetTopSellingCandy(); | |
void BuyCandy(ICandy candy); | |
} | |
class SweetTooth |