Skip to content

Instantly share code, notes, and snippets.

View xqm32's full-sized avatar
🎯
Focusing

Qiming Xu xqm32

🎯
Focusing
View GitHub Profile
@xqm32
xqm32 / notes.md
Last active December 11, 2023 08:23
@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 / PPP.md
Last active December 6, 2023 09:19
Python Project Practice

This practice is for Unix

Python Environment Preparation

Tools Installation

  1. Use [Homebrew] to install [Pipx]
  2. Use Pipx to install [Poetry] and [Tox]
  3. Use Homebrew (or official installer) to install [Pyenv] and [Pyenv-virtualenv]
import json
from typing import Any, List
from httpx import Client
class CardSquare:
"""
https://webstatic.mihoyo.com/ys/event/bbs-lineup-qskp/index.html#/pc/publish
"""
@xqm32
xqm32 / symlink.sh
Last active November 9, 2023 06:35
for dir in */; do
if [ ! -d "${dir}.git" ]; then
continue
fi
pushd ${dir} > /dev/null
echo ${dir}$(git branch --show-current)
git pull
popd > /dev/null
done
@xqm32
xqm32 / gacha.rs
Last active November 15, 2023 05:05
use rand::{rngs::ThreadRng, Rng};
const U5C_W: [i32; 90] = [
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,
9660, 10260,
];
const U4C_W: [i32; 10] = [510, 510, 510, 510, 510, 510, 510, 510, 5610, 10710];
@xqm32
xqm32 / lcmd.py
Last active August 20, 2023 05:24
LeetCode Markdown Committer
import datetime
import json
import os
import re
import subprocess
import sys
import textwrap
from typing import Self
@xqm32
xqm32 / wam.ahk
Last active July 17, 2023 13:26
Use macOS-style Keymap on Windows
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Reference https://medium.com/@chrisdhanaraj/mapping-your-macos-keybinds-to-windows-b6009c50065b
; Option Key Shortcuts
<!BS::Send {LCtrl Down}{BackSpace}{LCtrl Up}
<!Left::Send {LCtrl Down}{Left}{LCtrl Up}
@xqm32
xqm32 / far.yaml
Created March 11, 2023 08:02
Flood, Alist and RTorrent Docker Compose File
services:
# See https://github.com/jesec/flood/discussions/120
# Access Flood and register a user with `/config/.local/share/rtorrent/rtorrent.sock` rTorrent socket path
flood:
hostname: flood
image: jesec/flood:master
user: 0:0
restart: unless-stopped
command: --port 3001 --allowedpath /data
environment: