Skip to content

Instantly share code, notes, and snippets.

View daun's full-sized avatar
🕳️

Philipp Daun daun

🕳️
View GitHub Profile
@daun
daun / focus-starting-point.ts
Created April 12, 2024 09:12
Move document focus starting point
function setFocusStartingPoint(element: HTMLElement) {
element.focus({ preventScroll: true });
// Exit here if the element was successfully focused
if (element.matches(':focus')) return;
// Not focussed? Probably not a link/button/input
// In this case, we insert a focussable child into the element, focus it, and remove it again
const focusElement = createInvisibleFocusElement();
element.prepend(focusElement);
@daun
daun / LatteProvider.php
Last active January 27, 2024 09:17
Integrate Latte into Laravel directly without using a package
<?php
namespace App\Providers;
use Illuminate\Contracts\View\Factory;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
use Latte\Engine;
use Latte\Macros\MacroSet;
@daun
daun / README.md
Created January 10, 2023 15:20 — forked from mrl22/README.md
PHP 8.1 Support for Apache and NGINX (OpenResty) on Moss.sh

Do not copy and paste this code, it requires changes

As of writing this, Moss.sh does not support PHP 8.1 via the control panel even though Ubuntu does.

Set up your website using Moss.sh and select Apache with PHP 7.4.

Once complete, we need to install PHP 8.1 with all the packages moss installs for 7.4.

apt install php8.1-bcmath php8.1-bz2 php8.1-cli php8.1-common php8.1-curl php8.1-dev php8.1-fpm php8.1-imap php8.1-intl php8.1-mbstring php8.1-mysql php8.1-opcache php8.1-pgsql php8.1-readline php8.1-soap php8.1-sqlite3 php8.1-xml php8.1-xmlrpc php8.1-zip php8.1-gd php8.1-igbinary php8.1-imagick php8.1-memcached php8.1-msgpack