Skip to content

Instantly share code, notes, and snippets.

View LeonMarchetti's full-sized avatar

Leonardo Marchetti LeonMarchetti

View GitHub Profile
@LeonMarchetti
LeonMarchetti / clima.py
Last active September 20, 2025 02:02
Check if a temperature lower than a certain threshold is detected in next day's forecast in Weather.com
"""
Check if a temperature lower than a certain threshold is detected in next day's forecast in
Weather.com
Requirements:
* beautifulsoup4
* requests
"""
import subprocess
import sys
@LeonMarchetti
LeonMarchetti / likes_list.py
Last active September 25, 2025 12:52
Searches for deleted videos from the likes playlist of YouTube
"""
Searches for deleted videos from the likes playlist of YouTube
Ubuntu packages:
* python3-google-auth-oauthlib
* python3-googleapi
* python3-tqdm
"""
import argparse
import os
@LeonMarchetti
LeonMarchetti / backup_notion.sh
Created August 12, 2025 21:28
Backup de exportación de Notion
#!/bin/sh
BACKUP_NOTION="/home/leonardo/Baul/backup/notion.zip"
set -e
echo "\033[93m" "Copiar backup a remoto" "\033[m"
rclone copy "$BACKUP_NOTION" backup:
echo "\033[92m" "OK" "\033[m"
echo
echo "\033[93m" "Comprobando:" "\033[m"
ls -lt "$BACKUP_NOTION"
echo
@LeonMarchetti
LeonMarchetti / activity_plot.py
Created July 30, 2025 01:27
Parsear Actividad Diaria para Graficarlo
""" activity_plot.py
Diagrama heatmap de calendario de actividad
Dependencies:
- pandas
- numpy
- matplotlib
Usage:
python activity_plot.py
@LeonMarchetti
LeonMarchetti / seguro.py
Created July 30, 2025 01:25
Parsear Boleta Para Insertar en un Google Sheets
"""
This module processes insurance PDF files and updates a Google Sheets spreadsheet with extracted
data.
It provides functionality to:
- Authenticate and connect to Google Sheets using service account credentials.
- Parse and extract relevant information (such as month, price, and valuation) from a PDF file.
- Append the extracted data as a new row in a specified Google Sheets document.
- Optionally run in dry-run mode to print extracted data without updating the spreadsheet.
@LeonMarchetti
LeonMarchetti / checksum_test.au3
Last active October 12, 2024 14:45
Checksum Test
#include <WindowsConstants.au3>
#include "digimon-world-dawn_dusk\nogba.au3"
#include "digimon-world-dawn_dusk\utils.au3"
Opt("ExpandVarStrings", 1)
Opt("MouseCoordMode", 2)
Opt("PixelCoordMode", 2)
Opt("SendKeyDelay", 100)
Opt("TrayMenuMode", 3)
@LeonMarchetti
LeonMarchetti / xdebug
Created March 20, 2024 10:54
Toggle XDebug PHP extension
#!/bin/sh
FILE="/etc/php/7.4/mods-available/xdebug.ini"
case "$1" in
"off") patron="^(zend_extension)/# \1" ;;
"on") patron="^# (zend_extension)/\1" ;;
*) error 1 "Comando no reconocido"
esac
sed -Ei "s/$patron/" "$FILE"
@LeonMarchetti
LeonMarchetti / delete-account-number
Last active February 13, 2025 15:21
Deletes account number from receipt
#!/bin/sh
ACCOUNT="TODO"
set -e
result=${2-${1%.*}.2.${1##*.}}
tmpFile=$(mktemp)
pdftk "$1" output "$tmpFile" uncompress
sed -i "s/$ACCOUNT//g" "$tmpFile"
pdftk "$tmpFile" output "$result" compress
rm "$tmpFile"
@LeonMarchetti
LeonMarchetti / .tmux.conf
Last active November 18, 2024 19:32
Configuración de Tmux (Con Meslo NGS y símbolos, y con otra fuente)
# https://www.man7.org/linux/man-pages/man1/tmux.1.html
unbind C-b
set-option -g prefix C-a
set-option -g default-command ""
TMUX_COLOR="blue"
set -g status-bg black
set -g status-fg $TMUX_COLOR
@LeonMarchetti
LeonMarchetti / theodorus.py
Last active May 15, 2023 11:05
Generates the points for a Theodorus' spiral
def theodorus(stop: int, radius=1., center: list[float] = (0., 0., 0.), clockwise=True, z=0.):
""" Generates the Theodorus spiral points
Assumes the center of the spiral is at the `center`
#### Arguments
- `stop`: Number of points
- `radius` (default: `1.0`): Radius of the spiral
- `center` (default: `(0.0, 0.0)`): Center of the spiral
- `clockwise` (default: `True`): Rotation direction of the spiral