Blog Posts

How to Create a Reverse Polish Notation Calculator in Javascript

May 5, 2022

The challenge Your job is to create a calculator which evaluates expressions in Reverse Polish notation.


Read More

How to declare a global variable in React?

May 4, 2022

If you need to declare a global variable in React, then you can do the following:


Read More

How to Find the Missing Term in an Arithmetic Progression in Javascript

May 3, 2022

The challenge An Arithmetic Progression is defined as one in which there is a constant difference between the consecutive terms of a given series of numbers.


Read More

How to Count Characters in a Javascript String

May 2, 2022

The challenge The main idea is to count all the occurring characters in a string.


Read More

How to Increment/Decrement a value in React/NextJS

May 1, 2022

Use the following code block to get started: function GetCount() { const [count, setCount] = useState(1); const incrementCounter = () => { setCount(count+1) } const decrementCounter = () => { if (count>1) setCount(count-1) } return <div className="_counterWrapper"> <span className="_dec" onClick={() => decrementCounter()}>-</span> <span className="_val">{count}</span> <span className="_inc" onClick={() => incrementCounter()}>+</span> </div> } Then in your HTML code, add it like this:


Read More

How to disable text selection highlighting in CSS

April 30, 2022

If you would like to disable the text selection highlighting that is enabled by default on all browsers, then you can do this:


Read More

Irreducible Sum of Rationals in Golang

April 29, 2022

The challenge You will have a list of rationals in the form:


Read More

How to copy S3 objects between AWS accounts

April 28, 2022

In your source account create a customer-managed policy: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetObject" ], "Resource": [ "arn:aws:s3:::source-EXAMPLE-BUCKET", "arn:aws:s3:::source-EXAMPLE-BUCKET/*" ] }, { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:PutObject", "s3:PutObjectAcl" ], "Resource": [ "arn:aws:s3:::destination-EXAMPLE-BUCKET", "arn:aws:s3:::destination-EXAMPLE-BUCKET/*" ] } ] } In your destination bucket, update the bucket policy:


Read More

How to find all symlinks in a directory tree on Mac

April 27, 2022

If you need to recursively find all symbolic links in a directory tree on a Mac, then you have a couple of options.


Read More

How to Install App Mesh on AWS EKS

April 26, 2022

You can follow the steps below to install App Mesh on AWS EKS (Kubernetes).


Read More

[Solved] Kubernetes Namespace stuck in Terminating state

April 25, 2022

If you have tried to delete a Kubernetes namespace, and it has been hanging in ‘deleting’ for hours on end, it’s likely that you have dangling resources that have not deleted yet.


Read More

[Solved] error: src refspec main does not match any

April 23, 2022

If you get the following error: error: src refspec main does not match any error: failed to push some refs to 'https://github.


Read More

How to Force a Redeploy in Kubernetes

April 22, 2022

If you need to force a redeploy of a deployment in Kubernetes , then you can use the rollout feature.


Read More

How to Print to stdout in Flask using Python

April 21, 2022

If you are trying to print() to the console/stdout in your Flask app, but nothing is happening, then you just need to flush your prints, as follows:


Read More

How to Restart a Deployment in Kubernetes

April 20, 2022

If you need to restart a deployment in Kubernetes, perhaps because you would like to force a cycle of pods, then you can do the following:


Read More

How to push multiple Dockerfile apps to AWS ECR at the same time

April 19, 2022

I have a parent directory containing multiple sub-directories. Each of these child directories is a different application and contains a Dockerfile.


Read More

How to Create a Horizontal Pod Autoscaler in Kubernetes

April 18, 2022

If you could like to a create a Horizontal Pod Autoscaler (hpa) in Kubernetes, then you could run the following:


Read More

How to Run a Load Generator on Kubernetes

April 17, 2022

If you would like to test hpa, Horizontal Pod Autoscaling, or throw some chaos at a specific deployment in Kubernetes , then you could run a Load Generator


Read More

How to Deploy a Metrics Server in Kubernetes

April 16, 2022

If you would like to deploy a Metrics Server in Kubernetes , then you first need to create a namespace for it to live it, followed by installing the actual metrics server.


Read More