Welcome To Snipplr


Everyone's Recent Ruby Snippets Tagged ruby



1 1095 posted 16 years ago by nighthawk
2 977 posted 16 years ago by nighthawk
I needed a quick way to unescape a URL Encoded string. I found 2 chill ways
2 946 posted 16 years ago by chrisaiv
http://www.sitepoint.com/forums/showthread.php?t=552741
1 921 posted 16 years ago by chrisaiv
Simple Outlook automation, the idea is to use this in cygwin to send files without opening the outlook UI, to use it place the code under /bin folder and make it executable with chmod +x.
2 1014 posted 16 years ago by narkisr
If you get "JPEG marker not found!" error when you try to open an image file you must read it in binary mode.
1 887 posted 16 years ago by PixelMin
1 1176 posted 16 years ago by dbug13
1 909 posted 16 years ago by pmaciver
1 887 posted 16 years ago by pmaciver
1 886 posted 16 years ago by pmaciver
1 705 posted 16 years ago by sunfjun
1 792 posted 16 years ago by marouanomezzine
1. Make sure the following environment variable is set: WinXP: HOME=C:\Documents and Settings\*username* Vista: HOME=C:\Users\*username* 2. Create an .irbrc file in %HOME%: $ cd %HOME% $ touch .irbrc If you don't have...
1 1030 posted 16 years ago by charlesroper
Matches single line Javascript (and PHP, etc.) comments
1 882 posted 16 years ago by mikegreen
This is as simple as it gets, basiclly this templates shows you how to mock an object methods to any other piece of code that you like (open objects at its simplest glory).
1 883 posted 16 years ago by narkisr
https://www.chrisjmendez.com/2008/06/21/ruby-mixing-in-a-module-immediately-after-an-objects-singleton-class/
2 981 posted 16 years ago by chrisaiv
1 1113 posted 16 years ago by tonic
REXML does not seem to have a 'lang' method, which is strange since lang is in the XML 1.0 Specification §2.12 'Language Identification', and in many other libraries. Because of Ruby's 'monkey patching', it's pretty easy to add - you just recursivel...
1 774 posted 16 years ago by tommorris
2 892 posted 16 years ago by banzaiman
https://www.chrisjmendez.com/2008/06/04/ruby-open-a-text-file-and-re-write-its-contents-into-a-new-text-file/
1 1183 posted 16 years ago by chrisaiv
alternative to using DateTime.now.to_s
1 1086 posted 16 years ago by jhenry
Simple command line option parser snippet
1 1077 posted 17 years ago by mikegreen
Generates a ChangeLog from git repository.
1 864 posted 17 years ago by felipec
1 1107 posted 17 years ago by lakedenman