<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - noah</title>
<link>http://snipplr.com/users/noah/tags/iterator</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Wed, 15 Feb 2012 15:35:47 GMT</pubDate>
<item>
<title>(Ruby) Detect the first and last iteration of a loop in Ruby</title>
<link>http://snipplr.com/view/12419/detect-the-first-and-last-iteration-of-a-loop-in-ruby/</link>
<description><![CDATA[ <p>It's great that, at the times I really need it, I can ask for Ruby help on `#nyc.rb`:

      how can I detect the first or last iteration of a loop in
                      Ruby or Rails?                       
      what sort of loop? an array loop?
      or something else?
      f == array.first?
      in case of an array you want #each_with_index
      yah each_with_index would do it, thanks much 
      I'm looping through an array printing LIs and I want to apply
                      css classes to the first and last LIs respectively</p> ]]></description>
<pubDate>Fri, 20 Feb 2009 13:44:51 GMT</pubDate>
<guid>http://snipplr.com/view/12419/detect-the-first-and-last-iteration-of-a-loop-in-ruby/</guid>
</item>
<item>
<title>(Bash) Scrape Google from the command line</title>
<link>http://snipplr.com/view/4299/scrape-google-from-the-command-line/</link>
<description><![CDATA[ <p>This code is POC only -- actually using it would violate Google's TOS, which forbids scraping.  It is published here for educational value only.

Hypothetically, the following command should return a list of the top 500 or so hits in Google for onemorebug.com.

The results will be prepended with digits, followed by a dot and some whitespace (Lynx adds these).

_You must have Lynx and Wget installed on your system for this to work._

Keep in mind that *nix shells don't like it when you double-quote strings, see the comments.</p> ]]></description>
<pubDate>Sun, 09 Dec 2007 21:16:58 GMT</pubDate>
<guid>http://snipplr.com/view/4299/scrape-google-from-the-command-line/</guid>
</item>
<item>
<title>(Perl) dump the contents of a data structure</title>
<link>http://snipplr.com/view/3138/dump-the-contents-of-a-data-structure/</link>
<description><![CDATA[ <p>hashes in Perl can be so elegant</p> ]]></description>
<pubDate>Tue, 03 Jul 2007 23:08:28 GMT</pubDate>
<guid>http://snipplr.com/view/3138/dump-the-contents-of-a-data-structure/</guid>
</item>
<item>
<title>(JavaScript) for loop wrapper</title>
<link>http://snipplr.com/view/2867/for-loop-wrapper/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 15 Jun 2007 04:59:44 GMT</pubDate>
<guid>http://snipplr.com/view/2867/for-loop-wrapper/</guid>
</item>
</channel>
</rss>
