It's great for beginners. Then it turns into a mess.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import haxe.macro.Context; | |
| import haxe.macro.Expr; | |
| import haxe.macro.TypeTools; | |
| #if !macro | |
| @:genericBuild(PartialMacro.build()) | |
| #end | |
| class Partial<T> {} | |
| class PartialMacro { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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);})); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 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 'sam@samuelcole.name'. | |
| */ | |
| 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 |