7 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for slac3dork

A simple domain name checker. This script use service from who.is Usage: ruby domainchecker.rb <domain_name>

0
490
Member Avatar for Stylish

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, …

0
121
Member Avatar for Jessehk

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 …

-1
157
Member Avatar for vegaseat

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 …

0
269
Member Avatar for Dark_Omen

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 …

Member Avatar for bumsfeld
0
140
Member Avatar for Dark_Omen

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.

Member Avatar for bumsfeld
0
328
Member Avatar for Dark_Omen

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.

Member Avatar for Dark_Omen
0
227

The End.