Skip to content

Instantly share code, notes, and snippets.

Tommy Carlier tommy-carlier

View GitHub Profile
View efficientiterator.cs
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 Sep 28, 2012
Starting a process and capturing its output (C#)
View ProcessStarter.cs
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>
View TextPrettifier.cs
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
You can’t perform that action at this time.