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!

195 posts •
Developer tips

Networking for Introverted Developers — Without Pretending to Be Someone You're Not

The word “networking” was invented to make introverts miserable. It conjures images of badge-scanning at conference happy hours, small talk with strangers over lukewarm beer, and handing out business cards to people you’ll

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby-code

Paginate An Array In Ruby Using Each_slice

When displaying large datasets in pages — or processing records in batches — you need to split an array into fixed-size chunks. Ruby’s each_slice handles this cleanly without manual index arithmetic.

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby 3

method_missing and respond_to_missing? — Ruby Metaprogramming That's Actually Useful

Metaprogramming has a reputation for being either magical or dangerous, depending on who you ask. Both reactions are earned. Ruby’s method_missing hook lets you intercept calls to methods that don’t exist and handle

Rajan Bhattarai Rajan Bhattarai 8 min read
Rails

Service Objects in Rails — Keeping Controllers Thin Without Losing Your Mind

Fat models, skinny controllers was the mantra for years. Then models got fat and we realized that was wrong too. Business logic crammed into ActiveRecord models means models responsible for database persistence, validations,

Rajan Bhattarai Rajan Bhattarai 8 min read
Developer tips

Why Every Developer Should Have a Personal Blog (And How to Actually Start)

The number of developers who should have a personal blog and don’t is staggering. Not because they have nothing worth saying — most of them have been solving interesting problems for years —

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby-code

Count Word Frequency In A String In Ruby

Counting how often each word appears in a string is a common text-processing task — useful for analytics, content analysis, keyword detection, and building word clouds. Ruby’s Enumerable provides an idiomatic one-liner.

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby 3

tap, then, and yield_self — Ruby's Method Chaining Toolkit

Ruby has three methods that look similar on the surface but solve distinct problems in method chains: tap, then (aliased as yield_self), and itself. Once you understand what each one is actually for,

Rajan Bhattarai Rajan Bhattarai 8 min read
Rails

Turbo Frames — Partial Page Updates in Rails Without Writing JavaScript

Turbo Streams handle real-time updates pushed from the server. Turbo Frames handle a different problem: replacing sections of a page in response to user interaction — clicking a link, submitting a form —

Rajan Bhattarai Rajan Bhattarai 8 min read
Developer tips

Code Review Etiquette — How to Give and Receive Feedback That Actually Helps

Code review is one of the most consequential daily interactions in software development, and it’s rarely taught explicitly. Most developers learn by osmosis — they absorb the norms of whatever team they first

Rajan Bhattarai Rajan Bhattarai 11 min read
Ruby-code

Parse And Format Dates Cleanly In Ruby Without Common Pitfalls

Date and time handling trips up even experienced Ruby developers — timezone confusion, Date vs Time vs DateTime, string parsing that silently returns nil. This covers the clean patterns for parsing, formatting, and

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby 3

Enumerable#lazy — Processing Large Collections Without Loading Them All

Ruby’s Enumerable is one of the language’s best features — map, select, reject, reduce, and dozens of other methods that make working with collections feel natural. But every one of those methods is

Rajan Bhattarai Rajan Bhattarai 8 min read
Rails

Rails Credentials — Managing Secrets Without Leaking Them

Every Rails app has secrets — API keys, database passwords, third-party service tokens. The bad old pattern was storing these in environment variables set manually on each server, or worse, hardcoded in config

Rajan Bhattarai Rajan Bhattarai 7 min read
Developer tips

LinkedIn for Developers — Building a Profile That Works Without Feeling Fake

Most developers have a complicated relationship with LinkedIn. They filled out a profile years ago, accepted a few connection requests, and now get occasional recruiter messages for jobs they’re not interested in while

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby-code

Convert Strings Between Snake_case And Camelcase In Ruby

When bridging Ruby code (which uses snake_case) with JavaScript APIs or JSON payloads (which often use camelCase), you regularly need to convert between the two formats. Ruby and Rails provide clean ways to

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby 3

Ruby's Comparable Module — Custom Ordering That Just Works

You’ve probably used sort, min, max, and between? on numbers and strings without thinking much about them. They work because those classes already implement comparison logic Ruby’s core can use. But the moment

Rajan Bhattarai Rajan Bhattarai 7 min read
« Newer Posts Page 11 of 13 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! 🚀