Skip to content

Instantly share code, notes, and snippets.

View OutWithYieldReturn.cs
// LINQPad script showing a "use" for out parameters on iterators.
// It's a mockup of a discrete event simulator process (similar to SimPy - http://simpy.readthedocs.io).
// Since it's not possible to use 'out' with iterators, this uses an Action<T> instead.
// I'm not suggesting it's valid or in good taste :)
void Main()
{
foreach (var ie in Simulate().Take(100)) ie.Dump();
}
View Update-Package-Versions.cs
void Main()
{
var writeChanges = false;
var basePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Util.CurrentQueryPath), @"..\.."));
UpdateVersions(basePath, writeChanges);
}
void UpdateVersions(string basePath, bool writeChanges = false)
{
@BobStrogg
BobStrogg / ImmutableArray.h
Created Jan 18, 2014
ImmutableArray in Objective-C; Uses AviNode, found here: https://gist.github.com/BobStrogg/8449933
View ImmutableArray.h
//
// ImmutableArray.h
// AVLTree
//
// Created by Chris Cavanagh on 1/17/14.
//
#import <Foundation/Foundation.h>
@interface ImmutableArray : NSObject
@BobStrogg
BobStrogg / AvlNode.h
Last active Jan 3, 2016
Immutable AVL Tree in Objective-C
View AvlNode.h
//
// AvlNode.h
// AVL tree / Node
//
// Created by Chris Cavanagh on 1/14/14.
//
#import <Foundation/Foundation.h>
typedef int (^EqualityComparer)( id v1, id v2 );
View CJCAnonymousFacesFilter.h
//
// CJCAnonymousFacesFilter.h
// CJC.FaceMaskingDemo
//
// Created by Chris Cavanagh on 11/9/13.
// Copyright (c) 2013 Chris Cavanagh. All rights reserved.
//
#import <CoreImage/CoreImage.h>