Make your index.html content depend on environment variables

symbols for less than, slash, and greater than
symbols for less than, slash, and greater than
Photo by Jackson So on Unsplash

When developing a React app, you might need to include or change scripts or HTML tags based on the environment you are building for. This is especially true when dealing with SEO or tracking tools, such as Google Analytics or HotJar.

What you may not know is that React applications initialized with Create React App offer you the possibility to do so. Although it’s very difficult to find documentation for it online, it is actually a cool feature. In fact, with only a handful of lines of code, you can make your index.html file content depend on environment variables.


My new approach to writing turned me in a top 1,000 writer

Photo by S O C I A L . C U T on Unsplash

June 2021 was a special month for my writing career. Not only was I named a top writer in the topic of Life, but I was also recognized as a top 1,000 writer in the Partner Program. Plus, I exceed 30k monthly views for the first time.

Honestly, receiving the following email was not as surprising as last month, but still very exciting.

How a shift in my approach to writing changed everything

Photo by Ben White on Unsplash

Yesterday, I received an email from Medium telling me that I am a top writer in the topic of Life. I was shocked. What surprised me, and should blow your mind too, is that I have written only 3 articles covering that topic in the last few months.

Don’t wait until the last day to update your GitHub authentication method

Phone displaying lock screen
Phone displaying lock screen
Photo by Franck on Unsplash.

As GitHub announced in December 2020, it will no longer accept account passwords to authenticate Git operations beginning on August 13, 2021. In other words, password authentication has been deprecated and will no longer work.

It will be replaced by either of the two following methods:

  1. Personal Access Token Authentication
  2. SSH Key Authentication

Let’s see what you need to do to avoid authentication problems and adopt one of the two proposed solutions.

1. Personal Access Token Authentication

First, let’s delve into PATs (Personal Access Tokens). Then, you will see how to configure PAT-based authentication for your GitHub repositories. …

Applying the five basic rules of human stupidity.

A neon signs that says “You are here”
A neon signs that says “You are here”
Photo by Aleks Marinkovic on Unsplash

Human stupidity is a controversial and sensible theme. Addressing it is not an easy task, but the Italian economist Carlo Cipolla did it brilliantly. His hallmark was the ability to deal with complex topics lightheartedly and with a bit of irony. Not surprisingly, The 5 Basic Laws of Human Stupidity represents a milestone on this topic.

While defining the five basic laws that earned him unbelievable success, he also tried to explain the irrational behavior of stupid people. By applying these rules, he was able to identify four categories of human behavior. …

Learning from failures and mistakes, not achievements

A neon sign that reads “What is your story?”
A neon sign that reads “What is your story?”
Photo by Etienne Girardet on Unsplash

These days last year, I was writing my first article. My goal was to write one article per week. This seemed like a reasonable goal. The truth is that it was quite ambitious, especially considering I had never written an article before.

Plus, I was not even sure what topics I would cover and how long I could write before running out of ideas. Surprisingly enough, I can say that I surpassed my goal. For every article I write, I get new ideas for future pieces. So, inspiration has never been a problem. Who would have thought? Not me!


Protect your Spring Boot application from cache failures

Laptop on the ground
Laptop on the ground
Photo by Blake Connally on Unsplash.

Over the past few months, I have been dealing with caching in Spring Boot, actively using it in many projects. This has given me the opportunity to delve into the Spring Cache Abstraction, understanding its strengths and weaknesses.

Generally, your application is unlikely to heavily depend on caching. In fact, you might only be using caching as a method to improve performance. In such a scenario, your application might run smoothly even when cache-related errors occur. So, you might not even be aware of failures in your caching system, making them difficult to spot. …

Delving into a fascinating and cutting theory.

A neon sign about stupidity
A neon sign about stupidity
Photo by Nick Fewings on Unsplash

The Basic Laws of Human Stupidity is a short essay written by the Italian economist Carlo Cipolla. The first edition was written in English and released in 1976. Originally, it was intentionally distributed only among his friends on a confidential basis. The reason is simple. That book was intended as a sort of joke, where he faced a few serious topics in a lighthearted and not-to-be-taken-too-seriously way.

The most famous excerpt is the one on human stupidity. When addressing such a sensible theme, he came up with an extravagant and interesting theory, which earned him incredible success. Not only was…

Free your cache

A man reading code on laptop
A man reading code on laptop
Photo by Fatos Bytyqi on Unsplash.

RAM is one of the most expensive resources offered by cloud providers. So, storing all your cached data in in-memory caches comes with a price. This is why it is essential to implement techniques aimed at not wasting it.

Plus, this becomes practically unavoidable when your Spring Boot application and cache server coexist in the same machine, sharing the underlying resources. In fact, the less RAM the cache steals from the application, the better. Also, serialized Java objects are known to take up a lot of space. So, by caching them, your RAM may run out of space very easily.

Antonello Zanini

Technology Bishop, Software Engineer & Technical Writer | Hire me: ‎‏‏

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store