Media Extreme

Development Notes

Archive for the ‘Web’ Category

VirtualDocumentRoot for local development

without comments

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/ )

Written by chuck

December 21st, 2011 at 10:01 pm

Posted in Development,Web

Pretty Date

without comments

Here is a cool little javascript that turns a javascript Date into a pretty string. It’s very useful for twitter

http://ejohn.org/blog/javascript-pretty-date/

Written by chuck

October 30th, 2011 at 11:58 pm

Posted in Web

A new and better clearfix

without comments

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;
}

Written by chuck

October 9th, 2011 at 4:13 am

Posted in Web

Tagged with ,

CSS3 generator

without comments

This handy generator is great for CSS3 effects

You can use this to generate box-shadows to satisfy those pesky designers.

http://css3generator.com/

Written by chuck

October 9th, 2011 at 12:57 am

Posted in Web

Tagged with ,