Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# this will install everything as root, so take that into account before you run it
set -eu
# need cmake, python development headers, ZLib and OpenSSL
sudo apt-get install -y cmake python2.7-dev zlib1g-dev libssl-dev
root=`pwd`
@ifduyue
ifduyue / 0_reuse_code.js
Created May 24, 2014 11:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#include <stdio.h>
struct A {
int a;
char b;
};
struct A foo() {
struct A a;
a.a = 3;

PyCon 2012 Digest

from DevOps team {rduplain,mattd,teebes}, to mobile developers at WillowTree Apps

Pronunciation

@ifduyue
ifduyue / .bashrc
Last active December 25, 2015 03:49 — forked from atduskgreg/.bashrc
PS1="\[\033[01;35m\]\u\[\033[00m\]@\[\033[01;38m\]\h:\[\033[00m\]\[\e[1;34m\]\w\[\e[0m\] \$(parse_git_branch)\$(parse_git_dirty)\$ "
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
parse_git_dirty() {
if [[ -d .git ]]; then
[[ $(git status) =~ "nothing to commit, working directory clean" ]] || echo "*"
fi
@ifduyue
ifduyue / ab.result.vs.httpsqs.txt
Last active December 20, 2015 19:09
bench httpsqs & levelq
httpsqs:
=========================
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 100000 requests
Completed 200000 requests
Completed 300000 requests

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@ifduyue
ifduyue / curl.output
Last active December 16, 2015 16:40
openresty version
# curl 127.0.0.1/test
package.path: /usr/local/openresty/nginx//?.lua;/usr/local/openresty/lualib/?.lua;/usr/local/openresty/lualib/?/init.lua;./?.lua;/usr/local/openresty/luajit/share/luajit-2.0.0/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?/init.lua;
package.cpath: /usr/local/openresty/lualib/?.so;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so
cjson._VERSION: nil
[1,2,3]
# curl 127.0.0.1/test
curl: (52) Empty reply from server
@ifduyue
ifduyue / bson_decode_iter.py
Created March 7, 2013 12:41
An iterator version of bson.decode_all
#coding: utf8
'''
bson_decode_iter.py
~~~~~~~~~~~~~~~~~~~~~~
An iterator version of bson.decode_all
:copyright: (c) 2013 by Yue Du.
:license: The BSD 2-Clause License
'''
This file has been truncated, but you can view the full file.
H4sICAMrxVAC/2Rpc3QvZ2V2ZW50LTEuMHJjMi50YXIA7L3tehvXsS7ov8FV9KGdA5AbAAlSpGTK
Ug5FUTYTSWREyo6PrQM0gCbYIdCNdDdIws++jrmC+TPP3MH83Tc29VbV+mqAkhxn58x+Jt47YqN7
fa9a9V21JsltklWdXnenGO1uf/Gf8t8O/fd4fx9/e4/3d/y/5r8vers7B73d3f1HO3tf7PT2Hj3e
/SLa/+Kf8N+irOIiir4YJ1lafqTcp76biZi//0X+mwT7P7qOs0kyzSfdoqz+oft/8OjR+v3vHezs
93p2//f2sf8HvYO9L6Kdf+3/f/p/x2bHG8/Mf41GtxuNFkVBgDHLx4tpcngYCZw0Go13yTSJyyQS
iGl0gv8ajU70Kr1PxtGXu72dw2gUT6fDeHRTRndJkURZXkXFIouu8oKes844uYoX0yqa5vk8ag0X
kyjNqoK6HFELaSZ99Da71Oo8rkbXfWqutUlVqQaNupC3SRmVi+G8yEdJWUaLbIo/A/fq2WWxSAZR
WlLxskzGXTvIo6oq0uGiSk6KgoZEPV4vht0f4rRKClfqy96T3mE0i2+S6DodExxE6WyeF1UZ3aZl
OpwmUZVHV0WS/JJmE3rOp2U0Tan0fLmb3Cfd6ByjjIbL6F08vYouRteztKq89nd3dg+jeVKk+TjF
ii2jZZpMx9HdNfVF65WhXbeUrXKaJPPWzia9y7Ckw2k+uomq6yTiTZLlzPK7zaCPR4dRXnareb9I