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 tornado.ioloop | |
| import tornado.web | |
| import urllib2 as urllib | |
| from PIL import Image | |
| from cStringIO import StringIO | |
| import numpy as np | |
| import tesserwrap | |
| import cv2 | |
| class MainHandler(tornado.web.RequestHandler): |
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
| # git aliases - taken from oh-my-zsh's git plugin and translated to bash | |
| # https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet#helpful-aliases-for-common-git-tasks | |
| # https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh | |
| function git_current_branch() { | |
| ref=$(git symbolic-ref HEAD 2> /dev/null) || \ | |
| ref=$(git rev-parse --short HEAD 2> /dev/null) || return | |
| echo ${ref#refs/heads/} | |
| } | |
| function git_current_repository() { | |
| ref=$(git symbolic-ref HEAD 2> /dev/null) || \ |
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
| # git aliases - taken from oh-my-zsh's git plugin and translated to bash | |
| # https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet#helpful-aliases-for-common-git-tasks | |
| # https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh | |
| function git_current_branch() { | |
| ref=$(git symbolic-ref HEAD 2> /dev/null) || \ | |
| ref=$(git rev-parse --short HEAD 2> /dev/null) || return | |
| echo ${ref#refs/heads/} | |
| } | |
| function git_current_repository() { | |
| ref=$(git symbolic-ref HEAD 2> /dev/null) || \ |
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 python | |
| # coding: utf-8 | |
| import os | |
| import sys | |
| import json | |
| import uuid | |
| import tempfile | |
| from flask import Flask, request, Response, g |
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
| [mypy] | |
| python_version = 3.6 | |
| ignore_missing_imports = True | |
| disallow_untyped_calls = True | |
| disallow_untyped_defs = True | |
| disallow_incomplete_defs = True | |
| check_untyped_defs = True | |
| [mypy-app.migrations.*] | |
| ignore_errors = True |
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 python3 | |
| from attr import dataclass, Factory | |
| from typing import Dict, List | |
| @dataclass | |
| class Foo: | |
| _instances: Dict[str, "Foo"] = Factory(dict) |
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
| Python Cheatsheet | |
| ================= | |
| ################################ Input & Output ############################### | |
| name = input('please enter your name: ') | |
| print('hello,', name) | |
| ageStr = input('please enter your age: ') | |
| age = int(ageStr) |
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
| ,@@@@@@@@@@,,@@@@@@@% .#&@@@&&.,@@@@@@@@@@, %@@@@@@%* ,@@@% .#&@@@&&. *&@@@@&( ,@@@@@@@% %@@@@@, ,@@, | |
| ,@@, ,@@, ,@@/ ./. ,@@, %@% ,&@# .&@&@@( .@@/ ./. #@&. .,/ ,@@, %@% *&@&. ,@@, | |
| ,@@, ,@@&%%%%. .&@@/, ,@@, %@% ,&@# %@& /@@, .&@@/, (@@&%(*. ,@@&%%%%. %@% &@# ,@@, | |
| ,@@, ,@@/,,,, ./#&@@@( ,@@, %@@@@@@%* /@@, #@&. ./#&@@@( *(%&@@&. ,@@/,,,, %@% &@# .&&. | |
| ,@@, ,@@, ./, .&@# ,@@, %@% ,@@@@@@@@@% ./. .&@# /*. /@@. ,@@, %@% *&@&. ,, | |
| ,@@, ,@@@@@@@% .#&@@@@&/ ,@@, %@% .&@# ,@@/.#&@@@@&/ /%&@@@@. ,@@@@@@@% %@@@@@. ,@@, | |
| ,*************,,*/(((((//,,*(#%%%%%%%%%%%%%%%#(*,,,****************************************************,*/(((((((((/((((////****/((##%%%%%% | |
| ,*************,,//((((((//,,*(%%%%%%%%%%%%%%%%%##/* |
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
| #! /bin/bash | |
| ENV_NAME='env' | |
| PYTHON_NAME='python3' | |
| project_name=$1 | |
| function configure_sublime() { | |
| env_dir=$(readlink -f $project_name/$ENV_NAME) |
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/python | |
| # -*- coding: UTF-8 -*- | |
| # author: wankun | |
| # date: 2015-10-30 | |
| # description: async file | |
| import os as _os | |
| import os.path as _path | |
| import time as _time |
NewerOlder