Skip to content

Instantly share code, notes, and snippets.

View ryerh's full-sized avatar
🎯
Focusing

荷包蛋扣肉 ryerh

🎯
Focusing
View GitHub Profile
@ryerh
ryerh / sqlalchemy_middleware.py
Created February 12, 2019 10:04 — forked from ar45/sqlalchemy_middleware.py
Quick dirty SQLAlchemy middleware for django < 1.9
from sqlalchemy.engine import create_engine
from sqlalchemy.orm import sessionmaker
def create_engine_from_django_settings(database='default'):
from django.conf import settings
db = settings.DATABASES[database]
engine = db['ENGINE'].lower()
if 'postgresql' in engine:
sqlalchemy_engine = 'postgresql'
@ryerh
ryerh / jekyll-and-liquid.md
Created April 16, 2018 15:35 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@ryerh
ryerh / Enhance.js
Created July 14, 2016 03:31 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active October 30, 2024 08:09 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话: