Skip to content

Instantly share code, notes, and snippets.

View timendum's full-sized avatar

Timendum timendum

  • Italy
View GitHub Profile
@timendum
timendum / find_solution.py
Last active March 18, 2026 15:22
Make 10 and generic four numbers to reach a target
"""
This function solves a "make 10" puzzle:
given a string of digits (e.g., "3596"),
it finds all possible arithmetic expressions using those four digits (each used exactly once)
and the operators +, -, *, / that evaluate to 10.
It also considers different placements of parentheses to account for order-of-operations variations.
It's a brute-force solver for the "four numbers to reach 10" number game.
"""
@timendum
timendum / sanremo2026.ipynb
Last active March 3, 2026 08:30
Analisi dei commenti dei Megathread del 76° Sanremo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@timendum
timendum / edit_vcr.py
Last active January 29, 2026 08:10
How to edit Python VCR fixtures cassette
import gzip
import json
import yaml
from yaml import Dumper, Loader
FILENAME = "./test.yml"
with open(FILENAME) as fo:
tyaml = fo.read()
Get-ChildItem "$env:LOCALAPPDATA\Temp" -Recurse -Force -ErrorAction SilentlyContinue |
Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-7) }
@timendum
timendum / config.yaml
Last active March 30, 2026 14:53
dotbins
tools:
# Order is important!
fzf: junegunn/fzf
rg: BurntSushi/ripgrep
jq: jqlang/jq
lazygit: jesseduffield/lazygit
lnav: tstack/lnav
bat:
repo: sharkdp/bat
shell_code:
@timendum
timendum / obsidian.vbs
Last active October 7, 2025 15:53
Extract meeting info from Outlook to Obsidian
Sub AppendMarkdownUTF8(content As String, strFileName As String)
Dim stream As Object
Dim existingContent As String
Dim strFilePath As String
Dim fso As Object
strFilePath = Environ("USERPROFILE") & "\Documents\Obsidian\Daily\" & strFileName
Set fso = CreateObject("Scripting.FileSystemObject")
' Create empty file if missing (faster & simpler than ADODB)
If Not fso.FileExists(strFilePath) Then
@timendum
timendum / best.py
Created March 12, 2025 14:08
Python script to find best prices for gas
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "requests",
# ]
# ///
import argparse
import csv
import shutil
@timendum
timendum / SmartMove.vbs
Created March 5, 2025 10:41
Outlook Macro to move mails in the same folders as previous
Sub SmartArchive()
Dim objApp As Outlook.Application
Dim objSelection As Outlook.Selection
Dim objMail As Outlook.MailItem
Dim objConversation As Outlook.Conversation
Dim objRootItems As Outlook.SimpleItems
Dim objChildItems As Outlook.SimpleItems
Dim objRootItem As Object
Dim objChildItem As Object
Dim objFolder As Outlook.folder
@timendum
timendum / CloneCalendar.vbs
Last active October 8, 2025 09:16
Macro to clone a calendar in Outlook
Sub CloneCalendarItem()
Dim objApp As Outlook.Application
Dim objSelection As Outlook.Selection
Dim objItem As Object
Dim objNewItem As Outlook.AppointmentItem
Dim recip As Outlook.Recipient
Dim newRecip As Outlook.Recipient
Set objApp = Outlook.Application
Set objSelection = objApp.ActiveExplorer.Selection
@timendum
timendum / average_time.py
Created March 3, 2025 14:31
Calc averange time
import math
PRECISION = 24 * 60
def average_time(times: list[str]) -> str:
sum_sin = 0.0
sum_cos = 0.0
for time_str in times:
hours, mins = map(int, time_str.split(':'))
total_mins = (hours % 24) * 60 + mins