Skip to content

Instantly share code, notes, and snippets.

View holmeszyx's full-sized avatar

holmes zhang holmeszyx

View GitHub Profile
@holmeszyx
holmeszyx / windows_terminal_setting.json
Created July 28, 2026 02:31
terminal color schemes
{
"schemes": [
{
"name": "Desert",
"background": "#333333",
"black": "#4D4D4D",
"blue": "#CD853F",
"brightBlack": "#555555",
"brightBlue": "#87CEFF",
"brightCyan": "#FFD700",
@holmeszyx
holmeszyx / derp-dump.py
Created September 27, 2025 10:29
dump tailscale derp rule-set
import json
import urllib.error
import urllib.request
url = "https://login.tailscale.com/derpmap/default"
try:
with urllib.request.urlopen(url) as response:
charset = response.headers.get_content_charset()
if charset is None:
charset = "utf-8"
@holmeszyx
holmeszyx / share-oh-my-zsh.sh
Created August 29, 2025 08:23
share oh my zsh configuration environment from root user to other normal user.
#!/bin/bash
# share-oh-my-zsh.sh - Share oh-my-zsh configuration from root to another user
# Usage: share-oh-my-zsh.sh [target_user] [--backup]
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
@holmeszyx
holmeszyx / ln-nvim.sh
Last active March 24, 2025 08:56
bind nvim configurations
BASE_HOME=/home/ubuntu
if [ ! -d ~/.config ]; then
mkdir -p ~/.config
fi
if [ ! -d ~/.local/state ]; then
mkdir -p ~/.local/state
fi
if [ ! -d ~/.local/sharevim ]; then
mkdir -p ~/.local/share
@holmeszyx
holmeszyx / EdgeToEdge.kt
Created November 29, 2024 10:12
Standalone uitlity class, compatable with older versions Androidx. Copy it to androidx.activitycompat package to avoid conflicts.
/*
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@holmeszyx
holmeszyx / switch-java.sh
Last active March 30, 2026 01:41
Swith java version in PowerShell. Saving the script and Appending '. "C:\Path\To\Your\Script\switch-java.ps1"' to "$PROFILE" file. For git-bash, put 'test -f ~/bin/switch-java.sh && . ~/bin/switch-java.sh' to '.bash_profile'
#!/usr/bin/env bash
# Git-Bash edition of Java version switcher
# Usage: source this file in your .bashrc, then call `switch-java <version>` or `sj <version>`
# e.g. sj 21
switch-java() {
local version="$1"
# Java installation paths (git-bash style)
declare -A java_paths=(
@holmeszyx
holmeszyx / mintupg.py
Created April 29, 2024 08:16
oh-my-rime one-key upgrade
import urllib.request
import zipfile
import os
import urllib
import shutil
UPG_URL = "https://github.com/Mintimate/oh-my-rime/archive/refs/heads/main.zip"
SAVE_TMP = "mint-main.zip"
MINT_ZIP_PREFIX = "oh-my-rime-main"
/*
* Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@holmeszyx
holmeszyx / .bashrc
Created August 14, 2018 05:52 — forked from copperlight/.bashrc
Window Subsystem for Linux ssh-agent Configuraton
# ... more above ...
# wsfl bash is not a login shell
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# ssh-agent configuration
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
@holmeszyx
holmeszyx / c_blue.wsd
Last active June 25, 2018 08:05
PlantUrml theme. Modify from vscode PlantUML plugin. sytle/blue.wsd
scale 1.2
skinparam {
Default {
Font {
Name Noto Sans CJK SC
}
}
shadowing false
backgroundColor White