Skip to content

Instantly share code, notes, and snippets.

View ManiaciaChao's full-sized avatar
🐧
I'm just a penguin :P

Mani Penguin ManiaciaChao

🐧
I'm just a penguin :P
View GitHub Profile
@ManiaciaChao
ManiaciaChao / llm-cmp.fish
Created March 21, 2025 05:20
LLM command auto-completion
bind \e\\ __llm_cmd
# run `cargo install llm` to get `llm` command available
# system prompt is borrowed and modified from https://github.com/CGamesPlay/llm-cmd-comp/blob/main/llm_cmd_comp.py
function __llm_cmd -d "Fill in the command using an LLM"
set -l __system_prompt "Return only the command to be executed as a raw string, no string delimiters wrapping it, no yapping, no markdown, no fenced code blocks, what you return will be passed to the shell directly.
For example, if the user asks: undo last git commit
You return only: git reset --soft HEAD~1
The shell is $(which fish) on $(uname)"
@ManiaciaChao
ManiaciaChao / .config
Created March 5, 2023 13:03
LEDE compile config
#
# Automatically generated file; DO NOT EDIT.
# OpenWrt Configuration
#
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
CONFIG_HOST_OS_LINUX=y
# CONFIG_HOST_OS_MACOS is not set
# CONFIG_TARGET_airoha is not set
# CONFIG_TARGET_sunxi is not set
@ManiaciaChao
ManiaciaChao / HustGraduPaper.cls
Last active September 26, 2022 02:54
修正主义 HUST CS TeX 模板样式
%
% HustGraduPaper.sty
% 本文件是华中科技大学本科生毕业论文模板
% @author skinaze
% @maintainer maniacata
% @date 2018/03/19
% @version v2.2.1
%
% 本模板遵循MIT License
%
@ManiaciaChao
ManiaciaChao / PKGBUILD
Created May 27, 2022 09:20
PKGBUILD for liblog4cxx 12
# Maintainer: Akkenoth <akkenoth+aur [at] google [dot] com>
pkgname=log4cxx-git
_pkgname=log4cxx
pkgver=20181214
pkgrel=1
pkgdesc="A C++ port of Log4j, development version (GIT)"
url="http://logging.apache.org/log4cxx"
license=("Apache")
groups=()
depends=('apr-util' 'libxml2')
@ManiaciaChao
ManiaciaChao / taichi.html
Created November 18, 2020 11:35
Draw a Taichi symbol with CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Taichi</title>
<style>
.taichi {
width: 400px;
height: 400px;
@ManiaciaChao
ManiaciaChao / readme.md
Last active April 2, 2020 16:50
thunderbird theme with icons

Readme

Extract it to ~/.thunderbird/{YOUR PROFILE}/chrome and restart thunderbird.

@ManiaciaChao
ManiaciaChao / .bashrc
Created March 17, 2020 07:53
Get windows host ip in WSL2
# if your default shell is bash, then add this to your .bashrc
export winhost=`grep -G '^nameserver' /etc/resolv.conf | awk '{print $2}'`
@ManiaciaChao
ManiaciaChao / request-compat.js
Created March 12, 2020 06:43
make `fetch` API compatible with deprecated `request` library
import { URLSearchParams } from 'url'
/**
* @description for Map<string, any> only
* @param {Map} map
*/
export const mapToObj = map =>
Array.from(map).reduce(
(obj, [key, value]) => Object.assign(obj, { [key]: value }),
{}
@ManiaciaChao
ManiaciaChao / article-style.css
Last active August 13, 2024 15:13 — forked from bangedorrunt/article-style.css
GoldenDict Arc Dark Theme
/* mkdir ~/.goldendict/styles/arc-dark/
then put this stylesheet there */
body {
margin-top: 1px;
margin-right: 3px;
margin-left: 2px;
margin-bottom: 3px;
background: #4b5162;
color: white;
font-family: Noto Serif CJK SC, Noto Serif, Bookerly, Segoe UI,