Skip to content

Instantly share code, notes, and snippets.

View XueshiQiao's full-sized avatar
🕶️
WebRTC

xueshi XueshiQiao

🕶️
WebRTC
View GitHub Profile
@XueshiQiao
XueshiQiao / chrome-clear-saved-tab-groups.mjs
Last active April 11, 2026 03:09
Bulk list & delete all saved tab groups from Chrome on macOS (no extension API available — works by reading/writing Chrome's internal LevelDB)
#!/usr/bin/env node
/**
* Chrome Saved Tab Groups Manager
* ================================
* Bulk list and delete all saved tab groups from a Chrome profile on macOS.
*
* Chrome does NOT expose saved tab groups to extensions or DevTools there is
* no public API for this. This script works by directly reading/writing the
* LevelDB that Chrome Sync uses internally.
@XueshiQiao
XueshiQiao / qclaw.js
Created March 10, 2026 02:42
qclaw.js
// add these into you Surge config file.
//
//[MITM]
//hostname = jprx.m.qq.com
//
//[Script]
//qclaw_invite_bypass = type=http-response,pattern=^https:\/\/jprx\.m\.qq\.com\/data\/4056\/forward,requires-body=1,max-size=0,script-path=qclaw_bypass.js
// qclaw_bypass.js
@XueshiQiao
XueshiQiao / windows_config_for_cs2.md
Last active June 10, 2025 15:17
Windows Configuration for CS2

My Configurations

@XueshiQiao
XueshiQiao / macOS-like-keyboard.ahk
Last active April 12, 2025 05:41
在 Windows 上模拟 macOS 的快捷键体验 + Vim 体验
#Requires AutoHotkey v2.0
; recommended for performance and compatibility with future autohotkey releases.
#UseHook
#SingleInstance force
InstallKeybdHook()
SendMode "Input"
/**
@XueshiQiao
XueshiQiao / index.html
Last active August 31, 2024 03:12
Play streamed pcm on browser
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PCM to MP3 Player (with Queue and Delay)</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lamejs/1.2.0/lame.min.js"></script>
</head>
<body>
@XueshiQiao
XueshiQiao / joey_archlinux.toml
Last active May 7, 2024 08:43
Linux_evremap_config
# Config file for evremap (https://github.com/wez/evremap)
# usage:
# sudo target/release/evremap remap /path/to/joey_archlinux.toml
# device_name = "AT Translated Set 2 keyboard"
device_name = "Apple Inc. Magic Keyboard with Touch ID"
# add phys when multiple device_name with same name exists
phys = "usb-0000:02:00.0-6/input1"
# Hold capslock for ctrl, tap for esc
@XueshiQiao
XueshiQiao / run_whisper.sh
Last active March 27, 2024 08:46
Run Whisper
# whisper https://github.com/openai/whisper
# 使用GPU做ASR,因为 1080 显存限制,使用medium比较合适(medium 使用约 5G 显存,大于 10G 显存可以用 large)
# T4 GPU,16G 显存,跑 meidum 时耗比大概 0.36(303 秒的音频用了 108s),显存占用 4.8G,显卡利用率在 85% 左右
# --word_timestamps True --highlight_words True 显示 word-level 的时间戳(不加为 sentence-level)
whisper --model medium --language Chinese --verbose True --word_timestamps True --highlight_words True .\download.mp4
# 使用 CPU
whisper --device cpu --threads 10 --model large --language Chinese --verbose True --word_timestamps True --highlight_words True .\download2.mp4
#include <iostream>
#include <functional>
using namespace std;
// -std=c++17
template <typename In, typename Out>
class Filter {
public:
@XueshiQiao
XueshiQiao / .Xmodmap
Last active August 9, 2022 06:33
Global Vim-like Arrow Mapping configuration using xmodmap on Ubuntu
! ref: https://wiki.archlinux.org/title/Xmodmap
! exec: xmodmap ~/.Xmodmap
! Set Keyboard::Dispatch to 'keyCode' in VSCode, otherwise capslock remapping does't work
! ref: https://github.com/microsoft/vscode/issues/23991
! auto startup with system:
! add following command to 'Startup Applications Preferences' app on Ubuntu
! /bin/bash -c 'xmodmap /home/xueshi/.Xmodmap'
clear lock
! Map Caplock key to Mode_switch key, we use it as 'Hyper' key later
@XueshiQiao
XueshiQiao / cpp_move.cpp
Last active February 12, 2021 17:48
C++ std:move usage sample
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
class SimpleString {
public:
SimpleString(int s, const char* content): size(s+1), string(new char[s+1]) {
for (int i = 0; i < size - 1; i++) {