View index.php
This file contains 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 declare(strict_types=1); | |
// ---------------------------------------------------------------------------- | |
// Biomes | |
// ---------------------------------------------------------------------------- | |
namespace Biome { | |
use Pixel; | |
interface Biome |
View Base2Unit.php
This file contains 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 declare(strict_types=1); | |
enum Base2Unit: int implements UnitInterface { | |
case B = 1024**0; | |
case KB = 1024**1; | |
case MB = 1024**3; | |
case GB = 1024**4; | |
case TB = 1024**5; | |
case PB = 1024**6; |
View GetSetTrait.php
This file contains 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 declare(strict_types=1); | |
namespace App\Entity; | |
use InvalidArgumentException; | |
/** | |
* Remove the need for all the Doctrine getter/setter Entity boilerplate | |
*/ | |
trait GetSetTrait { |
View GetLibrary.graphql
This file contains 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
query ( | |
$slug: String!, | |
$type: MediaTypeEnum!, | |
$status: [LibraryEntryStatusEnum!], | |
$after: String | |
) { | |
findProfileBySlug(slug: $slug) { | |
library { | |
all(first: 100, after: $after, mediaType: $type, status: $status) { | |
pageInfo { |
View index.php
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Image Viewer</title> | |
<style> | |
* {margin: 0} | |
img { | |
max-width: 100%; | |
<?php if (empty($_GET['zoom'])): ?> | |
max-height: 900px; |
View kernel-update.sh
This file contains 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 | |
set -euo pipefail | |
# Adapted from: https://wiki.gentoo.org/wiki/GRUB_on_Open_Firmware_(PowerPC) | |
# Re-generate grub.cfg | |
grub-mkconfig -o /boot/grub/grub.cfg | |
# Make new OF grub img | |
grub-mkimage --prefix=/boot/grub --format=powerpc-ieee1275 --config=/boot/NWBB/grub-initial.cfg --output=/boot/NWBB/grub.img `cat /boot/NWBB/grub_mod-minimal.list` |
View json-parser.js
This file contains 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
/** | |
* Pure JS JSON Parser | |
* | |
* @see https://lihautan.com/json-parser-with-javascript/ | |
* @param {string} str | |
*/ | |
function parseJSON(str) { | |
let i = 0; | |
const value = parseValue(); |
View optimize-images.sh
This file contains 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 -euo pipefail | |
declare threads=`getconf _NPROCESSORS_ONLN` | |
optimise () { | |
declare -a exts=("${!1}") | |
declare msg=$2 | |
for ext in ${exts[@]} |
View emoji-functions.php
This file contains 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 declare(strict_types=1); | |
function createDataObject (int $min, int $max, array $blacklist = []): array | |
{ | |
$output = []; | |
$index = 0; | |
for ($i = $min; $i <= $max; $i++) | |
{ | |
$n = base_convert((string)$i, 10, 16); |
View build-php-ext.sh
This file contains 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 | |
make clean; # For those rebuilds | |
phpize; | |
autoreconf --install --force; # Stupid autotools/libtool version incompatibilities | |
./configure; | |
make; | |
sudo make install; |
NewerOlder