Skip to content

Instantly share code, notes, and snippets.

View futzlarson's full-sized avatar

Ryan DuVal futzlarson

View GitHub Profile
@futzlarson
futzlarson / volume-seed-gist.md
Last active April 14, 2026 20:55
php artisan app:volume-seed — realistic volume seeding for Laravel perf testing

php artisan app:volume-seed — realistic volume seeding for Care-Management perf testing

A Laravel Artisan command built for the Curitics Care-Management app to stress-test it at production scale and beyond. Generates N new patient records plus proportional related data (medication refills, conditions, care gaps, notes, tasks, plans) so performance benchmarks exercise the queries that actually get slow in prod.

Command lives at: app/Console/Commands/Performance/VolumeSeedCommand.php

Why we built it

Production had ~500K patients when this work started. The goal was to find out what happens at 1M, 3M, and beyond — before prod got there.

@futzlarson
futzlarson / vapor-optimize-issue.md
Last active April 21, 2026 19:41
Vapor build: php artisan optimize caching wrong paths on all environments

Vapor php artisan optimize: original analysis was wrong

TL;DR

The previous version of this gist claimed php artisan optimize should be moved from build to deploy because cached views/routes contain wrong file paths. That's incorrect. Cached Blade views only contain path references in PHP comments (/**PATH ... ENDPATH**/), not in executable code. Laravel resolves paths dynamically at runtime.

Moving optimize to deploy actually breaks the deploy because Lambda's /var/task is read-only and event:cache/view:cache can't write there.

The standard Vapor template (optimize in build) is correct. Don't change it.

@futzlarson
futzlarson / rebase-vs-merge.md
Created April 10, 2026 15:13
Rebase vs Merge: when to use each

Rebase vs Merge: When to Use Each

What they do

Both solve the same problem: your feature branch is behind upstream and you want the latest code.

  • Rebase replays your commits on top of the latest upstream. No extra commits. Clean history.
  • Merge combines the two branches and creates a merge commit as a bookmark.

The only practical difference

@futzlarson
futzlarson / autosave-review.md
Created April 8, 2026 17:29
Assessment autosave review (PR #2929) — performance concerns

Assessment Autosave Review (PR #2929)

PR: https://github.com/curiticshealth/Care-Management/pull/2929 Merged: 2026-03-25

Context

The assessment component is the highest-volume transaction in the app — 1.8M Livewire interactions in 2 days (Sentry data). PR #2929 added server-side autosave that fires afterStateUpdated on every form field.

Concerns

@futzlarson
futzlarson / cache-invalidation-note.md
Last active April 8, 2026 16:53
Cache invalidation note: rememberForever on master data

Cache Invalidation Note: rememberForever on Master Data

What's cached

Cache Key pattern Used by
CachesIdByName::idByName() App\Models\{Model}:{tenant}:{name} 7 models: MasterTaskStatus, MasterNoteDocStatus, MasterTaskPriority, MasterAssessmentStatus, MasterCaseStatus, MasterCareGapStatus, MasterFileCategory
MasterSmartText::cachedDescriptions() master_smart_texts:{tenant} 20 files — every note, task, assessment, care plan, calendar, and referral form

Both use Cache::rememberForever() with automatic invalidation via Eloquent saved/deleted events.

@futzlarson
futzlarson / caching.md
Last active April 6, 2026 18:49
Caching

Master Data Caching Strategy (M1–M6)

The application has 140 master_* tables containing reference data (statuses, types, priorities, etc.). These are queried millions of times but rarely change — some are truly static (genders, states, countries), others are modified every few weeks (task statuses, case statuses).

Approach: Cache::flexible() (Laravel 11's stale-while-revalidate) at the model level via a shared trait.

 // Trait added to all Master* models
@futzlarson
futzlarson / filament-assets-vapor-gap.md
Last active March 26, 2026 23:48
Care Management: Missing php artisan filament:assets in Vapor build

Missing php artisan filament:assets in Vapor Build

The Problem

Filament ships two separate layers that must stay in sync:

  • PHP — blade templates, component classes, action definitions (updated via composer update)
  • JS — compiled Alpine components published to public/js/filament/ (updated via php artisan filament:assets)

The Vapor build steps run composer install (which pulls the latest PHP), but never run php artisan filament:assets. This means every Filament version bump via composer silently leaves the published JS behind.

@futzlarson
futzlarson / checkly-vs-better-stack.md
Last active March 23, 2026 20:24
Checkly vs Better Stack - Feature & Cost Comparison

Checkly vs Better Stack vs Sentry vs Uptime Kuma vs UptimeRobot

General uptime monitoring + catching intermittent TLS failures on specific AWS API Gateway nodes.

Verdict

  • General monitoring: Start with Checkly Free (6 locations, 1-2 min checks) + Sentry uptime ($1/monitor/month) if you're already on Sentry. Or self-host Uptime Kuma for free on a $5/mo VPS. UptimeRobot Free (50 monitors, 5-min checks) is another solid zero-cost option if you just need simple HTTP pings.
  • Catching today's issue: Checkly Team ($64/mo) — 30s checks across 24 locations with TLS error detail. Better Stack, Sentry, Uptime Kuma, and UptimeRobot all fall short here — single-location or multi-failure requirements mean a bad node in a round-robin pool likely goes undetected.

Comparison

@futzlarson
futzlarson / ssl-investigation.md
Created March 19, 2026 13:39
SSL ERR_SSL_PROTOCOL_ERROR Investigation - curiticspulse.com

SSL Investigation: ERR_SSL_PROTOCOL_ERROR

Domains: cm.curiticspulse.com (production) · cm-uat.curiticspulse.com (UAT) Date: 2026-03-19

What Was Reported

  • An employee on cm-uat.curiticspulse.com and a client on cm.curiticspulse.com both seeing ERR_SSL_PROTOCOL_ERROR in Chrome on Windows
  • Works fine for the developer (macOS)

What Was Checked

@futzlarson
futzlarson / gist:7c95c7a7e451fab7769f3ec8d1d46964
Last active March 15, 2026 15:32
Risk Adjustment - Lambda Timeout Analysis Report (2026-03-15)

Risk Adjustment — Lambda Timeout Analysis Report

Date: March 15, 2026
Triggered by: CloudWatch Alarm vapor-Curitics-RA-production-d-timeout-warning
Alarm threshold: 28,000ms (approaching 30s Lambda limit)
Datapoint that fired: 28,877ms at 14:53 UTC


TL;DR