Skip to content

Instantly share code, notes, and snippets.

View ItzaMi's full-sized avatar
🎧

Rui Sousa ItzaMi

🎧
View GitHub Profile
@ItzaMi
ItzaMi / rc-analytics-mjs
Created April 27, 2026 11:36
RevenueCat Analytics & Metrics
#!/usr/bin/env node
// RevenueCat v2 analytics fetcher.
// Usage: RC_API_KEY=sk_v2_... RC_PROJECT_ID=proj_... node rc-analytics.mjs [lifetime|28d|90d]
// Defaults to 28d. Prints the overview snapshot plus a set of period-aware charts.
const PERIODS = {
lifetime: { days: null, label: "Lifetime" },
"28d": { days: 28, label: "Last 28 days" },
"90d": { days: 90, label: "Last 90 days" },
};
@ItzaMi
ItzaMi / tmux-add-right.sh
Created April 14, 2026 12:00
runtime / live-edit for tmux panes - on exiting session, ask for one more pane and it sorts out a reasonable spot for it
#!/bin/bash
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
panes=$(tmux list-panes | wc -l | tr -d ' ')
if [ "$panes" -eq 1 ]; then
tmux split-window -h -l 33% -c "#{pane_current_path}"
else
target=$(tmux list-panes -F '#{pane_id} #{pane_left} #{pane_top}' \
| sort -k2,2nr -k3,3nr | head -1 | awk '{print $1}')