Skip to content

Instantly share code, notes, and snippets.

View m4s0's full-sized avatar
🏠
Working from home

Marco Masotti m4s0

🏠
Working from home
View GitHub Profile
@m4s0
m4s0 / ArrayFlat.php
Created October 23, 2018 13:11
recursively flatten a multidimensional array
<?php
class ArrayFlat
{
public function execute($arg): array
{
return is_array($arg) ? array_reduce($arg, function ($c, $a) {
return array_merge($c, $this->execute($a));
}, []) : [$arg];
}
@m4s0
m4s0 / 1.pre_arch-root.sh
Last active November 22, 2024 23:02
archlinux installation script
#!/usr/bin/env bash
loadkeys it
timedatectl set-ntp true
mkfs.ext4 /dev/nvme0n1p2
mkfs.ext4 /dev/nvme0n1p4
mkfs.ext4 /dev/nvme0n1p5
mkswap /dev/nvme0n1p9
@m4s0
m4s0 / 1-pre-arch_root.sh
Last active March 20, 2025 10:55
arch_install_scripts
#!/usr/bin/env bash
loadkeys it
timedatectl set-ntp true
mkfs.ext4 /dev/nvme0n1p2
mkfs.ext4 /dev/nvme0n1p4
mkfs.ext4 /dev/nvme0n1p5
mkswap /dev/nvme0n1p9