A very basic starter template with fundamental HTML5 markup -- only the basics.
Based on HTML5 Bones | http://html5bones.com
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
import haxe.macro.TypeTools; | |
#if !macro | |
@:genericBuild(PartialMacro.build()) | |
#end | |
class Partial<T> {} | |
class PartialMacro { |
class ShortLambdaMacroTest { | |
static function other(i:Int){ | |
trace('ok, so $i'); | |
} | |
static function using(){ | |
Lambda.iter([1,2,3], function(i){trace(i);}); | |
Lambda.iter([1,2,3], f(i => trace(i))); | |
Lambda.iter([1,2,3], f(i => {trace(i + 1); other(i);})); | |
} |
m.validator = function (model, validations) { | |
this.errors = {} | |
this.validations = validations | |
this.model = model | |
} | |
m.validator.prototype.hasErrors = function () { | |
return Object.keys(this.errors).length | |
} |
A very basic starter template with fundamental HTML5 markup -- only the basics.
Based on HTML5 Bones | http://html5bones.com
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
import haxe.macro.Type; | |
using Lambda; | |
/** | |
Old school abstract class. | |
Classes that implements it, and their sub-classes, will be able to declare abstract methods (methods that without body). | |
There will be a check in compile-time such that no public constructor is allowed without all abstract methods implemented. | |
*/ |
/* | |
Based off of Gruber's awesome url regex: http://daringfireball.net/2010/07/improved_regex_for_matching_urls | |
In addition: | |
- Should match 'example.com', 'google.net', 'google.org'. (only com, net, and org are whitelisted). | |
- Should not match '[email protected]'. | |
*/ | |
var URL_RE = /(?:(?=[\s`!()\[\]{};:'".,<>?«»“”‘’])|\b)((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/|[a-z0-9.\-]+[.](?:com|org|net))(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))*(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]|\b))/gi |