Skip to content

Instantly share code, notes, and snippets.

View amorphobia's full-sized avatar
🏠
Working from home

Xuesong amorphobia

🏠
Working from home
View GitHub Profile
@amorphobia
amorphobia / postfix_parser.py
Last active April 3, 2022 06:21
龙书图2-27例程的 Rust 移植版本
import readchar
class Parser:
def __init__(self):
self.lookahead = readchar.readchar()
def expr(self):
self.term()
while True:
if self.lookahead == b'+':
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@amorphobia
amorphobia / hjkl.ahk
Created May 6, 2020 07:50
An AutoHotKey script enables space + h/j/k/l to send arrows and more
; Original script xlr-space.ahk (https://sspai.com/post/57157)
; Modified by amorphobia (https://github.com/amorphobia)
; Space
Space::Send {Space}
^Space::Send ^{Space}
#Space::Send #{Space}
^#Space::Send ^#{Space}
!Space::Send !{Space}
@amorphobia
amorphobia / flow.tex
Created April 26, 2020 05:50
TiKZ code for the first pic in the thread https://www.v2ex.com/t/665886
\documentclass[preview]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{arrows}
\tikzset{default/.style={draw,inner sep=10pt}}
\tikzset{else master/.style={draw=gray!60,inner sep=10pt}}
\tikzset{feature/.style={draw,inner sep=10pt,fill=gray}}
\tikzset{master/.style={draw,inner sep=10pt,fill=blue!20}}
\tikzset{rect/.style={rectangle,minimum height=25pt,minimum width=60pt}}
@amorphobia
amorphobia / xhyx.dict.yaml
Created July 11, 2019 05:48
小鹤音形 9.7 系统词库
# 小鹤音形 9.7_20190709 build 378 系统词库
# 删除了词库中的《静夜思》
# $ddcmd(   静夜思·李白
#
# 床前明月光,疑是地上霜。
# 举头望明月,低头思故乡。
# ,『静夜思·李白』) jysi
---
@amorphobia
amorphobia / append.swift
Created May 31, 2019 02:18
Swift: Append an element to an array which is a value of a dictionary, creating a new array if needed
var dict = [1: [11, 13, 15], 2: [23, 24]]
dict[3, default: []].append(39)
@amorphobia
amorphobia / chinese_lunar.ics
Last active January 2, 2020 05:46
Chinese lunar calencar
BEGIN:VCALENDAR
PRODID:-//Chen Wei//Chinese Lunar Calendar//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:农历
X-WR-TIMEZONE:Asia/Shanghai
X-WR-CALDESC:中国农历2017-2023, 包括节气.
BEGIN:VEVENT
DTSTAMP:20200102T054544Z
@amorphobia
amorphobia / chinese_lunar_1901_2100.ics
Created February 27, 2018 14:34
Chinese lunar calendar 1901 to 2100
This file has been truncated, but you can view the full file.
BEGIN:VCALENDAR
PRODID:-//Chen Wei//Chinese Lunar Calendar//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:农历
X-WR-TIMEZONE:Asia/Shanghai
X-WR-CALDESC:中国农历1901-2100, 包括节气.
BEGIN:VEVENT
DTSTAMP:20180227T141148Z
nginx:
container_name: ghost_blog_nginx
image: nginx
ports:
- "80:80"
- "443:443"
volumes:
- ~/Developer/Docker/ghost_blog/html:/usr/share/nginx/html
- ~/Developer/Docker/ghost_blog/nginx:/etc/nginx
links: