Skip to content

Instantly share code, notes, and snippets.

@:jsRequire("nano")
extern class Nano {
@:selfCall
public static function create(url: String): Nano;
}
### Keybase proof
I hereby claim:
* I am fponticelli on github.
* I am fponticelli (https://keybase.io/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
fponticelli / Server.hx
Last active April 29, 2016 15:51
A multi-process webserver with abe and nodejs + cluster.
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) = "0.0.0.0";
@fponticelli
fponticelli / Request.hx
Created April 4, 2016 02:43
typed request
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
fponticelli / Button.hx
Last active March 13, 2016 00:20
brainstorm on typed component styling
import doom.Html.*;
class Button extends doom.html.Component<ButtonPropps> {
override function render() {
return button([
"class" => props.status,
"click" => props.trigger
], children);
}
}
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
fponticelli / RGBLed.hx
Last active December 17, 2015 18:29
Rotating RGB LED color hue with BeagleBone Black, Haxe and BoneScript.
import bone.Bone;
import thx.color.Color;
import thx.color.HSL;
using thx.color.Convert;
class RGBLed
{
public static function main()
{
reset();
@fponticelli
fponticelli / gist:5040330
Last active December 14, 2015 06:09
Function wrapping in abstract
abstract FunctionInfo<T>({ f : T, arity : Int, hasReturn : Bool })
{
public inline function new(f : T, arity : Int, hasReturn : Bool)
{
this = { f : f, arity : arity, hasReturn : hasReturn };
}
public inline function self() : T return this.f;
public inline function call(args : Array<Dynamic>)
@fponticelli
fponticelli / config.ini
Created July 17, 2012 20:13 — forked from abergie/config.ini
RG Description
cache=2 days
formats=png,jpg,pdf,html
screenWidth=580
[params]
start=true
end=true
path=true
token=true
@fponticelli
fponticelli / config.ini
Created June 4, 2012 13:51 — forked from abergie/config.ini
RG Description
cache=2 days
formats=png,html
[params]
start=true
end=true
path=true