Skip to content

Instantly share code, notes, and snippets.

before(:each) do
user = Factory.create(:user, :email => "younotcookin@snakebarf.com")
login_as(user)
@redis = mock("Redis", :null_object => true)
Redis.stub!(:new).and_return(@redis)
end
it "should add the params to a list for the current user" do
@redis.should_receive(:new)
require 'rubygems'
require 'sinatra'
Sinatra::Application.default_options.merge!(
:run => false,
:env => ENV['RACK_ENV']
)
get '/home/jpoz/wwc/public' do
"This does work"
server {
listen 80;
server_name www.example.com alias example.com;
root /home/jpoz/wwc/public;
passenger_enabled on;
}
@class UIGlassButton;
- (void)viewDidLoad {
UIGlassButton *myButton = [[UIGlassButton alloc] initWithFrame:CGRectMake(2,2,316,50)];
[myButton addTarget:self action:@selector(doJunk:) forControlEvents:UIControlEventTouchDown];
[myButton setTitle:@"Neat button!" forState:UIControlStateNormal];
[myButton setTintColor:[UIColor colorWithWhite:0.20f alpha:1]];
[self.view addSubview:myButton];
}
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
class Awesome < Application
def update
run_later do
Awesome.import_massive_junk
end
redirect(url(:sweet))
end
end
describe Awesome do
it "should import_massive_junk" do
Awesome.should_recieve(:import_massive_junk)
dispatch_to(Awesome, :update)
end
end
describe Awesome do
it "should import_massive_junk" do
Awesome.should_receive(:import_massive_junk)
dispatch_to(Awesome, :update)
Merb::Dispatcher.work_queue.pop.call
end
end
require 'rubygems'
require 'sinatra'
require 'sinatra/recaptcha'
configure do
# https://admin.recaptcha.net/accounts/signup/
Sinatra::ReCaptcha.public_key = 'your_public_key'
Sinatra::ReCaptcha.private_key = 'your_private_key'
# to use ssl set Sinatra::ReCaptcha.server = 'https://api-secure.recaptcha.net'
end
APNS.host = 'gateway.push.apple.com'
# gateway.sandbox.push.apple.com is default
APNS.pem = '/path/to/pem/file'
APNS.pass = 'secret'
# openssl pkcs12 -in cert.p12 -out cert.pem -nodes -clcerts
APNS.port = 2195
# this is also the default. Shouldn't ever have to set this, but just in case Apple goes crazy, you can.