This file contains 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 PrintCwd { | |
static function main() | |
Sys.println('cwd: ' + Sys.getCwd() + ' args: ' + Sys.args()); | |
} |
This file contains 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
// items.xml to be found at https://raw.githubusercontent.com/dougmencken/HeadOverHeels/master/gamedata/items.xml | |
// Run per `haxe -lib tink_xml --run Main` | |
using sys.io.File; | |
class Main { | |
static function main() { | |
var s = new tink.xml.Structure<Array<Entry>>(); | |
switch s.read('items.xml'.getContent()) { | |
case Success(entries): | |
var doors = [], |
This file contains 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 js.Browser.*; | |
import vdom.VDom.*; | |
import coconut.Ui.hxx; | |
import coconut.ui.*; | |
import coconut.data.*; | |
using Scrolling; | |
class Scrolling { |
This file contains 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 tink.http.Client; | |
import tink.http.Request; | |
import tink.http.Response; | |
using tink.CoreApi; | |
typedef CachePolicy = OutgoingRequest->IncomingResponse->Future<Noise>; | |
class CachingClient implements tink.http.Client.ClientObject { | |
var actual:Client; | |
var policy:CachePolicy; |
This file contains 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.Context; | |
using sys.FileSystem; | |
using StringTools; | |
@:forward | |
abstract Entry(haxe.io.Path) { | |
public inline function new(s) | |
this = new haxe.io.Path(s); |
This file contains 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
@:forward(map, filter, copy, slice) | |
abstract ArrayRead<T>(Array<T>) from Array<T> to Iterable<T> { | |
@:arrayAccess inline function get(i:Int):T return this[i]; | |
public var length(get,never):Int; | |
inline function get_length() return this.length; | |
} |
This file contains 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 Sys.*; | |
using sys.FileSystem; | |
using sys.io.File; | |
class NpmInstall { | |
static function die(reason:String, ?code = 500) { | |
println(reason); | |
exit(code); | |
} |
This file contains 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 ; | |
#if macro | |
import haxe.macro.Context.*; | |
class Self { | |
static public function buildSelf() | |
return getType( | |
switch getTypedExpr(typeExpr(macro (function (?pos:haxe.PosInfos) {})())).expr { | |
case ECall(_, [macro { fileName: $_, lineNumber: $_, className: ${{ expr: EConst(CString(name)) }}, methodName: $_ }]): name; | |
default: throw 'assert'; |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>TodoMVCoconut</title> | |
<meta name="description" content="TodoMVC implementation based on MVCoconut" /> | |
<link rel="stylesheet" type="text/css" href="styles.css"> | |
<link rel="icon" href="https://avatars1.githubusercontent.com/u/25455337?v=3&s=200" type="image/png" /> | |
</head> |
This file contains 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 tink.state.*; | |
import coconut.ui.*; | |
using tink.CoreApi; | |
class Swapper<T> extends BaseView { | |
public function new(options:Observable<{ | |
className:String, | |
data: Promised<T>, | |
renderData:T->RenderResult, |