#Python
If you need to find the index of the minimum element in a list, you can do one of the following:
Option 1 – Using min() and index()
lst = …
Read Article →
#Python
If you need to convert a set to a string in Python, then you can do one of the following:
Option 1 – Using map() and join()
str_new = ', …
Read Article →
If you need to decrement a loop in Python, then you can do the following:
How to Decrement a loop in Python using -1
The optional third argument you …
Read Article →
#Python
If you need to create a zip of a directory using Python, then you can do the following:
Create a Zip using shutil in Python
import os
import shutil …
Read Article →
#PHP
If you need to remove the last character of a string in PHP, then you can do the following:
Option 1 – Using rtrim()
Syntax: rtrim($string, …
Read Article →
#PHP
If you need to create a PHP function that returns multiple values, then you can do one of the following.
Option 1 – Returning an array
function …
Read Article →
#Javascript
#Node
If you need to download a file in NodeJS without using any third party libraries, then you can do the following.
The NodeJS ecosystem comes with a fs …
Read Article →
#CLI
#Javascript
#Node
If you need to execute a shell script in NodeJS, then you can use the exec keyword.
Syntax: exec(command [, options] [, callback]
const shell = …
Read Article →
#Python
If you need to print out multiple arguments using Python, then you can do one of the following:
Option 1 – Using print
print("Something", …
Read Article →
#CLI
#Terraform
If you need to delete all resources created by Terraform, except for a single, specific one, then you can do the following:
Step 1 – Get the current …
Read Article →
#Ansible
#CLI
If you need to copy files between two (2) nodes, using Ansible, then you can do the following:
This solution uses the synchronize module, specifically …
Read Article →
#Ansible
#CLI
If you need to delete files and folders in a directory using Ansible, then you can do the following:
- name: Delete content & entire directory …
Read Article →