Jan 20 2010

Passenger, VMWare, and Windows for testing sites

I’ve been using Passenger for my Rails projects for the past year. When it comes to testing my Rails apps for browser compatibility I like to use crossover for ie6 (on OSX), and Windows 7 for ie7 and ie8 using Internet Explorers Developer Tools. I run Windows 7 using VMWare.

When I need to test an app that’s using Passenger in VMWare in the past I’ve updated my hosts file (/Windows/system32/drivers/etc/hosts) with my current IP address. This has become a pain, and time consuming.

The solution since we can not use 127.0.0.1 for a hostname. Run this command in your Terminal “ifconfig vmnet8” and grab the ip address next to inet. Take this ip address and update your hosts file on your Windows VM. Don’t forget to copy your hosts file from your Mac to the Windows hosts file.

Dec 21 2009

Fixing Select Drop down issues in IE using jQuery

Firefox does auto width on data in select drop downs automatically, but IE doesn’t. This is a quick example of how you can use jQuery to fix this width issue, and allow your web visitors access to all the data in your drop downs the same in all browsers.

You can either use the input name, ID, or class. In this example I’m assuming you have an input name on your select field.

Nov 17 2009

Resetting a cycle tag in Jinja

At my current client I’m working on a platform that uses Django, and a templating system called Jinja.

I had to use Jinja to change the CSS class to modify the background color for each dynamic data returned in each loop.

This seems straight forward after looking at Jinja’s documentation using the cycle tag.

So, the code looked like this:

and then the class in each loop look like this:

Each loop… that’s when I ran into an issue. We had more than one loop on one page, but we needed to have the class change, and increment by 1.

It was incrementing by 1, but not resetting after each loop. So, if 3 were in the first loop the next loop would start with 4, and not reset until after 5.

So, here is an example of resetting a cycle tag in Jinja:

By calling the cycle and using .reset() this returns none, and resets the cycle.

You will noticed I have commented out {{ row_class.reset() }} without comment tags this will render “None”. So, the hack is to just comment this out.

Jul 01 2009

Check this out! I get 2 seconds of TV fame!

Mar 03 2009
Feb 19 2009

Custom form with Validations using Rspec and Story Runner

To Install:

This is a custom Contact form with Validations without ActiveRecord. This works nicely without the use of the database or ActiveRecord model. It’s quite easy with a gem called Validatable.

Apr 10 2008
Life is one big road with lots of signs. So when you riding through the ruts, don’t complicate your mind. Flee from hate, mischief and jealousy. Don’t bury your thoughts, put your vision to reality . Wake Up and Live!?
— Bob Marley
Page 1 of 1