Welcome To Snipplr


Everyone's Recent Ruby Snippets Tagged ruby



1 ... 5 6 7 8 9
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 541 posted 17 years ago by vanne
2 603 posted 17 years ago by gtcaz
Requires wget and curl.
2 667 posted 17 years ago by gtcaz
1 559 posted 17 years ago by jordanbrock
3 954 posted 17 years ago by gtcaz
2 680 posted 17 years ago by gtcaz
Add this inside your .irbrc file to call "show Model" in your console instead of "y Model.column_names"
1 575 posted 17 years ago by vanne
1 612 posted 17 years ago by andyh
Extend any float object to allow for decimal conversion
1 555 posted 17 years ago by vanne
Add this to your ~/.irbrc file and you will have inline logging in the console
1 566 posted 17 years ago by vanne
Use this to sanitize a string and convert all wierd characters to your choice of delimiter
1 678 posted 17 years ago by vanne
1 598 posted 17 years ago by spider
3 820 posted 17 years ago by spider
3 792 posted 17 years ago by zuwiki
An example ajax form tag
5 722 posted 17 years ago by jordanbrock
Requires aspell and wxCocoaDialog. Now checks all of your selection for misspellings. Known issues: * e doesn't see contractions as a "word", so you must select things like can't, won't, etc. or the command won't see the whole word. * Dupl...
2 667 posted 17 years ago by gtcaz
This is an example of how to use the wxCocoaDialog dropdown widget from Ruby.
2 795 posted 17 years ago by gtcaz
used to remove unnecessary duplication of code. Code is from Jamis Buck (http://weblog.jamisbuck.org/2007/1/24/object-with_options)
1 501 posted 17 years ago by andyh
Using instance_eval to abstract values into meaningful methods
1 464 posted 17 years ago by vanne
put this into lib/tasks and then run rake db:version
1 530 posted 17 years ago by vanne
A custom assertion that will allow you to pass a block to find the difference between two values.
1 499 posted 17 years ago by vanne
Useful for when you need to do a find and map specific results to an array for use later
1 631 posted 17 years ago by vanne
This is useful for using ActiveRecord validations without the ActiveRecord DB dependencies, this snippet is meant to be used with Textmate... create this in models/name_of_your_model to use.
4 987 posted 17 years ago by vanne
This allows you to turn off ajax requests application wide, so that you don't have to do render :layout => false in every controller that needs it.
1 835 posted 17 years ago by vanne
Just name it s3cp (or similar), chmod it, and then you can do stuff like: s3cp ~/somefile.whatever bucket
1 654 posted 17 years ago by sudarkoff
This snippet is Polish-language specific. This class expands a number (Fixnum or Bignum) into a string with a textual representation of that number in Polish language. Currency suffix supported. Example: 456 -> "four hundred fifty six" (but in Polis...
0 452 posted 17 years ago by komor
1 560 posted 17 years ago by andyh
1 ... 5 6 7 8 9