Markdown rendering with react-markdown

Rich text content from Rails often comes as Markdown. The react-markdown library renders Markdown to React components with customizable styling and sanitization. I configure it to use syntax highlighting via react-syntax-highlighter for code blocks, c

Django custom management command for data import

Management commands are perfect for scripts that need Django's ORM and settings. I create them in management/commands/ and extend BaseCommand. The add_arguments method defines CLI options using argparse. I use self.stdout.write with style helpers for

tempfile for safe temporary file creation

The tempfile crate creates temporary files and directories that are automatically cleaned up on drop. I use it in tests, build scripts, and anywhere I need scratch space. tempfile::NamedTempFile gives you a file path, while tempfile::tempfile() create

React app structure with Vite and TypeScript

Vite provides lightning-fast dev server startup and hot module replacement compared to Create React App. I scaffold React projects with TypeScript for type safety across the entire frontend. The folder structure separates concerns: components for reus

Django custom authentication backend

Custom auth backends enable alternative authentication methods. I subclass ModelBackend and override authenticate(). Common use cases include email login, LDAP, OAuth, or custom token auth. The backend returns a user object or None. I add it to AUTHEN

Toast notifications delivered with Turbo Streams

Toasts are a great fit for Turbo Streams because they’re ephemeral UI that doesn’t need a dedicated page. I keep a #toasts container in the layout and turbo_stream.append a toast partial on success events. The toast itself is just HTML with a Stimulus

JWT verification with cached JWKS (handles key rotation)

JWT auth is easy to get subtly wrong, especially around key rotation. Instead of hard-coding public keys, I fetch JWKS and cache it with a refresh interval so new signing keys are accepted quickly. I still validate iss and aud so tokens from other env

Scroll into view after append using a custom Turbo Stream action

When appending new content (like a new message), I sometimes want to scroll it into view automatically. Rather than adding JS in the controller, I use a custom turbo stream action scroll_into_view that finds the target element and calls scrollIntoView

Laravel package development

Creating Laravel packages enables code reusability across projects. I structure packages with src/ for code, config/ for configuration, and database/ for migrations. Service providers register package components—routes, views, commands, configs. The p

iOS app extensions - widgets and share

App extensions expand app functionality into other parts of iOS. Today widgets display glanceable information using WidgetKit with SwiftUI views and timeline providers. Share extensions let users share content to your app from other apps—I process sha

Laravel route model binding

Route model binding automatically resolves Eloquent models from route parameters, eliminating manual lookups. Implicit binding matches parameter names to model IDs—/users/{user} injects the User model. Custom route keys use getRouteKeyName() to bind b

HTTP Timeouts + Retries Wrapper (Faraday)

I wrapped external HTTP calls once I realized most “flaky APIs” were actually my fault: no timeouts, unclear retries, and logs that didn’t tell a story. In Client with timeouts, I centralize a Faraday connection with explicit open_timeout and timeout,