Skip to content

Instantly share code, notes, and snippets.

@MrJake222
MrJake222 / json_dump_stream.py
Created September 17, 2021 16:59
Alloc-less version of json.dump(s) for MicroPython.
async def json_dump_stream(obj, write):
if obj is None:
await write("null")
elif isinstance(obj, str):
await write('"')
await write(obj)
await write('"')
elif isinstance(obj, bool):
@MrJake222
MrJake222 / beamer_count.lua
Created February 7, 2021 21:46
Simple counter program for AUNIS Beamers
local event = require("event")
local counts = {}
while true do
_, _, _, tab = event.pull("beamer_transfers")
for k,v in pairs(tab) do
if counts[k] == nil then counts[k] = 0 end
counts[k] = counts[k] + v
@MrJake222
MrJake222 / dial.lua
Last active June 11, 2021 01:21
Simple dialing program for AUNIS
address = {"Aries", "Auriga", "Crater", "Andromeda", "Aquarius", "Leo Minor", "Point of Origin"}
c = require("component")
event = require("event")
os = require("os")
sg = c.stargate
print("Dialing")
for i,v in ipairs(address) do print(i,v) end
print()