Keep It Clean!

This year I received a christmas present I certainly wasn’t expecting. When my sister was shopping for presents she said she came across this and couldn’t resist buying it – as a joke – for me.

What is it, you ask?

A Computer Cleaning Vac, similar to this one. It’s a small handheld vac with a couple of attachments to help get into the nooks and crannies of the keyboard and mouse.

When I unwrapped it, I must admit it brought a chuckle. We have a very similar sense of humour, so she knew when buying it, that it would do exacting what she intended.

Nice one sis’ and thanks.

It hasn’t been put to the test just yet, but will be in the near future I’m sure :)

Automated Style Switcher

With the Christmas period upon us, I got to thinking… wouldn’t it be cool to be able to change the style of your site automatically depending on the time of the year?

Well with PHP it’s easy!

$today = date(′d/m′);
echo "<style type="text/css">";
echo "/*<![CDATA[*/";
if  ($today == ′25/12′)  {
echo "@import url(css/xmas_style.css);";
}  elseif ($today == ′01/01′)  {
echo "@import url(css/newyears_style.css);";
} else {
echo "@import url(css/style.css);";
}
echo "/*]]>*/";
echo "</style>";

First you assign a value to the $today variable using the date() function.

Then you echo out the beginning of the style tag. Then using a simple if…elseif…else statement you check if the value of the $today variable is equal to a certain date. If so, import the appropriate stylesheet. Finally you need to echo out the end of the style tag.

The code above needs to be placed inside the <head></head> tags in order to work. Also, this will only work properly on sites that have separated presentation from content.

Of course the code above only works on a day-to-day basis. If, for example, you wanted to have an xmas stylesheet be used for the entire month of December you would need to edit the code to check if the day falls between 01/12 – 31/12, but I’ll leave that up to you to figure out :)

The 6 Myths Of Creativity

“A new study will change how you generate ideas and decide who’s really creative in your company.”

The 6 Myths Of Creativity

Eight years ago, Amabile took her research to a daring new level. Working with a team of PhDs, graduate students, and managers from various companies, she collected nearly 12,000 daily journal entries from 238 people working on creative projects in seven companies in the consumer products, high-tech, and chemical industries.

An interesting article and one I think is worth reading.

Web Design Moods

After reading this thread over at the Sitepoint Forums, it got me thinking. What would be a good way to get yourself in the mood for designing?

I think it’s fair to class myself as a “binge developer” like MrLen. Sometimes I can work away for hours on end without a break. Other times I just can’t get going at all :(

Even with my new outlook on life, it doesn’t make any difference. Maybe listening to some boppy music or watching a tv program where people are building something (American Choppers springs to mind :)) would help?

How do you get yourself in the mood?

Testing, testing…[updated]

My car has it’s biennial NCT test today. I’ve checked the oil and water levels and they’re ok. The tire pressure is fine. My only concern is the headlights alignment. Last time the car nearly failed on that. Let’s hope it doesn’t fail this time around!

Wish me luck :)

Update: Unfortunately the car failed to pass the test. Some of the reasons were downright ridiculous.

1. The registration plates failed because they are required to have both the European logo and the county the car was registered in. Cars older than 1991 can have neither or both, but not only one. My rear plate has only one! Seriously, this test is supposed to make sure the car is safe to drive. How does only having one of the two pieces of information above make the car any less safe? It doesn’t!

2. The indicator light on the front drivers side has a small hole in it. The light still works perfectly because there is a second layer of protection from mist, water and dirt. The reason it needs to be changed is apparently because a child could hurt themselves if they stuck their finger in the hole. Oh come on! There are 100’s of other places on the car where a child could hurt themselves.

Anyway, I’ve got most of the replacment parts needed. Now all I got to do is put them on the car. Shouldn’t take too long or cost too much…. I hope :)