Posted By

t0d0r on 06/24/07


Tagged

textmate rails random name domain generate


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

webstic


Generate random domain name


 / Published in: Rails
 

  1. def domain_name
  2. [
  3. "www",
  4. ("a".."z").to_a.sort_by{rand}.join.slice(0..rand(15)),
  5. %w{com net org}[rand(3)]
  6. ].join('.').downcase
  7. end
  8.  

Report this snippet  

You need to login to post a comment.