by Ossi Hanhinen, @ohanhi
with the support of Futurice 💚.
Licensed under CC BY 4.0.
// from c++ version: https://gist.github.com/timshen91/f6a3f040e5b5b0685b2a | |
// author: wangxiaochi | |
function ConcatExpr (Left,Right) {this.Left = Left;this.Right=Right} // ab | |
function AltExpr(Left,Right) {this.Left = Left;this.Right=Right} // a|b | |
function RepeatExpr(SubExpr) {this.SubExpr= SubExpr;} // a* | |
function OptionalExpr(SubExpr) {this.SubExpr= SubExpr;} // a? | |
function MatchExpr(ch) { | |
this.ch= ch | |
} |
关于 Riot 的 compiler,具体请见:[Riot compiler]
之前在 [Riot 源码阅读笔记] 中提到另挖坑来聊聊 Riot 提供的 template + logic
compiler 是怎么干活的,于是有了这一篇文章... (其实大部分都是正则,正则)
Riot 提供了两种方式,分别是 pre-compile
和直接在页面使用 script[type="riot/tag"]
,都是用的同一个 compiler 来处理代码的解析,在真实环境时推荐使用 pre-compile
的方式。
在页面使用 script[type="riot/tag", src="path"] 和 React 在页面使用 script[type="text/jsx", src="path"] 一样,都是用了 ajax 来请求文件内容,跨域就拜拜了,请知悉。
第一次看到 Riot,感觉就是惊艳。我对 React 不大了解,只是简单知道一些,所以在我看来,React 实现的一些东西,Riot 也可以实现,而且代码精简,麻雀虽小,五脏俱全,可以用很简单的语法创建类似 web component
的自定义标签,渲染的性能好像还不赖。
注:不支持自定义标签的浏览器需要手动创建标签,如 [demo/index.html]
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
和大家分享一下我整理的有趣的Github repository,项目地址在repo_starred
欢迎大家fork或者给我发issue
部分内容如下,不定期更新:
##navigation
#encoding = utf-8 | |
require 'anemone' | |
urls = [] | |
88.times do |i| | |
urls << "http://happycasts.net/episodes/#{i+1}" | |
end | |
urls.each do |url| |
TCTicketScript是一段浏览器脚本,帮你自动查询火车票余票。
javascript:var QPscript=document.createElement('script');QPscript.src='https://gist.github.com/oklai/6533698/raw/4c29378caebcc0fe9c80f2592f0951846ece1e04/TCTicketScript.js';document.body.appendChild(QPscript);
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000