Posts Tagged ‘geek’

Creating Commodore 64 style logos in Canvas

Tuesday, June 21st, 2011

The year is 1993 and a young me spends quite some time in front of a Commodore 1901 colour screen, a C-64 and use Amica Paint V1.8 with my trusty Competition Pro Joystick to set and delete pixels.

One of the things I did a lot was fonts for scrollers and logo effects, like the ones here:

c64 fonts

Fast forward to 2000 – a bit less younger me got his first PC and used Star Commander to move some of these fonts over to the PC to bring them on to the web. By now I develop in Perl and I write an online tool that allows you to create logos using the fonts:

logo-o-matic

A few years later, I re-wrote the generator in PHP. Well, seeing the very cool C64 yourself Canvas demo I thought I should now have a go at creating a pure client side version.

So here we go – check out Canvas Logo-O-Matic and get the source on GitHub

canvas logo-o-matic

The way it works is described very well in this Canvas image cropping tutorial and I heavily documented the logogen.js file for you.

Basically the trick is to write a JSON map of all the char data – where a char starts and how wide it is and then crop it out of a single sprite sheet top copy one after the other into the Canvas.

Dating for geeks – using YQL and Craigslist

Friday, April 16th, 2010

OK, it is Friday, so let’s have some fun. If you go to Craigslist, you will find that there is quite an extensive Personals section (more filled in the US than in Europe, admittedly). It is also full of very obvious messages, so make sure you are OK to watch the links in this article in your work place.

For London, for example the URL of that is:

http://london.craigslist.co.uk/ppp/

This lists all the personals there are – regardless of what type. It also comes as an RSS feed:

http://london.craigslist.co.uk/ppp/index.rss

So, the pattern here is:

http://{location}.craigslist.co.uk/{type}/index.rss

If you want to do a search, it is slighty different:

http://{location}.craigslist.org/search/{type}?format=rss&query={query}

This is exactly what is in use in the open YQL table for craigslist.

Now, the information in craigslist is pretty extensive – and full of stuff you will not want or need.

So, you can use YQL to filter it down to what you need. Say you are a dude and you are looking for a lady you will find that a lot of the content on the results page is not for you. You can filter however down to what you are looking for with the following in YQL query:

select item.title,item.description,item.link
from craigslist.search where location="london"
and type="ppp" and query="w4m"

You can see the result of this here (might contain NSFW text content).

You can also filter down to certain types. For example you can only see the women looking for men – including those who only want a casual encounter:

select item.title,item.description,item.link
from craigslist.search where location="london"
and type in ("w4m","cas") and query="w4m"

Results of this query are available here.

You can also broaden your horizons and include different queries, like couples looking for another man:

select item.title,item.description,item.link from
craigslist.search where location="london" and type="cas"
and query in("mw4m","w4m")

Check out these results

Problem here is that you cannot have two sub-selects in a single query – so you need to use query.multi:

select * from query.multi where queries='
select item.title,item.description,item.link from craigslist.search where
location="london" and type="w4m" and query in("mw4m","w4m");
select item.title,item.description,item.link from craigslist.search where
location="london" and type="cas" and query in("mw4m","w4m")
'

See the multi results here.

If you put this into a PHP script that gets information from a form, you can easily build a Craigslist date finder:

Craigslist Date Filter

The code is available below or directly on GitHub :

Another proof that YQL simply rocks.

TTMMHTM: Bond Mythbusters, security translation, boulevard wordpress and a ten year old tech writer

Monday, January 18th, 2010

Things that made me happy this morning:

TTMMHTM: BOSS community, inate music, encoding and chinese glyphs for geeks, happiness, map overlays, JS scope and web databases

Saturday, August 1st, 2009

Things that made me happy this morning:

TTMMHTM: iPhone GPS and Atari sourcecode, reboot Britain, augmented reality tube app, cougars and sun in San Francisco

Monday, July 6th, 2009

Things that made me happy this morning: