Geekpedia Programming Tutorials






Code Ruby Code

1 2 3
(14 code snippets in 3 pages)
Latest Code: RSS Feed RSS Feed     KlipFolio Klip Klip     Add to Google    Add to My Yahoo!    Subscribe in NewsGator Online    Add To Windows Live    Subscribe with Bloglines   
Code

*----
1 from 1 votes

Oct 27th 2007
by Andrew Pociu

Check if an URL is available

This little Ruby function will check if an URL is available (response code 200). It will return true if the return code is 200 (success), false if any other code is returned, such as 404 (not found.)

Code

-----
No votes

Oct 11th 2007
by Andrew Pociu

Validate a string for a certain amount of numbers

Using regular expressions in Ruby you can validate a string for a certain amount of numbers.

Code

****-
3.5 from 2 votes

Oct 9th 2007
by Andrew Pociu

Get the number of days in a month using Ruby

With a one-line function you can retrieve the number of days in a given month. Month must be passed as a number (1 to 12.)

Code

**---
2 from 1 votes

Oct 2nd 2007
by Andrew Pociu

Shorten a string with complete words

The Excerpt() function takes in a string and shortens it to the desired amount of characters, but without cutting into the middle of a word.

1 2 3
(14 code snippets in 3 pages)
Filter Results
Show:


Latest IT Jobs


Other Resources
Latest Tech Bargains

Advertisement

Free Magazine Subscriptions

Today's Pictures

Today's Video

Other Resources

Latest Download

Latest Icons