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’ [...]



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 [...]



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 [...]



 Page 12 of 13  « First  ... « 9  10  11  12  13 »