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 / smyh.base.schema.yaml
Last active January 18, 2024 05:15
smyh.base.schema.yaml
# Rime schema settings
# encoding: utf-8
schema:
schema_id: smyh.base
name: 吉旦餅·基礎碼表
description: |
可以打字。
engine:
@amorphobia
amorphobia / 键道安装.html
Created November 7, 2023 07:51
键道安装快捷指令
<!DOCTYPE html><html><head><meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta name="format-detection" content="telephone=no,date=no">
<title>键道安装</title>
<style>
body {
font-family: system-ui;
font-size: 0.95em;
margin-top: 1rem;
margin-bottom: calc(1rem + env(safe-area-inset-bottom));
@amorphobia
amorphobia / gedao.schema.yaml
Created November 5, 2023 09:24
格道双拼-仓
# Rime schema
# encoding: utf-8
schema:
schema_id: gedao
name: 格道双拼
version: "1.0.0"
author:
- fkxxyz (四叶草拼音词库)
- 吅吅大牛 (格道17键双拼布局)
# print code
for (( i=0x2194; i<=0x2199; i++ ))
do
out=$(printf "%#x\n" $i)
echo $out
done
# print table
# '\U0001f004' if 5-digit code
for code in '00a9' '00ae' '203c' '2049' '2122' '2139'
@amorphobia
amorphobia / xhyx.dict.yaml
Created July 11, 2019 05:48
小鹤音形 9.7 系统词库
# 小鹤音形 9.7_20190709 build 378 系统词库
# 删除了词库中的《静夜思》
# $ddcmd(   静夜思·李白
#
# 床前明月光,疑是地上霜。
# 举头望明月,低头思故乡。
# ,『静夜思·李白』) jysi
---
@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 / .profile.ps1
Created April 6, 2022 07:19
PowerShell Profile Script
Set-PSReadlineKeyHandler -Chord Ctrl+d -Function DeleteCharOrExit
Import-Module posh-git
Import-Module scoop-completion
Import-Module posh-cargo
$GitPromptSettings.DefaultPromptPrefix.Text = '$(Get-Date -f "yyyy-MM-dd HH:mm:ss") '
$GitPromptSettings.DefaultPromptPrefix.ForegroundColor = [ConsoleColor]::Magenta
$GitPromptSettings.DefaultPromptAbbreviateHomeDirectory = $true
$GitPromptSettings.DefaultPromptBeforeSuffix.Text = '`n'
use crate::lexer::Lexer;
pub mod token {
pub mod tag {
#[derive(Clone, Copy, Debug)]
pub enum Tag {
Char(u8),
Num,
Id,
True,
@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'+':
var FindProxyForURL = function(init, profiles) {
return function(url, host) {
"use strict";
var result = init, scheme = url.substr(0, url.indexOf(":"));
do {
result = profiles[result];
if (typeof result === "function") result = result(url, host, scheme);
} while (typeof result !== "string" || result.charCodeAt(0) === 43);
return result;
};