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
<html> | |
<head> | |
<title>flamegraph</title> | |
<style> | |
body { | |
margin: 0; | |
padding: 0; | |
font-family: Monaco, "Liberation Mono", Courier, monospace; | |
font-size: 10pt; | |
} |
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
hi |
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 'rubygems' | |
require 'mq' | |
EM.run do | |
def log(*args) | |
p args | |
end | |
amq = MQ.new |
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
$:.unshift File.dirname(__FILE__) + '/../lib' | |
require 'mq' | |
EM.run do | |
# open a channel on the AMQP connection | |
channel = MQ.new | |
# declare a queue on the channel | |
queue = MQ::Queue.new(channel, 'queue 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
#require 'rubygems' | |
require 'amqp/lib/mq' | |
EM.run do | |
def log(*args) | |
p args | |
end | |
# AMQP.logging = true |
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 'thread' | |
Thread.abort_on_exception = true | |
require 'rubygems' | |
require 'eventmachine' | |
class AsyncTime | |
def self.now | |
EM.add_timer(2){ yield(Time.now) } | |
end | |
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
require File.dirname(__FILE__) + '/fiber18' | |
require 'bacon' | |
class Bacon::Context | |
unless method_defined? :_it | |
alias :_it :it | |
def it *args | |
_it(*args){ if block_given? then yield; Fiber.yield end } | |
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
def ConstSetter(opts) | |
(@@__const_setter__modules ||= {})[opts] ||= Module.new do |m| | |
def m.included c | |
@@__const_setter__modules.index(self).each do |key, val| | |
c.const_set(key, val) | |
end | |
end | |
end | |
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
--- signal.c.orig 2008-08-21 18:42:46.000000000 -0700 | |
+++ signal.c 2008-08-21 18:55:42.000000000 -0700 | |
@@ -23,6 +23,7 @@ | |
#if defined HAVE_SIGPROCMASK || defined HAVE_SIGSETMASK | |
#define USE_TRAP_MASK 1 | |
+static int restore_signals = 0; | |
#else | |
#define USE_TRAP_MASK 0 | |
#endif |
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 'rubygems' | |
require 'rev' | |
require 'pp' | |
class Google < Rev::HttpClient | |
def self.connect loop = Rev::Loop.default | |
g = super('google.com') | |
g.attach(loop) if loop | |
g | |
end |
OlderNewer