Skip to content

Instantly share code, notes, and snippets.

View edavis's full-sized avatar
💭
I may be slow to respond.

Eric Davis edavis

💭
I may be slow to respond.
View GitHub Profile
@edavis
edavis / gist:332677769ff97521f9bdd7c6a54a392c
Last active March 29, 2025 00:04
plain text baseball scorekeeping
https://www.retrosheet.org/ex-sheet.htm
subs and pitchers not well supported
0 1 2 3 4 5 6 7 8 9 1 1 2 3 4
012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
: : : : : : : : : : : : : : : : : : : : 4
: : : : : : : : : : : : : : : : 5
: : : : : : : : : : 8
: : : : : : : : 10
* Migration
** Blank env
export INVITECODE=
export ACCOUNTDID=did:plc:XXX
export OLDPDSHOST=https://bsky.social
export OLDPDSSERVICEDID=did:web:bsky.social
export OLDHANDLE=
export OLDPASSWORD=""
export NEWPDSHOST=https://pds.merklehost.xyz
export NEWPDSSERVICEDID=did:web:pds.merklehost.xyz
@edavis
edavis / gist:7c4de3f179f56d25e3579d058cb4eb3b
Created September 25, 2024 21:03
First 10 entries from plc.directory/export
{"did":"did:plc:ragtjsm2j2vknwkz3zp4oxrd","operation":{"sig":"DyaPWDItkJnVkN1izINSW-fdjUzP9BkIKlD7SnzD5axfK_870ZZ-1EYcrQLQtP9VkWcp2cdbyIHprjPfeUs8WQ","prev":null,"type":"create","handle":"paul.bsky.social","service":"https://bsky.social","signingKey":"did:key:zQ3shP5TBe1sQfSttXty15FAEHV1DZgcxRZNxvEWnPfLFwLxJ","recoveryKey":"did:key:zQ3shhCGUqDKjStzuDxPkTxN6ujddP4RkEKJJouJGRRkaLGbg"},"cid":"bafyreieibu2mtgsovktnswo6l7dv4i4ztioutzpsy7wsasmbznzqxkpyje","nullified":false,"createdAt":"2022-11-17T00:35:16.391Z"}
{"did":"did:plc:l3rouwludahu3ui3bt66mfvj","operation":{"sig":"HIAolK_uyrcg8a6CqBT_taoF0AJ6HAwy70hutFGVM54j20rTe90MH---pm6aoe5CsiIm6khqgbr5_Aj7F3rptA","prev":null,"type":"create","handle":"divy.bsky.social","service":"https://bsky.social","signingKey":"did:key:zQ3shP5TBe1sQfSttXty15FAEHV1DZgcxRZNxvEWnPfLFwLxJ","recoveryKey":"did:key:zQ3shhCGUqDKjStzuDxPkTxN6ujddP4RkEKJJouJGRRkaLGbg"},"cid":"bafyreic64lvfs5ayb5g5cgym7xtbnkpcr6g42reni7n3c7r7i547w7wfoa","nullified":false,"createdAt":"2022-11-17T00:39:19.084Z"}
@edavis
edavis / gist:0daf6c11c196c9b5cf8fdc1afcd87312
Created September 4, 2024 17:40
"View in Astrolabe" bookmarklet
javascript:(function(){
var currentUrl = window.location.href;
var newUrl = currentUrl
.replace('https://bsky.app/profile/', 'https://astrolabe.edavis.dev/at/')
.replace('/post/', '/app.bsky.feed.post/');
window.open(newUrl, '_blank');
})();
@edavis
edavis / gist:a168dced532d1f5ef4ca314cab605379
Created August 20, 2024 16:26
The last instant of every TID by unique two-letter start
22zzzzzzzzz22 1971-02-12T05:26:12.088Z
23zzzzzzzzz22 1972-03-25T10:52:24.177Z
24zzzzzzzzz22 1973-05-06T16:18:36.266Z
25zzzzzzzzz22 1974-06-17T21:44:48.355Z
26zzzzzzzzz22 1975-07-30T03:11:00.444Z
27zzzzzzzzz22 1976-09-09T08:37:12.532Z
2azzzzzzzzz22 1977-10-21T14:03:24.621Z
2bzzzzzzzzz22 1978-12-02T19:29:36.710Z
2czzzzzzzzz22 1980-01-14T00:55:48.799Z
2dzzzzzzzzz22 1981-02-24T06:22:00.888Z
@edavis
edavis / gist:35a65aa76cf58ce45f8d012e59373f2e
Last active August 20, 2024 19:52
Timestamp of when every "3*" TID begins
3222222222222 2005-09-05T05:58:26.842Z
3322222222222 2006-10-17T11:24:38.931Z
3422222222222 2007-11-28T16:50:51.020Z
3522222222222 2009-01-08T22:17:03.109Z
3622222222222 2010-02-20T03:43:15.197Z
3722222222222 2011-04-03T09:09:27.286Z
3a22222222222 2012-05-14T14:35:39.375Z
3b22222222222 2013-06-25T20:01:51.464Z
3c22222222222 2014-08-07T01:28:03.553Z
3d22222222222 2015-09-18T06:54:15.642Z
sudo port install rbenv ruby-build
rbenv install 2.7.6
rbenv global 2.7.6
eval "$(rbenv init - bash)"
cd social-web
bundler install
nvm use # v18
corepack enable # this makes yarn available
yarn exec env # smoketest for yarn
@edavis
edavis / if_rx_eth0.sh
Created January 21, 2024 04:40
Graph rx and tx separately in munin. Taken from the core if_ plugin but simplified down.
#!/bin/bash
INTERFACE="eth0"
case $1 in
config)
echo "graph_title $INTERFACE rx traffic"
echo 'graph_args --base 1000'
echo 'graph_category network'
echo 'traffic.label rx'
@edavis
edavis / torrent-sum.py
Created November 23, 2023 06:48
Parse a directory of torrent files and return the total size of all files within
#!/usr/bin/env python
import os, glob
from io import BytesIO
class End(Exception): pass
def decode(stream):
delim = stream.read(1)
@edavis
edavis / bsky_firehose_standalone.py
Created September 23, 2023 04:58 — forked from DavidBuchanan314/bsky_firehose_standalone.py
This is not production quality code, several corners have been cut, etc. etc.
import io
import base64
import struct
import hashlib
import asyncio
import websockets
from enum import Enum
# ground control to major type