Skip to content

Instantly share code, notes, and snippets.

View Aareon's full-sized avatar
💭
Looking for work!

Aareon Sullivan Aareon

💭
Looking for work!
  • Amazon Ops Tech IT
  • Mississippi
  • 01:39 (UTC -06:00)
View GitHub Profile

RFC [INSERT NUMBER HERE]: WebSocket Chat Protocol

Introduction The WebSocket Chat Protocol is designed to facilitate real-time, bidirectional communication between a client and a server over a WebSocket connection. This protocol is specifically designed for chat applications, where users can send messages to each other in real-time.

Protocol Overview The WebSocket Chat Protocol defines a simple message format that can be used to send chat messages between a client and a server. The format of a chat message is as follows:

{ "type": "message",

@Aareon
Aareon / ed25519.py
Last active July 16, 2021 02:53
Simple Python utility lib for interacting with TNBC
import hashlib
b = 256
q = 2**255 - 19
l = 2**252 + 27742317777372353535851937790883648493
def H(m):
return hashlib.sha512(m).digest()
def expmod(b,e,m):
@Aareon
Aareon / CHICKENTICKET.md
Last active July 7, 2021 18:03
ChickenTicket mechanics

<Copyright (c) 2021 Aareon Sullivan>

ChickenTicket - mechanics

The Node communicates with the network, & receives messages from peers, a Validator Node, & the Primary Validator.

Definitions:

* PV: Primary Validator
* VP: Validator Pool
* Vn: Validator node
* Tx: Transaction
* Government: PV (president), VP (senate), Vn (governor)
#!python3
import sys
import time
from pathlib import Path
import requests
from pyrate_limiter import Duration, Limiter, RequestRate
try:
import ujson as json
@Aareon
Aareon / pythonista_tools_installer.py
Created May 22, 2021 22:40
Pythonista-Tools Installer Patch
#!coding: utf-8
"""
Installer program to help install tools registered on the Pythonista Tools GitHub repo. Python 3.6+ only
"""
__version__ = '1.1.0'
import functools
try:
import ujson as json # faster json
except ImportError:
@Aareon
Aareon / CopyWebPageText.py
Created May 22, 2021 22:21
Extension for Pythonista
# import 'pythonista'
# -*- coding: utf-8 -*-
"""Copy WebPage Text
A Pythonista script that works from the sharesheet or the clipboard to copy the text from a webpage to the clipboard. If you have copy a URL and run this script, it will open the URL from your clipboard.
"""
import os
import re
import sys
import appex
@Aareon
Aareon / Error
Created May 19, 2021 03:28
SIGABRT crash in Pyto REPL
NSInvalidArgumentException: *** -[NSArray objectAtIndex:]: method only defined for abstract class. Define -[__NSArrayM objectAtIndex:]!
0 CoreFoundation 0x00000001ae0dd668 E2D6A76B-6879-31A3-8168-DF49F94E17CD + 1222248
1 libobjc.A.dylib 0x00000001addffbcc objc_exception_throw + 56
2 CoreFoundation 0x00000001ae13a81c E2D6A76B-6879-31A3-8168-DF49F94E17CD + 1603612
3 CoreFoundation 0x00000001ae0d6d48 E2D6A76B-6879-31A3-8168-DF49F94E17CD + 1195336
4 pythonA 0x0000000101bcc044 ffi_call_SYSV + 68
5 pythonA 0x0000000101bd4ab0 ffi_call_int + 1300
6 pythonA 0x0000000101bd4590 ffi_call + 56
7 pythonA 0x0000000101bb409c _ctypes_callproc + 952
@Aareon
Aareon / git.py
Created May 4, 2021 21:54
Modified git.py for StaSH & Python 3.6+
# -*- coding: utf-8 -*-
'''
Distributed version control system
Commands:
init: git init <directory> - initialize a new Git repository
add: git add <file1> .. [file2] .. - stage one or more files
rm: git rm <file1> .. [file2] .. - unstage one or more files
commit: git commit <message> <name> <email> - commit staged files
merge: git merge [--abort] [--msg <msg>] [<commit>] merge another commit into HEAD
@Aareon
Aareon / get-powerline.sh
Created March 8, 2021 00:13
Get and install Powerline fonts
# make directory and its parents
md () { if ! [ -d $1 ]; then mkdir -p $1; fi }
# store pwd for reset later
PWD=pwd
# powerline fonts
md ~/.fonts && cd ~/.fonts
if [ -d powerline ]; then rm -rf powerline; fi
git clone https://github.com/powerline/fonts powerline --depth=1
cd powerline
@Aareon
Aareon / strap.sh
Last active March 3, 2021 11:50
golang and github cli
#!/bin/bash
## each separate version number must be less than 3 digit wide !
function version { echo "$@" | gawk -F. '{ printf("%03d%03d%03d\n", $1,$2,$3); }'; }
if ! command -v gh &> /dev/null
then
# install github cli
echo "github cli (gh) not installed"
ver="$(go version)"