Skip to content

Instantly share code, notes, and snippets.

View yuxi-liu-wired's full-sized avatar

Yuxi Liu yuxi-liu-wired

View GitHub Profile
@yuxi-liu-wired
yuxi-liu-wired / kill-copilot-key.md
Created March 1, 2026 07:10
Kill the Microsoft Copilot key on Linux — make it a real RCtrl with keyd

Microsoft replaced RCtrl with a Copilot key on new laptops. The firmware sends LeftMeta+LeftShift+F23 as a burst of taps, so standard remapping doesn't work.

The fix uses keyd (https://github.com/rvaiya/keyd). Put this in /etc/keyd/default.conf:

[ids]
*

[main]
leftmeta+leftshift = overload(control, noop)
@yuxi-liu-wired
yuxi-liu-wired / erase_ascii_claude_code.py
Created February 19, 2026 23:11
Erase the ASCII art in Claude Code
#!/usr/bin/env python3
"""Patch Claude Code binary to blank all ASCII art (hat, Clawd, welcome screen).
Art characters are stored as JS unicode escapes like \\u2591 or \\u259F
(6 ASCII bytes each, mixed case hex). We replace them with spaces.
Works even while Claude Code is running via atomic rename.
Resolves the binary path from the `claude` symlink, so it's version-independent.
Tested to work on Claude Code v2.1.47
@yuxi-liu-wired
yuxi-liu-wired / sh
Created August 8, 2025 18:26
Enable IPv6s on DigitalOcean
#!/bin/bash -eu
# https://docs.digitalocean.com/products/networking/reserved-ips/how-to/manually-enable/#enable-reserved-ipv6
IFACE_ETH0="eth0"
IFACE_LO="lo"
PREFIX_LEN="128"
# get Droplet metadata
md=$(curl -s 169.254.169.254/metadata/v1.json)
@yuxi-liu-wired
yuxi-liu-wired / chromedriver_updater.py
Created March 19, 2025 20:36
Python script that downloads the latest stable chromedriver to the current folder
import os
import requests
import zipfile
import io
import shutil
from bs4 import BeautifulSoup
def find_chromedriver(root_folder):
# Recursively search for chromedriver.exe in the given folder
for dirpath, dirnames, filenames in os.walk(root_folder):
# Plots for Competitive Programming with Large Reasoning Models (2025)
import requests
from bs4 import BeautifulSoup
import matplotlib.pyplot as plt
import numpy as np
# URL with all IOI 2024 scores
url = "https://cphof.org/standings/ioi/2024"
response = requests.get(url)
@yuxi-liu-wired
yuxi-liu-wired / crlf_to_lf.sh
Last active December 4, 2023 03:32
Run this in your local Git repo to convert it from CRLF to LF ending, and make sure it *stay so*.
#!/bin/bash
git config --global core.eol lf
git config --global core.autocrlf input
echo "* text=auto eol=lf" > .gitattributes
# Find files but exclude .git directory
find . -type f ! -path '*/.git/*' | while read -r file; do
# Check if the file is a text file
if file "$file" | grep -q text; then