<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John Yerhot - Weblog &#187; Programming</title>
	<atom:link href="http://www.johnyerhot.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnyerhot.com</link>
	<description>im in ur computrz makin castz</description>
	<lastBuildDate>Tue, 29 Jun 2010 04:32:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Deployment Nightmare: Godaddy</title>
		<link>http://www.johnyerhot.com/2008/11/04/deployment-nightmare-godaddy/</link>
		<comments>http://www.johnyerhot.com/2008/11/04/deployment-nightmare-godaddy/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 23:20:44 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby On Rails]]></category>

		<guid isPermaLink="false">http://www.johnyerhot.com/?p=99</guid>
		<description><![CDATA[Against the advice of, well, the entire Rails community, I attempted to deploy a project to Godaddy.
Godaddy proudly displays the little Ruby logo next to Php when browsing through their hosting plans, and seeing as you can get Rails hosting for $7/month through them, it seems like a decent deal, even if you know it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Against the advice of, well, the entire Rails community, I attempted to deploy a project to Godaddy.</p>
<p>Godaddy proudly displays the little Ruby logo next to Php when browsing through their hosting plans, and seeing as you can get Rails hosting for $7/month through them, it seems like a decent deal, even if you know it&#8217;s gonna get slow.</p>
<p>Baisically, what ends up happening when deploying to Godaddy, is you upload your application to a special directory you create through their control pannel, modify your dispatch.fcgi file, .htaccess files, turn off Java and pray.  Its all supposed to run as FCGI in the end, which is not the speediest way to deploy a Rails app, but is acceptable for smaller, non-demanding applications.</p>
<p>The application I was attempting to deploy was a Rails 2.1 app, and I found that Godaddy is rocking Rails 1.1.6 (Release Aug 2006), so I froze Rails (standard practice), change the configs to point to the manually created database (no rake support here folks) and tried to hit it.  Nothing.  First, every time you modify the .htaccess file (and you will need to &#8211; many times) it takes 10-30 minutes for Apache to notice.  So, you&#8217;re stuck making a change, waiting, testing, washing and repeating.  If you&#8217;re using FCGI, there is literally NO output into the &#8216;errorlog&#8217; Godaddy gives you, so you have to deploy with regular CGI to get any idea why your application isn&#8217;t working and then switch back to FCGI and pray.</p>
<p>Finally, after a couple hours of searching the interwebs and poking and prodding, I was getting somewhere &#8211; the error log started to get populated, but FastCGI wasn&#8217;t starting correctly.  After some snooping, I saw that Rails 2.1 assumes that you&#8217;re not running whatever version of Gem was around in 2006.  Gem was failing with a <em>method not found</em> error when Rails tries to talk to Godaddy&#8217;s almost 3 year old version.</p>
<p>I putzed around a bit looking for ways to skip that step of Rails&#8217; boot process, swaping out boot.rb files from older version of Rails, hacking, etc.. and to no avail.</p>
<p>This is where I stopped.  I figured that even if I got past this problem, the version of Rmagick was from mid 2006 and would likely not work with my app, and I wasn&#8217;t about to try and get Godaddy to update it.  If they haven&#8217;t updated any of the Rails stuff yet, I don&#8217;t think they are going to any time soon.</p>
<p>My message for Godaddy is this:  I want the entire day I spend on this back.  You should stop advertising that you support Ruby/Rails when you obviously don&#8217;t.  I&#8217;d bet 90% of Rails apps in development today would not be able to run on their hosting plans. Eh.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnyerhot.com/2008/11/04/deployment-nightmare-godaddy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>rQuote &#8211; Ruby on Rails Stock Quote Plugin</title>
		<link>http://www.johnyerhot.com/2008/08/29/rquote-ruby-on-rails-stock-quote-plugin/</link>
		<comments>http://www.johnyerhot.com/2008/08/29/rquote-ruby-on-rails-stock-quote-plugin/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 18:36:29 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Geeky]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[stocks]]></category>

		<guid isPermaLink="false">http://www.johnyerhot.com/?p=90</guid>
		<description><![CDATA[I merged some stock quoting stuff I had into a Rails plugin today.  If you&#8217;d like to be able to simply grab real time stock quotes in your Rails app, this will do the job.  Pretty much any stock symbol will work and you can enter as many as you&#8217;d like, you&#8217;ll get [...]]]></description>
			<content:encoded><![CDATA[<p>I merged some stock quoting stuff I had into a Rails plugin today.  If you&#8217;d like to be able to simply grab real time stock quotes in your Rails app, this will do the job.  Pretty much any stock symbol will work and you can enter as many as you&#8217;d like, you&#8217;ll get a <del datetime="2008-08-31T22:27:35+00:00">hash </del> array of hashes containing each symbol&#8217;s current value, change since open, and volume.</p>
<p><a href="http://github.com/johnyerhot/rquote/tree/master">http://github.com/johnyerhot/rquote/tree/master</a></p>
<pre>
Rquote
======

Gets realtime stock quotes from Yahoo Finance. 

Its super simple to use.

Example
=======

quote = Rquote.new
quote.find("aapl", "msft") 

=> [{:change=>"-4.02", :price=>"169.72", :volume=>"16105013", :symbol=>"aapl"}, {:change=>"-0.42", :price=>"27.52",
:volume=>"27024456", :symbol=>"msft"}]

Copyright (c) 2008 John Yerhot, released under the MIT license
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.johnyerhot.com/2008/08/29/rquote-ruby-on-rails-stock-quote-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>rDigg &#8211; Ruby on Rails Digg API plugin</title>
		<link>http://www.johnyerhot.com/2008/08/14/rdigg-ruby-on-rails-digg-api-plugin/</link>
		<comments>http://www.johnyerhot.com/2008/08/14/rdigg-ruby-on-rails-digg-api-plugin/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 20:09:01 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[digg.com]]></category>
		<category><![CDATA[rDigg]]></category>

		<guid isPermaLink="false">http://www.johnyerhot.com/?p=85</guid>
		<description><![CDATA[I&#8217;ve sort of finished up rDigg today.  It&#8217;s to the point I&#8217;m comfortable letting other people start to play with it anyways.
As you&#8217;d expect, rDigg is a Digg API wrapper in the form of a Ruby on Rails plugin.   It still needs some work, but works pretty well.
For example:
#create new Rdigg object
digg [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve sort of finished up rDigg today.  It&#8217;s to the point I&#8217;m comfortable letting other people start to play with it anyways.</p>
<p>As you&#8217;d expect, rDigg is a <a href="http://digg.com">Digg</a> API wrapper in the form of a Ruby on Rails plugin.   It still needs some work, but works pretty well.</p>
<p>For example:</p>
<pre>#create new Rdigg object
digg = Rdigg.new

# find the 3 newest submissions from Kevin Rose
stories = digg.user.find_submissions("kevinrose", :count =&gt; 3)

# stories is now an array with a hash for each story
stories.first[:story] #=&gt; the story's text
stories.first[:href] #=&gt; the story's url
stories.first[:diggs] #=&gt; number of diggs the story has</pre>
<p>Grab it  at: <a href="http://github.com/johnyerhot/rdigg/tree/master">http://github.com/johnyerhot/rdigg/tree/master</a>.  <del datetime="2008-08-15T01:20:18+00:00">I&#8217;ll have the Rdoc up at rdigg.yerhot.org later tonight</del> You can peruse the documentation at <a href="http://rdigg.yerhot.org">rdigg.yerhot.org</a>. I highly recommend you check out all methods that are available to you.</p>
<p>If you want to really dig in (sorry couldn&#8217;t resist) I&#8217;d go over the <a href="http://apidoc.digg.com/">Digg API wiki</a> to see what arguments you can pass.</p>
<p>I hope you enjoy the plugin!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnyerhot.com/2008/08/14/rdigg-ruby-on-rails-digg-api-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Meta Programming in Ruby</title>
		<link>http://www.johnyerhot.com/2008/08/10/meta-programming-in-ruby/</link>
		<comments>http://www.johnyerhot.com/2008/08/10/meta-programming-in-ruby/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 20:58:24 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[define_method]]></category>
		<category><![CDATA[Metaprogramming]]></category>

		<guid isPermaLink="false">http://www.johnyerhot.com/?p=84</guid>
		<description><![CDATA[Metaprogramming.  What a lovely buzz word.  I guess I&#8217;ve heard it enough and knew what the short definition is.  Metaprogramming is code that writes code.  I think it is one of those things I just never thought about, even though I had used concepts and even written some before without realizing it until recently.
Here [...]]]></description>
			<content:encoded><![CDATA[<p><em><a href="http://en.wikipedia.org/wiki/Metaprogramming">Metaprogramming</a></em>.  What a lovely buzz word.  I guess I&#8217;ve heard it enough and knew what the short definition is.  Metaprogramming is <em>code that writes code</em>.  I think it is one of those things I just never thought about, even though I had used concepts and even written some before without realizing it until recently.</p>
<p>Here is a short and simple example.</p>
<pre>class Something

@my_hash = {"foo" =&gt; "1234", "bar" =&gt; "5678"}

def initialize
  @my_hash.each do |a, b|
       self.instance_eval do
             define_method(a.to_s) {b.to_s}
       end
  end
end
end
</pre>
<p>And now we can play with it.</p>
<pre>a = Something.new
a.foo  # =&gt; 1234
a.bar # =&gt; 5678
</pre>
<p>Now, what happened here is pretty neat in my opinion.  We took our hash, my_hash, and in our initialize method, created two instance methods from its values.  <a href="http://www.ruby-doc.org/core/classes/Module.html#M001677">define_method</a> is what did all the magic.  You need to pass it a proc or, like what I did, just give it a simple block (just the string value from my hash).</p>
<p>Pretty neat, eh?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnyerhot.com/2008/08/10/meta-programming-in-ruby/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Super Simple Ruby Web Scraper</title>
		<link>http://www.johnyerhot.com/2008/05/19/anatomy-of-a-ruby-web-scraper/</link>
		<comments>http://www.johnyerhot.com/2008/05/19/anatomy-of-a-ruby-web-scraper/#comments</comments>
		<pubDate>Mon, 19 May 2008 19:47:37 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[mechanize]]></category>
		<category><![CDATA[open uri]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[sweefner.com]]></category>
		<category><![CDATA[web scraper]]></category>

		<guid isPermaLink="false">http://www.johnyerhot.com/2008/05/19/anatomy-of-a-ruby-web-scraper/</guid>
		<description><![CDATA[Alrighty folks.  Quick walk though for scraping remote web data with Ruby.  This is how I did it for my little web scraper I wrote on Saturday..
DISCLAIMER: Web Scraping is kind of a gray area.. don&#8217;t steal things that are copywritten and don&#8217;t be a jerk.  Give credit where credit is due..
First [...]]]></description>
			<content:encoded><![CDATA[<p>Alrighty folks.  Quick walk though for scraping remote web data with Ruby.  This is how I did it for my little web scraper I wrote on Saturday..</p>
<p><strong>DISCLAIMER:</strong> Web Scraping is kind of a gray area.. don&#8217;t steal things that are copywritten and don&#8217;t be a jerk.  Give credit where credit is due..</p>
<p>First thing is first.  You&#8217;ll need to install the <a href="http://mechanize.rubyforge.org/mechanize/">Mechanize</a> Ruby Gem.</p>
<blockquote><p>sudo gem install mechanize</p></blockquote>
<p>Mechanize is pretty slick.  It will iterate through a given url and let you access various html elements.  Further, you can use <a href="http://code.whytheluckystiff.net/hpricot/wiki">Hpricot</a> methods to further grab data.Lets get going..</p>
<blockquote><p>require &#8216;rubygems&#8217;require &#8216;mechanize&#8217;require &#8216;uri&#8217;</p>
<p>url = &#8220;http://www.johnyerhot.com&#8221;</p></blockquote>
<p>The way this is set up, you MUST have a complete url.</p>
<blockquote><p>@mech = WWW::Mechanize.new</p>
<p>@page = @mech.get(url)</p></blockquote>
<p>Now, lets say we want to get all the urls for embedded images from the webpage (http://www.johnyerhot.com)..</p>
<blockquote><p>@imgs = @page.search(&#8221;img[@src]&#8220;).map {|src| src['src']}</p></blockquote>
<p>You&#8217;ve now got an array (@imgs) with all the urls for embeded images!  What we actually did was use Hpricot&#8217;s search method to look for and image tags and sucked out the src attribute of that tag.  Mechanize does have its own methods for grabbing tags also, for example,  you can grab all the link targets from every link in the web page.</p>
<blockquote><p>#remember @page is just our mechanize instance<br />
# w/ http://www.johnyerhot.com</p>
<p>@links = Array.new<br />
@page.links.each do |link|<br />
@links &lt;&lt; link.href<br />
end</p></blockquote>
<p>Now lets weed out any links to non-images:</p>
<blockquote><p>@links.each do |link|  #yeah we&#8217;re only collecting jpgs</p>
<p>if (link.to_s.include? &#8220;.jpg&#8221;) || (link.to_s.include? &#8220;.JPG&#8221;) || (link.to_s.include? &#8220;.jpeg&#8221;) || (link.to_s.include? &#8220;.JPEG&#8221;)</p>
<p>@imgs &lt;&lt; link<br />
end<br />
end</p></blockquote>
<p>Finally, lets actually grab all those pictures and save them locally using Open URI&#8230;</p>
<blockquote><p>@counter =0<br />
@imgs.each do |image|<br />
url = URI.parse(image)#parse the url and separate need info<br />
Net::HTTP.start(url.host, url.port) { |http|<br />
#appeand the image path with the web root.<br />
image = http.get(image)#actually make the file to save<br />
open(&#8221;#{url.host}_#{counter}.jpg&#8221;, &#8220;wb&#8221;) { |file|<br />
file.write(image.body)<br />
counter = counter + 1<br />
}<br />
end</p></blockquote>
<p>And there you have it! Put it all together and you should have a functioning Ruby web scraper&#8230;Sort of. You still have to account for relative vs. absolute urls, are you gonna let in more than jpgs?, what if you need basic authentication for the url? There are still some missing pieces that need to be implemented to have this be ready for general use, but the core is there.<br />
<strong>Further Reading</strong><br />
<a href="http://mechanize.rubyforge.org/mechanize/">Mechanize Docs</a><br />
<a href="http://code.whytheluckystiff.net/hpricot">Hpricot</a><br />
<a href="http://www.ruby-doc.org/stdlib/libdoc/open-uri/rdoc/">Open URI</a><br />
<a href="http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html">Ruby net/http Docs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnyerhot.com/2008/05/19/anatomy-of-a-ruby-web-scraper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slicehost problems with Gem *FIXED*</title>
		<link>http://www.johnyerhot.com/2008/03/17/slicehost-problems-with-gem-fixed/</link>
		<comments>http://www.johnyerhot.com/2008/03/17/slicehost-problems-with-gem-fixed/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 18:43:33 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[Slicehost]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[problems]]></category>

		<guid isPermaLink="false">http://www.johnyerhot.com/2008/03/17/slicehost-problems-with-gem-fixed/</guid>
		<description><![CDATA[Today I set up 470.johnyerhot.com and set up a Rails app I worked on to run there, but I needed to install the Pdf-writer Gem for proper functionality.  Low and behold when I tried
sudo gem install pdf-writer
I was greeted with nothing, just
Updating Gem source index for: http://gems.rubyforge.org
and that was it.  After searching and [...]]]></description>
			<content:encoded><![CDATA[<p>Today I set up 470.johnyerhot.com and set up a Rails app I worked on to run there, but I needed to install the Pdf-writer Gem for proper functionality.  Low and behold when I tried</p>
<blockquote><p>sudo gem install pdf-writer</p></blockquote>
<p>I was greeted with nothing, just</p>
<blockquote><p>Updating Gem source index for: http://gems.rubyforge.org</p></blockquote>
<p>and that was it.  After searching and searching I realized the the version of Gem I had installed was 0.94 and that was the problem.</p>
<p>The solution is as follows:</p>
<blockquote><p>wget http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz<br />
tar zxvf rubygems-1.0.1.tgz<br />
cd rubygems-1.0.1<br />
ruby setup.rb<br />
sudo gem update</p></blockquote>
<p>You just need to manually install the updated Gem. Cinch.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnyerhot.com/2008/03/17/slicehost-problems-with-gem-fixed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal &#124; Front Page Module + Nice Menus = Headache</title>
		<link>http://www.johnyerhot.com/2008/03/03/drupal-front-page-module-nice-menus-headache/</link>
		<comments>http://www.johnyerhot.com/2008/03/03/drupal-front-page-module-nice-menus-headache/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 19:23:48 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[front_page]]></category>
		<category><![CDATA[nice_menus]]></category>

		<guid isPermaLink="false">http://www.johnyerhot.com/2008/03/03/drupal-front-page-module-nice-menus-headache/</guid>
		<description><![CDATA[I&#8217;ve spend all morning trying to get this to work.  I am using nice menus and the frontpage modules in Drupal for a project at work and I could not for the life of me get the nice menu to work on the newly created frontpage I set up using &#8220;full&#8221; type of front page.
After [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spend all morning trying to get this to work.  I am using <a href="http://drupal.org/project/nice_menus">nice menus</a> and the <a href="http://drupal.org/project/front">frontpage</a> modules in Drupal for a project at work and I could not for the life of me get the nice menu to work on the newly created frontpage I set up using &#8220;full&#8221; type of front page.</p>
<p>After hours of banging my head on the desk I&#8217;ve figured it out.</p>
<blockquote><p>    &lt;?php<br />
$block = module_invoke(&#8217;nice_menus&#8217;, &#8216;block&#8217;, &#8216;view&#8217;, 1);<br />
print $block['content'];<br />
?&gt;</p></blockquote>
<p>Yes that is it.  This will print out the contents of the nice menus block.  Ugh.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnyerhot.com/2008/03/03/drupal-front-page-module-nice-menus-headache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly Roundup</title>
		<link>http://www.johnyerhot.com/2008/01/28/weekly-roundup/</link>
		<comments>http://www.johnyerhot.com/2008/01/28/weekly-roundup/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 19:44:57 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Geeky]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Royner]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[deprec]]></category>
		<category><![CDATA[Linux Mint]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[openchrome]]></category>
		<category><![CDATA[xvmc]]></category>

		<guid isPermaLink="false">http://www.johnyerhot.com/2008/01/28/weekly-roundup/</guid>
		<description><![CDATA[Heres the week in review:
-Linux Mint home networking is now done and working beautifully.  Had some trouble getting the onboard Via Chrome9 Video working correctly, but I followed the instructions here(compiling it from source) and everything was great.  I wanted to use the OpenChrome driver instead of the VESA driver because the OpenChrome [...]]]></description>
			<content:encoded><![CDATA[<p>Heres the week in review:</p>
<p>-Linux Mint home networking is now done and working beautifully.  Had some trouble getting the onboard Via Chrome9 Video working correctly, but I followed the instructions <a href="https://help.ubuntu.com/community/OpenChrome" target="_blank">here</a>(compiling it from source) and everything was great.  I wanted to use the OpenChrome driver instead of the VESA driver because the OpenChrome one has <a href="http://wiki.openchrome.org/tikiwiki/tiki-index.php?page=About+openChrome">support for XvMC</a> which accellerates all kinds of video (i.e. Xvid, mpeg4&#8230;).  Only thing left to do is get a static IP so I can get to my machine from the outside world.</p>
<p>-Royner &#8211; I haven&#8217;t had much time to work on ironing out any of the kinks before a first release.  Hopefully this week will be different.  Thinking about <a href="http://www.slicehost.com/">Slicehost</a> to host it, as I&#8217;ve heard great things about them.  I&#8217;m also going to try out <a href="http://www.deprec.org/">deprec</a> for deployment, using <a href="http://nginx.net/">Nginx</a> instead of Apache.  Should be interesting.</p>
<p><img src="http://nginx.net/nginx.gif" height="32" width="121" /><br />
Other than thats, its another work week.  See ya&#8217;ll.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnyerhot.com/2008/01/28/weekly-roundup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rake Leaves</title>
		<link>http://www.johnyerhot.com/2008/01/10/rake-leaves-v01/</link>
		<comments>http://www.johnyerhot.com/2008/01/10/rake-leaves-v01/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 03:29:29 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rake Leaves]]></category>
		<category><![CDATA[Ruby On Rails]]></category>

		<guid isPermaLink="false">http://www.johnyerhot.com/2008/01/10/rake-leaves-v01/</guid>
		<description><![CDATA[Yeah, I came up with this little Rails rake task called &#8216;rake leaves&#8217;.  It will just create a text file that has all your tables, column names, and their data types.  I&#8217;ve always thought it would be handy to have this so you don&#8217;t need to switch to MySQL and spend the time [...]]]></description>
			<content:encoded><![CDATA[<p>Yeah, I came up with this little Rails rake task called &#8216;rake leaves&#8217;.  It will just create a text file that has all your tables, column names, and their data types.  I&#8217;ve always thought it would be handy to have this so you don&#8217;t need to switch to MySQL and spend the time to look it up.</p>
<p>Anyways, if you want to download it go for it.  All you need to do is put leaves.rake in /lib/tasks and then from the console</p>
<p><code>$rake leaves</code></p>
<p>You&#8217;ll get a file called table_structure_whatever_the_date_is.txt.<br />
You can download if <a href="http://www.johnyerhot.com/wp-content/uploads/2008/01/leaves1.rake" title="rake leaves v.01">right here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnyerhot.com/2008/01/10/rake-leaves-v01/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rails: Using Helpers in Your Controller.</title>
		<link>http://www.johnyerhot.com/2008/01/10/rails-using-helpers-in-you-controller/</link>
		<comments>http://www.johnyerhot.com/2008/01/10/rails-using-helpers-in-you-controller/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 15:40:15 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[Controller]]></category>
		<category><![CDATA[Helpers]]></category>
		<category><![CDATA[pdf-writer]]></category>

		<guid isPermaLink="false">http://www.johnyerhot.com/2008/01/10/rails-using-helpers-in-you-controller/</guid>
		<description><![CDATA[This morning there was a guy in the rails IRC room asking about using helpers in his controller and I recently wrote an app that used the great pdf-writer gem to generate some pdfs and used helpers in the controller for formatting in the pdf.  If you are going to generate very complicated pdfs, [...]]]></description>
			<content:encoded><![CDATA[<p>This morning there was a guy in the rails IRC room asking about using helpers in his controller and I recently wrote an app that used the great <a href="http://ruby-pdf.rubyforge.org/pdf-writer/" target="_blank">pdf-writer</a> gem to generate some pdfs and used helpers in the controller for formatting in the pdf.  If you are going to generate very complicated pdfs, its best not to put your pdf formatting code directly in the controller, but if you need just a real quick pdf generated, this works great.</p>
<p>First, create a new class in your application controller:<br />
<code><br />
class Helper<br />
include Singleton<br />
include ActionView::Helpers::PdfHelper #or whatever helpers you want<br />
end<br />
</code><br />
I wanted to use my pdf_helpers<br />
..and then:<br />
<code><br />
def pdf_helpers<br />
Helper.instance<br />
end</code><br />
Will create an instance of your new class.</p>
<p>Now, go to your pdf controller (or whatever) and simply:<br />
<code><br />
pdf.text pdf_helpers.my_crazy_helper(@foo.bar)<br />
</code></p>
<p>The pdf.text part is not the important part, thats just for pdf-writer, but what is is using &#8220;pdf_helpers.your_helper&#8221; to create a new instance of the helper class which will allow you to use that helper.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnyerhot.com/2008/01/10/rails-using-helpers-in-you-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
