Skip to content

Instantly share code, notes, and snippets.

View kjellm's full-sized avatar

Kjell-Magne Øierud kjellm

View GitHub Profile
@kjellm
kjellm / web_server.rb
Last active December 14, 2015 15:59
Plugman, Celluloid, DCell, Reel, Websockets
#! /usr/bin/env ruby
require 'reel'
require 'dcell'
DCell.start :id => "web_server", :addr => "tcp://127.0.0.1:9001"
class Inbox
include Celluloid
include Celluloid::Notifications
@kjellm
kjellm / graph.rb
Created October 26, 2011 09:38
Drawing graphs with Ruby, GTK, Cairo, and Graphviz
#!/usr/bin/env ruby -w
require 'gtk2'
edges = [[:a, :b],
[:a, :c],
[:b, :c],
[:c, :d],
[:d, :e],
[:d, :f],
Object subclass: #BaseObject
instanceVariableNames: ''
classVariableNames: 'registry'
poolDictionaries: ''
category: 'EventSourcing'!
!BaseObject methodsFor: 'as yet unclassified' stamp: 'KjellMagneOierud 1/22/2017 11:29'!
logg: aString
Transcript show: aString ; cr .! !
@kjellm
kjellm / app.rb
Last active July 26, 2021 04:46
Event Source proof of concept. Copyright 2017 Kjell-Magne Øierud. License: MIT https://opensource.org/licenses/MIT
require_relative 'base'
require_relative 'event'
require_relative 'cmd'
require_relative 'crud'
require_relative 'model'
require_relative 'read'
require 'pp'
class Application < BaseObject