Skip to content

Instantly share code, notes, and snippets.

View stefa168's full-sized avatar
πŸ‘”

Stefano Vittorio Porta stefa168

πŸ‘”
View GitHub Profile
@NARKOZ
NARKOZ / README.MOTHERFUCKING.md
Created December 16, 2025 20:05
This gist lists Motherfucking websites. Plain HTML. No frameworks. Read them, learn, stop overengineering.

Motherfucking Websites

A concise list of the Motherfucking-style sites β€” because sometimes the web needs blunt, unapologetic clarity.

@synthic
synthic / Dockerfile
Created December 11, 2025 05:25
DSpico Firmware Builder
FROM skylyrac/blocksds:slim-latest
RUN apt update && apt install -y \
build-essential \
cmake \
gcc-arm-none-eabi \
git \
python3
ENV DLDITOOL=/opt/wonderful/thirdparty/blocksds/core/tools/dlditool/dlditool
@marcoSanti
marcoSanti / statoTrenoTrenitalia.sh
Created December 26, 2023 17:40
Fetch trenitalia speed and delay from the terminal to avoid the slow and bloated page of portalefrecce
#!/bin/bash
while true ─╯
do
DATA=$(curl -s https://d6o.portalefrecce.it/PortaleFrecce/infoViaggioActionJson)
clear
SPEED=$(echo $DATA | jq '.speed')
DELAY=$(echo $DATA | jq '.delay2')
TRAIN=$(echo $DATA | jq '.tracknum')
FROMTO=$(echo $DATA | jq '.tracktitle')
echo "Train number: $TRAIN: \n\tfrom $FROMTO \n\ttraveling @ $SPEED Kmh with $DELAY of delay" | sed 's/"//g'
@matpag
matpag / italian_tax_code_regex.txt
Last active June 9, 2026 05:00
REGEX VALIDAZIONE CODICI FISCALI ITALIANI
Questa sotto Γ© una Regex che permette di validare la corretta formattazione dei codici fiscali italiani.
Tiene conto delle omocodie e di tutto il resto conosciuto finora.
La base di partenza Γ© stata presa qui: http://blog.marketto.it/2016/01/regex-validazione-codice-fiscale-con-omocodia/
quindi tutti i credits vanno all'autore di questo post ma Γ© stata modificata un minimo perchΓ© non copriva tutti i casi
^(?:[A-Z][AEIOUX][AEIOUX]|[B-DF-HJ-NP-TV-Z]{2}[A-Z]){2}(?:[\dLMNP-V]{2}(?:[A-EHLMPR-T](?:[04LQ][1-9MNP-V]|[15MR][\dLMNP-V]|[26NS][0-8LMNP-U])|[DHPS][37PT][0L]|[ACELMRT][37PT][01LM]|[AC-EHLMPR-T][26NS][9V])|(?:[02468LNQSU][048LQU]|[13579MPRTV][26NS])B[26NS][9V])(?:[A-MZ][1-9MNP-V][\dLMNP-V]{2}|[A-M][0L](?:[1-9MNP-V][\dLMNP-V]|[0L][1-9MNP-V]))[A-Z]$
@tonym128
tonym128 / shhh.py
Created December 9, 2022 21:48
Telegram Bot for Speeh to Text using OpenWhisper and capable of running on a Pi 4
import logging
from telegram import Update
from telegram.ext import filters, MessageHandler, ApplicationBuilder, CommandHandler, ContextTypes
import os
import shlex
from subprocess import Popen, PIPE
import time
import dbm
import uuid
@CPT-GrayWolf
CPT-GrayWolf / aacsdb-update
Last active February 19, 2026 05:08
Install Blu-Ray AACS VUK keys for libaacs automatically from the FindVUK database.
#!/bin/bash
#
# This is a simple bash script, designed to allow
# quick download and installation of the FindVUK
# AACS VUK database.
#
# This allows Blu-Ray disks who's VUK is known
# to be played on systems using libaacs.
#
# It's reccomended to schedule this file to run
@parmentf
parmentf / ConventionalCommitsEmoji.md
Last active May 10, 2026 09:18
Emoji for Conventional Commits
Type Emoji code
feat ✨ :sparkles:
fix πŸ› :bug:
docs πŸ“š :books:
style πŸ’Ž :gem:
refactor πŸ”¨ :hammer:
perf πŸš€ :rocket:
test 🚨 :rotating_light:
build πŸ“¦ :package:

Deterministic save load in Factorio

One of the key parts of the save/load process in Factorio is that it must be deterministic. This means that for a given save file (when no external factors change) saving, exiting, and loading the save shouldn't change any observable behavior.

There are a few reasons and benefits for this strict requirement:

  • Without it: You couldn't join a running multiplayer game (and by proxy save, exit, and resume one)
  • Without it: the replay system wouldn't work if you ever saved, exited, and resumed playing.
  • With it: we can easily test that saving and loading produces no observable change letting us know we implemented save/load correctly.
  • With it: you won't see things change randomly as a result of "reloading" like you do in so many other games.
\documentclass{article}
\usepackage[dvipsnames]{xcolor} % https://en.wikibooks.org/wiki/LaTeX/Colors
\definecolor{LightGray}{rgb}{0.97,0.97,0.97}
\usepackage{listings} % syntax highlighting
\lstdefinelanguage{SPARQL}{
basicstyle=\small\ttfamily,
backgroundcolor=\color{LightGray},
columns=fullflexible,
breaklines=false,