<?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, 22 May 2013 01:35:30 GMT</pubDate>
<item>
<title>(Ruby) Get string between two strings - joshmn</title>
<link>http://snipplr.com/view/70878/get-string-between-two-strings/</link>
<description><![CDATA[ <p>If you're using Rails and want to make this a global function, drop this into your application_controller and call it as a function.

Example:
     # get_string_between("hellomyfriendmoto", 'o', 'm')
     # > myfriend</p> ]]></description>
<pubDate>Mon, 22 Apr 2013 06:50:51 GMT</pubDate>
<guid>http://snipplr.com/view/70878/get-string-between-two-strings/</guid>
</item>
<item>
<title>(Ruby) `rb output margin - zhaowu</title>
<link>http://snipplr.com/view/70673/rb-output-margin/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 05 Apr 2013 18:20:40 GMT</pubDate>
<guid>http://snipplr.com/view/70673/rb-output-margin/</guid>
</item>
<item>
<title>(Ruby) Setup a Scroll View With TextView (Multiline Text in Cocoa) - ibob</title>
<link>http://snipplr.com/view/69835/setup-a-scroll-view-with-textview-multiline-text-in-cocoa/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 07 Feb 2013 05:15:35 GMT</pubDate>
<guid>http://snipplr.com/view/69835/setup-a-scroll-view-with-textview-multiline-text-in-cocoa/</guid>
</item>
<item>
<title>(Ruby) 001: Parse and add a CSS class to every html file in a folder - lfatr</title>
<link>http://snipplr.com/view/69681/001-parse-and-add-a-css-class-to-every-html-file-in-a-folder/</link>
<description><![CDATA[ <p>Run from console: ruby {filename}  
**Careful this script does not only read but also write**
  
This script 
 - looks for every html file in the folder above   
 - parses them and generates a classname based on the file name   
( '019-5028dca6d8bd8861270001b1.html' -> 'page19' )
- checks if the page's body tag has the page class, adds the class to the body tag
- and writes it back

LA</p> ]]></description>
<pubDate>Tue, 29 Jan 2013 01:44:20 GMT</pubDate>
<guid>http://snipplr.com/view/69681/001-parse-and-add-a-css-class-to-every-html-file-in-a-folder/</guid>
</item>
<item>
<title>(Ruby) prime factorization - the_blizz</title>
<link>http://snipplr.com/view/69314/prime-factorization/</link>
<description><![CDATA[ <p>finds the prime factors of some number N</p> ]]></description>
<pubDate>Mon, 31 Dec 2012 02:55:13 GMT</pubDate>
<guid>http://snipplr.com/view/69314/prime-factorization/</guid>
</item>
<item>
<title>(Ruby) Scale a number into a defined range - slhck</title>
<link>http://snipplr.com/view/67224/scale-a-number-into-a-defined-range/</link>
<description><![CDATA[ <p>Scales a number from a given range into a specific range, as explained [in this Stack Overflow](http://stackoverflow.com/questions/5294955/how-to-scale-down-a-range-of-numbers-with-a-known-min-and-max-value) post.

Just call it, for example like:

    0.5.scale_between(0, 1, 100, 200)

The result would be `150`.</p> ]]></description>
<pubDate>Tue, 18 Sep 2012 20:35:26 GMT</pubDate>
<guid>http://snipplr.com/view/67224/scale-a-number-into-a-defined-range/</guid>
</item>
<item>
<title>(Ruby) Rake Task for Rails - cliffbraton</title>
<link>http://snipplr.com/view/66687/rake-task-for-rails/</link>
<description><![CDATA[ <p>= Rake Task for Rails
* name: name of the task
* desc: description of the task</p> ]]></description>
<pubDate>Sun, 12 Aug 2012 12:12:04 GMT</pubDate>
<guid>http://snipplr.com/view/66687/rake-task-for-rails/</guid>
</item>
<item>
<title>(Ruby) Capture Screenshots in Ruby - Maximus1983</title>
<link>http://snipplr.com/view/66615/capture-screenshots-in-ruby/</link>
<description><![CDATA[ <p>Use this Gem to programmatically take screenshots of websites with this completely open source and free library. We have also provided easy to follow online tutorials and sample applications to help you set up GrabzIt as quickly as possible.

First run:

gem install grabzit

Then register a new account on http://grabz.it to get your application key and application secret.

Then use the code as shown below!</p> ]]></description>
<pubDate>Thu, 09 Aug 2012 23:22:47 GMT</pubDate>
<guid>http://snipplr.com/view/66615/capture-screenshots-in-ruby/</guid>
</item>
<item>
<title>(Ruby) Simple code - hquilo</title>
<link>http://snipplr.com/view/66357/simple-code/</link>
<description><![CDATA[ <p>Simple example for exhibiting snipplr's code embedding features in blogspot</p> ]]></description>
<pubDate>Fri, 27 Jul 2012 01:43:22 GMT</pubDate>
<guid>http://snipplr.com/view/66357/simple-code/</guid>
</item>
<item>
<title>(Ruby) uTorrent WebUI API Ruby Class - Affix</title>
<link>http://snipplr.com/view/65519/utorrent-webui-api-ruby-class/</link>
<description><![CDATA[ <p>uTorrent for ruby</p> ]]></description>
<pubDate>Sun, 10 Jun 2012 10:39:26 GMT</pubDate>
<guid>http://snipplr.com/view/65519/utorrent-webui-api-ruby-class/</guid>
</item>
<item>
<title>(Ruby) Malware Analysis Script - Affix</title>
<link>http://snipplr.com/view/65416/malware-analysis-script/</link>
<description><![CDATA[ <p>A simple script to analyse malware in ruby</p> ]]></description>
<pubDate>Wed, 06 Jun 2012 04:50:34 GMT</pubDate>
<guid>http://snipplr.com/view/65416/malware-analysis-script/</guid>
</item>
<item>
<title>(Ruby) CodeBreaker - slmnwise</title>
<link>http://snipplr.com/view/64706/codebreaker/</link>
<description><![CDATA[ <p>The "Mastermind" Game, Digitized</p> ]]></description>
<pubDate>Mon, 23 Apr 2012 12:36:50 GMT</pubDate>
<guid>http://snipplr.com/view/64706/codebreaker/</guid>
</item>
<item>
<title>(Ruby) seed db - cimminog</title>
<link>http://snipplr.com/view/63966/seed-db/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 16 Mar 2012 10:27:13 GMT</pubDate>
<guid>http://snipplr.com/view/63966/seed-db/</guid>
</item>
<item>
<title>(Ruby) betadata.rb - bsrinivasan92</title>
<link>http://snipplr.com/view/62928/betadatarb/</link>
<description><![CDATA[ <p>ruby file</p> ]]></description>
<pubDate>Tue, 31 Jan 2012 12:26:01 GMT</pubDate>
<guid>http://snipplr.com/view/62928/betadatarb/</guid>
</item>
<item>
<title>(Ruby) Inventor class - bsrinivasan92</title>
<link>http://snipplr.com/view/62921/inventor-class/</link>
<description><![CDATA[ <p>class</p> ]]></description>
<pubDate>Tue, 31 Jan 2012 07:24:52 GMT</pubDate>
<guid>http://snipplr.com/view/62921/inventor-class/</guid>
</item>
<item>
<title>(Ruby) xml_creator.rb - bsrinivasan92</title>
<link>http://snipplr.com/view/62917/xmlcreatorrb/</link>
<description><![CDATA[ <p>xml creator</p> ]]></description>
<pubDate>Tue, 31 Jan 2012 05:01:21 GMT</pubDate>
<guid>http://snipplr.com/view/62917/xmlcreatorrb/</guid>
</item>
<item>
<title>(Ruby) split.rb - bsrinivasan92</title>
<link>http://snipplr.com/view/62915/splitrb/</link>
<description><![CDATA[ <p>split</p> ]]></description>
<pubDate>Tue, 31 Jan 2012 04:42:47 GMT</pubDate>
<guid>http://snipplr.com/view/62915/splitrb/</guid>
</item>
<item>
<title>(Ruby) Ruby: Search Spotify API - chrisaiv</title>
<link>http://snipplr.com/view/62785/ruby-search-spotify-api/</link>
<description><![CDATA[ <p>Simple test showing how to make a request to Spotify's API.</p> ]]></description>
<pubDate>Thu, 26 Jan 2012 10:04:01 GMT</pubDate>
<guid>http://snipplr.com/view/62785/ruby-search-spotify-api/</guid>
</item>
<item>
<title>(Ruby) Extract most common colors from an image - kellishaver</title>
<link>http://snipplr.com/view/62442/extract-most-common-colors-from-an-image/</link>
<description><![CDATA[ <p>Takes an image (path or url) and extracts the 7 most common colors and returns their hex values.</p> ]]></description>
<pubDate>Tue, 10 Jan 2012 10:27:12 GMT</pubDate>
<guid>http://snipplr.com/view/62442/extract-most-common-colors-from-an-image/</guid>
</item>
<item>
<title>(Ruby) Image Uploading in Ruby - kellishaver</title>
<link>http://snipplr.com/view/62410/image-uploading-in-ruby/</link>
<description><![CDATA[ <p>Checks to make sure the file is a valid image file, checks max file size, and directory write permissions, requires 'fileutils' gem.</p> ]]></description>
<pubDate>Mon, 09 Jan 2012 08:34:18 GMT</pubDate>
<guid>http://snipplr.com/view/62410/image-uploading-in-ruby/</guid>
</item>
</channel>
</rss>