Skip to content

Instantly share code, notes, and snippets.

View casouri's full-sized avatar
💭
I may be slow to respond.

Yuan Fu casouri

💭
I may be slow to respond.
View GitHub Profile
@casouri
casouri / greek-text-substitution.plist
Last active July 14, 2023 11:48
Greek text substitution for mac user dictionary.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>phrase</key>
<string>Α</string>
<key>shortcut</key>
<string>alpha</string>
</dict>
@casouri
casouri / Keyboard-en.plist
Last active October 10, 2020 02:28
greek letter press and hold for mac,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Roman-Accent-f</key>
<dict>
<key>Direction</key>
<string>right</string>
<key>Strings</key>
<string>α β γ δ ε η θ </string>
@casouri
casouri / unlit.el
Created September 27, 2018 01:52
UiKit
;;; uikit.el --- UI kit for Emacs
;;; Commentary:
;;
;;; Code:
;;
(require 'eieio-base)
@casouri
casouri / README.org
Last active August 10, 2021 12:40
simple custom flymake modeline

Modified from flymake--mode-line-format. I only used diags-by-type, you can do stuff with known, running, disabled, etc.

I use unicode for each type of diagnose, flymake-error/warning/note-bitmap would be intersting to use, too.

Don’t read source of flymake--mode-line-format, your sanity will drop.

还可以用汉字代替unicode符号,比如“死”,“警”,“意”对应“error”,“warning”和“note”。 用汉字的话建议在汉字和数字之间加半个空格: M-x insert-char RET thin space RET

@casouri
casouri / Portfile
Created December 3, 2019 02:57
Portfile for v2ray
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
name v2ray
version 4.21.3
categories net security
platforms darwin
license MIT
maintainers {@casouri gmail.com:casouri}
@casouri
casouri / lambda.el
Created December 25, 2019 23:25
Untyped lambda calculus
;; Term = (Var index context-size)
;; | (Abs term bound-var-name)
;; | (App term term)
;; Context = [(name, _)]
(defun var-name (context-elm)
"Get name of CONTEXT-ELM."
(car context-elm))
(defun add-var (var context)
This file has been truncated, but you can view the full file.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This is the GNU Emacs Lisp Reference Manual
corresponding to Emacs version 27.0.60.
Copyright © 1990-1996, 1998-2020 Free Software Foundation,
Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@casouri
casouri / new-wrap.patch
Created May 28, 2020 17:40
中英文折行
From f7c58ba4f67a7c8bcffbb7b7077b10fd944471eb Mon Sep 17 00:00:00 2001
From: Yuan Fu <casouri@gmail.com>
Date: Tue, 26 May 2020 22:47:27 -0400
Subject: [PATCH] checkpoint
---
src/xdisp.c | 131 ++++++++++++++++++++++++++++++++++++----------------
1 file changed, 92 insertions(+), 39 deletions(-)
diff --git a/src/xdisp.c b/src/xdisp.c
(unless (boundp 'undo--last-change-was-undo-p)
(defun undo--last-change-was-undo-p (undo-list)
(while (and (consp undo-list) (eq (car undo-list) nil))
(setq undo-list (cdr undo-list)))
(gethash undo-list undo-equiv-table))
(defun undo-redo (&optional arg)
"Undo the last ARG undos."
(interactive "*p")
(cond
This file has been truncated, but you can view the full file.
/* Display generation from window structure and buffer text.
Copyright (C) 1985-1988, 1993-1995, 1997-2020 Free Software Foundation,
Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at