All Tutorials

Javascript

The optional chaining operator (?.) in Javascript

Learn how and when to use the Javascript optional chaining operator to simplify your codebase and make your application more error-prone

Rails

Everything you need to know about the Active Model Serializer gem

Active model serializer is a gem that allows you to customize your ruby on rails JSON response. With this gem, you can choose which and how attributes and relationships will be rendered.

React

Use Local Storage in React using hooks by building a progress tracker like Next.js' course page

Learn how to set up local storage in React using Hooks

Javascript

5 ways to remove duplicate objects from an array based on a property

Let's explore different ways to remove duplicate objects from an array based on a single property

Stimulus

Debounce and throttle in Stimulus

Debounce and throttle give us control over the rate at which a function is called. But do you call them in your stimulus controllers?

Stimulus

How to create hours input with Input Mask and Stimulus

If you are building an hour input, you can use input mask and stimulus to create a nice UI for your user.

Stimulus

Communicating between Stimulus controllers using custom events

One of the challenging things about Stimulus is communication between different Stimulus controllers.

Rails

Add FAQ markup schema to your articles in Ruby on Rails

Learn how to add a FAQ model for your articles in your Ruby on Rails application and then create the markup schema that you can put within your head tag.

Workflow

Set up a https remote when ssh is not working

Last week I was working from a café and I had to pull and push code to Github. But I got the following error

Rails

Current attributes in Rails

Rails 5.2 adds support for CurrentAttributes which give you access to global variables in your application.

Ruby

The difference between Ruby Public, Private & Protected methods

Ruby, like many other languages, allows you to control the access control of your methods. They can either be public (you can call the from anywhere), private or protected. In Ruby, all methods are public by default, so it's up to you to make them private or protected.

Javascript

How to use Local Storage in Javascript with an example

Web developers can use Local Storage to store data across browser sessions without an expiration date. You can read, write and delete data.

React

Implement an exit intent modal in React

Exit intent is a marketing strategy which increases conversion without being obstructive and annoying to customers. It displays a modal before the user leaves the page.

Css

What to do if purgeCSS is purging code inside an ignore block

A simple answer as to why your purgeCSS code is still purging you CSS/Tailwind code even though it is still inside an ignore block

Rails

How to pass attr accessors in your JSON response

If your attr accessors are not being passed through your json response, here's how to fix it

Javascript

Create a simple cookie policy popup

A tutorial teaching you how to create a cookie policy consent popup without using any libraries

Rails

What are the Ruby on Rails column types?

Find out all the different column types that you can add in your Ruby on Rails app.

Rails

How to run a worker from the console

If you want to test your sidekiq worker from the console, you can call it using the following command.

Ruby

What are Getter and Setter methods in Ruby?

If you want to either retrieve or set a value of an instance variable from a Ruby class, you need to learn about getters and setters. Learning about attr_accessor is also really useful to help you keep your class clean and tidy.

Ruby

Intro to Ruby Classes

Classes are the basic building block in Object Oriented Programming (OOP). They define the blueprint for creating objects. In this lesson, we will learn everything that we need to start working with Ruby Classes.

Rails

First vs take vs Limit methods in Rails

Learn about the differences between the methods first vs take vs limit

Rails

Checklist for deploying your Rails app to production on Heroku

Evething you need to do before you deploy. This is my checklist that I follow when I deploy a new feature of my Rails app to production on Heroku.

Rails

An easy way to connect your Rails server to your phone

Test your Rails application on your mobile phone or another laptop when they are connected to the same IP address

Ruby

The safe navigation operator (&.) in Ruby

Ruby's safe operator is used when you don't want your app to throw an exception if a method is called on a nil object.

Workflow

The fastest way to kill a process on a specific port

How often do you have a running port that you need to kill. Here is the quicker way to shit it down.

Rails

How to upgrade from Rails 5.2 to Rails 6

Step by step process on how I upgraded my client's websites from Rails 5.2 to Rails 6

Rails

Why a Rails form validation error renders the wrong URL and how to fix it

Learn a bit more about render, redirect_to and resources to find out why the form validation error renders the wrong URL

Rails

Why Letter opener gem doesn't open your letters

This is a simple way to find out why Letter opener is not opening your letters - use .deliver! so you can raise an exception

Ruby

Ruby Symbols vs Strings

Learn about Ruby's symbols and strings - what are the similarities and differences and which of the two is faster

Rails

Implement a passwordless authentication with Sorcery

Paswordless auth is great and provides a simple UX for your user - in this tutorial I implement in my Rails app using the auth gem Sorcery