<?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/tags/ruby</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sat, 25 May 2013 17:08:59 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>(Rails) Validate credit card - Fivell</title>
<link>http://snipplr.com/view/70545/validate-credit-card/</link>
<description><![CDATA[ <p>Supported brands
    
    name             | key
    -----------------------
    American Express | :amex
    China UnionPay   | :unionpay
    Diners Club      | :diners
    Dinner Club US   | :diners_us
    Discover         | :discover
    JCB              | :jcb
    Maestro          | :maestro
    MasterCard       | :mastercard
    Solo             | :solo
    Visa             | :visa</p> ]]></description>
<pubDate>Tue, 26 Mar 2013 06:26:40 GMT</pubDate>
<guid>http://snipplr.com/view/70545/validate-credit-card/</guid>
</item>
<item>
<title>(Rails) Rails fix for cookie munging AT&amp;amp;T Proxies - mightybs</title>
<link>http://snipplr.com/view/70030/rails-fix-for-cookie-munging-att-proxies/</link>
<description><![CDATA[ <p>Working on the problem described here: http://forums.att.com/t5/Data-Messaging-Features-Internet/3G-proxy-wnsnet-attws-com-strips-HTTP-response-headers/m-p/3294533/highlight/false#M59737

After some testing we found the below code to fix our troubles in Rails 1.0 sites.  I have not checked if future Rails versions provide the same "fix" or not.  We include this file in our environment file so that on load of the application we decide whether or not it is necessary and define the fix then.</p> ]]></description>
<pubDate>Thu, 21 Feb 2013 06:32:38 GMT</pubDate>
<guid>http://snipplr.com/view/70030/rails-fix-for-cookie-munging-att-proxies/</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) 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) 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>(Rails) Solución: Rails no encuentra la librería MySQL aunque esté instalada (OS X) - skozz</title>
<link>http://snipplr.com/view/63372/solucin-rails-no-encuentra-la-librera-mysql-aunque-est-instalada-os-x/</link>
<description><![CDATA[ <p>Esto suele ocurrer muy amenudo cuando instalamos Ruby on Rails antes que MySQL. Es un error "Library not loaded: libmysqlclient.18.dylib (LoadError)" donde lista los directorios donde busca y no lo encuentra. La solución es guiarle para que lo encuentre. 

Lo hacemos ejecutando este comando en el Terminal para darle la ruta.</p> ]]></description>
<pubDate>Thu, 16 Feb 2012 19:45:42 GMT</pubDate>
<guid>http://snipplr.com/view/63372/solucin-rails-no-encuentra-la-librera-mysql-aunque-est-instalada-os-x/</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) 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>
<item>
<title>(Ruby) Fetch remote JSON in Ruby - vestimir</title>
<link>http://snipplr.com/view/61726/fetch-remote-json-in-ruby/</link>
<description><![CDATA[ <p>An example method for fetching remote JSON data in Ruby.</p> ]]></description>
<pubDate>Wed, 07 Dec 2011 23:55:02 GMT</pubDate>
<guid>http://snipplr.com/view/61726/fetch-remote-json-in-ruby/</guid>
</item>
<item>
<title>(Ruby) Ruby: Parsing Blackberry Download Reports - chrisaiv</title>
<link>http://snipplr.com/view/60688/ruby-parsing-blackberry-download-reports/</link>
<description><![CDATA[ <p>The Blackberry AppWorld portal allows you to schedule reports which are delivered as CSV.zip files. Although the CSV file offers a lot of detail about operating system and date of download, most of the time I just want to know which users downloaded the app from which countries.  So usually I choose "Country, then date", unpack the .zip and run this (verbose) ruby script.</p> ]]></description>
<pubDate>Thu, 10 Nov 2011 11:46:26 GMT</pubDate>
<guid>http://snipplr.com/view/60688/ruby-parsing-blackberry-download-reports/</guid>
</item>
<item>
<title>(Ruby) Singleton Pattern MacRuby - iloveitaly</title>
<link>http://snipplr.com/view/60462/singleton-pattern-macruby/</link>
<description><![CDATA[ <p>Works fine for MacRuby applications</p> ]]></description>
<pubDate>Wed, 02 Nov 2011 04:14:50 GMT</pubDate>
<guid>http://snipplr.com/view/60462/singleton-pattern-macruby/</guid>
</item>
<item>
<title>(Ruby) Ruby: SMPTE Converter - chrisaiv</title>
<link>http://snipplr.com/view/60327/ruby-smpte-converter/</link>
<description><![CDATA[ <p>If you need to do any sort of screen capturing using FFMPEG, you might need this one day</p> ]]></description>
<pubDate>Sat, 29 Oct 2011 03:09:28 GMT</pubDate>
<guid>http://snipplr.com/view/60327/ruby-smpte-converter/</guid>
</item>
<item>
<title>(Bash) Rescue any exception in Ruby - cczona</title>
<link>http://snipplr.com/view/59991/rescue-any-exception-in-ruby/</link>
<description><![CDATA[ <p>From the Pickaxe, 4th edition, p. 352:

A rescue clause with no parameter is treated as if it had a parameter of StandardError. This means that some lower-level exceptions will not be caught by a parameterless rescue class. If you want to rescue every exception, use this:</p> ]]></description>
<pubDate>Thu, 20 Oct 2011 14:59:24 GMT</pubDate>
<guid>http://snipplr.com/view/59991/rescue-any-exception-in-ruby/</guid>
</item>
<item>
<title>(Rails) Rails request parameters! - abstraktor</title>
<link>http://snipplr.com/view/59039/rails-request-parameters/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 24 Sep 2011 01:25:26 GMT</pubDate>
<guid>http://snipplr.com/view/59039/rails-request-parameters/</guid>
</item>
<item>
<title>(Bash) remove trailing space from specific file (ex. ruby) - giver</title>
<link>http://snipplr.com/view/58125/remove-trailing-space-from-specific-file-ex-ruby/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 24 Aug 2011 13:00:24 GMT</pubDate>
<guid>http://snipplr.com/view/58125/remove-trailing-space-from-specific-file-ex-ruby/</guid>
</item>
<item>
<title>(Ruby) Ruby CSV writing and reading example with quotes, line breaks and commas in the fields - m1b</title>
<link>http://snipplr.com/view/58018/ruby-csv-writing-and-reading-example-with-quotes-line-breaks-and-commas-in-the-fields/</link>
<description><![CDATA[ <p>Shows how to read/write fully formatted CSV with Ruby</p> ]]></description>
<pubDate>Fri, 19 Aug 2011 05:51:04 GMT</pubDate>
<guid>http://snipplr.com/view/58018/ruby-csv-writing-and-reading-example-with-quotes-line-breaks-and-commas-in-the-fields/</guid>
</item>
<item>
<title>(Ruby) Ruby class and instance variables lifecycle across inheritance demo - m1b</title>
<link>http://snipplr.com/view/57956/ruby-class-and-instance-variables-lifecycle-across-inheritance-demo/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 18 Aug 2011 03:04:31 GMT</pubDate>
<guid>http://snipplr.com/view/57956/ruby-class-and-instance-variables-lifecycle-across-inheritance-demo/</guid>
</item>
</channel>
</rss>