Skip to content

Instantly share code, notes, and snippets.

View xqm32's full-sized avatar
🎯
Focusing

Qiming Xu xqm32

🎯
Focusing
  • Hefei University of Technology
  • Hefei, China
  • 11:20 (UTC +08:00)
View GitHub Profile
@xqm32
xqm32 / alacritty.md
Last active May 7, 2024 10:23
Automatically switch color theme for Alacritty on macOS

Original issue comment: alacritty/alacritty#5999 (comment)

Run the following command to clone themes:

mkdir -p ~/.config/alacritty/themes
git clone https://github.com/alacritty/alacritty-theme ~/.config/alacritty/themes

Add the following content to ~/.config/alacritty/alacritty.toml:

#!/usr/bin/env python
# 修改所有论坛链接,需要 Python>=3.12
# 使用方法:
# uv venv
# uv pip install dotenv mwclient
# export USERNAME=你的维基账号
# export PASSWORD=你的维基密码
# .venv/bin/python edit.py
@xqm32
xqm32 / clash-config.yaml
Last active April 13, 2024 08:31
clash config with proxy-providers and rule-providers
##### 使用说明 #####
# 1. 请填写 proxy-providers - subscribe - url 为订阅链接
# 2. 下载 https://github.com/Loyalsoldier/clash-rules/archive/refs/heads/release.zip 并解压至 ./profiles/ruleset 文件夹下
# 3. 若需要自动更新 ruleset, 请编辑 rule-providers-config - type 为 http
##### 参考链接 #####
# 1. clash 样例配置文件
# https://lancellc.gitbook.io/clash/clash-config-file/an-example-configuration-file
# 2. clash 规则集
# https://github.com/Loyalsoldier/clash-rules
import { $ } from 'bun'
async function compile(code: string) {
const hasher = new Bun.CryptoHasher("sha256").update(code)
const destination = hasher.digest("hex").substring(0, 6) + ".c"
Bun.write(destination, code)
await $`gcc ${destination} -o ${destination}.out`
const output = await $`./${destination}.out`.text()
console.log(output)
}
@xqm32
xqm32 / flood-rtorrent.yaml
Last active March 17, 2024 22:24
Docker Compose for Flood.js and rTorrent
# See https://github.com/jesec/flood/discussions/120
# Access Flood and register a user with `/config/.local/share/rtorrent/rtorrent.sock` rTorrent socket path
services:
flood:
hostname: flood
image: jesec/flood:master
user: 0:0
restart: unless-stopped
command: --port 3001 --allowedpath /data
environment:

Windows Subsystem for Linux Setup

APT

Install zsh and change the login shell to zsh.

Homebrew

Install necessary zsh plugins and activate them in .zshrc.

@xqm32
xqm32 / clash-yacd.yaml
Last active February 28, 2024 08:44
Docker Compose for Clash and YACD
services:
# See https://github.com/Dreamacro/clash/wiki/Running-Clash-as-a-service#docker
clash:
# ghcr.io/dreamacro/clash
# ghcr.io/dreamacro/clash-premium
# dreamacro/clash
# dreamacro/clash-premium
image: dreamacro/clash-premium
container_name: clash-premium
volumes:
@xqm32
xqm32 / VCB.md
Last active February 20, 2024 05:42
VS Code Bugs

[Python] Unexpected virtual environment activating microsoft/vscode#180486

For workspace like:

.
├── AandB.code-workspace
├── DirA
│  ├── A.py
│ └── venvA
@xqm32
xqm32 / fish.md
Last active January 22, 2024 06:11
Fish Shell Setup
install fish and setup fish shell
install homebrew and config homebrew
use homebrew install starship and set preset to plaintext
use homebrew install pyenv and pipx
install nvm and sdkman via script
install fisher for fish shell plugin
use fisher install nvm.fish and sdkman-for-fish
@xqm32
xqm32 / GLFH.md
Created December 19, 2023 14:40
Graceful Launch for HMCL