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
type EnumLike<K extends string> = { kind: K, value: any }; | |
type EnumMatchTable<E extends EnumLike<string>, T> = { | |
[Variant in E as Variant["kind"]]: (_: Variant["value"]) => T; | |
} | |
export type Case<K extends string, T> = { kind: K, value: T }; | |
export const caseConstructor = | |
<K extends string>(kind: K) => | |
<T,>(value: T) : Case<K, T> => ({ kind, value }); |
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
from __future__ import annotations | |
from typing import Final, NoReturn | |
import dataclasses, logging, sys | |
import pygame | |
from pygame import Surface | |
logging.basicConfig(level=logging.DEBUG) | |
DEFAULT_WIDTH: Final = 1280 | |
DEFAULT_HEIGHT: Final = 720 |
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 -e | |
HELP_STR="\ | |
Usage: | |
proxied # prints this message | |
proxied _proxy_ # prints sh snippet that sets _proxy_ | |
proxied _proxy_ _cmd_... # runs _cmd_ with _proxy_ | |
Environment variables that are affected: | |
- ALL_PROXY | |
- http_proxy |
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 -e | |
ENVNAME='CMU 15-213' | |
START="$PWD" | |
cd "$(dirname "$0")" | |
BIN="$PWD/bin" | |
LIB="$PWD/lib" | |
mkdir -p "$BIN" "$LIB" | |
cd "$START" |