This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function to activate virtual environment | |
function auto_activate_env() { | |
# Check for the presence of your custom environment file, e.g., `.venvfile` | |
if [ -f ".venvfile" ]; then | |
# Read the full path to the activate script from .venvfile | |
ENV_PATH=$(cat .venvfile) | |
if [ -f "$ENV_PATH" ]; then | |
# Check if already activated to prevent redundant activations | |
if [[ "$VIRTUAL_ENV" != "$(dirname "$ENV_PATH")" ]]; then | |
source "$ENV_PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This function checks if the email is valid and return the email if it is valid or return false if it is not valid | |
If covers all the modern email formats and top level domains. | |
*/ | |
const checkEmail = (email, cleanEmail = false) => { | |
const cleanUp = () => { | |
// Removing all spaces from the email | |
email = email.replace(/\s/g, ''); |