7 Reusable Code Snippet Topics
Remove Filter
|
|
A simple domain name checker. This script use service from who.is Usage: ruby domainchecker.rb <domain_name> |
|
I needed a way to spawn multiple threads, have them monitored, and restarted if an error occured. I came up with the following. This snippet is from a larger program, so if there is a problem please let me know. This is for command line and tested on Linux (well, … |
|
This is a simple, but complete (pseudo) random password generator. Examples of usage: [code] $ ruby pgen.rb soovmuvytv $ ruby pgen.rb --length=20 bynnugipyeeghdbihcdn $ ruby pgen.rb --length=20 -n v3ji3awj1trzjlda5oax $ ruby pgen.rb --length=20 -np :sa6vafpummpttjp?qo: [/code] For complete usage guidelines, run [inlinecode]$ ruby pgen.rb --help[/inlinecode] This (hopefully) serves as both … |
|
Using an SDL (Simple DirectMedia Layer) wrapper is one way to play sound and music with Ruby. I have tested this snippet with .MID .MOD and .WAV files and it performs well. There are several SDL wrappers for Ruby available, I picked RUDL because of its simplicity. RUDL is great … |
|
Okay, this introduces two new things into the widget. The first thing you need is a picture file (.jpg, .png, .bmp etc...). The new code makes the picture into the button with the text "Hello, World" on the side. In the parentheses next to File.open you would put the file … |
|
This is kind of an extension to my previous code snippet. This language is really fun to use. I find it pretty easy to use and understand. This will create a window with a button. |
|
This is a basic window coded in Ruby. To download Ruby go to [url]www.ruby-lang.org[/url] and download the latest version. The latest version includes the FX toolkit that is needed to create this window. |
The End.