Skip to content

Instantly share code, notes, and snippets.

View jquast's full-sized avatar
🐡
I may be slow to respond.

Jeff Quast jquast

🐡
I may be slow to respond.
View GitHub Profile
110 dim t$(16),f$(16):for i=1 to 16:t$(i)="":f$(i)="":next
130 t$(1)="back2pet (demo!)":t$(2)="frobots4 (demo!)"
150 t$(3)="miner! (1980)":t$(4)="pbros (2023)"
170 t$(5)="tut-tut (2021)":t$(6)="3d maze ..(2021)"
190 t$(7)="escape .. (2024)":t$(8)="defender (2020)"
220 t$(9)="trekwar (2022)":t$(10)="pssp (2023)"
240 t$(11)="truchet (2025)":t$(12)="kenatron (2025)"
260 t$(13)="microchess(1978)":t$(14)="vortex (1982)"
280 t$(15)="space! (1979)":t$(16)="galaga (1982)"
330 ms$="welcome to the 2025 detroit retro gaming show! "
#!/usr/bin/env python
#-u
# Python 2.4+ required
# by [email protected]
# This utility creates a multiplexing i/o pipe between a master process
# and multiple child processes. The master process reads in one input file
# and delegates equal chunks of those files into each child process.
#
# The child process script may be a binary program, too. so long as it
import blessed
import os, glob
import math
# TODO:
# - fast in-memory string compression of output
# - run at ~some fps, index into frames by rtt /2 use terminal query
import asyncio, telnetlib3
class MyTelnetServer(telnetlib3.TelnetServer):
def on_naws(self, rows, cols):
#### note: I wouldn't recommend using the python library of libchafa, at least, at the time of authoriship,
### it segfaulted every ~100 calls. I would suggest to use subprocess.Popen family of calls to the 'chafa'
### CLI utility, instead.
# TODO: calibration of FONT_RATIO:
import os
# ".. make a perfect circle ..."
import blessed
from chafa import *
public class ChessPiece {
String kind;
Position pos;
ChessPiece next;
ChessPiece(String kind, int xpos, int ypos)
{
this.kind = kind;
this.pos = new Position(xpos, ypos);
next = null;
@jquast
jquast / pizza_shop.py
Created August 16, 2022 21:55
how to drain the world's economy in less than one year
# inspired by https://www.theverge.com/2020/5/18/21262316/doordash-pizza-profits-venture-capital-the-margins-ranjan-roy
import math
starting_cash = 16
cost_to_order = 16
doordash_pays = 24
cost_of_pizza = 4
cash = starting_cash
@jquast
jquast / rfile.sh
Created March 2, 2022 20:44
zsh or bash function to show most recently modified file in current folder, or folder given
function rfile {
base=''
[ -n "${1}" ] && base="$1"/
ls -1rt ${1:-} | tac \
| while read f
do [ -f "${base}$f" ] && echo ${base}$f && break
done
}
import os
import time
import slack
import random
client = slack.WebClient(token=os.environ['SLACK_BOT_TOKEN'])
#response = client.chat_postMessage(
# channel=' #adam-test-channel',
# text="Hello world!")
@jquast
jquast / bytesize.sh
Created August 6, 2021 15:16
bytesize.sh
#!/bin/ksh
awk -v scale=$1 -v precision=$2 '
BEGIN {
# f_bytes and b_bytes, forwards and backwards for up and down-scaling
f_bytes="B K M G T P E Z"
b_bytes="Z E P T G M K B"
usage=0 # flipped on error condition, exit with usage
if ((scale == "-h") || (scale == "--help"))
usage=1
@jquast
jquast / ChessPiece.java
Created May 27, 2021 17:08
ChessPiece.java
public class ChessPiece {
String kind;
Position pos;
ChessPiece next;
ChessPiece(String kind, int xpos, int ypos)
{
this.kind = kind;
this.pos = new Position(xpos, ypos);
next = null;