Skip to content

Instantly share code, notes, and snippets.

View glyh's full-sized avatar
🐫
Made with OCaml

Yihang "Corvo" Liu glyh

🐫
Made with OCaml
  • o1Labs
  • 22:58 (UTC +08:00)
View GitHub Profile
@glyh
glyh / macros.nim
Last active December 24, 2021 05:43
Macros for subclassing in nimpy
import nimpy, std/macros, ast_pattern_matching, sequtils, unittest, strutils
let py = pyBuiltinsModule()
macro pyInjectMethods*(obj, memFuncs: untyped): untyped =
obj.expectKind nnkIdent
memFuncs.expectKind nnkStmtList
var stmts = newStmtList()
for mem_func in memFuncs.children:
memFunc.matchAst:
@glyh
glyh / cfg.json
Created November 23, 2021 05:57
tridactyl config
{"configversion":"2.0","nmaps":{"/":"fillcmdline find","?":"fillcmdline find -?","N":"findnext -1",",<Space>":"nohlsearch","n":"findnext 1","j":"scrollpage 0.5","s":"scrollpage 0.5","d":"scrollpage -0.5","x":"tabclose","a":"hint -b","m":"bmark","h":"tabprev","l":"tabnext",";x":"hint -F e => { const pos = tri.dom.getAbsoluteCentre(e); tri.excmds.exclaim_quiet(\"xdotool mousemove --sync \" + window.devicePixelRatio * pos.x + \" \" + window.devicePixelRatio * pos.y + \"; xdotool click 1\")}",";X":"hint -F e => { const pos = tri.dom.getAbsoluteCentre(e); tri.excmds.exclaim_quiet(\"xdotool mousemove --sync \" + window.devicePixelRatio * pos.x + \" \" + window.devicePixelRatio * pos.y + \"; xdotool keydown ctrl+shift; xdotool click 1; xdotool keyup ctrl+shift\")}","<A-p>":"pin","<A-m>":"mute toggle","<F1>":"help","o":"fillcmdline open","O":"current_url open","w":"fillcmdline winopen","W":"current_url winopen","t":"fillcmdline tabopen","]]":"followpage next","[[":"followpage prev","[c":"urlincrement -1","]c":"urlinc
@glyh
glyh / config.rasi
Created August 5, 2021 08:21
rofi config
/*
*
* Author : Aditya Shakya
* Mail : [email protected]
* Github : @adi1090x
* Twitter : @adi1090x
*
*/
configuration {
rofi usage:
rofi [-options ...]
Command line only options:
-no-config Do not load configuration, use default values.
-v,-version Print the version number and exit.
-dmenu Start in dmenu mode.
-display [string] X server to contact.
${DISPLAY}
-h,-help This help message.