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
| from contextlib import contextmanager | |
| import datetime | |
| import hashlib | |
| import inspect | |
| import itertools | |
| import json | |
| import os | |
| from pathlib import Path | |
| import re | |
| import sqlite3 |
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
| local uuid = {} | |
| assert(1<<60 ~= 0, "Requires at least 64-bit lua_Integer") | |
| local nominal_unix_epoch = {year = 1970, month = 1, day = 1, hour = 0, min = 0, sec = 0} | |
| local unix_epoch = os.time(os.date("!*t", os.difftime(os.time(nominal_unix_epoch), os.time(os.date("!*t", os.time(nominal_unix_epoch)))))) | |
| local unix_time_sec | |
| if unix_epoch == 0 then | |
| -- Lua's "some epoch" is just the Unix epoch | |
| unix_time_sec = os.time | |
| else |
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
| import asyncio, tkinter | |
| import ctypes | |
| import math | |
| import threading | |
| from types import coroutine | |
| __all__ = ["ATk"] | |
| if tkinter.TclVersion == 8.6: | |
| try: |
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
| # Makefile for building Lua on Windows with MSVC | |
| # See ../doc/readme.html for installation and customization instructions. | |
| # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= | |
| # Your platform. See PLATS for possible values. | |
| PLAT= msvc | |
| CC= cl.exe | |
| CFLAGS= /O2 /Wall /DLUA_BUILD_AS_DLL $(SYSCFLAGS) $(MYCFLAGS) |
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
| from contextlib import contextmanager | |
| from datetime import date | |
| from functools import reduce | |
| from gettext import dgettext | |
| from traceback import format_exception | |
| from types import SimpleNamespace | |
| import re | |
| import uuid | |
| from beancount.core.account import join as account_join, leaf, root, sans_root |
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
| #!/usr/bin/env python3 | |
| # Authored by James Edington Administrator in 2025; placed in the Public Domain. | |
| __all__ = ['udp_listen_sync', 'udp_listen_async'] | |
| """USAGE: | |
| from udp_helper import * | |
| # Simple iterator that responds instantly to Ctrl+C / SIGINT |
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
| # ~/.config/systemd/user/minecraft@.service | |
| # Setup: | |
| # loginctl enable-linger "${USER}" | |
| # systemctl --user daemon-reload | |
| # ln -sfv ../../jars/paper.jar /var/minecraft/servers/survival/server.jar | |
| # systemctl --user enable --now minecraft@"$(systemd-escape /var/minecraft/servers/survival)".service | |
| [Unit] | |
| Description=Minecraft Server (%I) |
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
| defmodule Foo.SimpleRNG do | |
| @moduledoc """ | |
| A simple glue layer to use CTR-mode `:crypto` algorithms with the `:rand` module. | |
| iex> new(:aes_128_ctr, <<0::size(128)>>) | |
| ...> |> :rand.seed() | |
| iex> :rand.uniform(10**10) | |
| 3992083247 | |
| iex> :rand.uniform(10**10) | |
| 4813258075 |
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
| // https://en.wikipedia.org/wiki/List_of_UTC_offsets | |
| const TZLETTER = new Map([ | |
| [0, "Z"], | |
| [60, "N"], | |
| [120, "O"], | |
| [180, "P"], | |
| [210, "P30"], | |
| [240, "Q"], | |
| [300, "R"], | |
| [360, "S"], |
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
| """Technically, you don't need this library. You *could* just DIY it with a clever pile of `lambda` decorators: | |
| >>> import threading, functools | |
| >>> @lambda t: t.start() or t | |
| ... @lambda f: threading.Thread(target=f, daemon=True) | |
| ... def worker_1(): | |
| ... import time | |
| ... time.sleep(1) | |
| ... print(threading.current_thread()) |
NewerOlder