Skip to content

Instantly share code, notes, and snippets.

@timw4mail
timw4mail / GetLibrary.graphql
Created December 30, 2020 17:27
Kitsu Library GraphQL Query
query (
$slug: String!,
$type: MediaTypeEnum!,
$status: [LibraryEntryStatusEnum!],
$after: String
) {
findProfileBySlug(slug: $slug) {
library {
all(first: 100, after: $after, mediaType: $type, status: $status) {
pageInfo {
@timw4mail
timw4mail / GetSetTrait.php
Created October 14, 2022 16:08
A trait for removing Doctrine Boilerplate
<?php declare(strict_types=1);
namespace App\Entity;
use InvalidArgumentException;
/**
* Remove the need for all the Doctrine getter/setter Entity boilerplate
*/
trait GetSetTrait {
@timw4mail
timw4mail / Base2Unit.php
Last active November 11, 2022 15:02
PHP 8.1+ Unit Formatter
<?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;
@timw4mail
timw4mail / index.php
Created June 2, 2023 14:32
One file procedurally generated game map, based on https://stitcher.io/blog/procedurally-generated-game-in-php
<?php declare(strict_types=1);
// ----------------------------------------------------------------------------
// Biomes
// ----------------------------------------------------------------------------
namespace Biome {
use Pixel;
interface Biome
@timw4mail
timw4mail / colors.ts
Created January 10, 2024 20:57
256 color terminal demo
export enum Ground {
Fore = 38,
Back = 48,
}
const code = (
param: string | number | string[] | number[],
suffix: string = '',
): string => {
if (Array.isArray(param)) {
@timw4mail
timw4mail / openrc-build.log
Created May 7, 2024 14:29
OpenRC build.log
 * Package: sys-apps/openrc-0.54:0
 * Repository: gentoo
 * Maintainer: [email protected]
 * USE: abi_x86_32 debug elibc_glibc kernel_linux netifrc pam sysvinit unicode x86
 * FEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox
 * Package: sys-apps/openrc-0.54:0
 * Repository: gentoo
 * Maintainer: [email protected]
 * USE: abi_x86_32 debug elibc_glibc kernel_linux netifrc pam sysvinit unicode x86
 * FEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox