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 / .style.yapf
Created November 7, 2018 06:06
yapf-config
[style]
based_on_style=pep8
allow_split_before_dict_value=False
join_multiple_lines=False
split_before_named_assigns=False
@liyaoxinchifan
liyaoxinchifan / .ycm_extra_conf.py
Created November 6, 2018 08:05
ycm_extra_conf
import os
import os.path
import fnmatch
import logging
import ycm_core
import re
BASE_FLAGS = [
'-Wall',
'-Wextra',
@liyaoxinchifan
liyaoxinchifan / .tmux.conf
Last active November 6, 2018 07:48
mac-tmux-conf
#set -g status off
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-capture-pane-contents 'on'
#set -g @plugin 'tmux-plugins/tmux-sensible'
setw -g mode-keys vi
set -g default-terminal "screen-256color"
set -sg escape-time 1
set -g status-justify left
@liyaoxinchifan
liyaoxinchifan / .vimrc
Last active November 6, 2018 08:53
vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-surround'
Plugin 'Valloric/YouCompleteMe'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'vim-airline/vim-airline'
@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

@liyaoxinchifan
liyaoxinchifan / autopm25.py
Created October 7, 2014 09:43
send AQI in sms or email
#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
import urllib2
import re
import smtplib
from email.mime.text import MIMEText
class Getpm:
def pmnow(self, pmurl):