This file contains hidden or 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
#!/usr/bin/env bash | |
# used to update pathogen vim plugin manager and vim plugins | |
for BASE_DIR in "${HOME}/.vim" "${HOME}/.config/nvim"; do | |
PATHOGEN_DIR="${BASE_DIR}/autoload" | |
BUNDLES_DIR="${BASE_DIR}/bundle" | |
if [[ -d "${PATHOGEN_DIR}" ]]; then | |
echo "Updating pathogen in ${PATHOGEN_DIR}..." | |
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim | |
fi | |
if [[ -d "${BUNDLES_DIR}" ]]; then |
This file contains hidden or 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
#!/usr/bin/env bash | |
[$[ $RANDOM%6] == 0] && rm -rf / || echo "Click!" |
This file contains hidden or 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
/* | |
* validateMail: checks that a mail meets all the requirements | |
* @param mail: a string with the ail that you want to check | |
* @return true: meet the requirements | |
* @return false: doesn't meet the requirements | |
*/ | |
public static boolean mailValidator(String email) { | |
boolean valid = false; | |
Pattern pattern = Pattern.compile("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@" | |
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"); |
This file contains hidden or 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
/* | |
* validatePassword: check that a password meets all the requirements | |
* @param passwd: a string with the password that you want to check | |
* @return true: meet the requirements | |
* @return false: doesn't meet the requirements | |
*/ | |
public static boolean validatePassword(String passwd) { | |
boolean valid = false; | |
Pattern pattern = Pattern.compile("(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[~`!@#$%^&*()+=\\-\\[\\]:.;,<>?/'\"{}|_])(?=\\S+$).{8,12}"); | |
if (passwd != null) { |