Language : ruby

Title User Language Tags Description Date
Get string between two strings joshmn Ruby

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: # getstringbetween("hellomyfriendmoto", 'o', 'm') # > myfriend

April 22
`rb output margin zhaowu Ruby April 5
Setup a Scroll View With TextView (Multiline Text in Cocoa) ibob Ruby February 7
001: Parse and add a CSS class to every html file in a folder lfatr Ruby

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

January 29
prime factorization the_blizz Ruby

finds the prime factors of some number N

December 31
Scale a number into a defined range slhck Ruby

Scales a number from a given range into a specific range, as explained in this Stack Overflow post.

Just call it, for example like:

0.5.scale_between(0, 1, 100, 200)

The result would be 150.

September 18
Rake Task for Rails cliffbraton Ruby

= Rake Task for Rails * name: name of the task * desc: description of the task

August 12
Capture Screenshots in Ruby Maximus1983 Ruby

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!

August 9
Simple code hquilo Ruby

Simple example for exhibiting snipplr's code embedding features in blogspot

July 27
uTorrent WebUI API Ruby Class Affix Ruby

uTorrent for ruby

June 10, 2012
Malware Analysis Script Affix Ruby

A simple script to analyse malware in ruby

June 6, 2012
CodeBreaker slmnwise Ruby

The "Mastermind" Game, Digitized

April 23, 2012
seed db cimminog Ruby March 16, 2012
split.rb bsrinivasan92 Ruby

split

January 31, 2012
xml_creator.rb bsrinivasan92 Ruby

xml creator

January 31, 2012