View zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="seeker"
# Set to this to use case-sensitive completion
View wxpython.sh
#!/usr/bin/env sh
PYTHON_VERSION=2.7
WXPYTHON_ROOT="$(brew --prefix wxwidgets)/lib/python${PYTHON_VERSION}/site-packages"
WXPYTHON_SITE_ROOT="${WXPYTHON_ROOT}/$(cat ${WXPYTHON_ROOT}/wx.pth)"
SYSTEM_PYTHON=/usr/bin/python
# find the root of the virtualenv, it should be the parent of the dir this script is in
ENV=`${SYSTEM_PYTHON} -c "import os; print os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..'))"`
View Makefile
PATCHED_FILENAME = "Monaco for Powerline.ttf"
$(PATCHED_FILENAME): Monaco.ttf fontpatcher.py fontpatcher-symbols.sfd
fontforge -script fontpatcher.py Monaco.ttf
@echo "(´・_・`) You can install the $(PATCHED_FILENAME) now."
Monaco.ttf: Monaco.dfont
fondu Monaco.dfont
rm *.bdf
View demo
#!/usr/bin/env bash
for i in {1..100}
do
echo -ne "\t$i"'%\r'
sleep 0.05
done
echo -e '\n'"success."
View requirements.txt
pip-tools==0.3.5
xlrd==0.9.3
View my_namedtuple.py
from operator import itemgetter
class Step(tuple):
location = property(itemgetter(0))
milestone = property(itemgetter(1))
step = Step(['nowhere', 'nothing'])
assert step.location == 'nowhere'
View captcha.py
import random
from wheezy.captcha.image import captcha
from wheezy.captcha.image import background
from wheezy.captcha.image import curve
from wheezy.captcha.image import noise
from wheezy.captcha.image import smooth
from wheezy.captcha.image import text
from wheezy.captcha.image import offset
from wheezy.captcha.image import rotate
View blog.tonyseek.com.conf
server {
listen 80;
server_name blog.tonyseek.com;
root /srv/blog.tonyseek.com/;
# digg has a broken https support while sni extension has been enabled.
if ($http_user_agent !~ Digg ) {
rewrite ^ https://$server_name$request_uri? permanent; # enforce to use https
}
View gulpfile.coffee
gulp = require 'gulp'
uglify = require 'gulp-uglify'
sourcemaps = require 'gulp-sourcemaps'
stylus = require 'gulp-stylus'
rename = require 'gulp-rename'
source = require 'vinyl-source-stream'
buffer = require 'vinyl-buffer'
browserify = require 'browserify'
del = require 'del'
pkginfo = require './package.json'
View withenv
#!/usr/bin/env sh
exec env $(cat .env 2>/dev/null | xargs) $@