Skip to content

Instantly share code, notes, and snippets.

View mcfans's full-sized avatar
🏠
Working from home

mcfans

🏠
Working from home
View GitHub Profile
@mcfans
mcfans / case-screen.py
Created July 25, 2026 07:26
关闭机箱面板
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
case-screen.py — Linux 下开关机箱屏幕 (MacroSilicon ms912x, VID 345f PID 9132,
"USB Display / usb extscreen", Myth.Cool / 瓦尔基里等机箱副屏方案)
用法:
python3 case-screen.py off 关屏 (断电 + 关背光)
python3 case-screen.py on 点亮 (恢复供电 + 背光; 画面需程序推流, 无推流时为黑屏/残帧)
python3 case-screen.py probe 打印设备寄存器状态 (诊断用)
@mcfans
mcfans / Gradient.swift
Created December 7, 2020 08:30
UIView Animate Gradient
class GradientView: UIView {
var color: UIColor
init(_ color: UIColor) {
self.color = color
super.init(frame: .zero)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")