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
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define ever (;;) | |
typedef struct { | |
size_t size; | |
char *names; |
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
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define ever (;;) | |
typedef struct { | |
size_t size; | |
char *names; |
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
CC := clang | |
CFLAGS := -std=c11 -Ofast -Wall -Wextra -Wshadow | |
SRCDIR := src | |
OBJDIR := obj | |
SRC := $(wildcard $(SRCDIR)/*.c) | |
OBJ := $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o) | |
EXEC := foo |
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 python3 | |
COINS = (200, 100, 50, 20, 10, 5, 2, 1) | |
COIN_INDEXES = {coin: index for index, coin in enumerate(COINS)} | |
class CoinsUsed: | |
def __init__(self, poopyjones=None): | |
self.poopyjones = poopyjones or ([0] * len(COINS)) |
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 python3 | |
import math | |
def build_regex(max_size=13): | |
parts = [] | |
for half_size in range(1, math.ceil(max_size / 2) + 1): | |
parts.append("^") | |
parts.append("(.)" * half_size) |
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 <stdlib.h> | |
typedef void (*printer_func)(void*); | |
struct LinkedList { | |
void *value; | |
struct LinkedList *next; | |
}; |
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 <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef char* Key; | |
typedef char* Value; | |
typedef struct BucketValue { | |
/** The key that matches this entry. */ |
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 python3 | |
from operator import sub, mul, floordiv | |
from functools import reduce | |
SHORT_LIST_THRESHOLD = 3 | |
def add_repr(cls): | |
import inspect | |
argspec = inspect.getargspec(cls.__init__) |
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 python3 | |
from operator import sub, mul, floordiv | |
from functools import reduce | |
SHORT_LIST_THRESHOLD = 3 | |
def add_repr(cls): | |
import inspect | |
argspec = inspect.getargspec(cls.__init__) |
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 python3 | |
from llvmlite import ir, binding as llvm | |
def compile_assembunny(instructions): | |
instructions = tuple(instructions) | |
program_size = len(instructions) | |
char = ir.IntType(8) | |
int32 = ir.IntType(32) |