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
#!/usr/bin/env bash | |
set -o nounset -o pipefail -o errexit | |
main() { | |
local INSTALL_PATH="${HOME}/code" | |
local GITHUB_USER="ViBiOh" | |
local DOTFILES_NAME="dotfiles" | |
local DOTFILES_BRANCH="main" | |
local ARCHIVE_FILENAME="${INSTALL_PATH}/dotfiles.zip" |
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
#!/usr/bin/env bash | |
git_is_inside() { | |
git rev-parse --is-inside-work-tree 2>&1 | |
} | |
git_root() { | |
if [[ $(git_is_inside) != "true" ]]; then | |
pwd | |
return |
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
#!/usr/bin/env bash | |
diffInitial=`git diff --name-only --diff-filter=ACMR` | |
BLUE='\033[0;34m' | |
RED='\033[0;31m' | |
RESET='\033[0m' | |
package=`git diff --cached --name-only --diff-filter=ACMR | grep -E "package.json$"` | |
js=`git diff --cached --name-only --diff-filter=ACMR | grep -E "jsx?$"` |
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 isFunction(potentialFunction) { | |
return potentialFunction && Object.prototype.toString.call(potentialFunction) === '[object Function]'; | |
} | |
function stringsReplace(str, callback) { | |
if (isFunction(callback)) { | |
str.replace(/(["'`])((?:(?=(\\?))\3.)*?)\1/gmi, (all, quote, value) => callback(value)); | |
} | |
return str.replace(mustacheRegex, callback); | |
} |
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
email.trim().replace(/^(.*?)(?:\+.*?)?(@gmail\.com)$/gi, '$1$2').replace(/\.(?!com$)/g, ''); |