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
// HistoryController.hx | |
package controller; | |
import funk.actors.types.mvc.Controller; | |
import funk.actors.types.mvc.Model; | |
import funk.ioc.Inject; | |
import funk.types.Tuple2; | |
import model.HistoryModel; | |
import generic.event.Events; |
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
// FUCK HEADS https://github.com/caolan/nodeunit#tests-run-in-series | |
// No -> | |
var _readFile = fs.readFile; | |
fs.readFile = function(path, callback){ | |
// its a stub! | |
}; | |
// test function that uses fs.readFile | |
// we're done | |
fs.readFile = _readFile; |
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
try { | |
// This should fail with an exception | |
// Gecko does not error, returns false instead | |
matches.call( document.documentElement, "[test!='']:sizzle" ); | |
} catch( pseudoError ) { | |
pseudoWorks = true; | |
} |
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 ; | |
typedef Function2Type<T1, T2, R> = T1 -> T2 -> R; | |
abstract Function2<T1, T2, R>(Function2Type<T1, T2, R>) from Function2Type<T1, T2, R> to Function2Type<T1, T2, R> { | |
inline function new(func : Function2Type<T1, T2, R>) { | |
this = func; | |
} | |
} |
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
interface IDrawable {} | |
class DisplayObject { | |
public function new(drawable: IDrawable){} | |
} | |
// Different drawable items | |
class Bitmap implements IDrawable {} | |
class Graphics implements IDrawable {} | |
class Movie implements IDrawable {} |
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 Model extends Actor { | |
private state: Int = 0 | |
private listeners: List[Actor] = Nil | |
def act =loop { | |
react { | |
case AddListener(who) => listeners = who :: listeners | |
case RemoveListener(who) => listeners = listeners.remove(who.eq) | |
case SetState(st: Int) => state = st; listeners.foreach(_ ! TheState(this, state)) | |
case GetState => reply(TheState(this, state)) | |
} |
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
d8 --use_strict --trace_inlining --trace_opt --trace_deopt --trace_dead_code_elimination --trace-gc Example.js |
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
js.Boot.__instanceof = function(o,cl) { | |
if (o === null || cl === null) return false; | |
if (typeof cl === 'function') { | |
if(o instanceof cl) { | |
if(cl == Array) return o.__enum__ == null; | |
return true; | |
} | |
if(js.Boot.__interfLoop(o.__class__,cl)) return true; | |
} | |
switch(cl) { |
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
var a = function(value1, value2, value3) { | |
return value1 + value2 + value3; | |
}.carries(1, _, _)(2)(3); // Traces 6 |
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 haxe.io.Bytes; | |
import haxe.io.BytesInput; | |
import haxe.io.BytesOutput; | |
import format.tools.CRC32; | |
import format.zip.Data; | |
import format.zip.Reader; | |
import format.zip.Tools; | |
import format.zip.Writer; | |
class Test { |
OlderNewer