Skip to content

Instantly share code, notes, and snippets.

View ThuggishNuggets's full-sized avatar
👨‍🚀
Oye beltalowda!

Mark Lewis ThuggishNuggets

👨‍🚀
Oye beltalowda!
  • Austin, TX
View GitHub Profile
@ThuggishNuggets
ThuggishNuggets / Zephyr.swift
Created June 7, 2017 20:46
Variadic Function Overload Workaround
// ... more code ...
public static func sync(keys: String...) {
sync(keys: keys)
}
public static func sync(keys: [String]) {
switch sharedInstance.dataStoreWithLatestData() {
@ThuggishNuggets
ThuggishNuggets / instructions.markdown
Last active September 29, 2017 22:20
A post-checkout/post-merge hook for running pod install if necessary after checking out a branch or merging changes

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 / pwrstat.sh
Created May 3, 2019 17:34
GPD Pocket Linux Charge Status
#!/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 / .ghci
Created March 18, 2020 17:54
GHCi Configuration
:set prompt "\ESC[1;33m%s\n\ESC[0;33mλ: \ESC[m"
:def Q const . return $ ":q"
:def clear const . return $ ":! clear"
:def cls const . return $ ":! clear"
:def hlint const . return $ ":! hlint \"src\""
:def hoogle \s -> return $ ":! hoogle --count=15 \"" ++ s ++ "\""