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:
| This is one way to build a snap for a Ruby app that: | |
| * uses Ruby 3.3 with YJIT | |
| * uses ZMQ/CZMQ, Sqlite3, libxml2, libmbedtls, libmysqlclient | |
| * bundles custom fonts and wktohtmlpdf for PDF generation | |
| * has a daemon (system service) which uses the 'network-bind' plug | |
| * respects the env vars FOOBAR_APP (path to app) and FOOBAR_CONF (path to config file) | |
| * has a separate, bundled web UI (unpacks webui-dist.tgz to /app/webui/dist inside the snap) | |
| * builds the snap using an LXD container |
| #!/usr/bin/env ruby --yjit | |
| WORKER_THREADS = 4 | |
| CHUNK_SIZE = 2**16 | |
| # BUG: my city struct is being corrupted when moving from the worker to the main ractor. | |
| # `#<struct City min=-11.3, tot=24088.30000000004, max=64.6, n=1164>` becomes | |
| # `#<struct City min=-11.3, tot=24088.30000000004, max=64.6, n=nil>`, note that each `n` attribute becomes `nil`. | |
| # https://bugs.ruby-lang.org/issues/20165 | |
| # I tried changing the Struct to a simple array and still using `move: true`, |
| 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' | |
I hereby claim:
To claim this, I am signing this object:
| #! /usr/bin/env ruby | |
| require "cztop" | |
| require "benchmark" | |
| if ARGV.size != 2 | |
| abort <<MSG | |
| Usage: #{$0} <message-size> <message-count> | |
| MSG | |
| end |
| 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()) |
| 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", |
| libcallback.dylib: callback.c | |
| clang -dynamiclib -std=gnu99 callback.c -o $@ |
| libcallback.dylib: callback.c | |
| clang -dynamiclib -std=gnu99 callback.c -o $@ |
| libcallback.dylib: callback.h callback.c | |
| clang -dynamiclib -std=gnu99 callback.c -o $@ |