Skip to content

Instantly share code, notes, and snippets.

View DarkVss's full-sized avatar
💊
world has gone mad...

Marcus Moriarty DarkVss

💊
world has gone mad...
  • Dreamland of heaven hell
View GitHub Profile
@DarkVss
DarkVss / phpEnumBefore8_1.md
Created February 27, 2023 14:58
PHP Enums before 8.1
abstract class BasicEnum {
    private static $constCacheArray = NULL;

    private static function getConstants() {
        if (self::$constCacheArray == NULL) {
            self::$constCacheArray = [];
        }
        $calledClass = get_called_class();
        if (!array_key_exists($calledClass, self::$constCacheArray)) {
@DarkVss
DarkVss / gist_image.md
Created June 7, 2022 07:29
Add image as a gist

Image as a gist

  1. Create a gist
  2. Clone your gist:
    # `<hash>` - gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh
@DarkVss
DarkVss / php_prepare.sh
Last active July 7, 2023 14:13
Php installer
#!/usr/bash
sudo apt install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
curl -fsSL https://packages.sury.org/php/apt.gpg| sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-keyring.gpg
sudo apt update
echo "!!! Now install PHP what u want !!!"
@DarkVss
DarkVss / Deepin language trouble.txt
Last active June 7, 2021 06:58
Deepin language trouble
echo '[Desktop Entry]
Encoding=UTF-8
Version=0.0.1
Type=Application
Name=Keymap US-RU
Comment=
Exec=setxkbmap us,ru -option grp:alt_shift_toggle,grp_led:scroll
StartupNotify=false
Terminal=false
Hidden=false' > ~/.config/autostart/keymaps.desktop
apt update && apt install wget -y && wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb && dpkg -i mysql-apt-config_0.8.13-1_all.deb && rm -f mysql-apt-config_0.8.13-1_all.deb && apt update && apt install mysql-community-server -y