How to Wait 1 Second in Javascript
If you need your Javascript code to wait one (1) second (or more) while executing, then there are a couple of ways to achieve this.… Read More »How to Wait 1 Second in Javascript
If you need your Javascript code to wait one (1) second (or more) while executing, then there are a couple of ways to achieve this.… Read More »How to Wait 1 Second in Javascript
Arrays come with a useful forEach function that allows you to loop through the array. You can also get the index in each loop as… Read More »How to use forEach method in Javascript
If you need to remove an element from an array in Javascript, then you can use one of the following five (5) options: Option 1… Read More »How to Remove an Element from an Array in Javascript
If you need to get an array of alphabetical letters in Javascript then you can use one of the following: Option 1 – Explicitly define… Read More »How to get the Alphabet as Array in Javascript
With the Power of Two, you can ask the following: How do you find the powers of 2? What does the power of 2 stand… Read More »The Power of Two (2) Table
Javascript gives a few options to determine the screen width. When we say screen, we mean the browser window’s width itself. Option 1 – Using… Read More »How to get the Screen Width in Javascript
If you need to read a file in Rust, then you can use the fs package from the standard library:
If you need to convert an array to a string in Java, then you could look at a solution like this: Or you could do… Read More »How to Convert Array to String in Java
If you need to join two (2) strings together in Golang, you can do the following, using the + concatenation operator:
If you need to recursively delete all files in an AWS S3 bucket, then you can do the following: If you only want to delete… Read More »How to Recursively Delete all Files in an AWS S3 Bucket
If you want to execute linux commands in Golang, then you can use exec.Command:
If you need to check for Prime Numbers in Golang, then you can use the following method:
If you need to raise a number to a power in Golang, then you can use the math.Pow function:
If you need to get the CPU Frequency in Linux, then you can run the following command:
How can python pandas disable warnings? If you need to disable warnings with Pandas on Python, then you can use the warnings module and ignore… Read More »How to Disable Warning with Python Pandas
If we take the following list: How do we extract only the UpperCase letters of a given word? How to get only the Capital Letters… Read More »How to Get all Caps Alphabet as List in Python
When you are trying to create an RDS database and you get the dreaded error message: IAM role ARN value is invalid or does not… Read More »[Solved] Error creating RDS DB Instance: IAM role ARN value is not value or does not include the required permissions for: ENHANCED_MONITORING
Step 1 – Lambda Code in Python The following code expects a python file with the contents as follows in a file called python/script1.py: Step… Read More »How to create an AWS Lambda in Terraform
If you get the Instance Profile already exists error when running your Terraform apply, then it is either because an instance profile with that name… Read More »[Solved] Instance Profile already exists in Terraform
If you are using aws configure sso to populate your ~/.aws/credentials file and you get the following error when you try and reauthorize, then you… Read More »[Solved] An error occurred (UnauthorizedException) when calling ListAccounts operation: Session token not found or invalid
If you need to match a string in a file, then grep is your friend. An example of using grep Let’s take a file called… Read More »How to Match Multiple Strings with grep
If you want to invoke an AWS Lambda from your CLI, then the best option is to have the AWS CLI installed. Getting started with… Read More »How to Invoke an AWS Lambda from the CLI
Sometimes you might want to exit a command if a variable is not set in Bash. You can do this as follows:
if you have a conditional in your Gitlab pipeline stage that checks if something has succeeded or failed, then you can use this to pass… Read More »How to Force Gitlab pipeline to fail on condition
If you find yourself having the requirements to support both AWS CLI v1 and v2 simultaneously, then you can use the following conditional in Bash… Read More »How to run AWS CLI commands based on AWS CLI Version in Bash