Skip to content

Instantly share code, notes, and snippets.


Jacob O'Bryant jacobobryant

View GitHub Profile
jacobobryant / Dockerfile
Created December 18, 2022 01:30
Dockerfile for deploying Biff on
View Dockerfile
from clojure:temurin-17-tools-deps-bullseye
ENV BB_COMMIT=965c177bca31ae9882c975ef7db448e12f59984e
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN curl$TRENCH_VERSION/trenchman_${TRENCH_VERSION}_linux_amd64.tar.gz \
jacobobryant /
Created September 16, 2022 17:30
Newsletter topic extraction
Usage: python extract_keywords
Reads from storage/keywords/corpus.csv, which has columns `<ID>,<Title>,<Description>`. Writes
keywords to storage/keywords/output.csv
I use this for newsletter topic modeling at
import sys
import nltk
jacobobryant /
Created February 4, 2022 01:26
git dad: improve git's error message

Add this to your .bashrc to improve git's error message for a common typo:

git() {
  if [ "$1" = dad ]; then
    curl -H "Accept: text/plain"
    $(which git) "$@"
jacobobryant /
Created August 20, 2021 18:25
Example of debugging an http endpoint (or function in general) in Biff (or Clojure in general)

Ratings API

I just added an API endpoint which gives you all your ratings as JSON. You could use it to e.g. fetch all your favorited articles and send them to your aunt. You can enable it from the settings page.

Also, Findka Essays has been a little flaky this week. There have been a couple days when it hasn't sent the emails out. I can trigger them manually, but I, uh, sometimes get distracted. Anyway, I've tweaked some things and hopefully it won't be an issue anymore. But either way, I'm keeping an eye on it, and I'll dig in further if the problem persists.

jacobobryant / bookmarklet.js
Last active May 19, 2022 20:14
How to make your own airtable bookmark bookmarklet
View bookmarklet.js
// 1. Create a table on Airtable, and make URL/text columns with these names:
// URL, Title, Description, Image, Feed
// 2. Add a Form view. Click "Open form", then copy the URL. Set `airtable_form_url`
// below to that URL.
// 3. Create a new bookmark in your web browser, and paste in the code below. Whenever
// you're on a page you want to save, click the bookmark ("bookmarklet", technically).
// You'll go to the airtable form, and the columns listed above will be prefilled.
from surprise import KNNBaseline
from surprise import Dataset
from surprise import Reader
import time
import threading
import sys
import json
def synchronized(func):
func.__lock__ = threading.Lock()
jacobobryant / gist:deeb5b69c3ad5093eff17e86c00b3518
Last active June 12, 2020 04:26
Biff-style txes + rules with Datomic
View gist:deeb5b69c3ad5093eff17e86c00b3518
; Code snippet from a previous version of Findka that used Datomic + Biff-style transactions & rules.
; See trident.datomic-cloud/tx:
(s/def :user.integration/goodreads-id #(or (empty? %)
(->> %
(str "")
(= 200))))
jacobobryant /
Last active November 18, 2019 16:01
common vim commands
j k h l
b B w W
C-u C-d ("control-u")
gg G 10G
C-e C-f
0 $
C-o <tab>
jacobobryant /
Last active July 13, 2019 16:45
Better logs for Datomic Cloud Ions

You may discover soon after adding logging to your Ions that CloudWatch really sucks. Fortunately you can forward your logs to Loggly instead. See here.