Skip to content

Instantly share code, notes, and snippets.

View caseywatson's full-sized avatar
🌳
Using my OC(d) to turn big mental trees into perfect toothpicks.

Casey Watson ☁️ caseywatson

🌳
Using my OC(d) to turn big mental trees into perfect toothpicks.
View GitHub Profile
@caseywatson
caseywatson / DistinctExtensions.cs
Created April 10, 2013 21:00
LINQ operators that require an IEqualityComparer<T> suck. Do this instead.
using System;
using System.Collections.Generic;
namespace SpaceX.CDL.Core
{
public class FunctionalEqualityComparer<T> : IEqualityComparer<T>
{
private readonly Func<T, T, bool> comparisonFunction;
public FunctionalEqualityComparer(Func<T, T, bool> comparisonFunction)
@caseywatson
caseywatson / MerryChristmasFriends.cs
Created December 25, 2012 15:23
Merry Christmas Friends!
public void string SingChristmasCarol()
{
var carolBuilder = new StringBuilder();
carolBuilder.AppendLine("Tis the season to be jolly!");
carolBuilder.AppendLine(SingChorus());
carolBuilder.AppendLine("Deck the halls with boughs of holly!");
carolBuilder.AppendLine(SingChorus());
carolBuilder.AppendLine("Don we now our gay apparel!");
carolBuilder.AppendLine(SingChorus());