FirstDEV blog

⚞ Well, Blog First!

  • Home
  • Ruby
  • Ruby On Rails
  • Tips
  • Solutions
  • About
Subscribe
Developer tips

How to Use GitHub CLI for PRs and Issues Without Touching the Browser

Push a branch, switch to the browser, wait for it to load, click “Compare & pull request”, retype the description you already wrote in your commit message, pick reviewers from a dropdown, submit.

Rajan Bhattarai Rajan Bhattarai 11 min read
Ruby 3

ObjectSpace and Memory Profiling — Finding Leaks Before Production Does

A Puma worker starts at 180MB and sits at 1.4GB by the end of the day. Restarting fixes it, so someone adds a memory-based worker killer and the problem becomes invisible rather than

Rajan Bhattarai Rajan Bhattarai 11 min read
Rails

with_options — DRY Validations and Routes Without the Abstraction Tax

Six validations in a row, each ending with the same if: :submitted?. Four routes sharing the same constraint. Three associations with identical dependent: :destroy, inverse_of: options. The repetition is noise, but the usual

Rajan Bhattarai Rajan Bhattarai 10 min read
Developer tips

Semantic Versioning in Practice — When to Bump Major, Minor, or Patch

Everyone knows MAJOR.MINOR.PATCH. The spec fits on one page and takes four minutes to read. And yet every library maintainer has shipped a patch release that broke someone, because the hard part was

Rajan Bhattarai Rajan Bhattarai 12 min read
Developer tips

Using .gitignore Effectively for Rails Projects

Somebody commits .DS_Store, someone else adds *.DS_Store to the project’s .gitignore, and three months later there are eleven personal editor entries in a file that’s supposed to describe the project. Meanwhile config/master.key is

Rajan Bhattarai Rajan Bhattarai 9 min read
Rails

Rails System Tests With Capybara — Setup, Speed, and Staying Sane

System tests are the ones that catch the bugs nobody else does — the form that submits fine but whose success message never renders, the Turbo Frame that silently swallows a redirect. They’re

Rajan Bhattarai Rajan Bhattarai 11 min read
Developer tips

Terminal Shortcuts Every Developer Should Know

You mistype a flag near the start of a long command and hold the left arrow for four seconds to get there. You retype a path you used two commands ago. You press

Rajan Bhattarai Rajan Bhattarai 11 min read
Ruby 3

Writing Fast Ruby — Benchmarking with benchmark-ips and Reading the Results Honestly

Someone on the team claims map.compact is faster than filter_map. Someone else says the opposite. Both have benchmarks. Both benchmarks are wrong, in different ways — one measured a hundred iterations on a

Rajan Bhattarai Rajan Bhattarai 11 min read
Developer tips

Pry Power User — ls, cd, show-source, and the Commands That Replace Grep

Most people install Pry, use it as a slightly nicer IRB with a binding.pry breakpoint, and never touch the rest. That’s a shame, because the interesting part isn’t the REPL — it’s that

Rajan Bhattarai Rajan Bhattarai 11 min read
Rails

Rack Middleware From Scratch — What Lives Between the Internet and Your Rails App

Before a request reaches your controller it passes through roughly twenty pieces of code you didn’t write. Session handling, cookie parsing, parameter decoding, flash messages, exception rendering — all of it is Rack

Rajan Bhattarai Rajan Bhattarai 11 min read
Developer tips

Editor Setup for Rails — The Extensions and Keybindings Worth Keeping

There’s a genre of blog post that lists forty editor extensions. You install all forty, your editor takes twelve seconds to start, three of them fight over formatting, and you uninstall the lot

Rajan Bhattarai Rajan Bhattarai 10 min read
Developer tips

Shell Aliases and Functions Every Rails Dev Should Have

You type bundle exec rspec spec/models/ maybe forty times a day. Over a year that’s a few hours of pure keystrokes, and more importantly it’s a few hours of tiny frictions that discourage

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby 3

TracePoint in Practice — Instrument Your Code Without Reaching for a Gem

Something in a Rails boot sequence is defining a method you can’t find. A query is being issued from a code path you can’t identify. An exception is swallowed six layers down and

Rajan Bhattarai Rajan Bhattarai 10 min read
Rails

Database Indexing for Rails Devs — Composite, Partial, and What EXPLAIN Is Telling You

Rails makes it easy to write a query and hard to see what it costs. add_index on every foreign key is the standard advice and it’s a decent floor, but it doesn’t help

Rajan Bhattarai Rajan Bhattarai 11 min read
Developer tips

How to Navigate an Unfamiliar Open Source Codebase Fast

A gem is misbehaving and the docs don’t cover your case. You clone it, open the source, and there are 340 files. The instinct is to start at the top of the directory

Rajan Bhattarai Rajan Bhattarai 10 min read
« Newer Posts Page 2 of 10 Older Posts »
FirstDEV blog © 2026
Proudly published with Jekyll & using Jasper2
Latest Posts Twitter
FirstDEV blog

Check viewARU - Brand Newsletter!

Newsletter to DEVs by DEVs - boost your Personal Brand & career! 🚀