Welcome To Snipplr


Everyone's Recent Ruby Snippets Tagged c



First things First you need to install this ruby gem user$ sudo gem install ezcrypto
2 1681 posted 18 years ago by chrisaiv
Before you save a password to a database, it may make sense to encrypt it. That way when you do some user authentication, you can compare the users submitted password to the one on the database.
1 1896 posted 18 years ago by chrisaiv
https://www.chrisjmendez.com/2007/10/15/ruby-parse-delicious-rss-feeds/
2 2081 posted 18 years ago by chrisaiv
https://www.chrisjmendez.com/2017/10/15/ruby-web-2-0-name-generator/
1 1313 posted 18 years ago by chrisaiv
1 1467 posted 18 years ago by lmcdougall
2 1641 posted 18 years ago by lmcdougall
2 2028 posted 18 years ago by lmcdougall
A simple way to build iPhone specific interface with Rails
2 1472 posted 18 years ago by ctran
The escape_javascript funtion is taken from Rails (http://rails.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html#M000633). Most of the work on this was done by pnomolos and n00ge on the E Text Editor forums.
1 1717 posted 18 years ago by charlesroper
Only works on valid XML (ie. XHTML, but not HTML). Grabs an alphabetized list of links from the given URL.
1 1520 posted 18 years ago by burke
This function (intended to be an application or view helper) creates a pager bar useful for navigating many pages. It shows the first, last, current, nearby, and halfway-to-end pages. It looks like this (where the current page is 11): < 1 ... 5 .....
1 1250 posted 18 years ago by Agent
This is an extension to Ruby's String class. Just put this code in a file and include it. This basically takes a string and adds literals and padding to it. For example, you can format a phone number with optional area code like this: "5445556...
1 1842 posted 18 years ago by Agent
Since there is no convenient way to clear the console in irb on windows, we can simple emulate the dos cls function
1 3244 posted 18 years ago by vanne
Gets an mp3 player to play mp3s which contain all the phrases given as arguments. Locate is much faster than xmms' library, usually in split a second. This is very handy, when you install a command-line into the wm panel. Creates files /locate.0, /...
1 1676 posted 18 years ago by Adek336
Just a quick command-line utility to check inflation values from US statistics office.
1 2912 posted 18 years ago by jarjar2k7
1 2713 posted 18 years ago by jpowell
1 1315 posted 18 years ago by jpowell
1 1390 posted 18 years ago by jpowell
2 1559 posted 18 years ago by gtcaz
1 1529 posted 18 years ago by sjtai
This is an easy to use any helpers that rails provides in any other place besides views and view helpers
1 1575 posted 19 years ago by vanne
1 1338 posted 19 years ago by felipec
Sample snip for my twitter wrapper.
1 1280 posted 19 years ago by felipec
Put this in environment.rb to use in your whole app or the console
1 1555 posted 19 years ago by vanne
This allows you to search any INSTANCE or CLASS methods of any objects including rails models, which is helpful if you want to see the methods that you created yourself.
1 1409 posted 19 years ago by vanne