<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/ruby</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Wed, 09 Jul 2008 04:30:15 GMT</pubDate>
<item>
<title>(Ruby) Match Single-line Javascript Comments - mikegreen</title>
<link>http://snipplr.com/view/7130/match-singleline-javascript-comments/</link>
<description><![CDATA[ <p>Matches single line Javascript (and PHP, etc.) comments</p> ]]></description>
<pubDate>Sat, 05 Jul 2008 00:37:26 GMT</pubDate>
<guid>http://snipplr.com/view/7130/match-singleline-javascript-comments/</guid>
</item>
<item>
<title>(Ruby) Rough Vitalist to Rememberthemilk conversion - berkes</title>
<link>http://snipplr.com/view/7104/rough-vitalist-to-rememberthemilk-conversion/</link>
<description><![CDATA[ <p>Hacked up Ruby script that downloads all the tasks from vitalist and mails them as new tasks to rememberthemilk. 

NOTE: you need to change some values in the source to make this work. You also need to comment and uncomment some parts if  you want to store stuff locally first, or use this as a one-time script.</p> ]]></description>
<pubDate>Thu, 03 Jul 2008 15:28:27 GMT</pubDate>
<guid>http://snipplr.com/view/7104/rough-vitalist-to-rememberthemilk-conversion/</guid>
</item>
<item>
<title>(Ruby) default rake task - mdi</title>
<link>http://snipplr.com/view/6903/default-rake-task/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 25 Jun 2008 09:41:15 GMT</pubDate>
<guid>http://snipplr.com/view/6903/default-rake-task/</guid>
</item>
<item>
<title>(Ruby) try - mdi</title>
<link>http://snipplr.com/view/6901/try/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 25 Jun 2008 09:40:34 GMT</pubDate>
<guid>http://snipplr.com/view/6901/try/</guid>
</item>
<item>
<title>(Ruby) Url.image - mdi</title>
<link>http://snipplr.com/view/6900/urlimage/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 25 Jun 2008 09:40:12 GMT</pubDate>
<guid>http://snipplr.com/view/6900/urlimage/</guid>
</item>
<item>
<title>(Ruby) generate password - mdi</title>
<link>http://snipplr.com/view/6898/generate-password/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 25 Jun 2008 09:39:01 GMT</pubDate>
<guid>http://snipplr.com/view/6898/generate-password/</guid>
</item>
<item>
<title>(Ruby) rcov rake task - mdi</title>
<link>http://snipplr.com/view/6897/rcov-rake-task/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 25 Jun 2008 09:38:07 GMT</pubDate>
<guid>http://snipplr.com/view/6897/rcov-rake-task/</guid>
</item>
<item>
<title>(Ruby) Simple mocking of Ruby objects - narkisr</title>
<link>http://snipplr.com/view/6842/simple-mocking-of-ruby-objects/</link>
<description><![CDATA[ <p>This is as simple as it gets, basiclly this templates shows you how to mock an object methods to any other piece of code that you like (open objects at its simplest glory).</p> ]]></description>
<pubDate>Sun, 22 Jun 2008 18:38:12 GMT</pubDate>
<guid>http://snipplr.com/view/6842/simple-mocking-of-ruby-objects/</guid>
</item>
<item>
<title>(Ruby) Mixing in a Module immediately after an objects Singleton class - chrisaiv</title>
<link>http://snipplr.com/view/6821/mixing-in-a-module-immediately-after-an-objects-singleton-class/</link>
<description><![CDATA[ <p>There are two ways to insert a module above the objects singleton class but before the objects Class</p> ]]></description>
<pubDate>Fri, 20 Jun 2008 19:58:38 GMT</pubDate>
<guid>http://snipplr.com/view/6821/mixing-in-a-module-immediately-after-an-objects-singleton-class/</guid>
</item>
<item>
<title>(Ruby) Scan and Require Ruby Files in Directory - jccovey</title>
<link>http://snipplr.com/view/6817/scan-and-require-ruby-files-in-directory/</link>
<description><![CDATA[ <p>Requires all Ruby source files in a given directory.</p> ]]></description>
<pubDate>Fri, 20 Jun 2008 11:27:51 GMT</pubDate>
<guid>http://snipplr.com/view/6817/scan-and-require-ruby-files-in-directory/</guid>
</item>
<item>
<title>(Ruby) String - jccovey</title>
<link>http://snipplr.com/view/6816/string/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 20 Jun 2008 11:18:46 GMT</pubDate>
<guid>http://snipplr.com/view/6816/string/</guid>
</item>
<item>
<title>(Ruby) String split by line - tonic</title>
<link>http://snipplr.com/view/6810/string-split-by-line/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 20 Jun 2008 09:04:19 GMT</pubDate>
<guid>http://snipplr.com/view/6810/string-split-by-line/</guid>
</item>
<item>
<title>(Ruby) Función básica para eliminiar acentos en minúsculas - tonic</title>
<link>http://snipplr.com/view/6808/funcin-bsica-para-eliminiar-acentos-en-minsculas/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 20 Jun 2008 05:55:22 GMT</pubDate>
<guid>http://snipplr.com/view/6808/funcin-bsica-para-eliminiar-acentos-en-minsculas/</guid>
</item>
<item>
<title>(Ruby) REXML Language Identification monkey patch - tommorris</title>
<link>http://snipplr.com/view/6744/rexml-language-identification-monkey-patch/</link>
<description><![CDATA[ <p>REXML does not seem to have a 'lang' method, which is strange since lang is in the XML 1.0 Specification §2.12 'Language Identification', and in many other libraries. Because of Ruby's 'monkey patching', it's pretty easy to add - you just recursively browse the ancestors. Alas, because attributes are stored internally as strings and not an Attribute object, there does not seem to be any way of monkey patching §2.12 support on to REXML's attribute handling.

One day, Ruby will have a really good XML parser - speedy as a SAX and fully DOMinanting over the vagaries of namespaces etc.

Enclosed is an RSpec test that demonstrates usage.</p> ]]></description>
<pubDate>Mon, 16 Jun 2008 21:30:16 GMT</pubDate>
<guid>http://snipplr.com/view/6744/rexml-language-identification-monkey-patch/</guid>
</item>
<item>
<title>(Ruby) TextMate bundle searching and pasting code - banzaiman</title>
<link>http://snipplr.com/view/6603/textmate-bundle-searching-and-pasting-code/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 05 Jun 2008 15:03:04 GMT</pubDate>
<guid>http://snipplr.com/view/6603/textmate-bundle-searching-and-pasting-code/</guid>
</item>
<item>
<title>(Ruby) TextMate bundle posting code - banzaiman</title>
<link>http://snipplr.com/view/6602/textmate-bundle-posting-code/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 05 Jun 2008 14:59:09 GMT</pubDate>
<guid>http://snipplr.com/view/6602/textmate-bundle-posting-code/</guid>
</item>
<item>
<title>(Ruby) Post to Twitter from the shell - noah</title>
<link>http://snipplr.com/view/6594/post-to-twitter-from-the-shell/</link>
<description><![CDATA[ <p>Put this in a file called twit.rb, then call as follows:
    ruby twit.rb username "my tweet"

Or you can include your password in the command like so 
    ruby twit.rb username:password "my tweet"

(note that this is hugely insecure as your password will wind up in your .history, not to mention being visible to shouldersurfers).

Also, I just noticed as I was posting this code, that there's a bug where if your tweet is too long and gets truncated, my script will claim you failed to post entirely.  I gotta go back and add logic to check the character count, but tbh I've never gone over 140 characters on the command line, tho I've posted daily with this script for the past several months.  Ymmv.</p> ]]></description>
<pubDate>Thu, 05 Jun 2008 09:23:47 GMT</pubDate>
<guid>http://snipplr.com/view/6594/post-to-twitter-from-the-shell/</guid>
</item>
<item>
<title>(Ruby) base64 enocde/decode - szsk</title>
<link>http://snipplr.com/view/6585/base64-enocdedecode/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 05 Jun 2008 00:25:09 GMT</pubDate>
<guid>http://snipplr.com/view/6585/base64-enocdedecode/</guid>
</item>
<item>
<title>(Ruby) Open a text file and re-write its contents into a new text file - chrisaiv</title>
<link>http://snipplr.com/view/6583/open-a-text-file-and-rewrite-its-contents-into-a-new-text-file/</link>
<description><![CDATA[ <p>Basic example of how to open a text file and print them (including line-numbers) into a new text file</p> ]]></description>
<pubDate>Wed, 04 Jun 2008 20:03:34 GMT</pubDate>
<guid>http://snipplr.com/view/6583/open-a-text-file-and-rewrite-its-contents-into-a-new-text-file/</guid>
</item>
<item>
<title>(Ruby) display date as ISO 8601 - jhenry</title>
<link>http://snipplr.com/view/6579/display-date-as-iso-8601/</link>
<description><![CDATA[ <p>alternative to using DateTime.now.to_s</p> ]]></description>
<pubDate>Wed, 04 Jun 2008 14:34:22 GMT</pubDate>
<guid>http://snipplr.com/view/6579/display-date-as-iso-8601/</guid>
</item>
</channel>
</rss>