articles

Rails authentication with Devise

In this tutorial, we will be dealing with Rails authentication with Devise. If you don’t want to use Devise for authentication, you may refer to the article create basic authentication in Ruby on Rails instead. Devise has been around for some time now and have been used and reviewed thousands of times and still receives […]

Dynamically import class with no SSR in Next.js

In this tutorial, I will show you how to dynamically import class with no SSR in Next.js. Probably you already have seen this Next.js documentation regarding dynamically importing component with no SSR. But the problem with this is that it can only be used on React components, but what if we need to dynamically import […]

Test Doubles: Stubbing & Mocking

What are test doubles? Test doubles are a substitute for production apps used for testing purposes. There are at least five (5) types of test doubles according to Gerard Meszaros but we are going to focus on two (2) which are stubbing and mocking. The difference between stubbing & mocking Stubbing Doesn’t fail. Makes sure […]

How to use FullCalendar in Next.js

In this tutorial, we would be learning on how to use FullCalendar in Next.js. You might have been able to come here because you have encountered an error Element is not defined when you are trying to use FullCalendar in Next.js project. Before we proceed with the solution, I will just point out the cause […]

Rails file upload using Active Storage

In this tutorial, we would be learning to upload files in Rails. Rails file upload have become easier since the release of Active Storage. It allows us to handle file uploads without using any gem. This tutorial aims to deliver the simplest way to integrate Rails file upload. We would be skipping the details on […]

Advantages and disadvantages of UUID

WHAT IS UUID? A universally unique identifier (UUID) also known as a globally unique identifier (GUID) is a 128-bit number used to identify computer systems information. UUID VERSIONS V1 – Generated based on server’s mac address & current timestamp. (predictable) V3 – Generated based on the MD5 hash of namespace and name. (high probability of […]

How to create basic authentication in Ruby on Rails

In this tutorial, we will be creating a basic authentication in Ruby on Rails. Step 1: Adding a password_digest field to the model. This field will be used for authenticating the user. Step 1.1-A: Coming from a fresh Rails project. If you are doing this from a fresh project then you must first create a […]

How to convert HTML to PDF in PHP

In this tutorial, we will be learning on how to convert HTML to PDF in PHP. There are many PHP libraries around the internet nowadays but most of them just don’t work like you expected it to be. I have been required by my client to automatically generate documents in pdf format. I have tried […]

How to resize an image in PHP

In this tutorial, we will learn to resize an image in PHP. Whenever you are doing something like a CMS for your website that requires an image to be uploaded then you can have a problem where users upload images in different dimensions. This can be a problem in the front-end as your design will […]

Converting timestamp to time ago in PHP like Facebook

In this tutorial, we will be learning on how to convert timestamp to time ago in PHP. Most of you have noticed that the famous social networking site Facebook uses the time ago instead of posting the original timestamp. Time ago is calculated based on the difference between the current time and date to the […]