Skip to content

Instantly share code, notes, and snippets.

From a7b7aec29c5ac203c4f85d68fb9139fa05718107 Mon Sep 17 00:00:00 2001
From: Dane Jensen <dane.jensen@gmail.com>
Date: Fri, 19 Feb 2010 11:29:35 -0800
Subject: [PATCH 1/2] extconf.rb: hack arch for 32-bit karmic
---
ext/extconf.rb | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/ext/extconf.rb b/ext/extconf.rb
require 'rubygems'
require 'mq'
EM.error_handler {|e|
p [:exception, e]
if e.kind_of? AMQP::Error
EM.add_timer(1) {
AMQP.conn.reconnect
}
end
@careo
careo / bunny
Created February 17, 2010 00:40
/ I'm horizontally scalable and naturally \
\ concurrent.                             /
-----------------------------------------
 \
  \   \
       \ /\
       ( )
     .( o ).
@careo
careo / mate
Created January 29, 2010 22:45
#!/usr/bin/env ruby
forbidden = ["~","~/Desktop"].collect { |path| File.expand_path path }
target = File.expand_path ARGV[0]
if forbidden.include? target
puts "You don't REALLY want to open #{target} in TextMate, do you?"
exit 1
else
require 'rubygems'
require 'sinatra/async'
require 'memcached'
cache = Memcached.new("localhost:11211")
cache.set "test:Action:/delay/30", "NOT delayed for 30 seconds"
class AsyncTest < Sinatra::Base
register Sinatra::Async
module Chainable
# Specify a block to be executed if and when the Deferrable object receives
# a status of :succeeded. See #set_deferred_status for more information.
#
# Calling this method on a Deferrable object whose status is not yet known
# will cause the callback block to be stored on an internal list.
# If you call this method on a Deferrable whose status is :succeeded, the
# block will be executed immediately, receiving the parameters given to the
# prior #set_deferred_status call.
#
require 'uri'
require 'rubygems'
require 'fiber'
require 'eventmachine'
require 'em-http'
#require 'net/http'
#require "rest_client"
ERL_LIBS=/Library/Erlang/lib
if [ -d $HOME/Library/Erlang/lib ]; then
ERL_LIBS=$HOME/Library/Erlang/lib:$ERL_LIBS
fi
export ERL_LIBS
export CAPP_BUILD=$HOME/Library/JavaScript/Cappuccino
export JAVA_HOME=$(/usr/libexec/java_home)
└─(1::01:01:%)── MAGLEV_OPTS="-d -MtraceLoad" maglev-gem install sinatra ──(Thu,Dec03)─┘
_____________________________________________________________________________
| Configuration Files |
| |
| System File: /Users/djensen/Source/Ruby/maglev/etc/system.conf |
| |
| Executable File: /Users/djensen/gem.conf |
| Warning: File not found (errno=2,ENOENT, The file or directory specified cannot
| be found) |
| using defaults. |
#include <CoreServices/CoreServices.h>
static void mycallback(ConstFSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths,
const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]) {
int i;
char **paths = eventPaths;
for (i=0; i<numEvents; i++) {
/* flags are unsigned long, IDs are uint64_t */
printf("Change %llu in %s, flags %lu\n", eventIds[i], paths[i], eventFlags[i]);