Skip to content

Instantly share code, notes, and snippets.

View craigw's full-sized avatar
🦄

Craig R Webster craigw

🦄
View GitHub Profile
#!/bin/sh
# This is /home/starling/service/log/run
exec multilog t s1000000 n10 ./main
#!/bin/sh
# This is /home/starling/service/run
exec 2>&1
echo "Starting..."
PORT=22122
IP=0.0.0.0
USER=starling
consumer = SMQueue(:adapter => BarkingIguana::Messaging::SMQueue::StarlingAdapter, :queue => "some.queue.name")
consumer.get do |message|
puts message.body.inspect
# => "Quack quack"
end
producer = SMQueue(:adapter => BarkingIguana::Messaging::SMQueue::StarlingAdapter, :queue => "some.queue.name")
producer.put "Quack quack"
require 'rubygems'
require 'smqueue'
require 'starling'
require 'yaml'
module BarkingIguana
module Messaging
module SMQueue
class StarlingAdapter < ::SMQueue::Adapter
class Configuration < ::SMQueue::AdapterConfiguration
s = "http://tinyurl.com/asdf"
s.expand_urls!
puts s.inspect
# => "http://support.microsoft.com/default.aspx?scid=kb;EN-US;158122"
class String
include BarkingIguana::ExpandUrl
end
require 'net/http'
module BarkingIguana
module ExpandUrl
def expand_urls!
ExpandUrl.services.each do |service|
gsub!(service[:pattern]) { |match|
ExpandUrl.expand($2, service[:host]) || $1
}
end
# Install the Aspell port
sudo port install aspell
# Install the Ruby bindings for Aspell
sudo gem install raspell -- --with-opt-dir=/opt/local
raspell.h:6:20: error: aspell.h: No such file or directory