Skip to content

Instantly share code, notes, and snippets.

View gist:04af2e8a32a864eb58f9111ccd6c7a40
### Keybase proof
I hereby claim:
* I am fponticelli on github.
* I am fponticelli ( on keybase.
* I have a public key whose fingerprint is D665 0895 F02A 5D6F 3089 7965 9CEC 6A8B B344 787C
To claim this, I am signing this object:
fponticelli / Server.hx
Last active Apr 29, 2016
A multi-process webserver with abe and nodejs + cluster.
View Server.hx
import abe.App;
import bl.server.*;
import js.Node.*;
import js.node.Cluster;
import js.node.Os;
import npm.Chalk.*;
class Server {
public static var defaultPort(default, null) = 8787;
public static var defaultHost(default, null) = "";
View Request.hx
package bl.common;
using thx.promise.Promise;
import thx.Url;
import js.html.XMLHttpRequest;
import js.html.XMLHttpRequestResponseType;
class Request<T> {
public var response(default, null) : Promise<T>;
var request : XMLHttpRequest;
fponticelli / Button.hx
Last active Mar 13, 2016
brainstorm on typed component styling
View Button.hx
import doom.Html.*;
class Button extends doom.html.Component<ButtonPropps> {
override function render() {
return button([
"class" => props.status,
"click" => props.trigger
], children);
View Haxe reflection based script thing.
private typedef _SActionFunc = EntityScript -> _SA -> Void;
private class _SActions {
// Every function in this class must be of type _SActionFunc.
// Who knows what will happen if this is not true.
public static function Idle(entity:EntityScript, action:_SA):Void {
public static function AnotherAction(entity:EntityScript, action:_SA):Void {
fponticelli / Lazy.hx
Created Sep 16, 2015
Lazy evaluation of remote files
View Lazy.hx
import js.node.vm.Script;
using thx.promise.Promise;
class Lazy {
static var map : Map<String, Script> = new Map();
public static function load(path : String) : Promise<{} -> String> {
var script = map.get(path);
if(null != script) {
return Promise.value(loadScript(script));
fponticelli / Main.hx
Created Mar 11, 2015
small js.Promise test
View Main.hx
import js.Promise;
class Main {
static function main() {
var p1 = new Promise(function(resolve, reject) {
p1.then(function(v) trace(v), function(e) trace('NOOO!! $e'));
var p2 = new Promise(function(resolve, reject) {
fponticelli / Router.hx
Last active Aug 29, 2015
extern issue
View Router.hx
import express.Request;
import express.Response;
import express.Next;
import express.Middleware;
import express.Express;
import abe.Router;
class Main {
public static function main() {
var router = new abe.Router(null);
fponticelli / Auth.hx
Created Feb 24, 2015
sample Auth with abe
View Auth.hx
class Auth implements abe.IRoute {
function login(user : String, password : String) {
fponticelli / Main.hx
Created Feb 15, 2015
Minimalistic Webserver with NodeJS + Express + Haxe (with Macros) and an experimental library called restx
View Main.hx
import restx.App;
class Main implements restx.IRoute {
function index()
response.send("Hello World!");
public static function main() {
var app = new App(9998);
app.router.register(new Main());
You can’t perform that action at this time.