Skip to content

Instantly share code, notes, and snippets.

@devknoll
devknoll / test
Created July 19, 2012 00:52
test
test
interface IMyInterface
{
String Name { get; }
}
abstract class MyBaseClass : IMyInterface
{
// We MUST write this stub or it fails to compile for
// not implementing IMyInterface - despite being abstract.
public abstract String Name { get; }
project "Cabal"
language "C++"
kind "ConsoleApp"
files { "**.h", "**.inl", "**.cpp", "**.c" }
links { "Game", "ppapi_gles2", "ppapi" }
includedirs { "" }
targetextension ".pexe"
function __ZN5cabal9rendering19CalculateProjectionERKNS0_6CameraE($agg_result, $camera) {
;
var __label__;
var $1;
var $focalLength;
var $farToNear;
$1=$camera;
var $2=$1; //@line 38 "..\5CCabal/Rendering/Camera.h"
var $3=(($2+76)|0); //@line 38 "..\5CCabal/Rendering/Camera.h"
@devknoll
devknoll / gist:4407479
Last active March 11, 2016 16:02
Convention for binding Caliburn.Micro action guard methods (i.e. CanExecute) to Rx IObservable<bool>.
var basePrepareContext = ActionMessage.PrepareContext;
ActionMessage.PrepareContext = (context) =>
{
ActionMessage.SetMethodBinding(context);
if (context.Target == null || context.Method == null)
return;
var guardName = "Can" + context.Method.Name;
var targetType = context.Target.GetType();
delegate Func<T1, T2> Recursive<T1, T2>(Recursive<T1, T2> r);
public static Func<T1, T2> Y<T1, T2>(Func<Func<T1, T2>, Func<T1, T2>> f)
{
return ((Recursive<T1, T2>)(g => n => f(g(g))(n)))(
g => n => f(g(g))(n));
}
var type = Class.New(new[] { typeof(ReactiveScreen), typeof(IHasState) }, cls => // Inherit from ReactiveScreen and implement IHasState.
{
var state = cls.Field<IObservable<string>>(); // Default to null.
cls.Property<IObservable<string>>(Modifier.Public, "State")
.Get(Modifier.Public, () => state.Get())
.Set(Modifier.Private, (value) => state.Set(value)); // TODO: INotifyPropertyChanged support...
cls.Function(Modifier.Public, "GetRandomNumber", () => 4); // Chosen by a fair dice roll. Guaranteed to be random.
});
## Options to set on the command line
d-i debian-installer/locale string en_US.utf8
d-i console-setup/ask_detect boolean false
d-i console-setup/layout string USA
#d-i netcfg/get_hostname string dummy
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
# Continue without a default route
## Options to set on the command line
d-i debian-installer/locale string en_US.utf8
d-i console-setup/ask_detect boolean false
d-i console-setup/layout string USA
#d-i netcfg/get_hostname string dummy
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
# Continue without a default route
@devknoll
devknoll / resources.md
Last active August 29, 2015 14:21
Relay / GraphQL Resources