This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
/// Get the n-th row of the pascal triangle | |
/// NOTE: This is a pure, recursive function without caching | |
/// n: the nth row to calculate | |
/// row: the pointer to an array with n+1 elements to store the row in |
This file contains hidden or 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
import sys | |
from math import sqrt | |
errors = 0 | |
def is_uniq(lst): | |
return len(list(set(lst))) is len(lst) | |
This file contains hidden or 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
0 4 0 7 0 14 24 0 0 6 0 17 10 19 5 0 0 3 0 0 20 0 23 15 0 | |
13 20 17 10 2 0 0 0 0 0 0 15 0 0 0 6 0 5 0 23 0 0 16 19 18 | |
0 22 0 0 0 17 0 0 25 0 0 0 9 0 11 7 0 12 0 19 3 0 24 8 10 | |
24 12 0 3 0 18 20 0 5 0 0 4 0 0 23 14 10 11 0 22 0 0 0 0 0 | |
0 18 0 0 0 10 22 0 15 21 0 20 3 0 6 2 0 8 0 0 0 0 7 0 12 | |
16 0 15 8 22 0 0 0 9 0 0 0 0 6 0 0 25 0 7 0 0 10 1 17 0 | |
7 0 0 23 11 0 16 6 19 0 4 0 5 24 13 0 12 21 0 20 0 0 0 0 0 | |
0 0 0 0 0 0 18 0 7 0 25 0 2 12 0 0 24 0 5 0 14 11 20 4 16 | |
0 0 20 14 19 11 10 5 0 2 0 0 0 0 0 0 15 4 8 6 0 13 0 0 0 | |
4 0 0 0 13 0 0 0 23 0 20 22 15 11 0 0 0 0 0 0 12 7 6 25 0 |
This file contains hidden or 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 | |
### | |
### MAKE BACK-UPS | |
### I AM NOT RESPONSIBLE | |
### MAKE BACK-UPS | |
### DON'T USE REGEXES | |
### MAKE BACK-UPS | |
### D O N O T U S E R E G E X E S |
This file contains hidden or 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
# The path of the executable | |
OUTPUT_EXEC = build/main | |
# Use clang by default | |
CC = clang | |
# Flags for Clang | |
CFLAGS = -O0 -g -Weverything | |
# Flags for GCC |
NewerOlder