Skip to content

Instantly share code, notes, and snippets.

View fiddlemath's full-sized avatar

Matt Elder fiddlemath

View GitHub Profile
#!/bin/bash -eoux pipefail
# Very very roughly, list a Mac's installed applications and their versions
# Output is nearly a valid CSV file, you might need to tweak it a little
for infile in /Applications/*/Contents/Info.plist ; do
name=$(plutil -extract CFBundleName raw "${infile}")
if [[ "$name" =~ .*"Could not extract value".* ]]; then
name=${infile#/Applications/}
name=${name%/Contents/Info.plist}
@fiddlemath
fiddlemath / stRSR.py
Last active November 16, 2021 03:13
Python-ish pseudocode for O(1) RSR staking setup
@dataclass
class CumulativeWithdrawal:
amount: int # total number of gray shares available
when_avail: int # timestamp when they'll become available
class stRSR:
def pool_rate() = total_pool_rsr / total_pool_shares #{ RSR / pool_share }
def gray_rate() = total_gray_rsr / total_gray_shares #{ RSR / gray_shares }
def __init__(self):

Keybase proof

I hereby claim:

  • I am fiddlemath on github.
  • I am fiddlemath (https://keybase.io/fiddlemath) on keybase.
  • I have a public key ASCtX-xKl1Eac1Y6QNPWYmMBlN_wTcPcN3C1p3SaJmMthwo

To claim this, I am signing this object:

0x9132ef3be807fe4339837f68ce0a7e0747a2f4cc