View logging-and-gevent.py
import logging
import itertools
import gevent.monkey
class SlowHandler(logging.Handler):
def emit(self, record):
gevent.sleep(1)
View surge_to_ssx.py
#!/usr/bin/env python3
"""ShadowsocksX Migration.
This script generates ShadowsocksX profiles from the Surge configuration.
"""
import os
import json
import time
View goaway-oracle-tracking.sh
#!/usr/bin/env sh
set -e
mkdir -p ~/.oracle_jre_usage
sudo chown root:admin ~/.oracle_jre_usage
sudo chmod o= ~/.oracle_jre_usage
View aliyun-is-terrible.sh
ansible all --ask-become-pass -i production -m shell -a 'curl http://update.aegis.aliyun.com/download/quartz_uninstall.sh | bash'
ansible all --ask-become-pass -i production -m shell -a 'rm -rf /usr/local/aegis'
View brew-cask-upgrade
#!/usr/bin/env bash
set -e
STAGING_LOCATION="$(brew cask doctor \
| grep -A1 '==> Homebrew-cask Staging Location:' | tail -n1 \
| awk '{print $1}')"
echo "==> Upgrading casks"
for cask in $(ls ${STAGING_LOCATION})
View Usage.md

How to use

from flask import Flask, render_template
from myapp.views.qrcode import bp, make_qrcode_url


app = Flask(__name__)
app.config['SECRET_KEY'] = 'random-bytes'
app.register_blueprint(bp)
View base.py
__all__ = ['EntityModel']
class EntityModel(object):
"""The base class of entity models.
All entity models are comparable and hashable. There are some meta
attributes:
- ``id_attr_name``
View adb-screencap
#!/usr/bin/env sh
if [ -z $1 ]; then
echo "usage: $0 FILENAME.png" > /dev/stderr
exit 1
fi
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > $1
View git-web
#!/usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2016 Jiangge Zhang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell