Skip to content

Instantly share code, notes, and snippets.

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

Peter Miles petermiles

🏠
Working from home
View GitHub Profile
@petermiles
petermiles / battery-history
Last active August 18, 2026 15:41
battery-history — historical macOS battery usage from pmset + system_profiler (no deps)
#!/usr/bin/env python3
"""battery-history — historical battery usage for macOS.
Data sources (no third-party dependencies):
* `pmset -g log` -> charge % samples over time (weeks of history)
* `system_profiler SPPowerDataType` -> current health / adapter
Everything is derived from the "Using AC/Batt(Charge: N)" samples that
macOS power management writes to its log.
"""
@petermiles
petermiles / cloudSettings
Created October 5, 2018 01:37
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-10-05T01:36:00.479Z","extensionVersion":"v3.1.2"}