Skip to content

Instantly share code, notes, and snippets.

View angeloevangelista's full-sized avatar
🌎
Studying (why a globe?)

Angelo angeloevangelista

🌎
Studying (why a globe?)
  • Lab2Dev
  • São Paulo
View GitHub Profile
@angeloevangelista
angeloevangelista / gist:cb2760988c47e5ec9cca5f00cedb3fa4
Created February 15, 2024 19:46
serialize-env-to-json-array.sh
for var in $(printenv); do env_arr="${env_arr}{\"key\":\"${var%%=*}\",\"value\":\"${var#*=}\"},"; done
export ENV_JSON=[${env_arr%,}]
echo "${ENV_JSON}"
@angeloevangelista
angeloevangelista / pre-request-script-for-bitbucket-auth.js
Created February 8, 2024 17:04
Pre request script to get bitbucket api auth on postman
const requestData = {
grant_type: 'client_credentials',
client_id: pm.environment.get('bitbucket_client_id'),
client_secret: pm.environment.get('bitbucket_client_secret'),
}
const payload = Object
.entries(requestData)
.map(([key, value]) => `${key}=${value}`,)
.join('&');
function fillTags(tagsObject) {
const tagsSpanElement =
document
.evaluate('(//h2/span[contains(., "Tags")])[last()]', document)
.iterateNext() ||
document
.evaluate('(//button/span[contains(., "Add new tag")])[last()]', document)
.iterateNext();
const checkElementIsRootContainer = (element) =>
@angeloevangelista
angeloevangelista / delete_bitbucket_project.py
Created May 24, 2023 18:52
It deletes a bitbucket project (and sends all the repositories within to hell)
import requests
def delete_bitbucket_project(access_token: str, account: str, project_key: str):
project_repositories = []
default_api_headers = {
'authorization': f'Bearer {access_token}'
}
current_page = 1
@angeloevangelista
angeloevangelista / format_json.js
Created April 28, 2023 18:22
It formats json on AWS Secrets manager page
(() => {
const preEl = document.querySelector("pre");
const jsonPreEl = document.createElement('pre');
jsonPreEl.innerText = [
"Your pretty json 😉",
'',
JSON.stringify(JSON.parse(document.querySelectorAll("pre")[0].textContent), null, 2),
].join('\n');
#!/bin/bash
npx nodemon --watch './**/*' --ext '.go' --signal SIGTERM --exec 'go' run ./cmd/
# or whatever creepy folder you entry point is
@angeloevangelista
angeloevangelista / base64.md
Created December 19, 2022 19:31 — forked from jdsimcoe/base64.md
A guide to how to embed Base64 stuff in your web stuff.

HTML

Here is some code on how to embed Base64 in HTML:

JPEG

<img src="data:image/jpeg;base64,BASE64_STRING"/>

PNG

#!/bin/bash
$AWS_ECR_ENDPOINT=""
echo "export AWS_DEFAULT_REGION=us-east-1" >> ~/.bashrc
source ~/.bashrc
# Docker installation
sudo whoami
@angeloevangelista
angeloevangelista / extractPaths.ts
Last active January 27, 2023 01:36
Recursive strategy to extract paths
export interface TreeType {
name: string;
children: TreeType[];
}
const originalTree: TreeType = {
name: "root",
children: [
{ children: [], name: "products" },
{
Write-Output "Gonna press Enter for u 😎"
Timeout /T 1800
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('Title')
Sleep 1
$wshell.SendKeys('~')