Curl Cheat Sheet

I have a scribbled sheet on my desk, which is my “cheat sheet” for curl, its really short and I thought I’d put my notes here for safe-keeping. If you’re visiting, then I hope they help you too.

Continue reading

Professional Development for Girl Geeks

Last night I gave a talk at the Leeds Girl Geek Dinners entitled “Professional Development for Girl Geeks” – and you can find the slides on slideshare if you’re interested.

Most of what I said wasn’t on the slides, but the gist of it was along the lines of:

  • Use the resources around you
  • People can be resources
  • Interact with resources
  • Ask Questions – do it well and ask each question once

I had a great night and I hope everyone enjoyed themselves as much as I did – and if you were there, are you asking questions yet?

Surfing Without a Mouse

I don’t use a mouse most of the time, because I have tendonitis in my forearms and find that I can use a keyboard for a whole working week without too much pain, whereas any mouse usage starts hurting badly in a day and half. As a web developer, I spend a lot of time with the Internet, developing on it, networking with it, reading on it, and so on – and I do it all without a mouse.

Spatial Navigation in Opera

The only browser I’ve ever managed to work with successfully is Opera, and most of my surfing uses the spatial navigation feature. Basically, you hold down shift, and use the arrows to jump around hyperlinks – much nicer than trying to tab around the place and getting stuck on some long list of links!

Keyboard Shortcuts

Opera has fabulous (and configurable) keyboard shortcuts. I could go on forever but my favourites are:
1 and 2 Next tab/previous tab
0 and 9 Make text bigger/smaller (its actually a zoom, so it works on pictures too)
6 Put the page back to the original size
Ctrl+t New tab
Ctrl+w Close tab
Ctrl+alt+z Open a tab that was closed, with all data still intact (I love this one!!)

With all of these put together, I can do pretty much everything.

Accessibility

The upshot of this is that I consider myself to have “accessibility requirements”. I don’t use a mouse, so I can’t click or mouseover. I use dropdown boxes by focussing and then arrowing down – so if yours triggers stuff at onchange, then I probably can’t use your site. I have javascript turned on most of the time, but plugins turned off (I can’t click on anything anyway) – and I regularly use Opera’s shortcuts for enabling/disabling CSS and images (ctrl+g and ctrl+i respectively) if I can’t see what’s going on. Opera also saves my preferences per site – so I can fiddle with settings for scripting and plugins on a per-site basis which is really helpful.

So there we go, if you have RSI problems, try using the ‘net from your keyboard. And if you thought “accessibility” went with “disabled”, think again.

Flickr Plugin Weirdness

I am an increasingly avid flickr user and have a growing collection of photos on my flickr account. It seems daft to upload photos twice all the time so I tried the flickr plugin for serendipity (my bloggling platform) but I couldn’t get my account to connect correctly. In the box labelled “flickr username” I added my flickr username, “lornajane”, which appears in my photos URL. However the plugin seemed to think my photos should then be at a URL:

http://www.flickr.com/photos/64718621@N00/

which they obviously weren’t. I played around with this for a while, also trying my yahoo user id and getting nowhere.

Eventually I tried another flickr plugin on another site and got identical behaviour – at which point I logged a support ticket with Flickr to ask what I was doing wrong. It turns out that “username” in this case means this label here:

Never noticed that before, and its certainly not how I refer to myself, so I’m a bit confused – but hey my plugin is working! I hope this helps someone (probably me, next time I try to plug flickr in to something else) confused by flickr seeming to think you have the wrong username!

Announcing the Leeds Girl Geek Dinner

Once upon a time there was a girl geek called Sarah Blow, and she wanted to hang out with her girl friends and geek out at the same time (and who wouldn’t?). So she founded the phenomenon of the Girl Geek Dinner in London. Well this great idea has spread and spread around the world and eventually to the North of England – first to Manchester (next event, this Friday 25th July!) and eventually to Leeds.

So I’m pleased to announce that, on Wednesday 13th August there will be the first Leeds Girl Geek Dinner!! Tickets are £10 and if you needed any further encouragement, I’m one of the speakers for the evening. If you’re going, or have any questions, leave a comment below – and I’ll see you there!

LugRadioLive Wolverhampton 2008

Yesterday I had an outing to the LUGRadio Live event in Wolverhampton. To be honest this isn’t my usual kind of crowd but it was local, the talks looked interesting and so off I went.

Well it was a very interesting day – the highlight was of course meeting Emma from emmajane.net – I enjoyed her talk and also her company for both lunch and dinner. Predictably there was an excellent crowd and I had a wonderful time – a few people were there from WYLUG and I had a really good chat with Robert Collins from Canonical, nominally about bzr but in reality we also put the world to rights which was illuminating and good fun. Here’s me and Emma having dinner:

I met a few IRC friends too, some I knew before, some I was hoping to run into and one who stopped me (in my phpwomen shirt) and went “oh, you’re the UK girl from phpwomen …. lornajane!!” which was very cool :) I was also impressed by the “low tech wiki” and “low tech open streetmap” … large pieces of paper and pens.

I also met Dave and Kat from Pale Purple and had a good long chat with them so all in all it was well worth the trip (there are a few more photos in the flickr set if you’re interested). Well done to the organisers for a great event!!

LugRadio Live UK

I’m attending LUGRadio Live UK this weekend, in sunny Wolverhampton! I’m slightly concerned that this might be too geeky for me and I might be scared but there are people I’d like to meet, the talks look interesting, and I can imagine it will be a pretty good crowd. If you are there, please come and say hi to me – I’m very easy to spot because I am tall and female with curly hair, usually a rare combination at any technical gathering :)

Mysql Error

I was running an import script today taken from a mysqldump from another user, when I saw an error that looked like this:

ERROR 1005 (HY000) at line 123: Cant create table  (errno: 150)

This is caused by a mysqldump or export process exporting tables in alphabetical order and not in the order in which they rely on one another. My tables had foreign keys which fail on import if the other table doesn’t exist when you create the table with the key. In this case I was only importing six or eight tables so I simply opened the script in a text editor and re-ordered the import blocks. On a bigger scale a more technical solution might be required!

Vim Macro: cleaning up line endings

When development teams have people working on a variety of platforms, its pretty common to end up with wrong line endings. In vim these will look like ^M at the end of each line. To get rid of these line endings you can use the following command (in command mode)

:% s/^M$//

To type the correct ^M character, you’ll need to press Ctrl + V followed by Ctrl + M (the first combination means “take the next combination literally).

To turn this into a macro you should do the following. In command mode, pressq, followed by any letter. This will be the shortcut to access the macro. Then type the command as above. Finally, press q again to stop recording and its done. You can use your macro by pressing @ and then the letter you chose.

Serendipity and Feed Problems

This site uses a blogging platform called serendipity which is a nice little tool and I’ve been mostly happy since moving across from textpattern (I did write about the experience). Recently however, a few things have been going wrong with the feeds.

I edited an old post, because the image links were broken (I did have a nightmare migrating because I was so inconsistent about the format of the image tags in textpattern, completely my own fault). I was very careful not to update the published date of the article, however the edited article appeared in the feed, which wasn’t what I had in mind! It turned out that this is by design. On line 262 of includes/functions_entries.inc.php (I have serendipity 1.1.3), I found this:

$cond['orderby'] = 'last_modified DESC';

I’ve commented out this line, which was in an if($modified_since) clause. Hopefully this will stop updated entries from appearing in the feed – I have a few other old ones to fix images in so we’ll soon see.

At around the same time, Ivo mentioned that he was seeing the order of posts change in his reader (google reader) when people commented on my posts. I suspect that this is part of the same issue and I’m optimistic of it also being fixed by this change. However when I was looking into the problem I noticed that the URL he was using to access my feed, http://lornajane.net/index.rss2, actually returned RSS 0.91. Not ideal! The problem is the rewrite rule in serendipity’s .htaccess file, which looks like this:

RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2

When you request index.rss2 it should rewrite to rss.php?file=$1&ext=$2 but the “rss” matches first so the user gets redirected to index.rss instead. As a nasty hack to get around this I removed the rss from the above example and gave it a line of its own:

RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss) rss.php?file=$1&ext=rss

Requests to index.rss2 are now correctly rewritten as rss.php?file=index&ext=rss2 and will get RSS 2.0 format in the response. I have just noticed however that this is the most requested page on the site so I really hope I didn’t break anything!