Skip to content

Instantly share code, notes, and snippets.

View adamwiggins's full-sized avatar

Adam Wiggins adamwiggins

View GitHub Profile
#!/usr/bin/env ruby
require 'bunny'
require 'uri'
queue_name = ARGV.shift or abort "usage: bleed_queue <queue>"
def options
uri = URI.parse(ENV["AMQP_URL"])
{
NoMethodError: undefined method `arguments' for nil:NilClass
vendor/amqp/lib/mq.rb:170:in `process_frame'
vendor/amqp/lib/amqp/client.rb:9:in `process_frame'
vendor/amqp/lib/amqp/client.rb:117:in `receive_data'
vendor/amqp/lib/mq.rb:170:in `run_machine'
@interface PlaySound : InstantAction
{
NSString *file;
}
+(void) play:(NSString *)file;
+(id) action:(NSString *)file;
-(id) init:(NSString *)_file;
/** Possible Pixel Formats for the EAGLView */
typedef enum {
/** RGB565 pixel format. No alpha. 16-bit */
kPixelFormatRGB565,
/** RGBA format. 32-bit (default) */
kPixelFormatRGBA8888,
kRGB565 = kPixelFormatRGB565,
kRGBA8 = kPixelFormatRGBA8888,
} tPixelFormat;
if(CGImageGetColorSpace(image)) {
if(hasAlpha || bpp >= 8)
pixelFormat = defaultAlphaPixelFormat;
else
pixelFormat = kTexture2DPixelFormat_RGB565;
} else //NOTE: No colorspace means a mask image
pixelFormat = kTexture2DPixelFormat_A8;
require 'sinatra'
before do
@refer = request.env['HTTP_REFERER']
m = (request.env['HTTP_REFERER'] || '').match(%r{https?://([^\/]+)/})
@refer_host = m ? m[1] : ''
end
get '/' do
@refer_host
require 'bacon'
require 'mocha/standalone'
require 'mocha/object'
class Bacon::Context
include Mocha::Standalone
def initialize(name, &block)
@name = name
@before, @after = [
class Accelerate( IntervalAction ):
def init(self, other, rate = 2):
self.other = other
self.rate = rate
self.duration = other.duration
def start(self):
self.other.target = self.target
self.other.start()
syntax on
set ts=3 sw=3 si
set hlsearch
set backspace=indent,eol,start
command Rubytabs set tabstop=2 smarttab shiftwidth=2 autoindent expandtab backspace=start,indent
command Regtabs set ts=3 sw=3 noexpandtab
require 'rubygems'
require 'memcache'
class MemCache
def self.cache
@@cache ||= MemCache.new('localhost:11211')
end
end
MemCache.cache['abc'] = 123