Skip to content

Instantly share code, notes, and snippets.

View thatrandomperson5's full-sized avatar
🖥️
Coding, actual legit cod (Not the game)

Nilts thatrandomperson5

🖥️
Coding, actual legit cod (Not the game)
View GitHub Profile
@thatrandomperson5
thatrandomperson5 / LICENSE.txt
Last active February 12, 2023 19:14
Desync: Making async-blocking code non blocking
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
@thatrandomperson5
thatrandomperson5 / highlight.nim
Created February 8, 2023 15:16
Adapted Highlighter
# Adapted from https://github.com/pietroppeter/nimib/blob/2e0c2223cef10423fc43fc3be9626890a6bb4779/src/nimib/highlight.nim
import std/[strutils, dom]
import packages/docutils/highlite
func nimNormalize(s: string): string =
# Copied from strutils.normalize (same except for branch i == 0)
# Normalizes a Nim identifier to all lowercase:
# - All letters except the first one are lower-cased
@thatrandomperson5
thatrandomperson5 / main.nim
Created January 11, 2023 01:13
Pure-Nim hand-written xml parser, using only stdlib
import parser
const xml = """
<MyTag>
Hello
<OtherTag attr1="hello" attr2="nono"></OtherTag>
<Container>
I'm shallow
<Deep>I'm down deep!</Deep>
I'm shallow
</Container>
@thatrandomperson5
thatrandomperson5 / mypy.yaml
Created December 6, 2022 01:40
Mypy example check
name: mypy
on: [push, pull_request]
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
@thatrandomperson5
thatrandomperson5 / rtfm.py
Created December 4, 2022 01:29
readthedocs lookup
import requests
from dataclasses import dataclass
import furl
from sys import argv
@dataclass
class RTDIOsearch:
slug: str
query: str
def __repr__(self):
@thatrandomperson5
thatrandomperson5 / readme.md
Last active December 3, 2022 20:55
MC flying machine speeds