Skip to content

Instantly share code, notes, and snippets.

View nathangathright's full-sized avatar
🎧
Full of information. Some of it's actually useful.

Nathan Gathright nathangathright

🎧
Full of information. Some of it's actually useful.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nathangath on github.
  • I am nathang (https://keybase.io/nathang) on keybase.
  • I have a public key ASC0R60OV0d4ZhtnSaKWQDksm8CRKptKcqmE-SV_E5HGtgo

To claim this, I am signing this object:

function noMoreLonelyWords(e, o) {
var t, n = document.querySelectorAll(e);
for (t = 0; t < n.length; ++t) {
var i = n[t].innerText.split(" ")
, a = i.splice(-o, o).join("&nbsp;")
, r = i.join(" ");
n[t].innerHTML = r + " " + a
}
}
{
"workbench.colorTheme": "One Dark Pro",
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"window.zoomLevel": 0,
"explorer.confirmDragAndDrop": false,
"workbench.startupEditor": "newUntitledFile",
"explorer.confirmDelete": false,
"prettier.printWidth": 240,
"terminal.integrated.rendererType": "dom",

Keyboard shortcuts I can't remember

  • shift+ctrl+↓ Expand selection to bottom of sheet

Bookmarklets

Google Cache

data:text/html;charset=utf-8,<html><head><link rel="shortcut icon" href="https://www.google.com/favicon.ico"><script type="text/javascript"> javascript:location.href='http://webcache.googleusercontent.com/search?q=cache:'+window.location.href%0A</script>

Archive.org

data:text/html;charset=utf-8,

javascript:!function(a){var b=document.createElement("textarea"),c=document.getSelection();b.textContent=a,document.body.appendChild(b),c.removeAllRanges(),b.select(),document.execCommand("copy"),c.removeAllRanges(),document.body.removeChild(b)}(document.querySelector("meta[property='og:image']").content);
<img src="http://SUBDOMAIN.DOMAIN.COM/hash/283379236/128" data-fallback="/feed/b9cd9278-2679-5cfd-9bc7-7f1e04f1cba4/item/f8e00bc8-9f47-11ec-adea-33b8a6094f44/128">
<script>
let podcastimages = document.querySelectorAll('[data-fallback]');
podcastimages.forEach(image => {
image.addEventListener("error", (event) => {
image.src!=image.dataset.fallback ? image.src=image.dataset.fallback : false;
})
});
</script>

WebFinger-esque lookup for podcasts

Example Request

GET /.well-known/webfinger?
feed=https://feeds.megaphone.fm/vergecast&
episode=74c2d4a8-350e-11ed-ac6e-af51166da149&
episode=2976ce64-49ae-11ed-a6dc-63e170f0bbd8
@nathangathright
nathangathright / deepgram.py
Last active April 12, 2023 17:39
Convert Deepgram JSON to PodcastNamespace JSON
# convert deepgram json to PodcastNamespace json
# Usage: python deepgram.py <input.json>
import json
import sys
# load json
with open(sys.argv[1]) as f:
data = json.load(f)
Name Slug Hostname
Amazon Music amazon music.amazon.com
Antennapod antennapod antennapod.org
Anytime Player anytimeplayer anytimeplayer.app
Apple Podcasts apple podcasts.apple.com
Audacy audacy audacy.com
Audible audible audible.com
Bullhorn bullhorn bullhorn.fm
Castamatic castamatic castamatic.com
Castbox castbox castbox.fm