some tools for diagrams in software documentation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
python3 -m venv path-to-venv # Normally I use "venv" as the name of the folder | |
source path-to-venv/bin/activate |
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
git() { | |
ROOT="$(/usr/bin/git rev-parse --show-toplevel)" | |
LOCATION="/.git/hooks/post-push" | |
if [ "$1" == "push" ] && [ -f "$ROOT$LOCATION" ]; then | |
/usr/bin/git $* && eval $ROOT$LOCATION | |
else | |
/usr/bin/git $* | |
fi | |
} |
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
sudo --preserve-env kubefwd svc -n foo |
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
# Add this code to .bashrc or .bash_profile file on ~/ | |
# \u: usuário atual | |
# \h: nome da máquina (host) | |
# \H: nome da máquina completo | |
# \w: diretório de trabalho atual | |
# \W: diretório de trabalho atual com o nome base (último segmento) apenas | |
# $(__git_ps1 "%s"): branch atual caso esteja em um repositório git, senão exibe nada. | |
# azul: \[\033[0;34m\] | |
# vermelho: \[\033[0;31m\] | |
# vermelho fluorescente: \[\033[1;31m\] |
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
-- {"contacts":[{"phoneNumber":987654321}]} See: https://www.postgresql.org/docs/12/functions-json.html | |
SELECT contacts | |
FROM customer | |
WHERE contacts @? '$[*] ? (@.phoneNumber == 987654321)'; | |
-- Other way | |
WITH data AS ( | |
SELECT jsonb_array_elements(contacts)->>'phoneNumber' "phoneNumber" | |
FROM customer | |
) |
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
# List nodes | |
kubectl get nodes | |
# List pods | |
kubectl get pods | |
# List services | |
kubectl get services | |
# Apply a monifest file |
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
void main() { | |
final String text = '11122233344'; | |
print(maskText(text, 'CPF')); | |
} | |
String maskText(String text, String type) { | |
// Format CPF. | |
if (type == 'CPF') { | |
final List<String> chars = text.split(''); |
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
version=$1 | |
if [ -z "$version" ] | |
then | |
echo "The version of the release: " | |
read -r version | |
fi | |
if [ -z "$version" ] | |
then | |
echo Version not defined | |
else |
NewerOlder