The following list is 10 favourite pieces of software which I’m thankful for every single day:

  1. 10. Meld file difference viewer
  2. 9. JQuery javascript framework
  3. 8. Trac project management platform
  4. 7. MythTV digital video recorder
  5. 6. Gimp image manipulation program (I know this is part of GNU but hey ho)
  6. 5. WordPress publishing platform
  7. 4. Firefox web browser
  8. 3. Ubuntu operating system
  9. 2. Linux kernel
  10. 1. GNU projectGnome Desktop (but also all the rest: e.g. gcc, glibc, gtk, emacs and the GPL)

If you want to use the “Purisa Light” font on your Linux hosted website, you can follow the following steps:

  1. Copy the font file from your desktop machine to your webserver. On Ubuntu the “Purisa Light” font file is located at /usr/share/fonts/truetype/thai/Purisa.ttf. e.g:
    scp /usr/share/fonts/truetype/thai/Purisa.ttf <username>@<webhost>:/<pathToWebsite>/fonts/Purisa.ttf
  2. Add the font face to your stylesheet:
    @font-face {
        font-family: 'Purisa';
        src: url('fonts/Purisa.eot'); /* For IE */
        src: local('Purisa'),
             url('fonts/Purisa.ttf') format('truetype');
    }
    
  3. Now you should be able to use it in your site pages. e.g.
    <div style="font-family:Purisa,arial">
    This should be in the "Purisa Light" font...
    </div>
    
  4. BUT, we’re not done yet because unfortunately, IE does not support TrueType (ttf) fonts – only Embedded Open Type (eot) fonts.
  5. Download ttf2eot from http://code.google.com/p/ttf2eot/ – it is a open-source font format converter.
  6. Extract it to your home directory. Then build it:
    cd ~/ttf2eot-0.0.2-2
    sudo apt-get install build-essential
    make
    
  7. Convert the font:
    ./ttf2eot < /usr/share/fonts/truetype/thai/Purisa.ttf > Purisa.eot
  8. Copy it to your website, e.g
    scp /usr/share/fonts/truetype/thai/Purisa.eot <username>@<webhost>:/<pathToWebsite>/fonts/Purisa.eot
  9. Now it should work on IE. If you don’t have time to convert this font, you can grab mine – use “view source” to find the URL from the stylesheet.

@font-face is a HTML5 feature supported by Safari 3.1+, Firefox 3.5+, Opera 10+ and IE 4+. At the time of writing Google Chrome currently doesn’t support @font-face (but the beta version does so it won’t be long).

This post was inspired from an excellent article called @font-face in Depth.

What is a “Amazon Carousel”? It is a advert showing a bunch of items you can buy on Amazon:

Amazon put a limit on the number of items in a carousel. However, if you have more than 10 items, you can use a little javascript to select 10 at random so a different set are shown on each page view.

This is some javascript that randomises an array of ASIN numbers:

var asinArray = new Array('0874477182', '0764138057', '0764136321', '0375428569', '0375764313', '037576433X', '0375428607', '141955252X', '141955039X', '0874477565', '0874477727', '037576593X', '0375429115', '0375765891', '0375765883', '0375429093', '0375429077', '0375429123', '0375429085', '0953265978', '0856609781', '1402209592', '0375428720', '0312366914', '0142003085', '0374525137', '0143112821', '0099479028', '1932080309', '0140620184', '0141185570', '014023750X', '014103534X', '0312361785');
document.write('Normal : ' + asinArray + '<br />');
asinArray.sort(function(){return (Math.round(Math.random())-0.5); });
document.write('Random : ' + asinArray + '<br />');

To select 10 from the randomised array:

if (asinArray.length > 10)
 asinArray.length = 10;
document.write('Random 10: \'' + asinArray.join(',') + '\'<br />');

To apply this to the Amazon Carousel:

<script type='text/javascript'>
var asinArray = new Array('0874477182', '0764138057', '0764136321', '0375428569', '0375764313', '037576433X', '0375428607', '141955252X', '141955039X', '0874477565', '0874477727', '037576593X', '0375429115', '0375765891', '0375765883', '0375429093', '0375429077', '0375429123', '0375429085', '0953265978', '0856609781', '1402209592', '0375428720', '0312366914', '0142003085', '0374525137', '0143112821', '0099479028', '1932080309', '0140620184', '0141185570', '014023750X', '014103534X', '0312361785');
asinArray.sort(function(){return (Math.round(Math.random())-0.5); });
if (asinArray.length > 10)
	asinArray.length = 10;
var asinText = "'"+asinArray.join(',')+"'";
var amzn_wdgt={widget:'Carousel'};
amzn_wdgt.tag='<your Amazon id>';
amzn_wdgt.widgetType='ASINList';
amzn_wdgt.ASIN=asinText;
amzn_wdgt.title='New Video Game titles from Amazon';
amzn_wdgt.width='600';
amzn_wdgt.height='200';
amzn_wdgt.marketPlace='GB';
</script>
<script type='text/javascript' src='http://wms.assoc-amazon.co.uk/20070822/GB/js/swfobject_1_5.js'>
</script>

Are you looking for website templates you can buy or borrow? Here’s a handy list:

Good Engineering Plus Good Art Equals Happy Users

Buy:

Borrow:

Also, here’s some good links for inspiration:

Butterfree

The hardware behind Bitvolution is called “Butterfree“, he’s based in Germany (www.hetzner.de):

Specs:

  • CPU: Intel® Core™ i7-920 Quadcore incl. Hyper-Threading Technology.
  • RAM: 8 GB DDR3.
  • Disk: 2 x 750 GB SATA II (Software-RAID 1).

Features:

  • LAMP – Full root access.
  • 24h reset service via Web interface
  • 92 GBit bandwidth with unlimited traffic usage (but the connection speed is restricted to 10 MBit/s if more than 2000 GB/month are exceeded).

My latest project was to implement a redesign of the PeoplePerHour “Find Freelancers” page.

Previous Design

screenshot of PeoplePerHour search page before redesign

New Design

screenshot of PeoplePerHour search page after redesign

Why is the new search better?

  1. It’s twice as fast
    • Many less DB queries per page (old: >100, new: 10)
    • Less page reloads needed (results refinement via AJAX)
    • Uses faster DB queries, less table JOINs and better indexes
  2. It returns more relevant results
    • It supports multiple keywords and uses Natural language full-text search so ranking takes into account proximity and duplication
    • Users get feedback about why a result was returned (keyword match highlighting)
  3. It’s more powerful
    • More search options, e.g. search on hourly rate of provider.
    • Returns more information, e.g. provider earnings, hourly rate
  4. It has better SEO
    • Used fairly nice URLs, higher keyword density, better HTML markup, better code to content ratio.
    • Added links to “Related queries”, “Popular queries” and “Top Searches by sector”.
  5. The user-interface and page layout has been improved. (UI built with JQuery).
  6. Users can now link to any search (cut&paste URL)

Do you ever use <br style='clear:both' /> or <div style='clear:both'></div> in your webdesign? If you do, stop now, there is a better way to prevent subsequent page elements being affected by the previous floating sections:

Bad:

<div style="float:left;width:300px">left text block</div>
<div style="float:right;width:300px">right text block<br> (which takes more vertical space than the left)</div>
<br style='clear:both' />
Text that you need to appear below the previous text blocks

Why is it bad?

  • <br style='clear:both' /> is bad because it introduces a blank line when you actually only want a newline. It adds vertical spacing when you don’t necessarily want it. It is using a HTML element for more than it’s specific purpose.
  • <div style='clear:both'></div> is bad because you shouldn’t use empty HTML elements.

Better:

<div class='clearAfter'>
    <div style="float:left;width:300px">left text block</div>
    <div style="float:right;width:300px">right text block<br>which takes more vertical space than the left</div>
</div>
Text that you need to appear below the previous text blocks

where the clearAfter css class is defined by:

.clearAfter:after {
clear: both;
content: ".";
display: block;
height: 0;
visibility: hidden
}
.clearAfter {zoom:1}   /*IE necessary workaround*/

I got this trick from the Yahoo! grids CSS framework – so it is a rock solid enterprise tested technique: “No matter which column is longer, the footer stays at the bottom“. Also, see http://snipplr.com/view/86/clear-floats-without-structural-markup/

What is the zoom:1 for? This is a hack needed for IE to force the element to be given a position component.

Screenshot_heidijoycegardens

We have just finished and published http://www.heidijoycegardens.com. It should hopefully look clean and simple?

Technical details of site:

Ubuntu Logo 200x52

If you have a font file with a “ttf” extension you can easily install it in Ubuntu (v9.04) and use it in applications such as the Gimp. Essentially, all you have to do is drop it in the correct folder:

  1. cd /usr/local/share/fonts
  2. If the truetype/custom directory doesn’t exist already: sudo mkdir truetype sudo mkdir truetype/custom
  3. sudo cp where_you_downloaded_the_new_font/fontname.ttf /usr/local/share/fonts/truetype/custom
  4. sudo chown root.root /usr/local/share/fonts/truetype/custom/fontname.ttf
  5. fc-cache – Otherwise, the font will disappear at the next reboot.

The following text was created in the Gimp: It uses 3 free fonts, the “B” is Heavy Data, the “it” is Sans Bold and the “volution” is Ballpark:

ttf font demo

It only takes a few lines of Javascript to make a HTML table start rotating it’s rows. Example:

Demo 1

field 1a field 1b
field 2a field 2b
field 3a field 3b
field 4a field 4b
field 5a field 5b
field 6a field 6b
field 7a field 7b
field 8a field 8b

Demo 2 – Job board

Web designer
£140.00
Start Up Stationary Design
£80.00
Flash / XML Menu System
£400.00
Open Source Application Rebranding
£10.00
Website Design/Build
£50.00
Internet Marketing Guru
£40.00
Icon design – Urgent project
£40.00
Looking for a dragon slayer
£30.00
Poster Design
£460.00
Telesales contacting schools
£40.00
Save the cheerleader
£40.00
Recruiting, need a honest liar
£403.00
Chess grand master wanted
£440.00
Gringots gold for sale
£430.00
webmaster of the universe
£240.00
sale of widgets
£450.00
Will code for food
£420.00
waterproof fish required
£4520.00
blind waiter needed
£240.00
fire resistant cigaretes?
£420.00

Using javascript, you need to remove the last row of the table and then insert it in front of the first table row and then repeat continuously.

Read on…

My latest project at PeoplePerHour was to implement a redesign of the website homepage. The new page is a lot less busy and less work for the webserver:

Previous Design

Screenshot before the redesign

New Design

Screenshot after the redesign

I’m loving jquery at the moment.

« Previous Page