Skip to content

Instantly share code, notes, and snippets.

View Phil-Venter's full-sized avatar
💭
I honestly have no idea what I'm doing...

Caffeinated Coder Phil-Venter

💭
I honestly have no idea what I'm doing...
View GitHub Profile
#!/usr/bin/env bash
# --- UPDATE GE PROTON ---
set -euo pipefail
# --- CONFIG ---
GITHUB_API_URL="https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest"
COMPAT_DIR_NAME="compatibilitytools.d"
STEAM_NATIVE_DIR="$HOME/.steam/root"
STEAM_FLATPAK_DIR="$HOME/.var/app/com.valvesoftware.Steam/data/Steam"
@Phil-Venter
Phil-Venter / oop.sh
Created August 29, 2025 07:00
Simple OOP bash
#!/bin/bash
Object() {
kind=$1 ; this=$2 ; shift 2
for arg in "$@"; do
read ARG_KEY ARG_VALUE <<< $(echo "$arg" | sed -E "s/(\w+)=(.*?)/\1 \2/")
read FUNC <<< $(echo "$arg" | sed -E "s/fn_(\w+)$/\1/")
if [[ ! -z "$ARG_KEY" && ! -z "$ARG_VALUE" ]]; then
@Phil-Venter
Phil-Venter / holidays.php
Last active August 29, 2025 06:02
South African Holidays
<?php
$year = (int) $argv[1];
$easterSunday = new DateTimeImmutable('@' . easter_date($year));
$holidayNameDateMapping = [
"Day of Goodwill" => new DateTimeImmutable("$year-12-26"),
"Christmas Day" => new DateTimeImmutable("$year-12-25"),
"Day of Reconciliation" => new DateTimeImmutable("$year-12-16"),
"Heritage Day" => new DateTimeImmutable("$year-09-24"),
@Phil-Venter
Phil-Venter / install.sh
Last active May 23, 2025 19:00
Install
#!/usr/bin/env bash
set -e
# BASE SETUP
sudo apt install software-properties-common apt-transport-https -y
# ADD STEAM
sudo dpkg --add-architecture i386 \
&& curl -s http://repo.steampowered.com/steam/archive/stable/steam.gpg \
| sudo gpg --dearmor -o /usr/share/keyrings/steam.gpg > /dev/null \
@Phil-Venter
Phil-Venter / Result.php
Last active February 28, 2025 14:01
safe try
<?php
/**
* Class Result
*
* This class encapsulates the result of a callable operation, handling both success (value) and failure (error).
* It implements the ArrayAccess interface for array-like access to its properties ('val' and 'err').
*/
class Result implements ArrayAccess
{
@Phil-Venter
Phil-Venter / Compose.md
Created March 8, 2024 14:03
Simple PHP pipe implementation
class Compose
{
    public static function pipe(callable ...$fns): Closure
    {
        return function ($initial) use ($fns) {
            return array_reduce($fns, fn ($prev, $curr) => $curr($prev), $initial);
        };
    }
}
@Phil-Venter
Phil-Venter / Collection.php
Last active August 18, 2020 08:08
Playing around with Functional PHP
<?php
class Collection
{
private $data;
public function __construct($data)
{
$this->data = $data;
}
@Phil-Venter
Phil-Venter / v.lib.js
Last active July 27, 2020 12:37
Simple validators
/**
* a simple validation class with no external requirements
* @class V
*/
class V {
/**
* some of the possible data types
* @static
* @enum
* @memberof V
@Phil-Venter
Phil-Venter / set_shortcuts.sh
Last active April 29, 2020 11:29
Ubuntu Alterations
#!/bin/sh
gsettings set org.gnome.desktop.wm.keybindings activate-window-menu "['<Alt>space']";
gsettings set org.gnome.desktop.wm.keybindings begin-move "['<Alt>F7']";
gsettings set org.gnome.desktop.wm.keybindings begin-resize "['<Alt>F8']";
gsettings set org.gnome.desktop.wm.keybindings close "['<Alt>F4']";
gsettings set org.gnome.desktop.wm.keybindings cycle-group "['<Alt>F6']";
gsettings set org.gnome.desktop.wm.keybindings cycle-group-backward "['<Shift><Alt>F6']";
gsettings set org.gnome.desktop.wm.keybindings cycle-panels "[]";
gsettings set org.gnome.desktop.wm.keybindings cycle-panels-backward "[]";
gsettings set org.gnome.desktop.wm.keybindings cycle-windows "['<Alt>Escape']";
@Phil-Venter
Phil-Venter / .eslintrc.yml
Created March 16, 2020 19:32
Base eslint yml file
env:
commonjs: true
es6: true
extends: 'eslint:recommended'
globals:
Atomics: readonly
SharedArrayBuffer: readonly
parserOptions:
ecmaVersion: 2018
rules: