Skip to content

Instantly share code, notes, and snippets.

View jakedouglas's full-sized avatar

Jake Douglas jakedouglas

View GitHub Profile
Installing json (1.1.9) from rubygems repository at http://ec2-us-east-mirror.rightscale.com/rubygems/archive/20100513/ with native extensions An exception occurred running /Users/jake/.rvm/gems/rbx-head/bin/bundle
ERROR: Failed to build gem native extension.
/Users/jake/.rvm/rubies/rbx-head/bin/rbx extconf.rb
checking for ruby/st.h... yes
checking for ruby/encoding.h... no
creating Makefile
make
gcc -I. -I. -I/Users/jake/.rvm/rubies/rbx-head/include -I. -DHAVE_RUBY_ST_H -ggdb3 -O2 -Wall -c generator.c
diff --git a/spec/ruby/optional/capi/ext/kernel_spec.c b/spec/ruby/optional/capi/ext/kernel_spec.c
index 667a1e8..e98af04 100644
--- a/spec/ruby/optional/capi/ext/kernel_spec.c
+++ b/spec/ruby/optional/capi/ext/kernel_spec.c
@@ -64,6 +64,21 @@ VALUE kernel_spec_rb_throw(VALUE self, VALUE result) {
#endif
#ifdef HAVE_RB_RESCUE
+VALUE kernel_spec_call_proc_with_raised_exc(VALUE arg_array, VALUE raised_exc) {
+ VALUE argv[2];
-module(gdemo_server).
-behavior(gen_server).
-export([start_link/0, connect/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
init(_Args) ->
process_flag(trap_exit, true),
From fad73fe62f2f7754ebd087283326c015d6dfe810 Mon Sep 17 00:00:00 2001
From: Jake Douglas <jakecdouglas@gmail.com>
Date: Mon, 15 Mar 2010 13:26:14 -0700
Subject: [PATCH] Remove a queue from MQ#queues on CancelOk if it is autodelete
---
lib/mq/queue.rb | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/mq/queue.rb b/lib/mq/queue.rb
["_ruby_re_search", "0x10007f930"]
["_ruby_re_set_casetable", "0x100073a00"]
["_ruby_release_date", "0x1000a42e1"]
["_ruby_run", "0x100031570"]
["_ruby_safe_level", "0x1000d35c0"]
["_ruby_sandbox_restore", "0x1000f1110"]
["_ruby_sandbox_save", "0x1000f1108"]
["_ruby_scan_hex", "0x1000943e0"]
["_ruby_scan_oct", "0x1000928e0"]
["_ruby_scope", "0x1000f1130"]
diff --git a/ext/em.cpp b/ext/em.cpp
index e4ee9be..69a70d2 100644
--- a/ext/em.cpp
+++ b/ext/em.cpp
@@ -928,6 +928,17 @@ bool EventMachine_t::_RunSelectOnce()
_ReadLoopBreaker();
}
else if (s < 0) {
+ switch (errno) {
+ case EAGAIN: {
From 55054011d2db9eb99affb96f3ffb89cbdab49dc9 Mon Sep 17 00:00:00 2001
From: Jake Douglas <jakecdouglas@gmail.com>
Date: Tue, 29 Dec 2009 14:22:28 -0800
Subject: [PATCH] add :confirm => some_proc for Queue#subscribe to receive ConsumeOk
---
lib/mq.rb | 7 +++++++
lib/mq/queue.rb | 12 ++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
class dumbhttpclient (host, port) =
object(self)
inherit Om_connection.connection (host, port)
method on_connected () =
print_string "Connected!\n";
flush stdout;
self#send_data("GET / HTTP/1.1\r\n\r\n");
method on_disconnected (error) =
// This code should align the stack to a 16 byte boundary for OSX function calls
push rbx // save rbx. joe says rbx is caller saved, but other things say its callee-saved?
mov rdx, 0 // move 0 into the first division register
mov rax, rsp // move rsp's address into the second division register
mov rbx, 16 // move the divisor, 16, into rbx
div rbx // perform the division using the value we just put into rbx
mov rbx, rdx // store the remainder into rbx so we have it when we return
subq rsp, rbx // grow the stack pointer by our offset
callq 0xdeadbeef // call out to the function
#define _GNU_SOURCE
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <sysexits.h>
#include <sys/mman.h>
#include <mach-o/dyld.h>