Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am robgough on github.
  • I am robgough (https://keybase.io/robgough) on keybase.
  • I have a public key ASAjiy_j8wmQjeIbFClJ5u4rIVLWUGRRz5TWZBZGnwimyQo

To claim this, I am signing this object:

@robgough
robgough / happy
Created July 9, 2014 14:42
The Happy Coder Song
If you're happy and you know it
push your code
#pushpush
if you're happy and you know it
push your code
#pushpush
if you're happy and you know it
and you really want to show it
commit to git
and push your bloody code
@robgough
robgough / csharptimes
Last active December 16, 2015 15:49
Borrows the "3.times" style syntax from Ruby and puts it in C# with an extension method
public class MyClass
{
public void MyMethod(int repeat)
{
repeat.Times(i => {
Console.WriteLine(String.Format("Repeat {0}", i));
}, 1);
}
}
public int AddOnePassByValue(int input)
{
return input + 1;
}
public int AddOnePassByRef(ref int input)
{
input + 1;
return -1;
}