using gravatar in classic ASP

A gravatar is a globally recognized avatar, which means that your avatar is stored in one place and it will appear on several websites, blogs, forums (which support gravatars). Whenever you change your avatar it will be updated on your existing comments, forum posts, etc. It’s a great service! Now if you know what a gravatar is you might want to use it in one of your classic ASP applications. This post describes how to solve this simple problem… Continue reading

webdevbros now supports

Gravatar logo from today we are supporting your personal avatars from You will recognize them in the post comments (see this post) and in the sidebar in the recent comments. If you don’t know what gravatar is, then here is a brief description:

A gravatar, or globally recognized avatar, is quite simply an 80×80 pixel avatar image that follows you from weblog to weblog appearing beside your name when you comment on gravatar enabled sites.

The creation is easy .. you just signup with your email and upload your avatar. Your image then appears on your webdevbros comments and hundreds other websites you comment. The nice thing is if you change it, it will affect all your existing entries on all sites. Thats cool! Long live service oriented architecture … Get your gravatar now and be displayed on webdevbros

Library with extensions for prototypejs and

prototype extensions library Today i have found which is an awesome resource for prototype and scriptaculous extensions. It offers one of the best extensions around on a very clear and web2ish site. Currently they offer 88 extensions which include javascript calendars, password strength meters, reflection generators, image croppers, faders, …. Go to and look yourself what they offer. Its good stuff which is based on one of the best libraries out there.

Special chars like e.g. {~ are not supported within rails console on windows

When working with Ruby on Rails on a windows machine you will sometimes need the development console or the interactive ruby console (irb). Actually you need it quite often :) If you do so you’ll discover that special character like the tilde (~) or the {}-brackets are not supported there. Why? I don’t know but let me know if you know the reason. However, to solve this problem just create a file which has the following content:

"M-[": "["
"M-]": "]"
"M-{": "{"
"M-}": "}"
"M-\": "\"
"M-|": "|"
"M-@": "@"
"M-~": "~"
"M-?": "?"

save this to e.g. c:.inputrc and put the following to your irb.bat (which is usually located in c:rubybin) straight after the @echo off line:

SET INPUTRC=C:.inputrc

Now you should be a more happier Rails dev.. At least i am. (I found this information at flip’s blog – Thanks!)

Want to show your source code to someone else?

Today i stumbled across a nice tool called Pastie. Pastie helps you if you want to show some bits of your source code to someone else. e.g. you need some help, advice (or you just want to show off with your code). You paste an excerpt of your code and pastie saves it for under a unique URL. Then you send this URL to the person you want to show the code. The big advantage here is that the syntax is nicely highlighted … very nice for remote troubleshooting! I have created a code snippet for demonstration.

(i’ve used code sections to create more sections.)

Bulk testing your model attributes with rails

When it comes to testing in Ruby on Rails I tend to test every piece of its public interface. This means I test every single public method and attribute to ensure my desired functionality. Recently I’ve updated my application from Rails 1.2.5 to 2.0.1 and I was happy to have tests. None of them failed and so I knew that my application is ready to rock with the new Rails 2.0.
However, what I want to write in this article about is how to do bulk testing of each single attribute of your models. Let’s be a bit precise. Say we have a model User which has attributes firstname, lastnameand age. In order to perfectly test the User model we should write tests which …

  1. ensure that invalid values result in an error for the tested attribute (e.g. age -2 is invalid, so the instance should hold an error for the attribute age)
  2. and valid values don’t result in an error for the tested attribute (e.g. age 20 should be fine)

Usually you should test a couple of invalid values and a couple of valid values against each attribute of your model. This can be quite a lot to code. I explain a nice approach how to speed things up and save time for the next family event. Continue reading

Google released free chart API (usage example)

chart Two days ago the guys at google released a brand new api. It’s called Google Chart API. and is free for approx. 50.000 requests per day. This should be enough for smaller projects ;) The interface is quite easy: You call URL’s for your desired graphs. Also the Data is passed directly via the URL as parameters. I did not have the time yet to experiment a lot with it but from the first sight it looks very professional and i will give it a try in one of my administration areas. Here is a custom made example where I illustrate the visitors of webdevbros from the past two weeks in a nice graph… Continue reading

Extended Email validation for all your models (validates_email)

Ruby on Rails ships with a lot of predefined validations for your models. Unfortunately there is no special email validation. Even Rails 2.0 does not ship it (check the ActiveRecord changelog) yet. Because I needed it I had to write my own validates_email method. I know there are a lot of plugins but non of them suits my needs. validates_email does the following:

  • checks if email is syntactically correct (using regex)
  • checks if the host of the email is supported within the application. This is very important for me because I dont want ppl signing up with one-time emails from e.g. (can be disabled)

Continue reading