Skip to content

Instantly share code, notes, and snippets.

@RealyUniqueName
RealyUniqueName / EventBuilder.hx
Last active October 30, 2015 09:49
Add getter & setter to openfl.events.Event
package;
import haxe.macro.Context;
import haxe.macro.Expr;
class EventBuilder
{
/**
* Description
@RealyUniqueName
RealyUniqueName / Main.hx
Created February 15, 2016 18:23
Minimal slider example for StablexUI
package;
import flash.Lib;
import ru.stablex.ui.skins.Paint;
import ru.stablex.ui.UIBuilder;
import ru.stablex.ui.widgets.Slider;
/**
* Simple demo project for StablexUI
@RealyUniqueName
RealyUniqueName / Test.hx
Created August 13, 2016 03:17
New php generator for Haxe
package example;
import php7.Exception;
class TestSuper {
function new () {}
function superMethod () return [Std.random(2), Std.random(2)][Std.random(2)];
@RealyUniqueName
RealyUniqueName / KeyValueIterator.hx
Last active October 14, 2016 10:35
Key-value map iterator
class KeyValueIterator<K,V> {
var map:Map<K,V>;
var keys:Iterator<K>;
static public inline function pairs<K,V>(map:Map<K,V>) return new KeyValueIterator(map);
public inline function new(map:Map<K,V>) {
this.map = map;
this.keys = map.keys();
}
@RealyUniqueName
RealyUniqueName / Json.hx
Last active February 10, 2022 15:45
Sample PHP externs for Haxe
//You can use any package name here.
//It's not required to match the namespace of php file.
package;
import php.NativeStructArray;
typedef EncodingOptions = {
?prettyPrint:Bool,
?enableJsonExprFinder:Bool,
}