Henrique Cardoso

837 posts

Henrique Cardoso banner
Henrique Cardoso

Henrique Cardoso

@hencf

ruby and elixir | dev at bspk | organizer @euruko 2025

Viana do Castelo, Portugal Katılım Kasım 2012
932 Takip Edilen397 Takipçiler
Henrique Cardoso
Migrated a large Rails app from RSpec to Minitest in 5 days. 5x faster CI, flaky tests gone, and Claude Code writes correct tests on the first try now. No DSL to hallucinate. hencf.org/blog/rspec-to-…
English
0
0
0
9
Henrique Cardoso
YouTube's InnerTube player API with the Android client context returns stable caption URLs. Pure Ruby stdlib, no gems. Third post in the Guia series, covering how the transcript data got into the database. hencf.org/blog/youtube-t…
English
0
0
0
15
Henrique Cardoso
Needed captions from 6,000 public YouTube videos. The official API only covers videos you own. Same problem the youtube-transcript-api and Ruby Events projects solved. Wrote up the Ruby implementation.
English
3
0
0
25
Henrique Cardoso
@miguelgbandeira Hey Miguel. I see you. Been through this for over 10 years now. I started going to Coworking when I moved to Portugal. Great opportunity to talk to people and do connections. Although to get real work done, I usually need to be alone at home. But having the option is great.
English
1
0
1
21
Miguel 🇵🇹
Miguel 🇵🇹@miguelgbandeira·
been working from home for 3 years i love it but i'm starting to feel the downsides it's lonely. it's distracting. and it's fucking with my routine there's no real barrier between work and personal life thinking about trying coworking spaces. might fix the routine, might help me separate work from home, maybe even meet some people anyone made this switch?
English
93
2
189
26.5K
Henrique Cardoso
The LLM call is 175ms. The real work is speaker deduplication, confidence filtering, and shipping extracted data from dev to prod via compressed seed files. Wrote it up. hencf.org/blog/llm-extra…
English
0
0
0
17
Henrique Cardoso
Ollama's OpenAI-compatible endpoint silently ignores your response_format. No error, no warning. Your structured output just isn't structured. Found out the hard way across 6,000 videos.
English
1
0
0
38
Henrique Cardoso retweetledi
Carmine Paolino
Carmine Paolino@paolino·
RubyLLM 1.14 is out! - Tailwind Chat UI generator: run one command, get a beautiful working AI chat app - Rails generators for agents, tools, and schemas - Providers now self-register their config options - Big batch of fixes: Faraday memory bloat, MySQL/MariaDB compat, agent config propagation github.com/crmne/ruby_llm…
English
5
14
101
3.2K
Henrique Cardoso
The part nobody talks about in RAG tutorials is the chunking. I have books where each chapter is a Q&A dialog and books that are straight narrative prose. Same pipeline, different chapter detection strategies. That matters way more than your embedding model. hencf.org/blog/rag-witho…
English
0
0
0
11
Henrique Cardoso
Every RAG tutorial: "first, pip install langchain pinecone openai" I built the whole thing in Rails. pgvector, Ollama for local embeddings, Groq for chat. 34 books and 6K video transcripts. Wrote it up.
English
1
0
0
35
Henrique Cardoso
The proxy mode fix is one line of config and it's wild how much it changes things. Cache goes from 5min to 1 year, and Thruster caches the responses in memory so Puma never even sees repeat requests. Rails 8.1 still doesn't ship Active Storage validators btw. The concern is like 20 lines. hencf.org/blog/active-st…
English
0
0
0
12
Henrique Cardoso
Someone told me images on the site felt slow. Opened DevTools and found Active Storage serving 4MB phone JPEGs with 5-minute cache headers. Cool cool cool. An afternoon later: WebP variants, proxy mode with 1-year caching, and a validation concern. Wrote it all up with the code.
English
1
0
0
33
Henrique Cardoso
Henrique Cardoso@hencf·
The 3MF generator turns kids' tag designs into print-ready files: pixel font for text, SVG-to-grid rasterizer for icons, triangle meshes with proper normals, dual-extruder metadata for two-color prints. Seven commits, Sunday to Tuesday. Rails 8.1, Stimulus, no Node.js. Full post: hencf.org/blog/rails-new…
English
0
0
1
30
Henrique Cardoso
Henrique Cardoso@hencf·
Built a classroom coding platform in a weekend with Claude Code. Three activities for kids: tag designer → 3D printer, block-based maze game, debugging puzzles. The wildest part: a pure Ruby 3MF generator. Bitmap font, SVG rasterizer, triangle meshes. No CAD libraries.
English
1
0
2
81
Henrique Cardoso
Henrique Cardoso@hencf·
How it works: Vips::Image.xyz() gives you pixel coordinates. Normalize X to [0,1], interpolate RGB channels, and you get a smooth gradient — all in Ruby. Add Pango markup for text, composite the org's logo, cache in Solid Cache for 24h. The tool was already installed through Active Storage. Full implementation: hencf.org/blog/dynamic-o…
English
0
0
0
24
Henrique Cardoso
Henrique Cardoso@hencf·
Built dynamic OG images for a multi-tenant Rails app using ruby-vips. Gradients from pixel math, Pango text rendering, per-org theming from daisyUI colors. No Puppeteer, no Node.js, no external service. Under 100ms per image.
English
1
0
1
41
Henrique Cardoso
Henrique Cardoso@hencf·
Gotchas I hit building Web Push in Rails: - iOS Safari only supports Push API in installed PWAs (not regular browser) - Async calls in notification click handlers silently kill the user gesture - Recurring activity reminders need calendar expansion (closed dates, pauses, schedules) - Cache-based dedup so 15-min job intervals don't send duplicates Full implementation: hencf.org/blog/web-push-…
English
0
0
0
15
Henrique Cardoso
Henrique Cardoso@hencf·
Built browser push notifications in Rails without Firebase, OneSignal, or any third-party service. VAPID keys, a service worker, Stimulus controller, Solid Queue reminders every 15 min. Free, no per-message costs. The iOS gotcha alone was worth writing this up.
English
1
0
0
52
Henrique Cardoso retweetledi
DHH
DHH@dhh·
Opus produced the best output with Ruby in this shoot-out between a bunch of different languages. Fewest tokens, fewest LOCs, fastest completion. Maybe one day, AI will just be writing straight machine code, but until then, Ruby is a superb target. dev.to/mame/which-pro…
DHH tweet media
English
119
80
927
75.2K
Henrique Cardoso
Henrique Cardoso@hencf·
Hooks fire on events (PostToolUse, PreToolUse). Mine runs after every Edit on a controller/view, scans for N+1 patterns, returns additionalContext. Commands are markdown files in .claude/commands/. My /simplify launches 3 parallel agents to review a PR for efficiency issues. Skills are structured workflows. /review-commit fetches a Linear issue via MCP and cross-references requirements against the commit diff. They compose: hook catches N+1s during implementation, /simplify reviews the PR, /review-commit validates against requirements. Tighter feedback loop at every stage. Full post: hencf.org/blog/claude-co…
English
0
0
0
17
Henrique Cardoso
Henrique Cardoso@hencf·
Claude Code has an extensibility layer most people don't use: hooks, commands, and skills. I built a hook that catches N+1 queries at edit time. Claude writes a controller action, the hook scans for association access inside loops, and injects a warning. Claude fixes it before I even review the code. Here's how each one works:
English
1
0
0
41