This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dispatch/dispatch.h> | |
#include <stdio.h> | |
#include <errno.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <string.h> | |
#include <signal.h> | |
#include <netinet/tcp.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hallo = lambda {|foo| puts foo} | |
proc = MessagePack.unpack hallo.to_msgpack | |
proc.call 1 | |
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// zproto_codec_mruby.gsl | |
// Generates a codec for a protocol specification. | |
.gsl from "zproto_codec_c.gsl" | |
.output "$(class.source_dir)/mrb_$(class.name)_body.h" | |
/* ========================================================================= | |
$(class.name) - $(class.title:) | |
Codec class for $(class.name). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "picohttpparser.h" | |
#include <mruby.h> | |
#include <mruby/data.h> | |
#include <mruby/variable.h> | |
#include <mruby/array.h> | |
#include <mruby/string.h> | |
#include <mruby/class.h> | |
#define PHR_MAX_HEADERS 255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sodium.h> | |
#include <mruby.h> | |
#include <mruby/data.h> | |
#include <mruby/class.h> | |
#include <mruby/string.h> | |
#include <mruby/array.h> | |
#include "picohttpparser.h" | |
static mrb_value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[submodule "picohttpparser"] | |
path = picohttpparser | |
url = https://github.com/h2o/picohttpparser.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <czmq.h> | |
int main(void) { | |
zsock_t *server = zsock_new_stream ("@tcp://*:8080"); | |
assert (server); | |
while (!zsys_interrupted) { | |
zmsg_t *msg = zmsg_recv (server); | |
if (!msg) | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ffi' | |
require 'benchmark' | |
module LibC | |
extend FFI::Library | |
ffi_lib FFI::Library::LIBC | |
attach_function :malloc, [:size_t], :pointer | |
attach_function :free, [:pointer], :void | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'pry' | |
platforms :ruby do | |
gem 'msgpack' | |
end | |
platforms :jruby do | |
gem 'msgpack-jruby', :require => 'msgpack' | |
end |
NewerOlder