Skip to content

Instantly share code, notes, and snippets.

View AstraLuma's full-sized avatar
🐍
snek snek snek snek

Jamie Bliss AstraLuma

🐍
snek snek snek snek
View GitHub Profile
@AstraLuma
AstraLuma / example.kdl
Created April 18, 2024 01:52
KDL for Misbehave
Import MoveForward="my_actions.MoveForward" Rotate="my_actions.Rotate"
Tree "foo" {
Sequence {
IncreaseValue "behavior_tree_runs"
MoveForward 10
Rotate 90
}
}
@AstraLuma
AstraLuma / channels.py
Last active November 5, 2023 11:33
Python Server-Sent Events/EventSource Implementations
# For Django Channels
import json
from channels.exceptions import StopConsumer
from channels.generic.http import AsyncHttpConsumer
from django.utils.http import parse_header_parameters
from django.utils.http import parse_header_parameters
@AstraLuma
AstraLuma / pixels.html
Created June 27, 2023 15:52
Pixels dice quick vanilla page
<!doctype html>
<html>
<head><title>Pixels Quickie</title></head>
<body>
<script type=module>
import {
requestPixel
} from "https://unpkg.com/@systemic-games/pixels-web-connect?module";
@AstraLuma
AstraLuma / main.py
Created March 29, 2023 20:06
Paramiko server based on socketserver
#!/usr/bin/env python3
import base64
import logging
import paramiko
from paramiko.agent import AgentServerProxy
from paramiko.sftp import SFTP_NO_SUCH_FILE
from paramikosocket import SocketServerInterface, run_server
@AstraLuma
AstraLuma / flac-encode.py
Created February 16, 2023 05:58
StreamBeats OBS web page
#!/usr/bin/env python3
"""
This looks in its directory for files. It looks in the format
`playlist/artist/album/1. title.ext`, allowing components to be omitted.
Requires ffmpeg.
"""
import os
from pathlib import Path
import re
@AstraLuma
AstraLuma / thinclient.md
Last active January 17, 2023 01:28
Thoughts on a portable ssh thin client

Basic Capabilities:

  • WiFi
  • Local SSH identity (hardware backed?)
  • Mosh (wishful thinking)
  • Text mode interface
  • Batteries with decent life
  • Good keyboard
  • Local UI for some configuration options
  • Non-trivial fonts
@AstraLuma
AstraLuma / init.lua
Created January 6, 2023 03:41
AstroNvim config
-- AstroNvim Configuration Table
-- All configuration changes should go inside of the table below
-- You can think of a Lua "table" as a dictionary like data structure the
-- normal format is "key = value". These also handle array like data structures
-- where a value with no key simply has an implicit numeric key
local config = {
-- Configure AstroNvim updates
updater = {
def mutate_url(url, *,
username=None, password=None, hostname=None, port=None, **kwargs
):
import urllib.parse
bits = urllib.parse.urlparse(url)
assert not ( (username or password or hostname or port) and 'netloc' in kwargs ) # noqa
if username or password or hostname or port:
# FIXME: url encoding
u = username or bits.username
w = password or bits.password
@AstraLuma
AstraLuma / README.md
Created March 3, 2021 17:00
git boop

Creates & pushes empty commits without disturbing your index or workspace

  1. Copy git-boop.sh to git-boop on your $PATH
  2. Run git boop
#!/usr/bin/env python3
"""
Launches and manages uMTP-Responder with better cleanup.
"""
import contextlib
import os
from pathlib import Path
import subprocess
import tempfile
import time