Skip to content

Instantly share code, notes, and snippets.


Alfred Zhou adaiguoguo

View GitHub Profile
shuanghua / ss-libev
Last active Dec 14, 2020
ss-libev + v2ray-plugin + tls
View ss-libev

ss-libev 插件 v2ray-plugin 的安装使用

请确保已经正确安装好了 ss-libev

购买域名 / 或申请免费域名

配置 Cloudflare

adaiguoguo /
Last active Jun 8, 2016 — forked from liaoyw/
# copy from
function extract() # Handy Extract Program
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
# copy from
function extract() # Handy Extract Program
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
View gist:feefe4e23865d1464d5f
bypass-tun =,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
janlay /
Last active Feb 26, 2021
Yet another config for


  1. Modify index.txt with your output path and proxy info
  2. Use Text Builder to build configuration for Surge: $ text-builder -index /path/to/index.txt Or run $ sh build-all to build all your index files.
  3. Import configuration via AirDrop/iTunes/Dropbox/iCloud

There are no guarantees, no any support. Use it at your own risk.

dalang /
Created May 11, 2015
print yanghui triangle
def yanghui_triangle():
def safe_get_value(l, index):
length = len(l)
return 0<= index < length and l[index] or 0
tmp = [1]
while True:
yield tmp
length = len(tmp)
new = []
massenz / README.rst
Last active Aug 8, 2017
Apache Mesos build and install scripts; optionally runs the Master/Slave locally and executes a demo (C++) framework against it, to validate it all went according to plan
View README.rst

Apache Mesos Build scripts

The `Getting started`_ instructions are a good start (no surprise there!) but are somewhat incomplete and currently look a bit outdated (I plan to fix them soon): however, the outcome has been that I have struggled more than I felt necessary in building and running Mesos on a dev VM (Ubuntu 14.04 running under VirtualBox).

Some of the issue seem to arise from the unfortunate combination of Mesos Master trying to guess its own IP address, the VM being (obviously) non-DNS resolvable and, eventually, the Slave and the Framework failing to properly communicate with the Master.

In the process of solving this, I ended up automating all the dependencies installation, building and running the framework; I have then broken it down into the following modules to make it easier to run only parts of the process.

umidjons /
Created Mar 2, 2015
Export HTML table to Excel in AngularJS

Export HTML table to Excel in AngularJS

		var uri='data:application/;base64,',
			template='<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns=""><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>',
			base64=function(s){return $window.btoa(unescape(encodeURIComponent(s)));},
			format=function(s,c){return s.replace(/{(\w+)}/g,function(m,p){return c[p];})};
		return {
vsouza / .bashrc
Last active Mar 2, 2021
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
View .bashrc
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
ouyangzhiping /
Last active Nov 12, 2020


Gitlab是目前比较流行的开源类Github代码管理平台。Gitlab使用Rails开发,使用PostgreSQL或MySQL数据库,Redis做缓存。一般自己搭建私有代码仓库,Gitlab通常是首选。这里简单介绍一下dockerized Gitlab。



这里以Ubuntu 14.04发行版为例,在bash中输入一下命令安装最新的docker: