Skip to content

Instantly share code, notes, and snippets.

View liyaoxinchifan's full-sized avatar
🎯
Focusing

Yaoxin Li liyaoxinchifan

🎯
Focusing
View GitHub Profile
@liyaoxinchifan
liyaoxinchifan / meta.py
Created August 22, 2021 07:03 — forked from shazow/meta.py
My latest SQLAlchemy model base class.
"""SQLAlchemy Metadata and Session object"""
import datetime
import json
import time
from sqlalchemy import MetaData
from sqlalchemy.orm import scoped_session, sessionmaker
__all__ = ['Session', 'metadata', 'Model', 'SchemaEncoder']
@liyaoxinchifan
liyaoxinchifan / tmux-cheatsheet.markdown
Created December 30, 2016 06:52 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@liyaoxinchifan
liyaoxinchifan / gist:315f807a3b6a9f9f0f55f63ae9d868ab
Created August 18, 2016 04:11 — forked from methane/gist:2185380
Tornado Example: Delegating an blocking task to a worker thread pool from an asynchronous request handler
from time import sleep
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.web import Application, asynchronous, RequestHandler
from multiprocessing.pool import ThreadPool
_workers = ThreadPool(10)
def run_background(func, callback, args=(), kwds={}):
def _callback(result):
@liyaoxinchifan
liyaoxinchifan / iterm2-solarized.md
Created July 2, 2016 01:48 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OS X / macOS)

Solarized