FirstDEV blog
  • Home
  • Ruby
  • Ruby On Rails
  • Tips
  • Solutions
  • About
Subscribe
cdrrazan

Rajan Bhattarai

Full Stack Software Developer! πŸ’» 🏑 Grad. Student, MCS. πŸŽ“ Class of '23. GitKraken Ambassador πŸ‡³πŸ‡΅ 2021/22. Works with Ruby / Rails. Photography when no coding. Also tweets a lot at TW / @cdrrazan!

118 posts •
Ruby-code

Rotate An Array By N Positions In Ruby

Shift array elements left or right by N positions using Array#rotate.

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby 3

Regular Expressions in Ruby β€” A Practical Guide That Skips the Theory

Regular expressions have a reputation for being write-only code β€” you craft them with intense focus, they work, and three months later neither you nor anyone else can read them. That reputation is

Rajan Bhattarai Rajan Bhattarai 8 min read
Rails

ActiveRecord Scopes and Query Objects β€” Keeping Your Queries Organized

Queries scattered across controllers, models, and background jobs are one of the most common maintainability problems in Rails apps. A where clause written inline in a controller is invisible to the next developer

Rajan Bhattarai Rajan Bhattarai 8 min read
Developer tips

How to Actually Ship Your Side Project β€” The Developer's Guide to Finishing

The developer graveyard is full of side projects. Half-built apps, promising ideas that reached MVP and no further, abandoned repos with commits from two years ago. Starting is easy β€” the problem is

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby-code

Remove Duplicate Elements From An Array While Preserving Order In Ruby

Deduplicate an array in insertion order using Array#uniq.

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby 3

Exception Handling in Ruby β€” rescue, ensure, retry, and raise Done Right

Exception handling is one of those topics that feels simple until you hit a subtle bug caused by rescuing too broadly, retrying without a limit, or swallowing errors that should surface. Ruby’s exception

Rajan Bhattarai Rajan Bhattarai 8 min read
Rails

Rails Caching Strategies β€” From Low-Level Cache to Russian Doll

Caching is how Rails apps go from β€œworks fine with 10 users” to β€œworks fine with 10,000 users” without rewriting everything. Rails ships a complete caching toolkit β€” low-level key-value cache, fragment caching,

Rajan Bhattarai Rajan Bhattarai 9 min read
Developer tips

Deep Work for Developers β€” Getting Real Hours Back in a World of Interruptions

Software development is cognitively one of the most demanding professions there is. Holding a complex system in working memory, tracing execution paths, spotting the subtle interaction between two pieces of code β€” these

Rajan Bhattarai Rajan Bhattarai 11 min read
Ruby-code

Zip Multiple Arrays Together In Ruby

Combine elements from two or more arrays by position using Array#zip.

Rajan Bhattarai Rajan Bhattarai 1 min read
« Newer Posts Page 7 of 14 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! πŸš€