[Rails Tip] DataMapper Timestamps Bug and Workaround

It has been confirmed by DataMapper’s core developer Martin Gamsjaeger (snusnu) that it is a bug. In short, created_[at|on] can be manually overridden, but updated_[at|on] cannot. The workaround is simple, do it in two steps, for example: Please check the bug ticket to see when it’s getting fixed.


[Rails Tip] Run Specs Faster!

Apr 09, 2010|1 Min Read|Comments|

If you are using rake spec to run the specs. Try using spec spec instead! It avoids doing some preliminary tasks and therefore is quicker to execute. You can verify the difference using Unix’s time command, i.e. time spec spec and time rake spec.


[Rails] Run Queued Tasks Using 'delayed_job', Now With Intervals!

If you don’t already know, ’delayed_job’ is a database based asynchronously priority queue system extracted from Shopify. I was seeking for a lightweight, easy to use solution for queueing tasks, ‘delayed_job’ fits the bill almost perfectly. ;) One thing we needed to do for a Rails 2 project at Envato, was to queue the tasks and to run them one after another, at a set interval. 'delayed_job’ unfortunately doesn’t come with this feature. So, instead of searching for more complicated solutions or…


i need textmate 2 or a 3d monitorprojector to

Mar 17, 2010|1 Min Read|Comments|

I need Textmate 2 (or a 3D monitor/projector) to come out sooner, otherwise there will be a day where I will just be totally lost in dozens of windows.


[Rails] MongoMapper on Rails 3 Master, Undefined 'to_key' Method

Mar 17, 2010|1 Min Read|Comments|

Rails 3 has recently renamed key method to to_key, which consequently rendered MongoMapper unusable. You might see an error that looks like: After some twiddling I’ve submitted a patch to address this issue. Feel free to pull my fork until the fix makes its way into John Nunemaker’s main repository.


Use the 'textmate' Command to Quickly Install Bundle Files

Mar 14, 2010|1 Min Read|Comments|

Initially developed by Yehuda Katz, the Textmate gem is an extremely handy tool for installing and managing your Textmate bundle files. The tool works very well, for the most part. But due to the way the GitHub search query was built, the tool failed at finding Textmate bundles that do not honour the ’-tmbundle’ suffix in the name of their repositories. I was waiting for GitHub to fix their API bug which I reported here, but today I discovered a workaround that solves this issue. So, here, I…


i hate it when this happens and i have a dozen of

Mar 14, 2010|1 Min Read|Comments|

I hate it when this happens and I have a dozen of Textmate and Terminal windows open…


[Rails] Use HAML templates with Devise

Mar 13, 2010|1 Min Read|Comments|

If you are a Rails developers, chances are you have heard of, or are using either Devise or HAML in your projects. And if you’re like me who uses both, then surely you’d wish these two worked together, i.e. generate devise views in HAML. Today is your lucky day! I’ve just committed some changes that enable you to do so! The changes are already merged back to the primary repository. In order to generate HAML views instead of ERb views, simply do: You can use the master branch of Devise, i.e. in…


first photoshop now textmate whats next

Mar 09, 2010|1 Min Read|Comments|

First Photoshop, now Textmate, what’s next?


Advanced Search Query on GitHub

Mar 09, 2010|1 Min Read|Comments|

Did you know, you can perform advanced search queries on GitHub? For example: The above query will search everything containing ruby, as well as either textmate or tmbundle. Unfortunately at this stage the GitHub API does not support it. I’ve opened a ticket here.