Geekpedia Programming Tutorials






Tutorials and Code Ruby Tutorials and Code

1
(13 tutorials and code in 0 pages)
Latest Tutorials: 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   
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

-----
No votes

May 2nd 2008
by Andrew Pociu

Count Words In String

The simplest way to count words in a string using Ruby and regular expressions by splitting the string at each space.

Code

-----
No votes

Apr 23rd 2008
by Andrew Pociu

Mask All Credit Card Digits But Last Four

Mask all the credit card number digits with asterisks except the last 4, for security purposes. The function works for all types of cards (Visa, MasterCard, Amex, Discovery, etc.)

Code

-----
No votes

Apr 16th 2008
by Andrew Pociu

Extract Age from Birth Date

A Ruby function for extracting one's age by passing in the birth date as a parameter.

Code

-----
No votes

Mar 4th 2008
by Andrew Pociu

Pronounceable Random Password Generator

This piece of code generates a random password of the specified length, but mixes the two sets of letters so that a pronouncable password is being generated.

Code

-----
No votes

Feb 29th 2008
by Andrew Pociu

Array of States and their Coordinates

An array of state abbreviations and their approximate GPS coordinates.

Code

*****
5 from 2 votes

Feb 9th 2008
by Andrew Pociu

Array of States and their Abbreviation

An array of states and their two letter abbreviation written in Ruby, useful for populating dropdown lists.

Code

-----
No votes

Dec 9th 2007
by Andrew Pociu

Inverse hex colors

With this function you can get the inverse of a color passed into as a hex value.

Code

*****
5 from 1 votes

Nov 22nd 2007
by Andrew Pociu

Strip HTML tags using Ruby

The StripHtml function strips all the HTML tags in the passed string but preserves the ones specified in the PreserveTags array.

Code

*****
5 from 1 votes

Nov 22nd 2007
by Andrew Pociu

Generate Random Password using Ruby

This code defines a function that allows you to generate an easily readable password of the specified length, containing only valid characters.

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
(13 tutorials and code in 0 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