Skip to content

Instantly share code, notes, and snippets.

@postite
postite / MiniApp.hx
Created March 12, 2019 23:22
tink_web & coconut minimal
package minimal;
#if client
import tink.web.proxy.Remote;
import tink.url.Host;
import tink.http.clients.JsClient;
import tink.web.proxy.Remote.RemoteEndpoint;
import js.Browser.document as doc;
using tink.CoreApi;
import coconut.Ui.hxx;
@postite
postite / Main.hx
Created October 19, 2018 08:41
minimal hl/heaps timer
import haxe.Timer;
using DateTools;
class Main extends hxd.App {
var txt:h2d.Text;
var fui:h2d.Flow;
var paused:Bool;
var music:hxd.snd.Channel;
var times = [[0, 20], [1, 20], [20, 0], [30, 0]];
@postite
postite / App.hx
Created February 12, 2016 08:35
minimalist ufront example failing with compilation server
/*
build.hxml
-main App
-lib erazor
--connect 6000
--times
--each
@:remove
@:autoBuild(SkipSerializeMacro.build())
interface ISkipSerialize {}
@postite
postite / gist:bea6649632107a100847
Last active August 29, 2015 14:03
macro trace var name
import haxe.macro.Context;
import haxe.macro.Expr;
import Test.Mac.getMyName;
class Test {
static var pup="3ze";
var plop:String;
static function main() {
new Test();
@postite
postite / cocoaScriptmacro.hx
Created May 7, 2014 10:07
macro function to format cocoascript like methods
public static function cocoize()
{
trace( "cocoize");
var fields = Context.getBuildFields();
//parsing fields
for ( f in fields){
//parsing metas
for ( m in f.meta){
//meta name
switch (m.name){
class Main
{
public function new()
{
trace("hello");
var g=new SubOB();
trace(g.pull);
g.pull="over";
trace(g.pull);
}
// In short, it turns the following code (spoilers!!)
macro { someFunction(lorem, ipsum, dolor); }
// into the following structure (pay no attention to "pos" for now)
{
expr => EBlock([
{
expr => ECall(
{
expr => EConst(CIdent(someFunction)),
@postite
postite / BABYLON.hx
Last active August 29, 2015 13:56
babylon.js haxe exteren generated not tested
typedef WebGLProgram = { };
typedef WebGLShader = { };
typedef WebGLUniformLocation = { };
typedef WebGLRenderingContext = { };
typedef VertexBuffer = { };
typedef IndexBuffer = { };
typedef Capabilities = { public var maxTexturesImageUnits : Float; public var maxTextureSize : Float; public var maxCubemapTextureSize : Float; public var maxRenderTextureSize : Float; };
extern class Engine {
public function constructor( canvas : HTMLCanvasElement, antialias : Bool ) : Dynamic;
@postite
postite / Main.hx
Created April 11, 2013 12:20
promhx test
import promhx.Promise;
using Main.HttpExtensions;
import haxe.Http;
using Main;
#if macro
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.Type;
#end