content_for in Rails
Tuesday 11/18/2008 – Category: Uncategorized
I’m not sure why I hadn’t come across this before, but Rails has a nifty helper called content_for that allows you to insert stuff anywhere in your layout.
A classic use case is inserting a javascript source file that is only used on a specific page.
In your view:
<% content_for :head do %>
<%= javascript_include_tag ‘whatever.js’ [...]
apache2-mpm-prefork, apache2-mpm-worker, and PHP5
Tuesday 11/18/2008 – Category: Uncategorized
So I was reading up on Apache MPMs and whether it’s better to use worker (threaded) or prefork.
The worker MPM uses multiple child processes. It’s multi-threaded within each child, and each thread handles a single connection. Worker is fast and highly scalable and the memory footprint is comparatively low. It’s well suited for multiple processors. [...]
Sending email through Gmail SMTP with Merb
Monday 11/3/2008 – Category: Uncategorized
I was having email delivery problems while using Postfix (emails were getting caught by spam filters) so I decided to try using Gmail SMTP to send stuff off.
Initially I tried to follow a tutorial like this to get Postfix to relay to Gmail but there was a lot of footwork involved setting up certificates, etc…and [...]
Server not serving XML correctly?
Wednesday 03/12/2008 – Category: Uncategorized
I ran into this issue with a Drupal plugin (FCKeditor) today where an XML file wouldn’t load. it turned out to be a server configuration issue where Apache wasn’t serving XML files as it should, so the ajax request wasn’t processed correctly. To get Apache to serve XML files correctly, add this line [...]
Checking your postfix maillog for bounces and process with ruby
Wednesday 01/30/2008 – Category: Uncategorized
1) Locate your maillog (usually in /var/log)
2) If you cat the file, you’ll get output something like:
Jan 27 01:19:28 145856-web1 postfix/smtp[8994]: DAA77A74568: to=, relay=none,
delay=388925, status=deferred (connect to noemail.org[82.98.86.165]: Connection refused)
3) we want to check for “status=deferred” or “status=bounced”. we’ll do this with the grep command:
grep “status=bounced” /var/log/maillog [...]
Recent Posts
- LED Light for iPhone 4
(Monday 06/28/2010 – 38 Comments) - WWDC 2010: Worth Every Minute
(Monday 06/14/2010 – No Comments) - Flickr Original for Safari 5!
(Wednesday 06/9/2010 – 15 Comments) - iPad thoughts
(Friday 04/2/2010 – 1 Comment)
