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
// src/Trie.ts | |
// pronounced "try" | |
/** | |
* Bespoke implementation of the Trie data structure. | |
* Used to do prefix search on shell builtins and, in the future, | |
* nodes in the virtual filesystem. | |
*/ | |
export default class Trie<T> { | |
children: Trie<T>[]; | |
value: T | null; |
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
// periodic_crosshair.cfg | |
// Nokko — Xonotic script to periodically turn your crosshair off | |
// DOES count shots even when weapon is on cooldown, since it's not that easy | |
// to check the current weapon and whether it's ready to fire. | |
// Think of it as being wired directly to the "trigger" of the current weapon. | |
///////////////////////// | |
// !! USER SETTINGS !! // | |
///////////////////////// |
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
/** | |
An implementation of the recursive backtracker maze | |
generation algorithm in C. Implemented recursively. | |
Author: nokko | |
Date: March 2nd | |
Look on my works, ye mighty, and cringe at my horrible code. | |
Credit to Jamis Buck for teaching me this wonderful algorithm. | |
(https://weblog.jamisbuck.org/2010/12/27/maze-generation-recursive-backtracking) |
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
""" | |
Quickly time a function. | |
""" | |
import timeit | |
def quick_timeit(fname, case="", number=1000): | |
return timeit.timeit(stmt=f"{fname}({case})", setup=f"from __main__ import {fname}", number=number) | |
# usage: | |
## def some_fn(x,y): return x + y + min(x,y) |
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
import urllib.request, os | |
from urllib.request import HTTPError | |
from bs4 import BeautifulSoup | |
from itertools import count | |
from textdistance import levenshtein, jaccard | |
""" | |
bastard_scraper.py | |
brought to you by: nokko | |
NOTE: TGaB is a large work, totalling 2,812,577 words as of Chapter 15-76 |