Ruby on Rails with Spring, Hibernate and JPA
Scott led a session at Bar Camp extolling the virtues of running your Ruby on Rails app in a pure Java environment, accessing the same resources as your programming brethren.

Scott led a session at Bar Camp extolling the virtues of running your Ruby on Rails app in a pure Java environment, accessing the same resources as your programming brethren.
I think lots of folks have run into this problem of using error_messages_for to display errors of nested or subordinate objects. The current Rails method doesn’t handle it well. In addition, there’s the problem of not being able to specify the full message. So… I tackled this problem today and came up [...]
I just implemented a statistics page for an application and found that I was using this pattern over and over again:
User.count(:conditions => [’created_at > ?’, 30.days.ago])
Here’s a simple extension I made to ActiveRecord to DRY it up:
module ActiveRecord
class Base
def self.count_since(time_ago)
[...]
So, I’m sure many others have made the same mistake. You downloaded the latest Apache, did the 3 step:
configure –prefix=/usr/local –enable-mods-shared=all –enable-ssl –enable-proxy
make
sudo make install
Doh! That’s probably not what you wanted. Now you have stuff like
/usr/local/build
/usr/local/icons
You’d have been better off going with Apache 2’s default prefix which is /usr/local/apache2. The problem [...]
Update 1/15/2008
Autotest and rspec both posted updates today. Now, the way to fix this issue is slightly different:
Autotest.add_hook :run do |autotest|
autotest.add_exception(/^\.\/vendor/)
autotest.add_exception(/\.svn/)
end
Thanks Ryan and David for the updates!
I’ve been noticing in my current project that running autotest was constantly consuming about 25-30% of my cpu and causing my macbook pro to [...]
On Tuesday, Forbes posted a bizarre article, Fear Among Facebook Developers, that seems to suggest if you’re not a big brand on the Internet then you should just pack your bags and go home.
The issue is that Facebook is going to start putting more of its own ads throughout the site. Big surprise. [...]
Today we released a new Ruby Gem that makes integrating with Amazon E-Commerce Service (ECS) a snap. It’s called acts_as_amazon_product and you can find it on RubyForge.
All that’s necessary to integrate any of your existing models with Amazon is to add a require line to the top of your model file and then an [...]
I just found out that the U.S. Patent office issued patent number 7,188,176 naming me as primary inventor for an “Apparatus, system, and method for maintaining a persistent data state on a communications network”. I’m pretty stunned. I did the work for this back in 1998 for Priceline and they filed for the [...]
Sometimes I set up a quick site for a client and want to summarize hits without setting up awstats. So, I wrote a quick and dirty script to sum up the hits per day in Apache’s access_log file.
Example:
$ cklog access_log
04-15-2007: 21
04-16-2007: 2134
04-17-2007: 304
04-18-2007: 6960
04-19-2007: 951
04-20-2007: 412
Here’s the script:
require ‘date’
daily = Hash.new
File.open(ARGV[0] || "access_log", "r") [...]
Here’s a web crawler I wrote awhile back. It’s pretty simple, but does the job. If you need something more, you might try rdig or Nutch.
You can run this as a stand-alone script and just pass in the URL to crawl as an argument.
[ruby]
require ‘net/http’
require ‘uri’
class SiteCrawler
def initialize(url)
[...]
Recent Comments