Skip to content

Instantly share code, notes, and snippets.

View ValterAndrei's full-sized avatar
馃彔
Working from home

Valter Andrei ValterAndrei

馃彔
Working from home
  • Po莽os de Caldas - MG, Brasil
View GitHub Profile
@ValterAndrei
ValterAndrei / Google OAuth2 Testing Guide.md
Created April 9, 2025 12:14
Google OAuth2 Testing Guide

Google OAuth2 Testing Guide

1. Gerar URL de redirecionamento e abrir no navegador

https://accounts.google.com/o/oauth2/auth?client_id=SEU_CLIENT_ID&redirect_uri=http://localhost:3000/users/auth/google_oauth2/callback&scope=profile%20email&response_type=code&access_type=offline

2. Copiar o c贸digo de autoriza莽茫o, ap贸s o login

http://localhost:3000/users/auth/google_oauth2/callback?code=SEU_CODIGO&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=1&prompt=consent
@ValterAndrei
ValterAndrei / start鈥恠top-instances.md
Last active March 13, 2025 13:50
Automating Instance Start/Stop - AWS, Lambda, EC2, RDS and Ruby

Automating Instance Start/Stop with AWS Lambda

  • Ruby 3.3
  • EC2 Instances
  • RDS DB Instance

Create Policy

IAM > Policies > Create policy > JSON > [copy + paste] > Next > Policy name: start-stop-instance-policy

@ValterAndrei
ValterAndrei / cpf_cnpj_regex.md
Last active July 27, 2022 12:29
Regex for CPF and CNPJ
  • CPF
/^\d{3}\.\d{3}\.\d{3}\-\d{2}$/
  • CNPJ
/^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/
# Stop all containers
docker stop $(docker ps -qa)
# Remove all containers
docker rm $(docker ps -qa)
# Remove all images
docker rmi -f $(docker images -qa)
# Remove all volumes