scattrbrain
Darshan Patil's personal blog
Learning Texas Holdem
Developing and managing a game website is hard. I try to play most of the games before I add them to my website. The problem there is I lose track and end up playing games all day. I need better discipline. Anyway I came across this game and it’s pretty cool. It’s a Texas Hold’em game. This has become a rage in the US off late. So if you dont know how to play this game, you can try playing it here.
Masking email in rails
I used to get a lot of spam after I released my blog. I guess most of it was because, I put my email address up on my blog and these spammer spiders got hold of it. I stopped running my mail server for a while ( what was on the site was not my primary email ). This probably got my address of the list. Next I wrote the following snippet of code, and now use it on all my sites. The idea is not new. It masks your email address by using character constants. Your browser recognizes this fine. Most email harvesters do not.
def mask_link(link)
masked_link = ""
link.each_byte do |byte|
masked_link << "&##{byte};"
end
return masked_link
end
def admin_email_link
mailto = "mailto:#{this_site.admin_email}"
"<a href='#{mask_link(mailto)}'>#{mask_link(this_site.admin_email)}</a>"
end
The first routine does the actual text masking. I use the helper method admin_email_link to put my email address on my sites.














