August 27, 2007 @ 09:17 AM by nap · 0 comments
So a few months back I started using nginx on my staging server, front-ending for Mongrel, and just recently I've stated migrating some production stuff over to it. It's pretty great as a lightweight Apache replacement. Incredibly simple syntax, very quick and close to the bone. Most of my production stuff still runs on Apache, but that may soon be changing. I also finally made the leap to Capistrano 2.0. Loving the new namespaced task hierarchy.
Anyway, here's a simple alternative maintenance page recipe for Capistrano's deploy:web:disable target and the corresponding Nginx config to make use of it. In case you're unfamiliar with it, the disable web task basically redirects all requests to a maintenance page until deploy:web:enable is run, which returns things to normal. This recipe assumes you've created your own (static) maintenance.html page in public/maintenance.html and that it makes use of existing stylesheets and images -- meaning that you don't want to rewrite those requests.
in config/deploy.rb:
namespace :deploy do
desc "Disable requests to the app, show maintenance page"
web.task :disable, :roles => :web do
run "cp #{current_path}/public/maintenance.html #{shared_path}/system/maintenance.html"
end
desc "Re-enable the web server by deleting any maintenance file"
web.task :enable, :roles => :web do
run "rm #{shared_path}/system/maintenance.html"
end
end
in nginx.conf (within your server block definition):
# allow requests for images, js, css, and icons to go through
# even if cap has been used to disable the site
if ($request_filename ~* /(images|javascripts|stylehseets)/) { break; }
if ($request_filename ~* .ico$) { break; }
# for cap's deploy:web:disable task
if (-f $document_root/system/maintenance.html) {
rewrite ^(.*)$ /system/maintenance.html last;
break;
}
August 20, 2007 @ 10:56 PM by nap · 0 comments
If you're in the greater NH/Maine/Mass seacoast area, don't forget to check out tomorrow's NHRuby group. Sir Brian DeLacey will be visiting us from Boston and talking about Shoes, the Ruby desktop UI toolkit from the ever-enigmatic _why.
If there's time left to spare, I'll probably spend some time blathering on about how you should participate in the upcoming Rails Rumble. Believe me, after seeing some of the prizes, you're going to want to get in on the action. I was dead f**king serious about that championship belt. You'll see.
August 17, 2007 @ 09:14 AM by nap · 0 comments
NetBeans really is the BOMB, as Charles Nutter notes over on his blog. Check out that link. I wanted to make sure I echoed his thoughts here, because for me, NetBeans really is the best Rails IDE on the planet. I switched over from IntelliJ some time ago and haven't regretted it even briefly.
I really can't say enough things about NetBeans. What other IDE makes it painless to debug (yes debug, within the IDE), refactor, and test your Ruby applications? Plus, the syntax highlighting is rockin and you get all the standard NetBeans goodness out of the box. Don't want a huge download? No big deal, there's a slimmed-down Ruby-only version available. Give it a shot. Even if you're a hardcore Textmate geek, I think you'll at least be able to see why I'm raving about it.
August 10, 2007 @ 02:12 PM by nap · 0 comments
So like everyone else, you probably have a killer web app idea you've been sitting on. Maybe you've thought about building it, maybe you've even drawn out some diagrams on the back of a napkin, but you just haven't found the time to execute it. The unfortunate reality is that sometimes you just need an excuse, or a little push, to get something awesome started.
Sound about right? Then this one's for you. Enter the Rails Rumble, September 8-9, and consider yourself pushed.
August 07, 2007 @ 08:58 PM by nap · 0 comments
Last week Amazon unveiled a beta of their new Flexible Payments Service, a potential Paypal-killer and Google Checkout-killer, among other things. At first glance, FPS seems to be everything that Paypal isn't: well designed, API-centric, and built with developers in mind.
While everyone is busy barking about how Amazon is going to go head to head with Google Checkout and Paypal for purchases, they seem to be missing the more interesting development here. I'm talking about something that neither Paypal or Google are even attempting to do, as far as I know: micropayments.
Ty, Steve, and I spent some serious time putting together a few different iterations of an idea/prototype earlier this year, that involves micropayments and the street performer protocol. And some other stuff, too :-). Unfortunately, when it came time to tie it into a payment gateway, it became painfully obvious that what we needed didn't really exist, so we compromised. And that compromise led to a bunch of problems and eventually what we felt was an unworkable solution. So it's been in mothballs since. This looks like it could be what we were maybe waiting for.
If you check out Amazon's rate schedule you can see why I'm excited:
For Amazon Payments balance transfers < $0.05:
20% of the transaction amount, with a minimum fee of $0.0025
OK, OK, so 20% is a hefty fee but not when we're talking about the alternative being somewhere in the neighborhood of $0.30 USD + 2-3%. So yeah, pfft. This is HUGE. And yes, it does look like these micropayments only work when you're using Amazon payments (as opposed to using a credit card, etc) but so what? I'm not so sure that's an obstacle.
Another reason it's so interesting to me is that they've decided to support three languages/platforms in their initial beta rollout: Java, PHP, and yes, my friends, Ruby. Oh, and the sample app? Yep. Rails.
Why aren't we more excited about this?