Skip to content

Instantly share code, notes, and snippets.

View oa414's full-sized avatar
🤓
苟利国家生死以,岂因祸福避趋之

Lin Xiangyu oa414

🤓
苟利国家生死以,岂因祸福避趋之
View GitHub Profile
// 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
}
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@teabyii
teabyii / Riot-compiler.md
Last active November 15, 2018 09:11
Riot-compiler 代码的简单解读

Riot 源码阅读笔记 -- compiler

关于 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 来请求文件内容,跨域就拜拜了,请知悉。

@teabyii
teabyii / riotjs.md
Last active August 23, 2017 13:40
riotjs 源码阅读记录

Riot 源码阅读笔记

官网:https://muut.com/riotjs/

第一次看到 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.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@tiye
tiye / copy.md
Created March 18, 2014 01:32
Github 上有趣的资料

和大家分享一下我整理的有趣的Github repository,项目地址在repo_starred

欢迎大家fork或者给我发issue

部分内容如下,不定期更新:

GitHub Starred Projects

##navigation

#encoding = utf-8
require 'anemone'
urls = []
88.times do |i|
urls << "http://happycasts.net/episodes/#{i+1}"
end
urls.each do |url|
@oklai
oklai / README.md
Last active January 9, 2019 10:11
TCTicketScript - 火车票自动查询工具

TCTicketScript

TCTicketScript是一段浏览器脚本,帮你自动查询火车票余票。

如何使用

  1. 请使用Chrome浏览器;
  2. 拖拽这个链接到你的书签栏,抢票工具,拷贝下面的代码;
javascript:var QPscript=document.createElement('script');QPscript.src='https://gist.github.com/oklai/6533698/raw/4c29378caebcc0fe9c80f2592f0951846ece1e04/TCTicketScript.js';document.body.appendChild(QPscript);
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active March 21, 2025 15:01
Backend Architectures Keywords and References
@willurd
willurd / web-servers.md
Last active April 28, 2025 14:34
Big list of http static server one-liners

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000