class Compose
{
public static function pipe(callable ...$fns): Closure
{
return function ($initial) use ($fns) {
return array_reduce($fns, fn ($prev, $curr) => $curr($prev), $initial);
};
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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 | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Collection | |
| { | |
| private $data; | |
| public function __construct($data) | |
| { | |
| $this->data = $data; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * a simple validation class with no external requirements | |
| * @class V | |
| */ | |
| class V { | |
| /** | |
| * some of the possible data types | |
| * @static | |
| * @enum | |
| * @memberof V |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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']"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| env: | |
| commonjs: true | |
| es6: true | |
| extends: 'eslint:recommended' | |
| globals: | |
| Atomics: readonly | |
| SharedArrayBuffer: readonly | |
| parserOptions: | |
| ecmaVersion: 2018 | |
| rules: |
NewerOlder