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; | |
import haxe.macro.Expr; | |
class Main { | |
static function main() { | |
var smap:StringMap = ['firstName' => 'Skial', 'lastName' => 'Bainn']; | |
trace( smap.lastName, smap.firstName ); // Bainn, Skial |
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
-- https://gist.github.com/fzzr-/b9cc28ee20cac95706d0bca1cedcbed9 | |
on open location theURL | |
set theNewURL to "" | |
set theGateway to "https://gateway.ipfs.io/" | |
set oldDelims to AppleScript's text item delimiters | |
-- xxx: better use `env bash -l` | |
set isIpfsRunning to length of (do shell script "bash -lc " & quoted form of "ipfs id -f='<addrs>'") > 0 | |
-- todo: display dialog "Wanna activate IPFS daemon?" | |
if (isIpfsRunning) then | |
set theGateway to "http://127.0.0.1:8080/" |
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 ; | |
import haxe.macro.*; | |
import haxe.macro.Expr; | |
import haxe.macro.Type; | |
class Main | |
{ | |
static var A:String = getConstA(); | |
static var B:String = getConstB(); |
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 ; | |
import haxe.macro.*; | |
import haxe.macro.Expr; | |
import haxe.macro.Type; | |
class Main | |
{ | |
static inline var A:String = getConstA(); | |
static inline var B:String = getConstB(); |
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.unit.*; | |
abstract Val<T:Float>(T) from T to T | |
{ | |
public inline function incrmnt():Void this++; // HERE | |
} | |
class Test extends TestCase | |
{ | |
function testAbstractInlineIncrement() |
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 hx.event.test; | |
import haxe.unit.TestRunner; | |
class Main | |
{ | |
public static function main() | |
{ | |
var runner = new TestRunner(); | |
runner.add(new SignalTest()); |
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 entities; | |
import nape.geom.Vec2; | |
/** | |
* @author MSGHero | |
*/ | |
@:enum | |
abstract Direction(Int) { | |
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.io.Bytes; | |
import haxe.Resource; | |
import openfl.Assets; | |
import openfl.display.Bitmap; | |
import openfl.display.BitmapData; | |
import openfl.display.Loader; | |
import openfl.utils.ByteArray; | |
/** |
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
/* | |
* Copyright (C)2005-2012 Haxe Foundation | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a | |
* copy of this software and associated documentation files (the "Software"), | |
* to deal in the Software without restriction, including without limitation | |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
* and/or sell copies of the Software, and to permit persons to whom the | |
* Software is furnished to do so, subject to the following conditions: | |
* |
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 Main { | |
static function parseProperties(text:String):Map<String, String> { | |
var map:Map<String, String> = new Map(), | |
ofs:Int = 0, | |
len:Int = text.length, | |
i:Int, j:Int, | |
endl:Int; | |
while (ofs < len) { | |
// find line end offset: | |
endl = text.indexOf("\n", ofs); |