Skip to content

Instantly share code, notes, and snippets.

View xqm32's full-sized avatar
🎯
Focusing

Qiming Xu xqm32

🎯
Focusing
View GitHub Profile
const std = @import("std");
const B = u64;
const D = enum(u2) { l, r, u, d };
const K = union(enum) { m: D, u, r, q, n };
const M = struct { b: B, s: u32 };
const R = packed struct(u64) { r: u16, s: u32, _: u16 = 0 };
const T = mk();
const S = sk();
@xqm32
xqm32 / wst
Last active April 20, 2026 10:15
#!/usr/bin/env -S uv run --script --quiet
# /// script
# requires-python = ">=3.14"
# dependencies = [
# "rich>=14.3.3",
# ]
# ///
from json import dumps
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Micro Drift (Osmos-like)</title>
<style>
html, body {
margin: 0;
height: 100%;
{
"$defs": {
"GroupConfig": {
"properties": {
"name": {
"anyOf": [{ "type": "string" }, { "type": "null" }],
"default": null,
"title": "Name"
},
"schedule": {
@xqm32
xqm32 / wsc
Last active April 2, 2026 10:03
#!/usr/bin/env -S uv run --script --quiet
# /// script
# requires-python = ">=3.13"
# dependencies = []
# ///
import json
from pathlib import Path
import shutil
@xqm32
xqm32 / gacha.go
Created February 21, 2025 16:09
Gacha
package gacha
import "math/rand/v2"
var (
Char5Prob = []int{
60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 660, 1260, 1860, 2460, 3060, 3660, 4260, 4860, 5460, 6060, 6660, 7260, 7860, 8460, 9060,
package style
import (
"os"
"github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/lipgloss/table"
"github.com/samber/lo"
"golang.org/x/term"
)
@xqm32
xqm32 / minesweeper.go
Created August 21, 2024 07:10
Minesweeper Game in Go
package main
import (
"math/rand/v2"
"strconv"
)
// The game config
type Config struct {
Width int
#!/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 / alacritty.md
Last active May 30, 2025 12:39
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: