Skip to content

Instantly share code, notes, and snippets.

View Lucent's full-sized avatar

Michael Dayah Lucent

View GitHub Profile

openpgp4fpr:3057B3A23A272B93408E34C4ADFE984091983F93

@Lucent
Lucent / substack_draft_timeline.js
Last active November 18, 2025 09:27
Fetches Substack draft save times and bins them into configurable N-minute chunks, and prints one ASCII line per day showing active vs idle periods
// Substack versions → per-day ASCII timeline + multi-scale totals +
// fractal dimension (D) + 5s-resolution "true" writing time estimate.
// Paste into console on a /publish/post/{id} page.
(async () => {
const CHUNK_MINUTES = 5; // bucket size for DISPLAY + legacy total
const START_HOUR = 8; // display window start (local)
const END_HOUR = 2; // display window end (next day, local)
const ACTIVE_CHAR = "━"; // writing
const INACTIVE_CHAR = "·"; // idle
@Lucent
Lucent / export_to_text.sh
Created January 3, 2026 23:39
tweets.js from Twitter export displayed as plain text prefixed with date/time
#!/usr/bin/env bash
set -Eeuo pipefail
sed '1 s/^[^[]*\[/[/' "$1" |
jq -r '
def sortable_date:
.tweet.created_at
| strptime("%a %b %d %H:%M:%S %z %Y")
| mktime
| . - 18000