Welcome To Snipplr


Everyone's Recent Snippets Tagged ruby



1 ... 5 6 7 8 9 ... 13
3 2470 posted 16 years ago by sionnnn
1 1239 posted 16 years ago by dbug13
Creating a object that doesn't have any methods in Ruby (regular objects inherit methods from Object class), useful for Proxies that use method missing (http://onestepback.org/index.cgi/Tech/Ruby/BlankSlate.rdoc).
1 1669 posted 16 years ago by narkisr
0 1331 posted 16 years ago by hlubek
Can be used to generate a random code for an online voucher. You just need to set VOUCHER_CODE_LENGTH in your environment.rb or similar.
1 1345 posted 16 years ago by jordanbrock
An example of redo statement in Ruby, redo makes an iteration step repeat itself again (http://www.rubyrailways.com/rubys-most-underused-keyword/).
1 1280 posted 16 years ago by narkisr
I had a directory tree with around 4000 pdf files and I needed a page count - so I semi-rolled this. I swiped the counter code from the gem README: http://github.com/yob/pdf-reader/tree/master It could be more contained - as is I run it from irb:...
1 1822 posted 16 years ago by inkdeep
3 2383 posted 16 years ago by dbug13
1 1087 posted 16 years ago by paramah
2 1559 posted 16 years ago by paramah
2 1182 posted 16 years ago by Krypt
Select text Right-click, select "Filter through command..."
1 1141 posted 17 years ago by reedelrub
0 1269 posted 17 years ago by eugegim
Rake task - Copies files from one directory to another in a batch of 50 files, giving 15 seconds break between each batch.
1 1614 posted 17 years ago by cnicolaou
1 1681 posted 17 years ago by nighthawk
2 1469 posted 17 years ago by nighthawk
0 1159 posted 17 years ago by haru01
I needed a quick way to unescape a URL Encoded string. I found 2 chill ways
2 1279 posted 17 years ago by chrisaiv
1 1401 posted 17 years ago by eugegim
http://www.sitepoint.com/forums/showthread.php?t=552741
1 1279 posted 17 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 1343 posted 17 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 1349 posted 17 years ago by PixelMin
0 1019 posted 17 years ago by johnloy
1 1670 posted 17 years ago by dbug13
1 972 posted 17 years ago by filiptepper
1 ... 5 6 7 8 9 ... 13