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
var builder = new ContainerBuilder(); | |
builder.AddModule(new ModuleA()); | |
builder.AddModule(new ModuleB()); | |
builder.AddModule(new DebugFakesModule()); | |
var container = builder.Build(); | |
// Will be FakeEmailService if compiled with DEBUG |
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
var ignoredColumns = new[] { | |
"CreatedBy", | |
"CreatedDate", | |
"ModifiedBy", | |
"ModifiedDate", | |
"LogicallyDeletedBy", | |
"LogicallyDeletedDate", | |
"LastModified" | |
}; |
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
Tuesday | |
--------------- | |
3:00 PM -> 3:30 PM | |
Arena 1A Stuff Developers will Want to See | |
Arena 2 Windows Server 2012 - Prepare to be Amazed |
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
interface IHaveAttachments { } | |
interface IAttachment<T> where T : IHaveAttachments { | |
void AttachTo(T obj); | |
} | |
class AttachmentsModule : Autofac.Module | |
{ | |
private static readonly MethodInfo _attach = typeof(AttachmentsModule).GetMethod("Attach", BindingFlags.Static | BindingFlags.NonPublic); |
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
void Main() | |
{ | |
var start = new DateTime(2012, 10, 1); | |
var end = new DateTime(2012, 10, 31); | |
var days = from d in start.UpTo(end) | |
where d.DayOfWeek == DayOfWeek.Wednesday | |
select d; | |
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
void Main() | |
{ | |
var items = new List<string>{ "A", "B", "C", "D", "E", "F", "G", "H", "I" }; | |
items.Chunk(2).Dump(); | |
} | |
public static class Ext | |
{ | |
public static IEnumerable<IEnumerable<T>> Chunk<T>(this IEnumerable<T> source, int chunkSize) |
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
void Main() | |
{ | |
DoTheThing(1); | |
DoTheThing(2); | |
DoTheThing("Banana"); | |
} | |
public static void DoTheThing(object o) | |
{ | |
DoTheThingInternal((dynamic)o); |
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
void Main() | |
{ | |
var refDate = DateTime.Today.AddMonths(-1); | |
var start = refDate.StartOfMonth().Backwards().FirstOrDefault (d => d.DayOfWeek == DayOfWeek.Monday); | |
var end = refDate.EndOfMonth().Forwards().FirstOrDefault (d => d.DayOfWeek == DayOfWeek.Sunday); | |
start.UpTo(end).ToArray().Dump(); | |
} |
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
<Query Kind="Program"> | |
<Reference><RuntimeDirectory>\System.Web.DataVisualization.dll</Reference> | |
<Reference><RuntimeDirectory>\System.Web.dll</Reference> | |
<Namespace>System.Web.UI.DataVisualization.Charting</Namespace> | |
<Namespace>System.Drawing</Namespace> | |
</Query> | |
void Main() | |
{ | |
var r = new Random(); |
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
void Main() | |
{ | |
var entries = GetEntries().Cache("from-youtube"); | |
(from e in entries | |
let category = Categorize(e.Title) | |
group e by category into g | |
orderby g.Key descending | |
select new | |
{ |