Skip to content

Instantly share code, notes, and snippets.

@juanluisrto
juanluisrto / calculadora_impuestos.py
Created July 12, 2023 10:08
Función para estimar el irpf a pagar en España, teniendo en cuenta los tramos
def calculadora_impuestos(ingresos):
irpf_escalones = {
12_450 : 0.19,
20_200 : 0.24,
35_200 : 0.30,
60_000 : 0.37,
300_000 : 0.45,
1e100 : 0.47
}
@juanluisrto
juanluisrto / chat.sh
Last active July 4, 2025 13:10
a chat command that sends your visible terminal state to GPT and preloads the reply as your next command.
#!/usr/bin/env zsh
# chat – ask OpenAI using the last visible terminal lines (curl + jq)
chat() {
local lines=30 # how many terminal lines to capture
local model="gpt-4.1-nano" # default model
local verbose=false
local -a query_parts=()
# -------------------- parse options --------------------