2023
React hook for JavaScript debounce
Create a JavaScript Debounce hook that works with React state.
Schedule unique jobs in Sidekiq
In one of the projects I work, there was a requirement to schedule only one job for a record at a time. If someone wants to schedule another one for the same record, the system should clear the old schedule for it and schedule the new one.
2022
Git - delete local branches
After working on a project for a while, we normally end up having too many branches locally.
2021
OpenSSL connection error with Redis6 on heroku
OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate in certificate chain))
React state validation hook using Yup
2020
Struct class in Ruby
Struct
is a collection of attributes with accessor methods,
without having to write the class explicitly.
Dig method in Ruby
#dig
method was added in Ruby 2.3 to Array
and Hash
classes.
It makes digging the Array and Hash easy while making the code readable.
Zero-Downtime migrations in Rails
Often, we rename a column and deploy to find out the Honeybadger screaming at us with the errors accessing column with the old name!
Hash With Indifferent Access in Rails
When I found out how the params
could be accessed using both symbol
and string
as keys,
I dived deep to figure out about ActiveSupport::HashWithIndifferentAccess
class in Rails.
Comparable module in Ruby
Ruby’s
Comparable
module is used when implementing class objects needs to be ordered or compared.
Exploring Ruby’s Enumerable Module
Ruby’s Enumerable
module adds magical methods
to classes like Array
and Hash
.
In this post, we will learn to implement enumeration with an example.
OpenStruct in Ruby
In Ruby,
OpenStruct
is a data structure,
similar to Hash
.
With this,
we can define
attributes with values
(key value pairs).
Create and publish your first ruby gem!
In this post, we will create, test, build and publish the gem to RubyGems! (without breaking a sweat).