View fake-vs-stub.cs
/* using FakeItEasy and Cone */ | |
interface ICandy { } | |
interface ICandyShop | |
{ | |
ICandy GetTopSellingCandy(); | |
void BuyCandy(ICandy candy); | |
} | |
class SweetTooth |
View table-emptying-order.sql
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 ACE-Bio
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 EntitySupport.cs
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 gist:4488313
using NUnit.Framework; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
namespace NUnitBehavesLike | |
{ | |
public interface IThingamabob | |
{ |
View gist:2351063
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(','); |