This file contains hidden or 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 setup(method) | |
{ | |
window[method] = fake; | |
}; | |
var fake = function() | |
{ | |
return "faked"; | |
}; |
This file contains hidden or 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
jQuery.fn.aspHide = function() { | |
$(this).each(function() { | |
var elem = $(this); | |
elem.data('height', elem.height()); | |
elem.height('0'); | |
elem.css('visibility', 'hidden'); | |
}); | |
}; | |
jQuery.fn.aspShow = function() { |
This file contains hidden or 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
// I'm implementing a reusable library for the Scheduler-Agent-Supervisor pattern blogged about by Clemens Vaster's here: | |
// http://vasters.com/clemensv/2010/09/28/Cloud+Architecture+The+SchedulerAgentSupervisor+Pattern.aspx | |
// I'm starting my work on the communication between the Scheduler and the Agent's. This will be (for now) done via | |
// WCF and leverage MSMQ for elasticity. The Scheduler has a request queue and a response queue. This is the first | |
// draft of the Scheduler class which implements both queue WCF endpoints as well as some helper functions for client creation. | |
// Because of Task<T> this helps facilitate the DataContractResolver away from the user of the library. | |
using System; | |
using System.Messaging; |
This file contains hidden or 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 Xunit; | |
using VirtualRoundtableData; | |
using System; | |
using Models; | |
namespace UnitTests | |
{ | |
public class when_using_the_user_repository: TestBase | |
{ |
This file contains hidden or 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 find(root, obj) { | |
var seen = []; | |
function search(root, name, depth) { | |
if (root === obj) { | |
console.log(name); | |
return; | |
} | |
if (!depth) { return; } | |
if (seen.indexOf(root) >= 0) { return; } | |
if (typeof root !== "object") { return; } |
This file contains hidden or 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
public class PageKeywordMappings : ClassMap<ScrewturnPageKeyword> | |
{ | |
public PageKeywordMappings() | |
{ | |
Table("PageKeyword"); | |
CompositeId() | |
.KeyProperty(m => m.Page) | |
.KeyReference(m => m.Keyword) | |
.KeyReference(m => m.Namespace); | |
Map(m => m.Namespace); |
This file contains hidden or 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
public class ScrewturnPageKeyword | |
{ | |
private int? _hashCode; | |
public virtual string Page { get; set; } | |
public virtual string Namespace { get; set; } | |
public virtual int Revision { get; set; } | |
public virtual string Keyword { get; set; } | |
public override bool Equals(object obj) |
This file contains hidden or 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
public static T TryParse<T>(this string stringToParse) { | |
if (typeof(T).HasMethod("TryParse")) { | |
var m = typeof(T).GetMethod("TryParse", new Type[] { typeof(string), typeof(T).MakeByRefType() }); | |
T outParam = Activator.CreateInstance<T>(); | |
object[] ps = new object[] { stringToParse, outParam }; | |
bool result = (bool)m.Invoke(null, ps); | |
if (result) | |
return (T)ps[1]; | |
} | |
return default(T); |
This file contains hidden or 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 System; | |
using System.Collections.Generic; | |
namespace MostlyScottish { | |
//This is what I think we should move towards | |
public interface IRepository<T> { | |
void Save(T entity); | |
} |
This file contains hidden or 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
public interface IJudgeDread | |
{ | |
void IAmTheLaw(); | |
} | |
public interface IRoboCop : IJudgeDread | |
{ | |
void ServeThePublicTrust(); | |