Skip to content

Instantly share code, notes, and snippets.

View Steffo99's full-sized avatar

Stefano Pigozzi Steffo99

View GitHub Profile
@Steffo99
Steffo99 / font-orderer.fish
Created January 29, 2022 16:04
Reorder and rename fonts in directory
#!/bin/fish
for file in *
set font_name (fc-query "$file" | egrep 'fullname:' | sed -E 's/fullname: \"(.+)\"\(s\)/\1/g')
set file_name (echo "$font_name" | string trim | sed -E 's/[^A-Za-z0-9]/-/g' | string lower)
set file_ext (echo (basename "$file" | string split -r -m1 ".")[2] | string lower)
set full_name (echo "$file_name.$file_ext")
mv $file $full_name
end
@Steffo99
Steffo99 / tris.pro
Last active July 18, 2021 14:26
A tic-tac-toe enumerator in Prolog
/**
* Usage:
*
* play(A, "X", "O"). % Gets boards where X wins and O loses
* play(A, "O", "X"). % Gets boards where O wins and X loses
* play([[_,_,_], [_,"X",_], [_,_,_]], "X", "O") % Finds winning boards for X with that starting condition
* play([[_,_,_], [_,"X",_], [_,_,_]], "O", "X") % Finds winning boards for O with that starting condition
* ...
*/
@Steffo99
Steffo99 / rndashcoz.md
Last active January 2, 2022 18:37
Installing Robotics;Notes DaSH with the CoZ Patch on Linux

Installing Robotics;Notes DaSH with the CoZ Patch on Linux

Requirements

  • Steam
  • Proton 5.x
  • unzip
  • winetricks
  • protontricks
@Steffo99
Steffo99 / levenshtein.py
Last active February 21, 2021 13:39
Come si calcola la distanza di Levenshtein?
def build_matrix(a: str, b: str) -> list[list[int]]:
"""Costruisci la matrice di distanza date le stringhe a e b."""
# Crea una matrice vuota di dimensioni (len(a) + 1) * (len(b) + 1)
# c o n o
# . . . . .
# c . . . . .
# o . . . . .
# s . . . . .
# a . . . . .
@Steffo99
Steffo99 / peertube-hide-regular-login.css
Created February 7, 2021 01:21
HIde the regular login form and only display external login buttons
.login-form-and-externals form {
display: none;
}
.login-form-and-externals .external-login-blocks .block-title {
visibility: hidden;
}
.login-form-and-externals .external-login-blocks .block-title::before {
visibility: visible;
@Steffo99
Steffo99 / groupwrite.fish
Last active February 7, 2021 00:55
Make all future files and subdirectories created in a certain directory writable by the group.
#!/usr/bin/fish
# Make all future files and subdirectories created in a certain directory writable by the group.
# Set the setuid flag on all subdirectories
chmod g+s (find -type d)
# Set the default file ACL for the group to rwx
setfacl -d -m g::rwx (find -type d)
@Steffo99
Steffo99 / .README.md
Created July 22, 2020 01:36
Plasma: Allow F13, F14, F15, ..., F24 to be bound on Dota 2

Add the following lines to ~/.Xmodmap and ensure "Bind keys based on keyboard position" is DISABLED.

@Steffo99
Steffo99 / lemmy-apache.conf
Last active July 9, 2023 17:13
**VERY OLD AND UNMAINTAINED** · Apache configuration file for Lemmy content aggregator
<VirtualHost *:443 >
# Your server name
ServerName example.org
ServerAdmin [email protected]
# Use HTTPS
SSLEngine on
# Enable reverse proxy mode
ProxyRequests On
@Steffo99
Steffo99 / ClampedFloat.cs
Created May 1, 2020 00:35
Unity script for floats and int that should stay between two values, with a custom inspector
using System;
using UnityEngine;
using UnityEditor;
[Serializable]
public class ClampedFloat {
public float minimum;
public float maximum;
public float starting;
public float _current;
@echo off
echo --------------------------------------------------
echo Il Grande Hackerino di Steffo per AoE3 Multiplayer
echo --------------------------------------------------
ipconfig
echo Cerca l'indirizzo IPv4 della connessione ad Internet che stai usando, poi scrivilo qui e premi invio per avviare il gioco.
echo Se dopo aver provato una volta il gioco non si apre, devi prima avviarlo una volta da Steam con l'account di Balu.
echo --------------------------------------------------
set /p ip=Indirizzo IPv4 desiderato:
start bin/age3y.exe OverrideAddress="%ip%" +noIntroCinematics