Skip to content

Instantly share code, notes, and snippets.

@fragglet
fragglet / authsock.sh
Last active June 26, 2022 19:30
Track and update SSH_AUTH_SOCK after reconnecting via ssh. Add this to your .bashrc
add_authsock() {
if [[ -L "$SSH_AUTH_SOCK" || ! -e "$SSH_AUTH_SOCK" ]]; then
return
fi
local f c i
mkdir -p "$HOME/.ssh/authsocks"
c=""
for i in $(seq 10); do
f="$HOME/.ssh/authsocks/$i"
if [[ ! -e "$f" ]]; then
@fragglet
fragglet / rubber-feet.md
Last active March 6, 2024 00:12
Apple IIc rubber feet

I'm publishing this as a public gist so that it's googleable for anyone else looking for replacement rubber feet for their Apple IIc.

Rubber tends to perish over time and when restoring an old Apple IIc I found that the rubber feet on mine were in a bad condition. A good (perfect?) replacement seems to be 3M Bumpons, specifically part number SJ5003 (11.1mm in white). I believe these may even be the originals that were fitted on the IIc as shipped, because this story on folklore.org describes Apple using Bumpons in 1983.

"""Extracts media URLs from a tweet archive."""
import glob
import json
for filename in glob.glob("tweets/*.js"):
with open(filename, "r") as f:
data = f.read()
_, data = data.split("=", 1)
tweets = json.loads(data)
for tweet in tweets:
@fragglet
fragglet / go2-error-handling.md
Last active September 13, 2018 09:46
Go 2 errors response: One Handler Per Function

This is a response to the draft design for Go 2 error handling.

I think that the main thing I dislike about the proposed check/handle blocks is that they feel too much like a kind of "magic goto" that breaks the normal program flow. I worry that it won't be straightforward to follow the logic of what happens when a check fails. In the simple handle err { return err; } it isn't so bad but the examples with chained handle blocks seem quite counterintuitive.

I'm in agreement with Alessandro Arzilli in that I think chaining is the main source of my objection. It seems to me that the

doom2map/map01.dwd
doom2map/map03.dwd
doom2map/map06.dwd
doom2map/map07.dwd
doom2map/map08.dwd
doom2map/map09.dwd
doom2map/map10.dwd
doom2map/map12.dwd
doom2map/map13.dwd
doom2map/map16.dwd
Corel Draw has a bug in its SVG parsing: it treats all movement commands as absolute. By default, inkscape will use both absolute and relative movement commands.
There are two ways to deal with this:
1. Convert the SVG to PDF in inkscape. Corel's PDF import is less buggy.
2. Tell inkscape to output SVGs with only absolute movement commands:
2a. Open the Inkscape Preferences window (via Shift+Ctrl+P or File | Inkscape Preferences).
2b. Go to "SVG Output".
2c. Uncheck "Allow relative coordinates".

Keybase proof

I hereby claim:

  • I am fragglet on github.
  • I am fraggle (https://keybase.io/fraggle) on keybase.
  • I have a public key whose fingerprint is 6D2C 117E 0310 6644 97AA 9546 F6C2 EE9C 2335 4344

To claim this, I am signing this object:

Github Gists. What's it all about? Is it good or is it wack?