This file contains 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 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 |
This file contains 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 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): |
This file contains 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
#### 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 * |
This file contains 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
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; |
This file contains 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
# 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 |
This file contains 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
function rfile { | |
base='' | |
[ -n "${1}" ] && base="$1"/ | |
ls -1rt ${1:-} | tac \ | |
| while read f | |
do [ -f "${base}$f" ] && echo ${base}$f && break | |
done | |
} |
This file contains 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 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!") |
This file contains 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
#!/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 |
This file contains 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
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; |
This file contains 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
{ | |
"5.1.0": [ | |
12752, | |
12753, | |
12754, | |
12755, | |
12756, | |
12757, | |
12758, | |
12759, |
NewerOlder