Skip to content

Instantly share code, notes, and snippets.

@Quantumplation
Quantumplation / demo.cs
Last active November 15, 2015 03:13 — forked from martindevans/demo.cs
public void Main()
{
Gate a = new Gate(0);
Gate b = new Gate(100);
var ctx = new TravelContext(a, b);
// Github interpreter, provide a more baked in one for release versions of the game
var ruleProvider = new GithubInterpreter("project", "hash", "credentials");
var time = ctx.Get(ruleProvider).TravelTime;
}
struct Key
: KeyTrait<ValueType>
// ^ ^ Type of the value this key supplies
// | Implement a trait indicating this is a key
{
}
//usage
Key k = whatever(); //Get a key object
!Building
Aliases:
- &residential_floor_count !NormalValue
Min: 5
Max: 10
Floors:
- !Repeat
Count: !NormalValue
Min: 1
geometry.Union(geometry
.CreatePrism(material, points.Quickhull2D().ToArray(), height)
.Translate(new Vector3(0, this.GroundOffset(height), 0))
.Transform(InverseWorldTransformation),
false
);
geometry.Union(geometry
.CreatePrism(material, points.Quickhull2D().ToArray(), height)
.Translate(new Vector3(0, this.GroundOffset(height), 0))
public interface IManager {}
public interface IManager<T> : IManager { public void AddComponent(T comp); }
public GraphicsManager : IManager<Sprite>, IManager<Camera>
{
...
}
public void World
{

Keybase proof

I hereby claim:

  • I am quantumplation on github.
  • I am quantumplation (https://keybase.io/quantumplation) on keybase.
  • I have a public key whose fingerprint is 943E 532F 13F6 06CE 6836 72CD BAA9 EB7E 5843 BBC7

To claim this, I am signing this object:

/* Martin had this suggestion for an improvement */
public class UnitOfWork : IUnitOfWork
{
private UnitOfWork() {}
public static Do(Action<IUnitOfWork> action)
{
action(new UnitOfWork());
}
(ns Anaximander.core
(:use [compojure.core]
[clojure.java.io]
ring.middleware.cors)
(:require [compojure.handler :as handler]
[compojure.route :as route]
[clojure.data.json :as json]
[clojure.contrib.java-utils :as io]
[clojure.java.io :as jio]))
struct Point
{
public Point(int x, int y)
{
this = new Point();
X = x; Y = y;
}
int X; int Y;
}
@Quantumplation
Quantumplation / Sample.cs
Created December 12, 2012 19:12
Gist as a blogging platform.
// I can also attach sample code files
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MassiveGalaxyBattles
{