Skip to content

Instantly share code, notes, and snippets.

View filipedfs's full-sized avatar
👨‍🎓
In the middle of the journey

Filipe Fonseca filipedfs

👨‍🎓
In the middle of the journey
View GitHub Profile
@filipedfs
filipedfs / AnalyzeMethodHierarchy.ipynb
Created October 13, 2025 23:21
Find class usages using Kotlin Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@filipedfs
filipedfs / script.sh
Created July 9, 2023 12:26
Create a python virtual environment
python3 -m venv path-to-venv # Normally I use "venv" as the name of the folder
source path-to-venv/bin/activate
@filipedfs
filipedfs / git-post-push-function.sh
Created March 28, 2022 21:27 — forked from koddsson/git-post-push-function.sh
Runs a `post-push` hook after a successful run of `git push`
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
}
@filipedfs
filipedfs / kubefwd.sh
Created December 7, 2021 02:44
kubefwd working command
sudo --preserve-env kubefwd svc -n foo
@filipedfs
filipedfs / .bashrc
Created November 4, 2021 20:27
Show git branch on terminal
# 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\]
@filipedfs
filipedfs / query_postgres_jsonb.sql
Last active October 25, 2021 19:02
Postgres query to search inside jsonb
-- {"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
)
@filipedfs
filipedfs / kubernetes_commands.sh
Last active June 30, 2022 18:32
Kubernetes commands
# List nodes
kubectl get nodes
# List pods
kubectl get pods
# List services
kubectl get services
# Apply a monifest file
@filipedfs
filipedfs / main.dart
Created June 9, 2021 18:19
Format CPF
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('');
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

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII