Skip to content

Instantly share code, notes, and snippets.

public class EfficientIterator<TOne, TTwo>
{
private Action<TOne, TTwo> always = (one, two) => { };
private Action<TOne, TTwo> match = (one, two) => { };
private Action<TOne> oneOnly = (one) => { };
private Action<TTwo> twoOnly = (two) => { };
private readonly Func<TOne, TTwo, int> compare;
public Action<TOne, TTwo> Always { set { this.always = value; } }
@tommy-carlier
tommy-carlier / ProcessStarter.cs
Created September 28, 2012 09:14
Starting a process and capturing its output (C#)
using System;
using System.Diagnostics;
using System.Globalization;
namespace TC
{
/// <summary>Starts a process and allows capturing the output (both standard and error).</summary>
public static class ProcessStarter
{
/// <summary>Starts a new process with the specified file name and arguments.</summary>
@tommy-carlier
tommy-carlier / TextPrettifier.cs
Created March 26, 2012 08:28
Text prettifier (C#)
using System;
using System.Text;
using System.Text.RegularExpressions;
namespace TC
{
/// <summary>Makes text pretty, replacing certain patterns with their typographically correct equivalent.</summary>
public static class TextPrettifier
{
private static readonly Regex