Skip to content

Instantly share code, notes, and snippets.

View foxyseta's full-sized avatar
💨
Moved to codeberg.org/foxy

Stefano Volpe foxyseta

💨
Moved to codeberg.org/foxy
View GitHub Profile
@foxyseta
foxyseta / trees.py
Created June 18, 2021 10:24
A minimal Python implementation for binary trees
# University of Bologna
# First cycle degree in Mathematics
# 07276 - Computer Science
#
# Stefano Volpe #969766
# 06/18/2021
#
# trees.py: tree class implementation
class tree:
@foxyseta
foxyseta / xml_to_wifi.ps1
Created June 18, 2021 20:25
A PowerShell script to connect to my home wifi automatically
# configure Wi-Fi using dynamic IP (admin required)
if (-not (new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator))
{
$newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
$newProcess.Arguments = $myInvocation.MyCommand.Definition;
$newProcess.Verb = "runas";
[System.Diagnostics.Process]::Start($newProcess);
exit
}
netsh interface ip set address "Wi-Fi" dhcp
@foxyseta
foxyseta / transposition_cipher.cpp
Created July 12, 2021 17:32
Minimal transposition cipher implementation in C++.
/*
es. 07 - transposition_cipher.cpp
Creare una classe Codice con attributi due stringhe (l'originale e la
trasformata). Creare un programma di trasformazione che prenda dal
main una stringa e la codifichi e decodifichi col cifrario A
TRASPOSIZIONE (libro pag. 66). Scegliere i metodi a piacere,
considerando che da una stringa iniziale si debba potere codificare
(metodo CODIFICA) e decodificare (metodo DECODIFICA).
Volpe Stefano (5Bsa)
@foxyseta
foxyseta / lalla.tex
Created October 19, 2021 23:18
Some LaTeX examples for my friend
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{table}[h!]
\centering
\begin{tabular}{ | c | c | c | c | c | c | c | c | c | c | }
\hline
@foxyseta
foxyseta / nightowl-truecolor.toml
Created November 9, 2021 13:17
NightOwl port for Termshark
unused = "#79e11a"
[nightowl]
gray1 = "#637777"
gray2 = "#657b83"
gray3 = "#aaaaaa"
gray4 = "#d6deeb"
black = "#011627"
blue = "#7fdbca"
@foxyseta
foxyseta / patch.sh
Last active August 14, 2022 00:31
Apply the same diff file to every repo in the current folder.
#!/bin/sh -ex
for folder in $(ls); do
if [ -d "$folder" ]; then
cd $folder
patch -p1 < ../patch.diff
git add .
git pull
git commit -m "Apply patch from template"
git push
@foxyseta
foxyseta / preprocess.sh
Created July 20, 2022 20:39
Preprocesses every .c file in the current folder using ../include/ as headers directory
for file in *.c; do gcc -E -P -I ../include/ -o `expr substr $file 1 \( \( length $file \) - 2 \)`.i $file; done