Published on Sunday, 20 May 2012
Digging Deep with ActiveSupport::Notifications by Matt Sanders should not be missed.
ActiveSupport::Notifications is a powerful, under-utilized library which makes it easy to instrument and monitor your code. Rails exposes a tons of performance information which is easy to access and you can create your own events with a single line of code. This talk explores the basics of ActiveSupport::Notifications and gets into powerful techniques you can use to super-charge your monitoring and instrumentation.
This presentation covers the incredibly powerful instrumentation API within ActiveSupport.
ActiveSupport::Notifications.subscribe 'foo' do |*args|
event = ActiveSupport::Notifications::Event.new(*args)
event.name
event.time
event.end
event.duration
event.transaction_id
event.payload
# log or process payload...
end
I really liked how the API ...(continued)
It's pretty awesome to have my work merged into a gem that I've been relying on for many of my Rails ap ...(continued)
To prevent receiving config error: mail loops back to me (MX problem?) errors, you need to add each ...(continued)
**This beginner's guide is based on the fantastic post titled 'Ubuntu, Ruby, RVM, Rails, and You' by [Ryan ...(continued)
In less than two months I decided to pick up the RO RG, as the 15300 line was canceled upon confirmation from SIHH in January 2012. I was offered a fantastic deal on th ...(continued)

This is a new addition to my pen collection for 2012,
This is the Mont ...(continued)
Here's a snap of the collection as 2011 comes to an end:
Published on Friday, 11 May 2012
It's pretty awesome to have my work merged into a gem that I've been relying on for many of my Rails apps, personally and professionally, to handle the task of ACL — in-app authorisation.
This commit allows non-db backed controllers, a 'faux' resource if you will, to be authorised when namespaced.
Reading through Ryan's source was quite a learning experience for me — his coding style is extremely elegant and CanCan is a great example of how to author a well written and documented gem.
Many thanks to Ryan for his awesome work on Railscasts as well as Jeremy Friesen for his triage work on wading through the many CanCan pull-requests on Github.
Published on Friday, 04 May 2012
To prevent receiving config error: mail loops back to me (MX problem?) errors, you need to add each virtualdomain.tld to the /etc/mail/local-host-names file and re-compile your sendmail config via make.
You have asked mail to a domain (e.g., domain.net) to be forwarded to a specific host (in this case, relay.domain.net) by using an MX record, but the relay machine doesn't recognise itself as domain.net. Add domain.net to /etc/mail/local-host-names [known as /etc/sendmail.cw prior to version 8.10] (if you are using FEATURE(`use_cw_file')) or add "Cw domain.net" to your configuration file.
Source: http://www.sendmail.com/sm/open_source/support/support_faq/general_issues_faq/#4.5
Perform the following to enable email forwarding from the virtual domain virtualdomain.tld to another email address (in this example, jdoe@gmail.com). There are no local accounts associated - the aliase ...(continued)
Published on Tuesday, 17 April 2012
This beginner's guide is based on the fantastic post titled 'Ubuntu, Ruby, RVM, Rails, and You' by Ryan Bigg (@ryanbigg).
At this time, I would also like to thank Wayne E. Seguin (@wayneeseguin) for his fantastic work on RVM and Deryl (@deryldoucette) for his advice!
First, run sudo apt-get update to fetch the latest sources followed by sudo apt-get upgrade thereby upgrading your install of Ubuntu.
You are strongly advised to edit /etc/ssh/sshd_config and secure your server, especially its OpenSSH daemon's configuration. Details on setting up public and private SSH k ...(continued)
Published on Sunday, 18 March 2012
Tyler Menezes wrote a blog post called “I will not learn Rails” and appeared on my Twitter timeline thanks to Ryan Bigg's tweet indicating his follow up post.
Since Ryan has done an excellent job in responding, I'm only going to touch on a couple points — those that I do not agree with and/or feel are out right incorrect.
… design flaw mass-assignment
See my previous post covering the whole Github debacle which closed with links to various approaches to ensure your Rails apps are safe from mass-assignment issues. I've also linked to a commit in the 3-2-stable branch of rails/rails which shows that all future apps will have the whitelisting, attr_accessible protection that is, enabled as default when newl ...(continued)
Published on Sunday, 18 March 2012
This has been one of my favourite sayings for quite a while and I wanted to keep this definition in an easy to find place, so here it is:
It’s kind of a long-running joke. It started with bored English boarding school students creating the pseudo-latin phrase, “Illegitimi non carborundum”, which is very bad Latin ostensibly meaning “Don’t let the bastards wear you down.” It got to be kind of famous as a kind of intellectual joke. Somebody later came along and translated it into much more proper Latin, “Noli nothis permittere te terere,” which is essentially right. “Nothis” is literally “illegitimate children” (nothus, second declension, dative case) which is not really the intended connotation of “bastards” in this case, but it gets the point across. It would be pronounced: NO-lee NO-teece per-mee-TAIR-ray TEH tuh-RAIR-ay
Published on Saturday, 10 March 2012
There's a rather lengthy Gist on Github detailing what went into Homakov's hack; it's fair enough to call this a hack as it did allow him to assign his public SSH-key to a member of the Rails core team and cause a bit of a stir.
It's worthy to note that Model.new and Model.create are equally susceptible as obj.update_attributes when a hash of arguments are passed to them.
While I've been ailing away in the ER for a past few days — yes, I missed out on all the fun — I was wondering if doing something similar to a .reject on the params hash was worth it... but ah, reject is an array method and the equivalent method in the Hash domain is slice!
DHH has proposed the use of slice as per the following example
class PostsController < ActionContro ...(continued)
Published on Sunday, 04 March 2012
In less than two months I decided to pick up the RO RG, as the 15300 line was canceled upon confirmation from SIHH in January 2012. I was offered a fantastic deal on the 'last' stock piece and just could not refuse!
Hope you enjoy this brief overview of an utterly fantastic piece by Audemars Piguet.
Published on Friday, 02 March 2012
Note: the following partial is not DRY; it's functional which is what's important for now — I'll refactor bits like this at a later point.
I was chatting with my friend Jon-Paul Lussier (@jonpaullussier) and I ended up nicking the new Panel UI 'widget' (it's just pure CSS) from ZURB's Foundation and ended up refactoring one my blog's partials — the one that presents the 3-column block on the landing page.
Wanted to pass an array instead of a direct string and just wanted to ensure the SQL query made sense
From: /Users/mdesilva/code/linode.mwdesilva.com/rails/mwdesilva.com/app/views/posts/_featured.html.erb @ line 2 in ActionView::CompiledTemplates#_app_views_posts__featured_html_erb__1174825261695298304_70309845808520:
1: <% query = Post.published.joins(:tags).where(: ...(continued)
Published on Friday, 02 March 2012
This is an incredible video featuring the manufacturing process of the AP “Grand Tapisserie” dials for the Royal Oak; the original Pantograph's used in the process are shown in operation as well!
Published on Thursday, 01 March 2012
Here's my take on Matt's post titled Learning from Rails’ failures. I'd like to touch on some of the points he's raised and then continue on with some of my thoughts.
I'm not sure if I'm doing something wrong but for the past 4-6 months, upgrading my apps haven't been as painful as Matt seems to suggest. Of course, the largest version-gap I've attempted has been a 3.0.x to 3.2.1 and I'd take the upgrades step-by-step considering 3.1 brought about a lot of changes.
The first thing I do is to do an app diff against a newly generated app 'template' to see where the generators have added/removed configs etc. I'd then proceed to tackle the update from a dependencies perspective and this is inherently tricky for the simple reason that the older the app you are upgrading, there's a good chance quite a bit has changed in your dependencies (gems). Heck, Dev ...(continued)