Skip to content

Instantly share code, notes, and snippets.

@VinceGuidry
VinceGuidry / 1-dsl.rb
Last active April 26, 2025 20:05
Ruby DSL
require 'tempfile'
# The DSL class. The render method simply takes a block, then executes the block in the scope of the DSL class. You can see
# a use of it in the next file.
module Keyd
class DSL
def self.render(&block)
d = new
d.instance_exec(&block)
@VinceGuidry
VinceGuidry / editor.rb
Created September 24, 2025 13:27
Kitty terminal protocol parsing
require 'io/console'
require 'ansi/terminal'
require 'ansi/string'
require 'pry'
module Vinced
class Keypress
attr_reader :string, :parsed, :printable