This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List; | |
import java.util.ArrayList; | |
interface Entity { | |
public int getId(); | |
public int getKind(); | |
} | |
interface Taggable { | |
public void addTag(int tagId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=supervisord - Supervisor process control system for UNIX | |
Documentation=http://supervisord.org | |
After=network.target | |
[Service] | |
Type=forking | |
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf | |
ExecReload=/usr/bin/supervisorctl reload | |
ExecStop=/usr/bin/supervisorctl shutdown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for i in {1..100} | |
do | |
echo -ne "\t$i"'%\r' | |
sleep 0.05 | |
done | |
echo -e '\n'"success." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip-tools==0.3.5 | |
xlrd==0.9.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .weixin_compat import fixup_weixin_oauth | |
oauth = OAuth() | |
weixin = oauth.remote_app( | |
'weixin', | |
app_key='WEIXIN', | |
request_token_params={'scope': 'snsapi_base'}, | |
base_url='https://api.weixin.qq.com', | |
authorize_url='https://open.weixin.qq.com/connect/oauth2/authorize', | |
access_token_url='https://api.weixin.qq.com/sns/oauth2/access_token', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from operator import itemgetter | |
class Step(tuple): | |
location = property(itemgetter(0)) | |
milestone = property(itemgetter(1)) | |
step = Step(['nowhere', 'nothing']) | |
assert step.location == 'nowhere' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from StringIO import StringIO as BytesIO | |
except ImportError: | |
from io import BytesIO | |
import matplotlib.pyplot as plt | |
def render_latex(formula, fontsize=12, dpi=300, format_='svg'): | |
"""Renders LaTeX formula into image.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |