captured sparks

Archive for 2010

Blue Sky Resumes

The website for blue sky resumes is brilliant. They seem like they really care about their potential clients; even going so far as to recommend competitors if the visitor doesn’t think blue sky would be the right fit.

They offer an online resume writing course (free), which has the potential to reduce their business and 80 sample resumes (free), which again have the potential to reduce their business.

This is a brilliant way to build brand loyalty and I know that if I wanted my resume reviewing, I would certainly consider blue sky.

DISCLAIMER: This is not a sponsored post.

Implementing cache-control with Apache 2

With Google’s decision to include page speed in the factors it uses to decide ranking, it’s more important than ever to increase the speed with which your page loads. The Google Page Speed plugin in for Firebug is a great way to identify what is slowing down your page and where improvements can be made.

One of the areas that I could improve on captured sparks was to explicitly set how I wanted my content to be cached. This site is running on Apache 2 so these instructions are for that versions:

cd /etc/apache2/mods-enabled

Check to see if mod-headers and mod-expires are enabled. If not:

cd /etc/apache2/mods-available
sudo a2enmod headers
sudo a2enmod expires
sudo /etc/init.d/apache2 force-reload

If these modules are not compiled, you will need to do so.

Although I have access to my httpd.conf file, I’ve implemented cache-control in my sites .htaccess file.

<FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|swf)$">
   Header set Cache-Control "max-age=2592000"
</FilesMatch>

This sets the expiry of images and flash to 1 month from the request date as these are unlikely to change particularly frequently.

<FilesMatch "\.(js|pdf)$">
   Header set Cache-Control "max-age=604800"
</FilesMatch>

This sets the expiry of javascript and pdfs to one week from the request date.

<FilesMatch "\.(html|htm|css|txt)$">
   Header set Cache-Control "max-age=43200"
</FilesMatch>

Finally, this sets HTML, stylesheets and text files to expire 1 day from the request. As I am making changes to my site every couple of days at the moment (refining is the word), I need a short expiry time.

Screenshot of Firebug showing expiry date

Inspecting an image with Firebug, you can see that they will now expire 1 month from today at which point the browser will request the file from the server again.

Adding a Twitter feed via jQuery

So, as part of my ongoing development of the site, I’ve added a Twitter feed. The instructions here were great for getting a basic feed.

I’ve then expanded on the javascript used to linkify normal links to incorporate links to users and hashtags:

String.prototype.linkify = function() {
	var text = this.replace(/([A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+)/,"<a href='$1'>$1</a>");
	var text = text.replace(/(@([\w]+))/g,"<a href='http://twitter.com/$2'>$1</a>");
	var text = text.replace(/(#([\w]+))/g,"<a href='http://twitter.com/#search?q=$2'>$1</a>");
	return text
};

The first replace deals with normal links. The second deals with usernames by capturing each username and then using backreferences to construct the link. The same method is used for hashtags.

Firefox and block level links

Has anyone else had any problems trying to wrap block level elements in an a tag in Firefox for Mac.

In my case, I was trying the following:

<a href="">
<li><img src="" /></li>
</a>

Unfortunately, Firefox for Mac seems to pre-emptively close the a element and then wraps the img in an a tag.

I’ve checked on my Windows machine though and the elements work fine.

Moving to Wordpress

So, I’m back and have just moved my blog to Wordpress. I had been running on a custom system for a couple of years but never got round to developing it and it made sense to make the move.

I’ve set Wordpress up so that I can deploy with Capistrano following the instructions at Adam Hunter’s blog. I’ve set out below a few more recipes I added to the deploy code to take into account the plugins I am using. These were mainly to ensure I could continue running a development version on my Mac.

For those using a Sitemap generator, generate the Sitemap in the shared directory and use the following to symlink it:

desc "Make symlink for sitemap"
task :sitemap do
    run "ln -nfs #{shared_path}/sitemap.xml #{release_path}/public/sitemap.xml"
end

If you are using the Smart Archives plugin, the archives.txt file will be in different places on your dev machine. Make a duplicate file called smartarchives-online.php and set the archives.txt location to the appropriate place. Then use the following:

desc "Copy online smart archives file"
task :archives do
  run "cp #{release_path}/public/wp-content/plugins/smartarchives-online.php #{release_path}/public/wp-content/plugins/smartarchives.php"
  run "chmod 775 #{release_path}/public/wp-content/archives.txt"
end

Finally, to remove the wp-config.php file, use the following:

desc "Remove dev config file"
task :remove_dev_config do
  run "rm -rf #{release_path}/public/wp-config.php"
end

Thankfully, as I did not have too many entries on my blog, setting up 301 redirects has not been too much of a task. I’ll have to wait and see when Google next crawls the site, if I’ve picked all the changes up.

My Space Kids

Background

The site was needed to act as a brochure for parents looking to place their kids into activity camps during school holidays. It also needed to enable parents to complete booking forms to send with payment to reserve their child’s place.

Intatec

Background

The site was primarily developed to enable prospective customers to search the vast range of products that Intatec offers. Large images on the front page highlight the quality of the image and the individual product pages show the approvals that each product holds.

Another year has been and gone

2009 ended on a high note for me. A site I designed in 2009 for a medium-sized company obtained a really positive review in this magazine (pdf).

Beautifully and simply laid out from start to finish, the home page with its Need Help? and Downloads section front and centre shows this site has a true sense of targeted purpose.

In terms of statistics, I had just over 2700 visits in 2009, up a 1000 over 2008.

What are my plans for 2010? After some reflection, I think I’m a starter, not a finisher. Looking through the Code folder on my Macbook lists the following project names:

  • coffee
  • deliver
  • eventamatic
  • plane
  • radar
  • recruit

All projects in varying stages of completion. For 2010, I want to develop a personal project and have it launched and mildly successful. For this, I’d be happy to partner with anyone who is looking to do the same. I am of course also available for client work.

I wish everyone a successful and happy 2010.

« Previous Page