VirtualDocumentRoot for local development

If you want to develop locally on your machine, its a pain to have to write a virtualhost container and restart apache every time. There is a simple way to do this by using VirtualDocumentRoot directive.

1) use localhost as the domain and create subdomains in /etc/hosts ie
127.0.0.1 devsite.localhost

2) Put this into your httpd-vhosts.conf file

VirtualDocumentRoot /my_home_dir/Sites/%0

AllowOverride All

Order allow,deny
Allow from all
All your development sites need to be in /my_home_dir/Sites and the directories must have the same name as the entry in /etc/hosts ( ie /my_home_dir/Sites/devsite.localhost/ )

A new and better clearfix

I love clearfix. It works great, but now there is a new sheriff in town.

This is micro clearfix. For those of you not familiar with clearfix, when you have child elements that are all floated, the parent element has no “shape” to hold its height. Clearfix takes care of that.

http://nicolasgallagher.com/micro-clearfix-hack/

 

/* For modern browsers */
.cf:before,
.cf:after {
    content:"";
    display:table;
}

.cf:after {
    clear:both;
}

/* For IE 6/7 (trigger hasLayout) */
.cf {
    zoom:1;
}