<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Indiehead's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 17 May 2008 10:47:27 GMT</pubDate>
    <description>DZone Snippets: Indiehead's Code Snippets</description>
    <item>
      <title>nginx expires config</title>
      <link>http://snippets.dzone.com/posts/show/5386</link>
      <description>&lt;code&gt;&lt;br /&gt;  location ~* ^.+\.(js|css|php|jpg|jpeg|gif|png|pdf|zip|rar)$ {&lt;br /&gt;    root   /var/www/apps/myapp/public;&lt;br /&gt;    access_log   off;&lt;br /&gt;    expires      7d;&lt;br /&gt;  }&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 18 Apr 2008 14:12:01 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5386</guid>
      <author>indiehead (John)</author>
    </item>
    <item>
      <title>nginx gzip config</title>
      <link>http://snippets.dzone.com/posts/show/5385</link>
      <description>&lt;code&gt;&lt;br /&gt;  # output compression saves bandwidth &lt;br /&gt;  gzip              on;&lt;br /&gt;  gzip_proxied      any;&lt;br /&gt;  gzip_http_version 1.1;&lt;br /&gt;  #gzip_min_length   1100;&lt;br /&gt;  gzip_comp_level   5;&lt;br /&gt;  #gzip_buffers      4 8k;&lt;br /&gt;  gzip_types        text/plain text/html text/xml text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/atom+xml;&lt;br /&gt;  #gzip_vary        on;&lt;br /&gt;  #gzip_disable     "MSIE [1-6]\.";&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 18 Apr 2008 14:09:29 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5385</guid>
      <author>indiehead (John)</author>
    </item>
    <item>
      <title>rails sendmail settings</title>
      <link>http://snippets.dzone.com/posts/show/5378</link>
      <description>&lt;code&gt;&lt;br /&gt;config.action_mailer.raise_delivery_errors = true&lt;br /&gt;ActionMailer::Base.delivery_method = :sendmail&lt;br /&gt;ActionMailer::Base.sendmail_settings = {&lt;br /&gt;    :location       =&gt; '/usr/sbin/sendmail',&lt;br /&gt;    :arguments      =&gt; '-i -t'&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 17 Apr 2008 13:23:44 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5378</guid>
      <author>indiehead (John)</author>
    </item>
    <item>
      <title>record grouping</title>
      <link>http://snippets.dzone.com/posts/show/5377</link>
      <description>&lt;code&gt;&lt;br /&gt;@users = User.find(&lt;br /&gt;  :all, &lt;br /&gt;  :select =&gt; "MONTH(created_at) as month, YEAR(created_at) as year, COUNT(*) AS records",&lt;br /&gt;  :conditions =&gt; ["admin = 0'"], &lt;br /&gt;  :group =&gt; "year, month")&lt;br /&gt;&lt;br /&gt;&lt;% for @user in @users %&gt;&lt;br /&gt;  &lt;%=@user.month%&gt;&lt;br /&gt;  &lt;%=@user.year%&gt;&lt;br /&gt;  &lt;%=@user.records%&gt;&lt;br /&gt;&lt;% end %&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Thu, 17 Apr 2008 13:22:33 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5377</guid>
      <author>indiehead (John)</author>
    </item>
    <item>
      <title>date_select conversion</title>
      <link>http://snippets.dzone.com/posts/show/5376</link>
      <description>function to convert a value from a date_select into a more sql-friendly value&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;%=date_select(:date,'',:start_year =&gt; 1950,:include_blank =&gt; false, :default =&gt; { :year =&gt; '1970' })%&gt;&lt;br /&gt;&lt;br /&gt;def convert_date(obj) &lt;br /&gt;  return &#8220;#{obj[&#8216;(1i)&#8217;]}-#{obj[&#8216;(2i)&#8217;]}-#{obj[&#8216;(3i)&#8217;]}&#8221; &lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 17 Apr 2008 13:20:35 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5376</guid>
      <author>indiehead (John)</author>
    </item>
  </channel>
</rss>
