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
public class PropertyInterceptor : IInterceptor | |
{ | |
private readonly IDictionary<string, object> _properties = new Dictionary<string, object>(); | |
public void Intercept(IInvocation invocation) | |
{ | |
var key = invocation.Method.Name.Substring(4); | |
if (invocation.Method.Name.StartsWith("set_")) | |
{ |
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
public static string Join<T>(this IEnumerable<T> collection, char separator, Func<T, string> fn) | |
{ | |
return collection | |
.Head() | |
.Aggregate(new StringBuilder(), (b, x) => | |
{ | |
b.Append(fn(x)); | |
b.Append(separator); | |
return b; | |
}) |
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
require 'rubygems' | |
require 'rake/clean' | |
require 'albacore' | |
include FileUtils | |
desc 'Publish nuget package' | |
task :default => ["deploy:publish"] | |
namespace :deploy do |
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
FileList["**/packages_local.config"].each do |file| | |
cp file, "packages.config" | |
sh "nuget install packages.config /OutputDirectory Packages /source #{local_feed}" | |
end |
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
require 'rubygems' | |
require 'net/http' | |
require 'json' | |
require 'uri' | |
require 'date' | |
@host = 'prairiedevcon.com' | |
#@host = 'localhost' | |
@port = '80' | |
#@port = '50758' |
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
return MakeSlots( | |
b => b.From(7).To(8).Event("Registration & Breakfast"), | |
b => b.From(8).To(8.15).Event("Welcome"), | |
b => b.From(8.15).To(9.15).Event("KeyNote"), | |
b => b.From(9.30).To(10.45) | |
.InRoom(LombardyA) | |
.Presenter("Tom Opgenorth").Session("Intro Into the Android Army"), | |
b => b.InRoom(LombardyB) | |
.Session("Limits of TDD: How To Test Code Never Meant To Be") | |
.Presenter("Robert Reppel"), |
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
public class ConcreteMockTest | |
{ | |
[Test] | |
public void Worker_WhenDoWorkIsCalled_SendsEmailToTylerAboutRussianBrides() | |
{ | |
var emailSender = new FakeEmailSender(); | |
var worker = new Worker(emailSender); | |
worker.DoWork(); |
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 a IDictionary | |
public void ExecuteCall(string query, IDictionary<string, object> parameters); | |
ExecuteCall("SELECT * from....", new Dictionary { {"City", "New York" }, { "Code", 3 } }); | |
// using an anonymous | |
public void ExecuteCall(string query, object parameters); | |
// and to call it | |
ExecuteCall("SELECT * from....", new { City = "New York", Code = 3 } ); |
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
// Given the class | |
class PropertyId { | |
public int Id {get;set;} | |
public int StateCode {get;set;} | |
} | |
var id = new PropertyId { Id = 1, StateCode = "NY" }; | |
// call the method | |
SetProperty(id => id.StateCode, "CA"); |
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 System; | |
using System.Linq.Expressions; | |
using System.Web.Mvc; | |
using System.Web.Mvc.Html; | |
using System.Text.RegularExpressions; | |
namespace Website.Extensions | |
{ | |
public static class HtmlExtensions | |
{ |
OlderNewer