Skip to content

Instantly share code, notes, and snippets.

@judell
judell / bsquare-embed-fix.html
Last active April 26, 2026 15:44
B Square Bulletin community calendar embed — auto-height iframe (fixes double-scroll)
<!--
B Square Bulletin — community calendar embed fix
Problem: the current embed shows two scrollbars (page + iframe). The iframe
has a fixed 1800px height with scrolling="yes", so when the event list is
taller than 1800px it gets its own scrollbar inside the page's scrollbar,
and when it's shorter you see a big gap.
Fix: opt the iframe into auto-height mode (?autoheight=true), turn off its
scrollbar, start it at height:0, and add a tiny postMessage listener that
@judell
judell / verify_edge_functions.sh
Created April 25, 2026 04:14
Community Calendar: verify a fork's deployed edge functions match upstream repo source
#!/usr/bin/env bash
# verify_edge_functions.sh — compare deployed edge function source against repo
#
# Usage:
# export SUPABASE_ACCESS_TOKEN=sbp_... # from supabase.com/dashboard/account/tokens
# export SUPABASE_PROJECT_REF=your_project_ref
# bash verify_edge_functions.sh
#
# Requires: curl, diff, jq
# Run from the root of your community-calendar repo clone.
@judell
judell / verify_migrations.sql
Last active April 25, 2026 04:28
Community Calendar: verify a fork's Supabase database has all required objects
-- Verify that a fork's Supabase database has all required objects.
-- Paste this into the Supabase SQL Editor and run it.
--
-- Each check returns '✅ OK' or '❌ MISSING' with the fix.
--
-- Auto-generated from DDL files on 2026-04-24.
-- Regenerate: python scripts/generate_verify_sql.py
SELECT '── TABLES ──' AS section, '' AS status
@judell
judell / fork-sync-instructions.md
Last active April 20, 2026 02:16
Instructions for B-Square-Bulletin fork to align with upstream for smoother syncs

Smoother upstream syncs for B-Square-Bulletin/community-calendar

Five commits just landed upstream that reduce merge friction for forks. Here's what to do and why.

What changed upstream

  1. report.json and xmlui/version.txt are no longer tracked. These auto-generated files always diverge across forks, causing pointless merge conflicts.

  2. xmlui/config.local.js is no longer tracked. It was already gitignored but still in the repo from an earlier commit. A config.local.js.example template is now shipped instead.

@judell
judell / wfhb-edit-events.md
Created April 13, 2026 22:29
Event rewriting spec for WFHB: viewer (Jon) + moderator (Chuck)

Event Rewriting for WFHB

WFHB needs to edit certain events as they flow from the community-calendar database to the iframed viewer. The approach: add an eventOverrides object to the existing excluded.json file that WFHB already manages in GitHub. The community-calendar viewer already fetches this file via the ?exclude= query param; it just needs to apply overrides in addition to exclusions.

Two repos are involved:

  • community-calendar (Jon) — the shared viewer that any city can iframe
  • wfhb (Chuck) — the WFHB-specific moderator UI

Part 1: community-calendar viewer (Jon)

The published blog at blog.xmlui.org is a standalone XMLUI app (xmlui-blog), separate from the main website. Its source lived in blog/src/ but has been removed from the working tree — only blog/dist/ remains.

The key file was blog/src/config.ts, which contains:

  1. A hardcoded blogPosts array listing every post's metadata (title, slug, description, author, date, image, tags, draft).
  2. That array is passed to the XMLUI runtime via appGlobals.blog.posts.
  3. Blog markdown files are loaded from blog/public/blog/*.md via Vite glob import.
  4. The Main.xmlui for the blog app used hardcoded Page routes with index-based references (posts[0], posts[1], etc.).

Adding a new post to the published blog requires:

@judell
judell / plan-issue-41.md
Created March 25, 2026 04:59
Plan: Stop committing generated ICS/JSON files to the repo (issue #41)

Plan: Stop Committing Generated ICS/JSON Files to the Repo

Current State

  • CI workflow commits cities/*/events.json, cities.json, and version.txt to git after every build
  • Individual .ics files from scrapers/feeds are also committed
  • The app does not serve these files to users — it queries Supabase directly
  • The load-events edge function fetches events.json from raw.githubusercontent.com to upsert into Supabase
  • cities.json and version.txt ARE used by the frontend at load time (via GitHub Pages)
@judell
judell / meetup-rsvp-leaky-abstraction.md
Last active February 13, 2026 18:15
meetup-rsvp-leaky-abstraction.md

When “RSVP Today” Stops Making Sense

I received this Meetup email today and could not make sense of it.

image
@judell
judell / newstack-refactor-after.xml
Created January 13, 2026 06:58
newstack-refactor-after
<!-- after -->
<HStack>
<WeatherStat
label="Cloud Cover"
value="{condition.cloudcover}%"
/>
<WeatherStat
label="Humidity"
value="{condition.humidity}%"
/>
@judell
judell / newstack-refactor-before.xml
Created January 13, 2026 06:56
newstack-refactor-before
<!-- before -->
<HStack>
<VStack>
<Text variant="secondary" fontSize="$fontSize-sm">Cloud Cover</Text>
<Text fontWeight="semibold" fontSize="$fontSize-lg">
{condition.cloudcover}%
</Text>
</VStack>
<VStack>