Skip to content

Instantly share code, notes, and snippets.

View skinnyjames's full-sized avatar

Sean Gregory skinnyjames

  • Columbus, Ohio
View GitHub Profile
@skinnyjames
skinnyjames / session.rb
Created October 4, 2026 15:09
session.rb
module Ooze
module Terminal
# Based on the VT220 Programmers reference manual
# https://www.vt100.net/docs/vt220-rm/
# ASCII Code table (occupies the C0 range starting on the 1st bit to 7th)
ASCII_CODE_TABLE = {
nul: 0x00, soh: 0x01, stx: 0x02, etx: 0x03, eot: 0x04, enq: 0x05,
ack: 0x06, bel: 0x07, bs: 0x08, ht: 0x09, lf: 0x0A, vt: 0x0B,
ff: 0x0C, cr: 0x0D, so: 0x0E, si: 0x0F, dle: 0x10, dc1: 0x11,
@skinnyjames
skinnyjames / test.rb
Created September 5, 2026 18:24
voice-test
class Counter < Hokusai::Block
style <<~EOF
[style]
additionStyles {
background: rgb(214, 49, 24);
cursor: "pointer";
}
additionLabel {
size: 40;
require "color"
require "mini_magick"
GROW = 3
COLORS = {}
SIZE = ENV.fetch("SIZE", 30)
SWIDTH = SIZE
SHEIGHT = SIZE
ASSETS = ENV.fetch("ASSETS", "#{__dir__}/assets")
SOURCE = ENV.fetch("SOURCE", "source.png")
@skinnyjames
skinnyjames / counter.rb
Created August 25, 2026 13:24
accessibility idea
class Counter < Hokusai::Block
template <<-EOF
[template]
vblock
text#count { :content="count.to_s" }
hblock
vblock#inc {@click="increment"}
empty
vblock#dec {@click="decrement"}
empty
@skinnyjames
skinnyjames / panel.rb
Created June 3, 2026 09:57
friction.rb
module HackOS
class Panel < Hokusai::Block
template <<~EOF
[template]
clipped {
@tap="on_tapdown"
@drag="on_taphold"
@taphold="on_taphold"
@swipe="on_swipe"
@taprelease="on_taprelease"
@skinnyjames
skinnyjames / launcher.rb
Created June 1, 2026 14:14
launcher code
module HackOS
class MovingIcon < Hokusai::Block
template <<~EOF
[template]
virtual
EOF
computed! :moving
computed! :name
computed! :width
class ACamera < Hokusai::Block
template <<~EOF
[template]
empty { @click="add_filter" }
EOF
uses(empty: Hokusai::Blocks::Empty)
attr_accessor :lw, :lh, :texture, :camera
@skinnyjames
skinnyjames / character-mover.rb
Created April 8, 2026 22:13
Just the code to slice a sprite sheet up and move the character. It needs the spritesheet to work, I'll publish a repo if you want to try it out.
class Char < Hokusai::Block
template do
child(Hokusai::Blocks::Empty) do
on(:keydown) do |event|
move(event)
end
end
end
# 68x68 blocks
@skinnyjames
skinnyjames / composed.gemspec.rb
Last active November 1, 2025 05:35
MRBuild gemspecs
gemspec("counter-app") do |config|
gem path: "../mruby"
gem path: "../hokusai-pocket"
end
@skinnyjames
skinnyjames / gemspec.rb
Last active October 28, 2025 06:40
proposal gemspec api from mruby
# Proposed DSL API
# Declare a gemspec with an ID
#
# conf contains properties about the build
gemspec "mruby-hokusai-pocket" do |conf|
conf.version = "0.1.0"
conf.author = "skinnyjames"
#..etc