Skip to content

Instantly share code, notes, and snippets.

View guicaulada's full-sized avatar

Guilherme Caulada guicaulada

View GitHub Profile
@guicaulada
guicaulada / statusline.sh
Created February 13, 2026 17:35
~/.claude/statusline.sh
#!/usr/bin/env bash
# Read JSON input from stdin
input=$(cat)
# Extract all data from JSON in a single jq call
eval "$(echo "$input" | jq -r '
@sh "model=\(.model.display_name // "Unknown")",
@sh "context_total=\(.context_window.context_window_size // 0)",
@sh "context_percentage=\(.context_window.used_percentage // 0)",
@guicaulada
guicaulada / rebalance-shares.sh
Last active January 7, 2026 12:58
Rebalance your shares
#!/bin/bash
# Script to calculate the number of shares to buy/sell for rebalancing.
# Formula: ((market_value * target_percentage / current_percentage) - market_value) / last_price
# Percentages can be provided as decimals (e.g., 0.20 for 20%) or integers (e.g., 20 for 20%).
# The script assumes consistent format for both percentages.
usage() {
echo "Usage: $0 market_value target_percentage current_percentage last_price"
echo ""
@guicaulada
guicaulada / cmator-backup.sh
Created December 29, 2025 06:54
Cryptomator Backup script
#!/usr/bin/env bash
# Usage:
# ./backup_script.sh encrypt <input_folder1> [input_folder2 ...] [output_file]
# ./backup_script.sh decrypt <input_file> [output_dir]
#
# Examples:
# ./backup_script.sh encrypt FINANCE/ RECOVERY/ 202512290317-BACKUP.tar.gz.gpg
# ./backup_script.sh decrypt 202512290317-BACKUP.tar.gz.gpg
#
@guicaulada
guicaulada / find-malicious-npm.sh
Last active September 16, 2025 03:23
Find malicious NPM packages on any node_modules folder in the system
#!/bin/bash
# Function to display a spinner
spinner() {
local pid=$1
local delay=0.1
local spinstr='|/-\'
while kill -0 $pid 2>/dev/null; do
local temp=${spinstr#?}
printf " [%c] " "$spinstr"
@guicaulada
guicaulada / cloudSettings
Last active December 16, 2022 16:22
Visual Studio Code Settings Sync Gist
{"lastUpload":"2022-12-16T16:22:02.205Z","extensionVersion":"v3.4.3"}
@guicaulada
guicaulada / Mac Launchpad Scripts
Last active May 20, 2022 22:52
Scripts with SQLite Commands for Mac Launchpad
Mac Launchpad Scripts
@guicaulada
guicaulada / deleteMessages.js
Created February 20, 2022 07:09
Delete messages from users that left your server
async function clearMessages(server, channel, author, offset=0) {
const authToken = 'YOUR_DISCORD_TOKEN';
const headers = { 'Authorization': authToken, 'Content-Type': 'application/json' };
const baseURL = `https://discordapp.com/api/v6/channels`;
let searchURL = `https://discordapp.com/api/v6/guilds/${server}/messages/search?channel_id=${channel}&offset=${offset}&include_nsfw=true`;
let clock = 0;
let interval = 2000;
function delay(duration) {
return new Promise((resolve, reject) => {
@guicaulada
guicaulada / pictureInPicture.js
Last active February 20, 2022 06:41
Remove discord picture in picture
$("[class^=pictureInPicture]").remove()
!.gitignore
!.htaccess
!.htpasswd
%20../
%2e%2e//google.com
%3f/
%EXT%
%ff/
..;/
.7z
@guicaulada
guicaulada / functions.js
Last active December 24, 2020 01:08
Discord Console Functions
// Use CTRL + SHIFT + I to open Discord Developer Console
let _$$ = $$ // Setup jQuery
// Forever utilities
let forevers = {}
let startForever = async (id, f, t) => {
f()
forevers[id] = setTimeout(() => startForever(id, f, t), t)
}