Skip to content

Instantly share code, notes, and snippets.

@toburger
toburger / EnumerableExtensions.cs
Created October 1, 2012 09:09
Enumerable Extension Method to Distinct or Union IEnumerable(s) by a property without the need to create an IEqualityComparer<T> implementation.
static class EnumerableExtensions
{
public static IEnumerable<T> Distinct<T, TProperty>(
this IEnumerable<T> source,
Expression<Func<T, TProperty>> propertyExpression)
{
return source.Distinct(
new PropertyExpressionComparer<T, TProperty>(propertyExpression));
}
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@forki
forki / gist:1400378
Created November 28, 2011 13:21
Poor mans type classes
// Mimic type classes with additional param
type 'a Num = {
zero: 'a
add: 'a -> 'a -> 'a
mult: 'a -> 'a -> 'a
fromInteger: int -> 'a }
let intNum = {
zero = 0