Skip to content

Instantly share code, notes, and snippets.

var css = {
"margin-top": (($(dv).parent().height - $(dv).height()) / 2) + 'px',
"position":"absolute"
};
$(dv).css(css);
$(dv).parent().css('position', 'relative');
@tkellogg
tkellogg / BDD.cs
Created December 28, 2011 17:44
BDD in C#
[TestFixture]
class when_adding_numbers
{
Maths maths;
void Given_an_object_in_bigint_mode()
{
maths = new Maths();
maths.BigInt = true;
}
@tkellogg
tkellogg / gist:1221166
Created September 16, 2011 03:58
Another AutoMapper example using polymorphism
public class Account
{
public virtual int AccountId { get; set; }
[Matches(@"[A-Z]{2}\d{5}")]
public virtual string Code { get; set; }
[Required]
public virtual string Name { get; set; }
public virtual int? Age { get; set; }
}
@tkellogg
tkellogg / ModelsAndViewModels.cs
Created September 16, 2011 03:05
AutoMapper example for my blog (http://timkellogg.blogspot.com)
public class Account
{
public virtual int AccountId { get; set; }
[Matches(@"[A-Z]{2}\d{5}")]
public virtual string Code { get; set; }
[Required]
public virtual string Name { get; set; }
public virtual int? Age { get; set; }
}
@tkellogg
tkellogg / SiteVisitWorkflow.cs
Created March 8, 2011 16:44
Abstract workflow factory & example usage (SiteVisitWorkflow) for ObjectFlow
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using kpa.mko.dal;
using kpa.common.workflow;
using Rainbow.ObjectFlow.Stateful;
using kpa.common.container;
using kpa.common.interfaces;