Webservice to mock HTTP responses
Need a simple way to fake server replies during development when external APIs are unavailable or unreliable.
Install the Nokogiri gem on Ubuntu servers
You need to install the following packages before you can build the Nokogiri gem:
sudo apt-get install libxml2-dev libxslt1-dev
Use find_in_batches or find_each to deal with many records efficiently
Processing large record sets can exhaust memory when loading everything at once. find_in_batches and find_each keep memory usage lower for long-running data updates.
Git for Subversion users
Quick Git commands for former Subversion users who need to clone, stage, commit, push, pull, branch, stash, and restore files.
Fixing flaky E2E tests
E2E tests often fail from race conditions between browser, app, and test script; synchronizing actions, retries, and test environment settings improves stability.
weighttp - a lightweight and simple webserver benchmarking tool
Threaded web server benchmark can exhaust application resources more effectively than ApacheBench or httperf; libev is required for installation.
Netty - the Java NIO Client Server Socket Framework - JBoss Community
The Netty project is an effort to provide an asynchronous event-driven network application framework and tools for rapid development of maintainable high performance & high scalability protocol servers & clients.
Gatekeeping: Guide for developer
Developer workflow for review-gated changes in Linear and GitLab, with branch, merge, reject, and staging steps to reduce client rejections.
Capistrano: exclude custom bundle groups for production deploy
Custom Bundler groups can still be downloaded during Capistrano deploys, slowing production and staging releases. Exclude unnecessary groups with bundle_without to avoid installing unused gems.
How to make changes to a Ruby gem (as a Rails developer)
Ruby gems need manual file loading, multi-version support, and their own release workflow, unlike Rails apps. Safe changes depend on understanding structure, tests, versioning, and packaging.
Locally testing a website on its real domain
Use a real production domain in local development for testing embeds, cookie banners, and other domain-allowlisted integrations by mapping it to localhost with HTTPS.
Ruby: A small summary of what return, break and next means for blocks
return, break, and next behave differently in Ruby blocks: one exits the method, one exits the yielding method, and one skips only the current iteration.
Sentry Local Logging in Ruby
Local Sentry event logging helps debug error capture and background jobs without sending data to Sentry or affecting production metrics.
Be very careful with 301 and 308 redirects
301 and 308 redirects can be cached by browsers indefinitely without cache control, making later changes impossible unless users clear their cache.
How to fix broken font collisions in wkhtmltopdf
PDFKit and wkhtmltopdf can ignore CSS font names when font metadata collides, causing one face to dominate or local files to fail. Fixing internal font names or embedding fonts restores proper rendering.
Howto: Create a self-signed certificate
Local HTTPS development often needs a trusted certificate; openssl or mkcert can create self-signed X.509 certificates for testing without browser warnings.
Popular mistakes when using nested forms
Common Rails nested form pitfalls include missing accepts_nested_attributes_for, wrong form helper scope, and lost parameters that prevent child records from saving.
How to use pessimistic row locks with ActiveRecord
Concurrent requests can overwrite each other or double-process a change. FOR UPDATE row locking in a transaction makes one request wait while the other completes.
makandra cards: A knowledge base on web development, RoR, and DevOps
Internal knowledge base with best practices for web development, Ruby on Rails, DevOps, and trainee programs, used by developers worldwide to find practical solutions and learning paths.
HTML: Making browsers wrap long words
Long words can overflow layouts when browsers wrap only at word boundaries. CSS hyphenation, soft hyphens, <wbr>, and overflow-wrap offer different control levels.
How to: Self-hosted fonts via NPM packages
Self-hosted webfonts can satisfy GDPR requirements without bundling font files manually. Fontsource NPM packages include weights, glyph sets, and smarter CSS loading.
PSA: Be super careful with complex `eager_load` or `includes` queries
eager_load and includes can explode 1-n association queries into huge cross products, wasting memory. preload uses separate queries and avoids the row multiplication.
4 Lessons Learned Doing Angular on Rails
Experience from building an Angular frontend with a Rails backend, highlighting practical lessons for teams combining a JavaScript client with server-side Ruby on Rails.
fnando/i18n-js
Rails I18n translations become available in JavaScript clients through a small library for sharing locale data outside the server.