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 | |
abstract class Enum { | |
private static $cache = []; | |
// Helper function to load the required fields into the cache. | |
private static function loadCache(): void { | |
// Create cache for enum | |
self::$cache[static::class] = []; | |
// Get all constants |
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
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <dirent.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <stdlib.h> |
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 -eu | |
set -o pipefail | |
IFS=$'\n' | |
source="$HOME/i3" | |
output="${1:-$HOME/.config/i3/config}" |
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
"""Take a random image and replace all distinct colours with | |
a random other colour | |
:arg infile: The source image to read from | |
:arg loop: Whether to loop the list of colours instead of only replacing the N first | |
:arg upper: The upper bound of colours to replace | |
""" | |
from PIL import Image | |
from collections import defaultdict |
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
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <dirent.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <stdlib.h> |
OlderNewer