Skip to content

Instantly share code, notes, and snippets.

View test_class_method_super.rb
class Base # ./lib/roadster/messaging/protocols/csp/messages.rb:6:in `<top (required)>'
def self.property(name) # ./lib/roadster/messaging/protocols/csp/csp.rb:6:in `require_relative'
properties << name # ./lib/roadster/messaging/protocols/csp/csp.rb:6:in `<top (required)>'
end # ./lib/roadster/messaging/protocols/protocols.rb:7:in `require_relative'
View keybase.md

Keybase proof

I hereby claim:

  • I am paddor on github.
  • I am paddor (https://keybase.io/paddor) on keybase.
  • I have a public key ASB83G0OHrjTatUVY6r1RJrheLLmMgz6ezrSWDUhijVmiQo

To claim this, I am signing this object:

View inproc_thru.rb
#! /usr/bin/env ruby
require "cztop"
require "benchmark"
if ARGV.size != 2
abort <<MSG
Usage: #{$0} <message-size> <message-count>
MSG
end
@paddor
paddor / diff.txt
Last active Aug 18, 2016
from Ruby to Crystal
View diff.txt
from Ruby to Crystal:
* compiled to one binary
* (optional) type restrictions
* there's a class Bool (values are true and false)
* Nil is the type of nil (not NilClass)
* very DRY: def initialize(@name)
* nice way to avoid alias_method_chain: previous_def
* @@var is valid only in that class and its instances, not subclasses
* file-global functions can be called from within a method (foo() or explicitly ::foo())
View host_port.cr
require "benchmark"
require "uri"
HOSTS = {
"fqdn" => "example.com:3000",
"ipv6" => "[123::1]:3000",
"ipv4" => "123.123.123.123:3000",
"mapped" => "[::192.168.1.1]:3000",
"garbage" => "foo.bar:a000",
"invalid_port" => "foo:123456",
@paddor
paddor / Makefile
Created Dec 27, 2015
JRuby/Rubinius: doesn't abort C function when FFI::Function breaks
View Makefile
libcallback.dylib: callback.c
clang -dynamiclib -std=gnu99 callback.c -o $@
@paddor
paddor / Makefile
Last active Dec 27, 2015
Rubinius: FFI::Function doesn't return break value
View Makefile
libcallback.dylib: callback.c
clang -dynamiclib -std=gnu99 callback.c -o $@
@paddor
paddor / Makefile
Last active Dec 27, 2015
Rubinius: can't spawn a Thread from within an FFI::Function if the FFI::Function is called from another thread
View Makefile
libcallback.dylib: callback.h callback.c
clang -dynamiclib -std=gnu99 callback.c -o $@
View Makefile
libcallback_bug.dylib: callback_bug.h callback_bug.c
clang -dynamiclib -std=gnu99 callback_bug.c -o $@
@paddor
paddor / hang.txt
Created Dec 24, 2015
CZMQ: Hang when destroying Zactors
View hang.txt
$ ./zactor_issue.rb
CZMQ::FFI::Zactor
new Zactor
main thread: #<Thread:0x007fb5208bc3b0 run>
zactor thread: #<Thread:0x007fb52087e678 run>
nil: processing messages
nil: waiting for next message ...
#<FFI::Pointer address=0x007fb52059e860>: zactor created.
instanciates