Skip to content

Instantly share code, notes, and snippets.

@sonygod
sonygod / Utype.hx
Created March 9, 2013 08:45
haxe3 uint8 uint16 uint32
package proxy;
abstract UInt8(Int) to Int {
private inline function new(a:Int) {
this = a;
}
static public inline function safe(a:Int):UInt8 {
return new UInt8(a&0xFF);
}
static public inline function unsafe(a:Int):UInt8 {
@sonygod
sonygod / Ex.hx
Created March 10, 2013 16:15
request tinkerbell
package ;
import sys.db.ResultSet;
class Ex {
public function new() {
var test:Test = new TestProxy();
@sonygod
sonygod / Main.hx
Created March 11, 2013 08:48
haxe3 bind Test
package ;
import haxe.ds.StringMap;
import js.Node;
using Reflect;
import tink.lang.Cls;
//import proxy.Bag;
import proxy.Utype;
import Type;
package proxy;
import haxe.ds.Vector;
import proxy.Utype;
/**
* ...
* @author sonygod
*/
typedef BaseRoleItem = {
@sonygod
sonygod / Main.as
Created March 14, 2013 02:41
Test haxe3 swc for as3 just Test
/**
* Created with IntelliJ IDEA.
* User: p5
* Date: 13-1-31
* Time: 下午8:00
* To change this template use File | Settings | File Templates.
*/
package {
import flash.display.MovieClip;
import flash.display.Sprite;
abstract FunctionReturning<T>(Dynamic) {
inline function new (x:Dynamic) this = x;
@:from static inline function from0 <T>(x:Void->T):FunctionReturning<T> return new FunctionReturning(x);
@:from static inline function from1 <T>(x:Dynamic->T):FunctionReturning<T> return new FunctionReturning(x);
@:from static inline function from2 <T>(x:Dynamic->Dynamic->T):FunctionReturning<T> return new FunctionReturning(x);
@:from static inline function from3 <T>(x:Dynamic->Dynamic->Dynamic->T):FunctionReturning<T> return new FunctionReturning(x);
/* ... */
}
class Test {
/*
* Copyright (c) 2011, TouchMyPixel & contributors
* Original author : Tarwin Stroh-Spijer <tarwin@touchmypixel.com>
* Contributors: Tony Polinelli <tonyp@touchmypixel.com>
* Andras Csizmadia <andras@vpmedia.eu>
* Reference for further improvements:
* http://haxe.org/doc/start/flash/as3migration/part1
* http://www.haxenme.org/developers/documentation/actionscript-developers/
* http://www.haxenme.org/api/
* All rights reserved.
@sonygod
sonygod / ProtoToHaxe (2).hx
Created March 26, 2013 08:15
proto to haxe
package;
import haxe.ds.IntMap;
import sys.db.Object;
import sys.FileSystem;
import neko.Lib;
//import neko.Sys;
@sonygod
sonygod / proto2Haxe.hx
Created March 26, 2013 12:39
proto2haxe final
package;
import haxe.ds.IntMap;
import sys.db.Object;
import sys.FileSystem;
import neko.Lib;
//import neko.Sys;
@sonygod
sonygod / As3ToHaxe.hx
Created March 27, 2013 06:31
create as3 interface from source
package;
import haxe.ds.IntMap;
import sys.db.Object;
import sys.FileSystem;
import neko.Lib;
//import neko.Sys;