Skip to content

Instantly share code, notes, and snippets.

View brownan's full-sized avatar

Andrew Brown brownan

View GitHub Profile
import StringIO
import pty
import os
import subprocess
import termios
import fcntl
import errno
def postfork():
"""This is executed in the forked child, before it executes the requested
@brownan
brownan / twitch.py
Last active November 11, 2018 12:30
Python script to get a window's size and position, then launch avconv to stream that window to twitch.tv
#!/usr/bin/env python3
# Adapted from http://www.creativetux.com/2012/11/streaming-to-twitchtv-with-linux.html
#
# Make sure to put your twitch.tv key in a file called "key" in the current directory.
#
# Before running, make sure PulseAudio is set up with the correct loopback modules
# and a null sink named "mix". You can use something ilke the following commands:
#
# pactl load-module module-null-sink sink_name=mix
d6450e937791232c201ab933451815b2 a_Data.MHK
9658363d21012c757ed8ef5412c4f363 a_Sounds.MHK
e386ace2719cfe36cc94b7e79c829694 b2_data.MHK
ea84fee7c06975b030841706dee24dec b_Data.MHK
8b6df65ea01caea7200f4be1f64c65e8 b_Sounds.MHK
32742619cd38a9c82d6403c9ea8acf2b g_Data.MHK
7998b57be99188e03a9ff292e71e169a g_Sounds.MHK
cbbfe924f4f64b61901841fab44751b6 j_Data1.MHK
310c4f169d96c124122133ae9cafcf36 j_Data2.MHK
b27fcc84564db0776b28781ad0a24c2d j_Sounds.MHK
import sys
import math
import numpy
from overviewer.world import ChunkDoesntExist
from overviewer import blockdefinitions
from overviewer.oil import Matrix
from overviewer import textures
from overviewer.isometricrenderer import IsometricRenderer
import StringIO
import pty
import os
import subprocess
import termios
import fcntl
import errno
def postfork():
"""This is executed in the forked child, before it executes the requested
@brownan
brownan / prompt.py
Last active July 10, 2025 10:14
Ollama command line interface with Markdown rendering
#!/bin/env python3
import argparse
import io
import json
import os
import sys
import urllib.parse
import urllib.request
from typing import Optional, NamedTuple