Skip to content

Instantly share code, notes, and snippets.

View glyh's full-sized avatar
🦎
Made with LISP

Yihang Liu glyh

🦎
Made with LISP
View GitHub Profile
@glyh
glyh / vector_types.h
Last active April 3, 2024 07:51
vector_types.h
/*
* Copyright 1993-2018 NVIDIA Corporation. All rights reserved.
*
* NOTICE TO LICENSEE:
*
* This source code and/or documentation ("Licensed Deliverables") are
* subject to NVIDIA intellectual property rights under U.S. and
* international Copyright laws.
*
* These Licensed Deliverables contained herein is PROPRIETARY and
```lua
-- this template is borrowed from nvim-lspconfig
local on_windows = vim.loop.os_uname().version:match("Windows")
local function join_paths(...)
local path_sep = on_windows and "\\" or "/"
local result = table.concat({ ... }, path_sep)
return result
end
-- this template is borrowed from nvim-lspconfig
local on_windows = vim.loop.os_uname().version:match("Windows")
local function join_paths(...)
local path_sep = on_windows and "\\" or "/"
local result = table.concat({ ... }, path_sep)
return result
end
vim.cmd([[set runtimepath=$VIMRUNTIME]])
@glyh
glyh / emojis
Last active February 4, 2022 13:22
emojis
// =============================================================================
//
// Waybar configuration
//
// Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
//
// =============================================================================
{
// -------------------------------------------------------------------------
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
(ros:ensure-asdf)
#+quicklisp(ql:quickload '(swank com.google.base asdf uiop cffi unix-opts) :silent t))
(in-package :cl)
-- this template is borrowed from nvim-lspconfig
local on_windows = vim.loop.os_uname().version:match("Windows")
local function join_paths(...)
local path_sep = on_windows and "\\" or "/"
local result = table.concat({ ... }, path_sep)
return result
end
vim.cmd([[set runtimepath=$VIMRUNTIME]])
@glyh
glyh / rifle.conf
Created January 3, 2022 00:44
rifle.conf
# vim: ft=cfg
#
# This is the configuration file of "rifle", ranger's file executor/opener.
# Each line consists of conditions and a command. For each line the conditions
# are checked and if they are met, the respective command is run.
#
# Syntax:
# <condition1> , <condition2> , ... = command
#
# The command can contain these environment variables:
@glyh
glyh / indent.nim
Created December 24, 2021 05:05
Indent Parser in Lark
import nimpy, ./macros # the macros in the other GIST
assert(pyImport("sys").version_info.major.to(int) >= 3)
let
lark = pyImport("lark")
idt = pyImport("lark.indenter")
tree_grammar = """
?start: _NL* tree
tree: NAME _NL [_INDENT tree+ _DEDENT]
@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