Skip to content

Instantly share code, notes, and snippets.

View jdonaldson's full-sized avatar

Justin Donaldson jdonaldson

  • Mercer Island, Washington
  • 05:44 (UTC -07:00)
View GitHub Profile
Write a dark comedy TV episode about an HR agency that brings dead heros back to life in order to go on one-off quests with other living members of the party
Episode Title: “The HR Agency From Beyond”
Opening Scene:
The camera pans through a grey, oppressive office building. A few people mingle in the hallways, but they seem to be dressed in the same drab, dark attire. There’s an air of unease in the building. We come to a black door with the words “HR agency” painted on the outside. Inside, we see a group of people gathered around a table. The camera zooms in on a woman with bright red hair.
Red Hair: Welcome to the HR agency. Our mission is to provide unique opportunities for the living and the dead. We bring back heroes from the past to help you in the present.
The camera pans around the room. We see a very strange mix of people - some living, some dead. They are all dressed in armor, holding swords and shields.
jdonaldson / Main.hx
Last active April 26, 2020 22:36
Hello World Hashlink
class Main {
static function main() {
trace("Hello World");
class Main {
static function main() {
#if disable_unicode_strings
trace("disable unicode flag");
#if target.unicode
trace("unicode enabled");
jdonaldson / Main.hx
Created December 27, 2019 20:02
Paths example
class Main {
static function main(){
var router = Paths.buildRouter(Page);
var o = router(["Home"]);
trace(o + " is the value for o");
var p = router(["Foo","Baz", "1"]);
trace(p + " is the value for p");
import haxe.macro.Expr;
import haxe.macro.Context;
class Paths {
public static macro function toPath(value) {
var en = switch Context.follow(Context.typeof(value)) {
case TEnum(_.get() => en, _): en;
case _: throw new Error("not an enum", value.pos);
import lua.jit.FFIBuilder;
import lua.Ffi;
class Main {
static function main() {
var k= 'hi';
trace(k.length + " is the value for k.length");
SomeFfi.printf("foo %s", "hi");
jdonaldson / field_completions_string.json
Last active June 26, 2018 23:23
Completions in haxe
"data": {
"index": 0,
"origin": 0
"detail": "public function charAt(index:Int):String",
"documentation": null,
"kind": 2,
"label": "charAt",
jdonaldson / Config.hx
Last active May 24, 2019 17:34
Utility Classes for Haxe
using haxe.macro.Context;
import haxe.macro.Expr;
Simple config merge routine. Supply a series of anonymous objects, and this macro will merge them into a single instance.
This is useful for providing a series of overrides for config, so I've gone with that name.
The benefit is that the macro preserves all of the typing info, so you still get completions, etc. on the merged object.
class Config {
public static macro function merge<T>(arr : Array<ExprOf<T>>) : Expr {
jdonaldson /
Created October 31, 2017 23:48

Keybase proof

I hereby claim:

  • I am jdonaldson on github.
  • I am omgjjd ( on keybase.
  • I have a public key ASAJ48Z_opUoHhbGQKzJZbWQYPJjP05hPY3mvsLyjC0Jhwo

To claim this, I am signing this object:

jdonaldson / Main.hx
Last active April 6, 2017 03:34
quick uint64_t abstract example
import lua.Lua;
import lua.Ffi;
class Main {
static function main() {
var d = Clock.realtime64();
var d2 = Clock.realtime64();
trace(d2 - d + " is the value for d2 - d");
trace(d2 - 1 + " is the value for d2 - 1");