Skip to content

Instantly share code, notes, and snippets.

@dbbbit
dbbbit / v2ex_api.md
Last active August 29, 2015 14:06 — forked from fanzeyi/v2ex_api.md
@dbbbit
dbbbit / foo.log
Last active August 29, 2015 14:06 — forked from ibeex/foo.log
A warning occurred (42 apples)
An error occurred
#: http://www.v2ex.com/api/members/show.json?id=1
member_id rank
1 0.021082598720727041552436276106163859367370605468750000000000
17638 0.004677871797238067341773160023876698687672615051269531250000
18119 0.004215808006276704558712431492040195735171437263488769531250
21351 0.003610164228372608492129147705895775288809090852737426757812
33 0.003468028344499850257331985403652652166783809661865234375000
362 0.002998325412711831325363043276865937514230608940124511718750
@dbbbit
dbbbit / ninja-search-userscript.md
Last active August 29, 2015 14:06
userscript for v2ex.com

What

安装该脚本在 v2ex 搜索框直接使用 ninja-search

使用方法

  • 下载 ninja-search.user.js
  • chrome 打开 chrome://extensions/
  • 拖动 ninja-search.user.js 到拓展界面安装即可。
(def fab (fn [x, tmp]
(if (or (= x 0) (= x 1))
tmp
(fab (- x 1) (* tmp x)))))
(println (= 24 (fab 4 1)))
(println (= 1 (fab 0 1)))
function static(path)
content = read(path)
version = hash(content)
store static file
return domain + path + version
--cabal install Network--
import Network.Socket
import Control.Exception
main :: IO()
main = do
hole <- socket AF_INET Stream defaultProtocol
bind hole (SockAddrInet 3000 0)
listen hole 5
from origin import A
A.p = "test"

deb http://mirrors.aliyun.com/ubuntu/ utopic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ utopic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-backports main restricted universe multiverse

# -*- coding: utf-8 -*-
# 嵌套式事务
class OriginStore(object):
cache = []
success = []
def transaction_begin(self):
if len(self.cache):