Getting year-month-date from JS dates

If you ever find yourself in a situation where you need to extract only the year, month, and day from a JavaScript date object, here’s a simple solution. Let’s say you want today’s date in the following format: 2023-01-20T07:00:00+02:00. You want the time portion (T07:00:00+02:00) to always remain the same, but the date part should reflect the current date. The toISOString() method of the JavaScript Date object can give you the complete date and time in the following format: 2023-01-10T07:35:37....

Git Workflow for Managing Multiple Branches

As a senior developer, I rely on Git as my go-to version control tool for all my projects. Over the years, I have honed a strategy inspired by the principles outlined in “A Successful Git Branching Model” by Vincent Driessen. This strategy allows me to efficiently manage work on multiple branches while keeping the codebase organized and stable. Permanent Branches: Master and Develop To maintain a structured flow of work, I always have two permanent branches: master and develop....

Glitch: A Powerful Platform for Developers

Glitch is an incredible platform for learning and experimenting with code. In this blog, we will introduce you to Glitch and explore how it can take you from zero to hero in no time. Glitch is a remarkable platform for learning how to code. It provides a fun and interactive interface that allows you to showcase your concepts and allows others to build upon your projects. As a developer, I frequently use Glitch for my tutorials because it is an excellent tool that enables me to easily demonstrate concepts and provide a hands-on experience for users....

Go Data Structures: Binary Search Tree

In this article, we will analyze and implement the Binary Search Tree data structure in Go. A Binary Search Tree is a hierarchical data structure where each node can have a maximum of two children. The left child of a node always has a value less than the value of the right child. This data structure is useful for efficient storing, indexing, and retrieval of data. Terminology Before diving into the implementation details, let’s go over some terminology related to Binary Search Trees:...

Go Data Structures: Set

In this technical blog, we will analyze and implement the Set data structure in Go programming language. A Set is a collection of values that allows various operations such as iteration, addition, removal, size retrieval, and checking if an item is present. Sets do not allow duplicates, meaning each value can only be stored once. First implementation Let’s start with a simple implementation of the Set data structure. This implementation is not yet concurrency safe, as we have skipped locking resources for the sake of simplicity and understanding....

Go Operators: A Comprehensive Guide

In Go, operators are an essential aspect of programming that allow us to perform a wide range of operations. In this article, we will explore the various operators in Go and their functionalities. Let’s dive in! Assignment Operators Go provides two assignment operators: = and :=. These operators are used to declare and initialize variables. Here’s an example: var a = 1 b := 1 Comparison Operators Comparison operators are used to compare two values and return a boolean result....

Going Independent: A Developer's Perspective on Working Solo

In the ever-changing landscape of software development, the idea of working independently as a developer has gained traction. Having spent the past 10 years working on various teams, I have had the opportunity to reflect on the benefits and challenges of being a solo software developer. In this blog post, I will share my thoughts and experiences on the topic. Freedom: The Best Part of Being Independent As an independent contractor, the most significant advantage I have experienced is the freedom it brings....

GraphQL API vs REST API: Understanding the Differences

There are significant differences between GraphQL and REST when it comes to building APIs, and understanding these distinctions can help determine which approach is best for your specific use case. REST as a Concept REST (Representational State Transfer) has become the de-facto architecture standard for building APIs. However, REST does not have a formal specification and has multiple unofficial definitions. On the other hand, GraphQL has a comprehensive specification and operates as a Query Language with a well-defined set of tools and a thriving ecosystem....

Handling CORS in Express: Enabling Cross-Origin Requests

Cross-Origin Resource Sharing (CORS) is a mechanism that allows JavaScript applications running in a browser to make HTTP requests to servers on different domains, subdomains, ports, or protocols. By default, browsers enforce the same-origin policy, which means that cross-origin requests are not allowed. To enable cross-origin requests in your Express application, you need to set up a CORS policy on the server. This is particularly important when working with modern browser features such as ES Modules....

Handling forms in JavaScript: A Beginner's Guide

Discover the basics of working with forms in HTML and JavaScript to enhance user interaction and enable various functionalities on your web page. Forms play a crucial role in HTML and the Web Platform as they allow users to interact with the page in various ways, such as searching for something on the site, triggering filters to narrow down result pages, and sending information. By default, forms submit their content to a server-side endpoint, with the default endpoint being the page URL itself....