Skip to content

Instantly share code, notes, and snippets.

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

Yihang Huang PekingSpades

🏠
Working from home
  • Peking University
  • Beijing, China
  • 05:49 (UTC +08:00)
View GitHub Profile
@PekingSpades
PekingSpades / DragDropHintWindow.xaml
Created November 29, 2025 05:04 — forked from nilaoda/DragDropHintWindow.xaml
Detect Windows Drag&Drop Event using UIAutomationClient. Code generated by gemini. 监测Windows文件拖动事件
<Window x:Class="SystemDrag.DragDropHintWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="DragDropHintWindow"
Height="60" Width="250"
AllowsTransparency="True"
WindowStyle="None"
Topmost="True"
Background="#CC000000"
Foreground="White"
@PekingSpades
PekingSpades / compress.go
Created December 11, 2024 13:58
Compress multiple files and folders using go
// zipFiles 将指定目录下的文件和文件夹打包成一个ZIP归档文件。
//
// 参数:
// dir string - 必须是一个绝对路径的文件夹路径。
// files []string - 只能包含dir目录下的文件夹名称或文件名称。
//
// 返回值:
// string - 生成的ZIP文件的名称。
// error - 如果过程中发生错误,返回相应的错误信息。
func zipFiles(dir string, files []string) (string, error) {