Blaze Blog

Archive For: Technology

Oct23

Using CSS Tweak for Deployment

A few people have asked me recently how and why they should use CSS optimization tools like CSS Tweak.

I think there is a general misunderstanding about when these tools should be used, and how they can benefit your site overall. The issue for most people is that once they have optimized their CSS, it is completely unreadable and impossible to update. Optimizing the local development copy of your CSS isn’t really the right way to use the tool.

The idea of CSS Tweak is to provide optimization for deployment. So, this means you would keep a development copy of all your CSS files on your local machine. Then, when you are ready to upload your site, run the CSS through CSS Tweak, and upload the optimized files. This way, you have a perfectly maintainable copy on your own machine, and an identical copy on the server, only fully optimized, reducing your site load times and bandwidth usage.

That’s all really, I just thought I’d talk about this briefly, as it seems to be a recurring question. I don’t think I made this all that clear when I first released CSS Tweak, so really it’s my own fault! Has anyone been using CSS Tweak in this fashion already?

Aug13

How To: Virtual Hosts with Parallels and OS X

By Andy in Apple, Technology

I’ve had Parallels Workstation installed on my Macbook Pro for around two months now. It’s been a real joy to test websites in IE6 without bleeding from the eyes using Virtual PC. However, I’ve come across a problem using virtual hosts.

Virtual Hosts allow me to access any of my local website development copies through an easy to remember local URL. An example would be this site, where I have an exact mirror accessible through:

www.cssdev.local

This way I can play around with the site in exactly the same conditions as if it were live.

The issue is when I want to access these sites in Windows through Parallels. The virtual hosts just plain don’t work, and if I type in the direct path:

http://10.0.1.2/Sites/cssdev/index.php

the links to the CSS, Images and JS all break as they’re pointing to the root directory.

So, what would be great is if I could just boot up Parallels, open IE6 and just type in ‘www.cssdev.local’. Things would be seamless and that would just make me a happy man.

After a bit of fiddling, I managed it. Here’s how to set up a virtual host in OS X Tiger using the built in Apache installation, and get it to work in Windows XP through Parallels:

Step 1

If you already have a virtual host set up in OS X, then you can skip straight to step 7.

First of all, turn off ‘Personal File Web Sharing’ in ‘System Preferences » Sharing’ by un-checking it. We want to disable Apache because we’re going to make a couple of changes to its configuration.

Step 2

Boot up the ‘Terminal’ application which is in ‘Applications » Utilities’. If you have Textmate installed then type the following command:

mate /etc/httpd/httpd.conf

If you are not running Textmate, you should be. Go and download a trial copy and see how good it is for yourself. Otherwise you might want to use “VI” which is a built in editor, just replace “mate” with “vi” in the command above.

Step 3

You should now see the ‘httpd.conf’ file in your editor of choice. This is the Apache configuration file and it’s in here that you can set up a virtual host. Search for the words “NameVirtualHost” and you should come across the same lines that you see in the screen grab below.

Web Sharing

Remove the ”#” from the NameVirtualHost line, and change the ”*:80” to the IP address of your computer. If you don’t have a static IP address, you may want to get one (most routers can be configured for this). If your IP changes frequently then your virtual hosts will break.

Step 4

Now we are going to add our virtual host. Copy the following code, replacing your own IP address, ServerName, and DocumentRoot.

<VirtualHost 10.0.1.2>
ServerName www.cssdev.local
DocumentRoot /Library/WebServer/Documents/Sites/cssdev/
</VirtualHost>

Place this in the httpd.conf file below the commented out example, which ends with ”#”. Your httpd.conf file should now look something like this:

Web Sharing

Step 5

Save the “httpd.conf” file as we’ve made all the changes we need to. Next we need to modify your hosts file, so that your computer knows that ‘www.cssdev.local’ points locally. In ‘Terminal’ type the following command:

mate /private/etc/hosts

After the commented section of the file ending in ”##” type in the following line, replacing your own IP address and virtual host name:

10.0.1.2      www.cssdev.local

Make sure you place a [tab] after the IP address, and not a space. Your hosts file should now look something like the following:

Web Sharing

Close and save the file.

Step 6

Now we can test. Turn on ‘Personal File Web Sharing’ by following the instructions in step 1, but checking the box instead.

Open up your web browser and try typing in your virtual host URL. If the site displays, then well done, things are working in OS X. Now we can make a quick change in Windows and we’re done!

Step 7

Boot up Parallels Desktop and get Windows XP loaded and waiting for you. Head to ‘Start » Run’ and type in the following:

wordpad c:\\windows\\system32\\drivers\\etc\\hosts

Now, we want to make this file a carbon copy of our hosts file in OS X, so, same as in step 5, add the following lines after the header comment:

10.0.1.2      www.cssdev.local

Save and close the file.

Step 8

Things should now work perfectly under windows in every browser but IE. Here’s the final thing. Open up IE and go to ‘Tools » Internet Options » Lan Settings…’.

Make sure that ‘Automatically detect settings’ is unchecked.

That’s it! If you followed everything perfectly you should now be able to access your virtual host through OS X and Windows. You can of course add as many virtual hosts as you wish by repeating the steps for each site.

I hope this step by step guide helps people out. Virtual hosts are really handy, especially if you are having path issues between live copies and development copies. Enjoy!

May17

Durable: Best Overall Design!

Durable has been named the best overall design in the Wordpress Theme Competition.

Arena WPI am very honored to have been named the winner by the judges as the field contained many great designs this time around.

Well, actually to be honest I am a little surprised. There were designs in the competition that are aesthetically far more pleasing than Durable. I was sure that those designs would have the extra edge over the themes that concentrated on function over form. I guess that was where the multiple categories came into play, my personal favorite was Derek’s very beautiful Foliage Mod Theme which won “Most Creative Design”. Well done Derek.

That begs a question though, are people beginning to pick themes based not solely on the look and feel, but also the bundled functionality? I can’t help but think that people’s feelings towards what makes a good Wordpress theme have changed quite a lot since the Wordpress 1.5 competition. The boundaries of what theme authors can do with Wordpress has been pushed since 1.5, simply because better documentation is now available, and we’ve had more time to fiddle around with the Wordpress code.

Anyway, that was more of a brain dump than anything. It’s just great to see that judges really took time to look at the themes, judging functionality just as much as the look and feel.

Thanks to everyone who put in their free time to make this competition possible, your hard work is much appreciated.

Update: I have released a minor update to Durable. Version 0.2.1 is available for download and decreases page load times by 25%.

Jan9

Coding Smart With TextMate

I’ve been using Textmate for over six months and it has gone from strength to strength. It packs a powerful punch for such a simple editor.

Textmate IconBefore using TextMate I’d switched and swapped which editor I used regularly. Sometimes I’d settle for the bloated features of an IDE like Zend Studio, and other times just shoot for something simple and fast like Mac OS X’s TextEdit. I never really found the balance, and like most people I have spoken to, they and I found BBEdit to be too old (and too ugly) for any real productive use.

So why does TextMate appeal so much? I guess it’s attention to detail, and the developers ability to prioritize what features the user really wants. It includes all the basics you would expect of your average editor, code highlighting, auto indentation, some level of auto completion etc etc. However, it also adds to these, by including features like snippets, code block collapsing and a project file browser. These are features that won’t make the software bloated, but go a long way for increasing your productivity and appreciation of the simple added extras.

Snippets

Snippets in TextmateMy favorite of the three features I mentioned above is snippets. This is one of TextMate’s features that I took some time to really get used to. I’m one of those people who tends to retype code over and over again, just because I don’t want remove my fingers from the keyboard to select and copy a block of code. Snippets allows me to assign a keyword to code that I regularly have to retype, then all I need to do is type this keyword and hit tab. The code magically appears and even lets you tab between input locations within it. This has been an amazing time saver, TextMate already has hundreds of snippets pre-bundled.

I’m also amazed by the rate and amount of updates that come out for the software. I subscribe to the bleeding edge releases, so I receive all the unofficial builds. Even so, I’ve found all the releases so far to be perfectly stable, and allow me to take advantage of features before their official release. TextMate includes it’s own auto-update feature, which is easily the best that I’ve seen. I hate auto updates, they’re annoying and always get in the way. TextMate’s is quite the opposite however, updates download quickly and unobtrusively, and everything is automated. It even removes your old copy, copies itself over to you applications directory and then restarts. This all happens in less that 15 seconds for me. Perfect.

What’s Missing?

TextMate does have a couple of features missing that I would really like to see included. CVS or Subversion support would be a great bonus, that would cut my checking in time down dramatically. Also, auto completion of code would be great for all the PHP work I do. This is lesser of a wish however, as I’m finding that I memorize far more functions by having to remember them and not rely on the prompt window to back me up! I’m sure that these features will come, but again they are lower down on the priority list as they are not so important for the masses.

If you are a Mac user and find BBEdit ugly and slow, give TextMate a shot. It has a free trial and is cheap (around €39). I paid for a license within the first week of using it, it’s that good. They also just redesigned their website which now looks very polished compared with the old one. I’m looking forward to continued updates, and with version 1.5 just released, I’ve got a whole bunch of new features to test out!

Technorati Tags: ,

Dec27

Wordpress Goes 2.0

By Andy in News, Technology

No official announcement yet, but looks like it’s there, live and kicking.

As I’m writing this there is no formal announcement yet, but if you visit the download page, it seems to download version 2.0 final?? Get it while it’s hot!