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 •
Rails

Stimulus Controllers โ€” Adding JavaScript Behavior to Rails Views Without a SPA

The appeal of server-rendered Rails has always been that you write less โ€” less duplication between client and server, less state management, less JavaScript infrastructure. But โ€œless JavaScriptโ€ doesnโ€™t mean no JavaScript. Dropdowns

Rajan Bhattarai Rajan Bhattarai 9 min read
Developer tips

Speaking at Your First Tech Meetup โ€” A Practical Guide for Developers

Most developers who could benefit from speaking at meetups never do. Not because they lack something to say, but because the idea of getting on stage feels much larger than it actually is.

Rajan Bhattarai Rajan Bhattarai 11 min read
Ruby-code

Sort A Hash By Its Values In Ruby

Use sort_by to order a hashโ€™s key-value pairs by value, returning a sorted array of pairs that can be converted back to a hash.

Rajan Bhattarai Rajan Bhattarai 2 min read
Ruby 3

Refinements in Ruby โ€” Scoped Monkey Patching Without the Footguns

Monkey patching in Ruby has a reputation โ€” usually deserved โ€” for causing exactly the kind of spooky action-at-a-distance bugs that make senior engineers twitch. Open a class anywhere in the codebase, add

Rajan Bhattarai Rajan Bhattarai 9 min read
Rails

Solid Queue โ€” Background Jobs in Rails 8 Without Redis

For years, adding background jobs to a Rails application meant adding Redis. Sidekiq is excellent, but it pulls in a dependency that needs its own infrastructure, its own monitoring, its own operational overhead.

Rajan Bhattarai Rajan Bhattarai 8 min read
Developer tips

How to Get Your First 100 Newsletter Subscribers as a Developer

A newsletter is the most underrated asset a developer can build. No algorithm, no platform risk, no fighting for attention in someone elseโ€™s feed. Just you, your readers, and a direct line. The

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby-code

Group Consecutive Elements In An Array By Condition In Ruby

Use chunk_while to group adjacent array elements that share a condition โ€” perfect for run-length encoding, streak detection, and range grouping.

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby 3

Object Freezing and Immutability in Ruby โ€” When to Lock Things Down

Mutability is the default in Ruby โ€” most objects can be changed after creation, which is convenient right up until you have a hash shared between two parts of a system and one

Rajan Bhattarai Rajan Bhattarai 11 min read
Rails

ActiveRecord Validations โ€” Custom Validators and the Patterns Worth Knowing

Rails ships with a solid set of built-in validations that cover the common cases. Most applications, though, quickly accumulate requirements that built-ins canโ€™t express cleanly โ€” business rules about date ranges, format constraints

Rajan Bhattarai Rajan Bhattarai 9 min read
« Newer Posts Page 5 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! ๐Ÿš€