Skip to content

Instantly share code, notes, and snippets.

View acrees's full-sized avatar

Alexander C Rees acrees

  • Whiteley, Hampshire, UK.
View GitHub Profile
@acrees
acrees / mixin.ts
Created February 22, 2013 22:55
Simple TypeScript implementation of mixins.
// Base class for any object using mixins.
class Base {
// Member function to include a mixin in this class.
include(target, mixin, includeProperties?: bool) {
for (var name in mixin) {
if (!target.hasOwnProperty(name)) {
if (typeof mixin[name] === "function" || includeProperties) {
target[name] = mixin[name];
}
}
@acrees
acrees / Script.fsx
Created August 4, 2014 13:10
Naive xUnit.net test runner (console)
#r "bin/Debug/System.Runtime.dll"
#r "bin/Debug/xunit.abstractions.dll"
#r "bin/Debug/xunit.assert.dll"
#r "bin/Debug/xunit.core.dll"
#r "bin/Debug/xunit.execution.dll"
open System
open System.IO
open System.Reflection
open Xunit.Sdk