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
// i made this to troll my friend | |
// https://store.steampowered.com/app/1720850/AB/ | |
type Contains<T extends string, Substring extends string> = T extends `${string}${Substring}${string}` ? true : false | |
type ReplaceOne<T extends string, Find extends string, ReplaceWith extends string> = | |
T extends `${infer Start}${Find}${infer End}` | |
? `${Start}${ReplaceWith}${End}` | |
: T |
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
# a python repl that actually exits on ctrl+C | |
while True: | |
try: | |
code = input(">>> ") | |
try: | |
print(eval(code)) | |
except SyntaxError: | |
exec(code) | |
except KeyboardInterrupt: | |
exit(1) |