Skip to content

Instantly share code, notes, and snippets.

View waneck's full-sized avatar

Cauê Waneck waneck

  • São Paulo, Brazil
View GitHub Profile
@waneck
waneck / Main.hx
Created May 12, 2012 13:35
Hello, Blog!
class Main
{
static function main()
{
trace("Hello, Blog!");
}
}
@waneck
waneck / Main.hx
Created May 12, 2012 15:07
Hello, Blog!
class Main
{
static function main()
{
trace("Hello, Blog!");
}
}
@:generic class NativeArrayWrapper<T>
{
public var cls(default, null):Class<T>;
public function get(idx:Int):Dynamic { return throw "not implemented"; }
public function get_f(idx:Int):Float { return get(idx); }
public function set(idx:Int, v:Dynamic):Dynamic { return throw "not implemented"; }
public function set_f(idx:Int, v:Float):Float { return set(idx, v); }
@waneck
waneck / Array.hx
Created July 26, 2012 14:00
@:generic proposal, 2
@:generic class Array<T>
{
private var arr:NativeArrayWrapper<T>;
public function new()
{
arr = new NativeArrayWrapper<T>(0); // this will be automatically replaced
}
public function get(x:Int):T
{
class LimitMinMax implements haxe.rtti.Meta
{
public var max:Float;
public var min:Float;
public function new(max, min)
{
this.max = max;
this.min = min;
}
@waneck
waneck / Main.hx
Created July 2, 2019 01:31
hxcpp cppia bug
import Test;
class Main {
static function main() {
trace("loading cppia");
untyped __global__.__scriptable_load_cppia(sys.io.File.getContent("cppia.cppia"));
var t3:Test = Type.createInstance(Type.resolveClass('Test2'), []);
t3.doTest(15);
}
}
@waneck
waneck / Repl.hx
Last active September 13, 2020 14:04
Very simple Haxe REPL
/*
Copyright (c) 2014 Cauê Waneck
All rights reserved.
Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the <organization>. The name of the