Skip to content

Instantly share code, notes, and snippets.

View zwzheng45's full-sized avatar

ZZW zwzheng45

View GitHub Profile
@zwzheng45
zwzheng45 / rules.json
Created December 15, 2025 00:36
Karabiner规则:fn/ctrl+ijkl to ↑←↓→
{
"description": "Map fn+ijkl and ctrl+ijkl to arrow keys",
"manipulators": [
{ "type": "basic", "from": { "key_code": "i", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "up_arrow" }] },
{ "type": "basic", "from": { "key_code": "k", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "down_arrow" }] },
{ "type": "basic", "from": { "key_code": "j", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "left_arrow" }] },
{ "type": "basic", "from": { "key_code": "l", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "right_arrow" }] },
{ "type": "basic", "from": { "key_code": "i", "modifiers": { "mandatory": ["control"], "optional": ["any"] } }, "to": [{ "key_code": "up_arrow" }] },
{ "type": "basic", "from": { "key_code": "k", "modifiers": { "mandatory": ["control"], "optional": ["any"] } }, "to": [{ "key_code": "down_arrow" }] },
@zwzheng45
zwzheng45 / auto_update_rime.sh
Last active February 18, 2026 12:20
定时同步rime词典
#!/bin/bash
REPO_DIR="/Users/zzw/GitHub/rime-fast-xhup"
TARGET_DIR="/Users/zzw/Library/Rime"
cd "$REPO_DIR" || { echo "目录不存在"; exit 1; }
pull_output="$(git pull 2>&1)" || { echo "$pull_output"; exit 1; }
dry_cn="$(rsync -ani cn_dicts/ "$TARGET_DIR/cn_dicts/" 2>&1)" || { echo "$dry_cn"; exit 1; }
@zwzheng45
zwzheng45 / scheduled_speedtest.sh
Last active April 3, 2025 06:32
定时网速监测:使用ookia的speedtest服务进行网速测试,并通过飞书Webhook推送结果
#!/usr/bin/env bash
#
# scheduled_speedtest.sh
#
# 定时网速监测
# - 使用ookia的speedtest服务进行网速测试
# - 如果大于设置的速度合格阈值,则直接退出
# - 如果未达到测速阈值,调用飞书Webhook发送警告,并进行3次补测,再将补测结果一并推送到飞书
# - 如果Webhook调用失败,会将待发送信息先保存在本地,每次运行时都会检查并尝试发送之前未成功发送的信息
# - 使用crontab等程序定时运行此脚本即可实现定时监测,如: