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
| // adapted from the original acube demo by tkcne. | |
| // enjoy | |
| include "stdlib.h"; | |
| include "string.h"; | |
| include "malloc.h"; | |
| include "math.h"; | |
| include "gccore.h"; | |
| include "stdio.h"; |
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
| trait MyTrait { | |
| public function doSomething(): Void; | |
| } | |
| abstract MyType: Int { | |
| rules { | |
| ($this.doSomething) => $this.MyTrait.doSomething; | |
| } | |
| } |
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
| abstract Color: Uint32 { | |
| rules { | |
| (${a: Color} + ${b: Color}) => | |
| ((($a & 0xff0000) + ($b & 0xff0000)) & 0xff0000) + | |
| ((($a & 0xff00) + ($b & 0xff00)) & 0xff00) + | |
| ((($a & 0xff) + ($b & 0xff)) & 0xff) as Color; | |
| } | |
| } | |
| function main() { |
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 kit.mem; | |
| struct MyStruct { | |
| public var x: Int; | |
| public var y: Int; | |
| public static function new(allocator: Box[Allocator]): Ptr[MyStruct] { | |
| var newValue: Ptr[MyStruct] = allocator.alloc(sizeof MyStruct); | |
| newValue.x = 1; | |
| newValue.y = 2; |
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.ExprTools; | |
| class AssertTest { | |
| macro public static function assert(e:ExprOf<Bool>) { | |
| #if debug | |
| var assertion = ExprTools.toString(e); | |
| return macro { | |
| if (!$e) { |
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
| FROM ubuntu:latest | |
| RUN apt-get update | |
| RUN apt-get install -y haxe php7.0 apache2 libapache2-mod-php7.0 | |
| RUN mkdir -p /var/www/try-haxe | |
| RUN a2enmod php7.0 | |
| RUN a2enmod rewrite | |
| COPY try-haxe.conf /etc/apache2/sites-enabled/000-default.conf | |
| EXPOSE 80 |
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
| package flixel; | |
| import flixel.FlxSprite; | |
| import flixel.graphics.FlxGraphic; | |
| import flixel.graphics.frames.FlxImageFrame; | |
| import flixel.math.FlxPoint; | |
| import flixel.math.FlxRect; | |
| import flixel.system.FlxAssets; | |
| import flixel.util.FlxColor; |
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
| function replace(graphicList:Graphiclist, search:Graphic, replace:Graphic) { | |
| var children = graphicList.children; | |
| var index = children.indexOf(search); | |
| if (index > -1) { | |
| children[index] = replace; | |
| } | |
| } |
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 MapArray<T> | |
| { | |
| public static function main() | |
| { | |
| var x = new MapArray<Int>(new Map<Int, Int>()); | |
| for (i in 1 ... 100001) | |
| x.push(i); | |
| x.remove(5002); |
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
| #!/bin/bash | |
| DIR=$(pwd) | |
| REPOS=$(find . -type d -name .git) | |
| echo "-- Directory: " $DIR | |
| echo "-- Repos: " $REPOS | |
| for i in hx py xml; do | |
| echo $i |
NewerOlder