Skip to content

Instantly share code, notes, and snippets.

View kg's full-sized avatar

Katelyn Gadd kg

View GitHub Profile
@kg
kg / gzip.js
Created June 25, 2013 06:57 — forked from kig/gzip.js
TarGZ = function(){};
// Load and parse archive, calls onload after loading all files.
TarGZ.load = function(url, onload, onstream, onerror) {
var o = new TarGZ();
o.onload = onload;
o.onerror = onerror;
o.onstream = onstream;
o.load(url);
return o;
public class DrawingFeature : Feature {
private Drawing drawing_;
public event EventHandler DrawingChanged;
private NonBlockingMutex inDrawingChanged_;
protected void OnDrawingChanged()
{
using (inDrawingChanged_.AcquireOrThrow()) {
if (DrawingChanged != null) {
DrawingChanged(this, EventArgs.Empty);
@kg
kg / Closures.cs
Created April 28, 2012 09:39 — forked from TryJSIL/Closures.cs
Closures v2
using System;
public static class Program {
public static void Main (string[] args) {
int x = 1;
string y = "y";
Func<string> a = () => {
return String.Format("x={0}, y={1}", x, y);
};
@kg
kg / gist:2517491
Created April 28, 2012 09:38 — forked from TryJSIL/NBody.cs
NBody v2
We couldn’t find that file to show.
@kg
kg / file1.cs
Created April 28, 2012 09:35 — forked from TryJSIL/Enums.cs
Enums v2
using System; // Hello
public static class Program {
public enum SimpleEnum {
A,
B = 3,
C,
D = 10
}
@kg
kg / BinaryTrees.cs
Created April 28, 2012 09:34 — forked from TryJSIL/BinaryTrees.cs
Tree Benchmark v2
/* The Computer Language Benchmarks Game
http://shootout.alioth.debian.org/
contributed by Marek Safar
*/
using System;
public static class Program {
const int minDepth = 4;
@kg
kg / Interfaces.cs
Created April 28, 2012 09:34 — forked from TryJSIL/Interfaces.cs
Interfaces
using System;
public interface I {
void Foo ();
}
public class A : I {
public void Foo () {
Console.WriteLine("A");
}
@kg
kg / Interfaces.cs
Created April 28, 2012 09:33 — forked from TryJSIL/Interfaces.cs
Interfaces
using System;
public interface I {
void Foo ();
}
public class A : I {
public void Foo () {
Console.WriteLine("A");
}
@kg
kg / Reflection.cs
Created April 28, 2012 09:30 — forked from TryJSIL/Reflection.cs
Reflection
using System;
using System.Reflection;
using System.Collections.Generic;
public static class Program {
public static void Main (string[] args) {
Common.Util.ListMembers<MethodInfo>(
typeof(T),
BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public
);