Skip to content

Instantly share code, notes, and snippets.

View gustavocoleta's full-sized avatar
🤓

Gustavo Coleta gustavocoleta

🤓
View GitHub Profile
@gustavocoleta
gustavocoleta / prepare-commit-msg
Created February 29, 2024 17:33
prepare-commit-msg
#!/bin/bash
# Include any branches for which you wish to disable this script
BRANCHES_TO_SKIP=(main)
# Get the current branch name and check if it is excluded
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_EXCLUDED=$(printf "%s\n" "${BRANCHES_TO_SKIP[@]}" | grep -c "^$BRANCH_NAME$")
# Trim it down to get the parts we're interested in with a comment # at line start
TRIMMED=$(echo \# $BRANCH_NAME | sed -e 's:^\([^-]*-[^-]*\)-.*:\1:' -e \
'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/')
@gustavocoleta
gustavocoleta / publish.py
Created July 28, 2023 20:31
Publish on RabbitMQ Queue using Python
#!/usr/bin/python3
import pika, os, logging, json
logging.basicConfig()
credentials = pika.PlainCredentials('user', 's3cre7')
parameters = pika.ConnectionParameters('localhost',
5672,
'/',
@gustavocoleta
gustavocoleta / getCommitCountAfterLastTag.md
Last active July 13, 2021 13:14
Obter a quantidade de commits após a ultima tag criada
  1. Obter a ultima tag criada
$ git describe --tags --abbrev=0 $(git rev-list origin/main --tags --max-count=1)
  1. Obter o sha através do nome da tag
$ git log origin/main v1.2.9 -1 --pretty=%H
@gustavocoleta
gustavocoleta / PostgreSQLInstallationCentOS7.md
Last active April 12, 2021 17:57
PostgreSQL Installation in Linux CentOS 7
  1. Instalar os packages:
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install postgresql11
yum install postgresql11-server
yum install postgresql96-contrib
  1. Inicializar o banco de dados e habilitar o início automático: