Skip to content

Instantly share code, notes, and snippets.

View timendum's full-sized avatar

Timendum timendum

  • Italy
View GitHub Profile
@timendum
timendum / cachemire.csv
Last active April 15, 2024 12:11
Tintoria e Cachemire
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 7 columns, instead of 2. in line 8.
ID,Title,PublishedAt,Duration,ViewCount,LikeCount,CommentCount
eYeHRvyiTgE,"Cachemire Podcast - Episodio 3: La posta di Sonia, Sanremo e Walker Texas Ranger",2020-12-18T11:45:03Z,PT1H11M14S,217055,6288,364
uudLdmsNbhQ,"Cachemire Podcast - Episodio 2: Pizza, Sushi e Tripadvisor",2020-12-11T12:30:41Z,PT1H8M30S,255574,7475,399
ZFGTo-zFIW4,"Cachemire Podcast S3 - Episodio 1: Remake, Reboot, Ripartiti!",2022-11-18T13:30:06Z,PT1H39S,151422,5627,361
GdHybYErqkY,Cachemire Podcast S2 - Episodio 15: Cartoni Animati,2022-02-25T13:30:06Z,PT59M42S,121812,3689,303
hz_gdMGGqVY,Cachemire Podcast S2 - Episodio 8: Primeggiare feat. Matteo Berrettini,2021-12-03T13:30:07Z,PT1H25M41S,212954,6605,242
prouISP730Y,Cachemire Podcast - Episodio 20: Ricordati di Santificare le Feste feat. Valerio Lundini,2021-04-23T12:15:01Z,PT1H22M57S,550174,13931,702
Lfo6sK4MVUY,Cachemire Podcast S3 - Episodio 13: Luoghi Comuni con Valerio Lundini,2023-03-10T13:33:43Z,PT1H4M57S,279350,8101,332
K1QB3_RmEwk,Cachemire Podcast S3 - Episodio 10: Amici Am
@timendum
timendum / contanomi.py
Created October 25, 2023 12:29
contanomi to csv
import requests
import json
dcsv = {"0": {}, "1": {}}
for y in range(1999, 2022):
r = requests.get(f"https://www.istat.it/ws/nati/index2021.php?type=list&limit=20&year={y}")
rdata = json.loads(r.text[9:-2])
for k in ("0", "1"):
for row in rdata[k]:
@timendum
timendum / cursed-fraction.py
Last active March 3, 2022 16:09
Frazioni maledette
from z3 import Int, Solver, Not, And, sat
a = Int("a")
b = Int("b")
c = Int("c")
s = Solver()
s.add(a > 0, a < 10)
s.add(b > 0, b < 10)
s.add(c > 0, c < 10)
@timendum
timendum / italy-2021.ipynb
Created January 11, 2022 14:11
Analisi r/italy 2021
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@timendum
timendum / ip6tables_setup.bash
Last active September 30, 2020 09:20
Basic setup for ip6tables - drop all traffic except local and LAN traffic.
#!/bin/bash
# http://ipset.netfilter.org/iptables.man.html
# Source: https://gist.github.com/velizarn/9c5bd160fa19161a4a761865d400f522
# flush (delete all rules)
ip6tables -F
# Set default chain policies
ip6tables -P INPUT ACCEPT
@timendum
timendum / REMOVE-ATTACHMENTS-OUTLOOK.md
Last active April 28, 2022 08:50
Remove big attachments from Outlook macro
  1. Alt+F11
  2. Insert > Module
  3. Past macro.vbs
@timendum
timendum / .eslintrc
Created September 16, 2019 13:40
eslint config
{
"parserOptions": {
"ecmaVersion": 8,
},
"env": {
"browser": true,
"es6": true,
"webextensions": true
},
// from https://dxr.mozilla.org/mozilla-central/source/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
@timendum
timendum / COPY-OUTLOOK-LINK.md
Created June 25, 2019 16:16
Generate a link from Outlook mail item and copy to clipboard
@timendum
timendum / stopwords-it.txt
Last active May 24, 2018 10:58
Stopwords
adesso
allora
altre
altri
altro
ancora
avere
ben
bene
buono
@timendum
timendum / create.sh
Last active September 10, 2020 11:05
Create a GIF with ffmpeg
ffmpeg -y -ss $BEGIN -t $LENGTH -i $INPUT cut.mkv
ffmpeg -i cut.mkv -vf cropdetect=24:16:0 -f null -
ffmpeg -i cut.mkv -vf crop=$CROP cropped.mkv
ffmpeg -y -i cropped.mkv -vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png
ffmpeg -y -i cropped.mkv -i palette.png -filter_complex "fps=10,scale=400:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
# example:
# $INPUT = file.mkv
# $BEGIN = 00:00:50.5
# $LENGTH = 1.6