Welcome To Snipplr


Everyone's Recent Ruby Snippets Tagged c



1 2 3 4 5 6 ... 12
0 1662 posted 16 years ago by sai-venkat
1 1565 posted 16 years ago by wdso
Easy way to add belongs_to association to nested forms in Rails
0 2047 posted 16 years ago by viatropos
Credit: http://pragmatig.wordpress.com/2009/04/14/recursive-symbolize_keys/
0 1722 posted 16 years ago by nate63179
Sniffing http request & response using pcap in Ruby.
2 2167 posted 16 years ago by narkisr
Fetches an RSS feed and displays the title and summary of each entry. Nothing fancy.
0 1618 posted 16 years ago by PhilK
Simple example for using ActionMailer with Gmail (or other hosts if you remove the TLS settings).
0 1698 posted 16 years ago by PhilK
Don't forget to use require 'directory/name_of_class'
0 2579 posted 16 years ago by chrisaiv
1 2198 posted 16 years ago by endorfin
Ruby provides a platform independent way of displaying file paths. Here are a few common ways to show absolute and relative paths.
0 1967 posted 16 years ago by chrisaiv
This shows how we can find objects inside code blocks (aka data sets).
0 2617 posted 16 years ago by chrisaiv
1 1453 posted 16 years ago by shiftyjelly
Inserted at the top of the method body, this line creates instance variables for each of the method parameters and sets them to their respective argument values.
0 2174 posted 16 years ago by pmadden
The shell command which provides documentation for Ruby's classes and methods is:
0 1646 posted 16 years ago by deepsoul
A monkey patch splitting a string into sentences.
0 2399 posted 16 years ago by cocomo
This assumes the modules names are CamelCase and not UPPERCASE.
0 2630 posted 17 years ago by blasterpal
Groovy has the as keyword which enables the implementation of a Java interface by using the as keyword, its quite easy to mimic this in JRuby.
0 2192 posted 17 years ago by narkisr
1 2 3 4 5 6 ... 12