Skip to content

Instantly share code, notes, and snippets.

Mark Lewis ThuggishNuggets

  • Austin, TX
Block or report user

Report or block ThuggishNuggets

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ThuggishNuggets
ThuggishNuggets / pwrstat.sh
Created May 3, 2019
GPD Pocket Linux Charge Status
View pwrstat.sh
#!/bin/bash
voltage() { cat /sys/class/power_supply/fusb302-typec-source/voltage_now; }
voltage_actual() { cat /sys/class/power_supply/max170xx_battery/voltage_now; }
current_actual() { cat /sys/class/power_supply/max170xx_battery/current_now; }
current() { cat /sys/class/power_supply/fusb302-typec-source/current_max; }
current_limit() { cat /sys/class/power_supply/bq24190-charger/input_current_limit; }
capacity() { cat /sys/class/power_supply/max170xx_battery/capacity; }
echo "Voltage: $(expr `voltage` / 1000000)V DC"
echo "Voltage (actual): $(echo 'scale=2; '$(voltage_actual)'/1000000' | bc)V DC"
@ThuggishNuggets
ThuggishNuggets / instructions.markdown
Last active Sep 29, 2017
A post-checkout/post-merge hook for running pod install if necessary after checking out a branch or merging changes
View instructions.markdown

pod install, post-checkout & post-merge

Keep your installed pods up-to-date between branch checkouts! This is a git post-checkout hook for running a pod install if necessary when a checkout event happens in your local working git repository.

Install with

curl https://gist.github.com/ThuggishNuggets/7a2013189e42f52a5bc22a3f66c99c2a/raw/a872173642d9f7c4b0805ef5e76a231155879789/pod-install-post-checkout-hook > .git/hooks/post-checkout
chmod +x .git/hooks/post-checkout

curl https://gist.github.com/ThuggishNuggets/7a2013189e42f52a5bc22a3f66c99c2a/raw/a872173642d9f7c4b0805ef5e76a231155879789/pod-install-post-checkout-hook > .git/hooks/post-merge
@ThuggishNuggets
ThuggishNuggets / Zephyr.swift
Created Jun 7, 2017
Variadic Function Overload Workaround
View Zephyr.swift
// ... more code ...
public static func sync(keys: String...) {
sync(keys: keys)
}
public static func sync(keys: [String]) {
switch sharedInstance.dataStoreWithLatestData() {
You can’t perform that action at this time.