Skip to content

Instantly share code, notes, and snippets.

View calexandre's full-sized avatar
:shipit:
🤘

Carlos Alexandre calexandre

:shipit:
🤘
View GitHub Profile
@calexandre
calexandre / main.tf
Created December 4, 2022 18:25
terraform code to get all GCP shared-vpc service-projects attached to a particular host-project
# instructions:
# on the first run you to target apply otherwise terraform will complain with for_each
# 1. terraform apply -target='null_resource.projects'
# 2. terraform apply
terraform {
required_providers {
google = {
source = "hashicorp/google"
}
@calexandre
calexandre / azurerm-find-private-endpoint-zones.tf
Last active December 19, 2022 16:43
azurerm-find-private-endpoint-zones.tf
locals {
azurerm_private_endpoint = {
custom_dns_configs = [
{
"fqdn" = "something.westeurope.data.azurecr.io"
"ip_addresses" = [
"10.10.10.202"
]
},
{
@calexandre
calexandre / script.js
Last active February 11, 2024 13:42
script para acelerar o processo de classificação no site e-factura (usado em 2022)
/* Como executar:td:icontains
* Abrir o site na página das faturas a classificar e abrir a consola javascript nas DevTools.
* Copy & Paste do código js e executar para cada página
*/
// comparação case insensitive
jQuery.expr[':'].icontains = function(a, i, m) {
return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
};
@calexandre
calexandre / merge-zsh-history.sh
Last active April 3, 2024 14:11
Merge two zsh history files
#!/bin/bash
# Inspired on https://david-kerwick.github.io/2017-01-04-combining-zsh-history-files/
set -e
history1=$1
history2=$2
merged=$3
echo "Merging history files: $history1 + $history2"
test ! -f $history1 && echo "File $history1 not found" && exit 1