This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Mac Power Monitor - Real-time power consumption dashboard for macOS | |
| Features: | |
| - Dynamic power detection (supports any charger wattage) | |
| - Hardware telemetry: CPU/GPU/ANE (measured), Memory/Storage/Network/Screen (estimated) | |
| - Application power analysis with proportional allocation | |
| - Smart battery status detection (optimized charging, insufficient power warnings) | |
| - Cross-validation using multiple data sources (ioreg, powermetrics, system_profiler) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{ | |
| default: Turndown | |
| }, { | |
| default: Readability | |
| }]) => { | |
| /* Optional vault name */ | |
| const vault = ""; | |
| /* Optional folder name such as "Clippings/" */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public protocol ReusableView: class { } | |
| extension ReusableView where Self: UIView { | |
| public static var reuseIdentifier: String { | |
| return String(describing: self) | |
| } | |
| } | |
| extension UITableViewCell: ReusableView { } | |
| extension UITableViewHeaderFooterView: ReusableView { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension UIView { | |
| public func addSubviews(_ subviews: [UIView], tAMIC: Bool = false) { | |
| for subview in subviews { | |
| addSubview(subview) | |
| subview.translatesAutoresizingMaskIntoConstraints = false | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension UIView { | |
| @discardableResult | |
| public func constrainEdges(to view: UIView) -> [NSLayoutConstraint] { | |
| let constraints = [ | |
| leadingAnchor.constraint(equalTo: view.leadingAnchor), | |
| topAnchor.constraint(equalTo: view.topAnchor), | |
| trailingAnchor.constraint(equalTo: view.trailingAnchor), | |
| bottomAnchor.constraint(equalTo: view.bottomAnchor) | |
| ] | |
| NSLayoutConstraint.activate(constraints) |