Updating EmailVeracity to allow single character email addresses

I got a request from WineAlign today to allow a user to register with an email address with only one character in the name like “m@wibblz.com”.  Now I’m going to admit, I haven’t tested using just one character before.  Sure enough it was failing.  I am using the EmailVeracity gem to validate my mail which is working pretty well and it is very easy to tweak to your needs.  First I located the problem, it was the regex that was validating the format of the email address.  I took the following regex

/\A(([\w]+[\w\+_\-\.]+[\+_\-\.]{0})@((?:[-a-z0-9]+\.)+[a-z]{2,})){1}\Z/i

over to rubular.com and started testing.  It was a quick tweak to the regex and I ended up with this.

/\A(([\w]+[\w\+_\-\.]*[\+_\-\.]{0})@((?:[-a-z0-9]+\.)+[a-z]{2,})){1}\Z/i

All I needed to do was then update the gem itself.  Easy!  In a config initializer throw in this one line and restart!

EmailVeracity::Config[:valid_pattern] = /\A(([\w]+[\w\+_\-\.]*[\+_\-\.]{0})@((?:[-a-z0-9]+\.)+[a-z]{2,})){1}\Z/i

Great!!  WineAlign is now accepting email address like “m@wibblz.com”

Thursday, July 23rd, 2009 Uncategorized 2 Comments

Google Notifier not updating as frequently as you like? Me neither! Until now!!

Do you need email as if it was sugar to a diabetic?  I sure do.  That’s why I’ve got my crackberry for when I’m on the go or just away from my mac.  When I am at my mac, I’ve been relying on Google Notifier to tell me when I have new mail.  It would check every 3-8 minutes which drove me crazy until today.  I’ve got it checking now every minute by using a SUPER simple fix I found via a Google Groups discussion.

I’ll give you the steps to make it easy for you.

  1. Click on you Google Notifier
  2. Press Option + Command together
  3. Click on preferences, if  a new window appreared with two fields in it, you did it correct.
  4. In the “Key” field, type “AutocheckInterval”
  5. In the “Value” field, type a number 1…60, I would like it updated every minute so I put in “1″
  6. Click “Set”
  7. Quit Google Notifier by pressing Command + Q
  8. Open Google Notifier

There you go.  All the steps you need to have Google Notifier update every minute or as frequently as you’d like.

Tags: ,

Tuesday, June 9th, 2009 Tips and Tricks No Comments

JavaScript V8 Benchmark Suite Test Results

These are my personal test results for the JavaScript V8 Benchmark Suite (the higher the score the better).

  • 148 - FireFox 3.0.10 on OS X
  • 1,265 - Safari 4 Public Beta (5528.16) on OS X
  • 779 - Google Chrome 1.0.145.59 on Windows XP SP3
  • 21.5 - Internet Explorer 7 on Windows XP SP3 (After getting the infamous “Not Responding” for a few minutes)

Again another reason to love Internet Explorer is that it handles JavaScript so well (I’m kidding).  Wow Safari, knocking it out of the park there.  Can’t wait to test this on the next realease of Google Chrome.  I have a feeling it will even surpass Safari 4.

Thursday, May 21st, 2009 Browsers No Comments

WineAlign launches new landing page

Today we launched a new landing page on WineAlign.com. Check it out at http://www.WineAlign.com!

WineAlign's new landing page

Tuesday, May 19th, 2009 Ruby on Rails No Comments

MailChimp Gem

I’m working on integrating WineAlign.com with MailChimp and I gotta say thanks to Brian for wrapping up a nice gem called Hominid. It sure has made things quick and easy. I worked on a project in the past that used the ruby-mailchimp plugin which also did the trick just as well.

Tags:

Saturday, May 16th, 2009 Ruby on Rails No Comments