Posts Tagged ‘code’

Google Chrome OS & Development

Peter Rojas and Ryan Block make a good point on the gdgt podcast, one that made me stop and think:

  • I think the tell will be a year from now, how many people at Google are running Chrome OS as their primary, or say sole, operating system at work. And I think that that number will actually be relatively low. I think that most people will still be running a more fully functioning install of Linux.
  • I don’t think you could develop code in Chrome OS.
  • There isn’t really a good, at least that I’ve heard of, a good web-based IDE, web-based code developing. You can’t substitute a terminal in the browser.

I’ve seen nothing so far that makes me want to get rid of TextMate (my text editor of choice on the Mac). But like I’ve said (somewhere, possibly on Twitter?) before, there’s nothing to stop this from being a secondary machine.

Listen to it »

St Paul’s School Intranet

St Paul’s School updated the installation of their Content Management System, Firefly.NET, . Along with this update they included a new template that I built, changing the layout of the Intranet which had been there since, I believe, 2001. Here’s a few screenshots to compare the two:

Homepage Comparison
CompSoc Comparison
ICT Department

This redesign made use of Firefly.NET’s template architecture, so the template files were built with XSLT and various stylesheets. While the old template was built using tables (back in 2001, I imagine this was fairly common), the update changes to use <div>s and more common stylesheet positioning instead. It’s technically HTML5, in that the first line of every document is <!doctype html>, though this doesn’t really mean anything for the time being. My favourite part of the redesign? The name of the school now has a proper apostrophe (St Paul’s vs. St Paul's). Apparently I can be a little picky.

Firefly.NET is the system St Paul’s has been using to manage content on its website and Intranet for quite a while now. It was developed by two former pupils of the school, Joe Mathewson and Simon Hay. You can read more about their work and their clients on the Firefly Solutions site.

Open Leeds & The Leeds Hack Space Hack Day (Phew)

Last Saturday, I went to the Hackspace::Leeds Hack Day, organised by the Leeds branch of Hackspace, and supported by the Hackspace Foundation.

The day was split into hardware and software, and I went for the latter. Hardware’s never particularly appealed, requires far too much dexterity. I worked with Chris on the UI and front-end for The Open Leeds project, which is a group of people who are just getting started, making historical data about Leeds accessible. (If someone wants to work on something like this for London – or if something like this is already going on – I’d love to get involved).

I wish there’d been more time, as we only managed to end up with a basic structure and layout for the site, and a promise that we’d all continue work on the mailing list. Below are a few screenshots as the day progressed.

The Open Leeds project
The Open Leeds project

Bedouin Foundry

Bedouin Foundry Main Page

I’ve spent the last couple of months working on a site for a new company, Bedouin® – it was great experience, and really good fun. The site isn’t particularly extensive, so it’s based on flat files rather than any kind of content management system or database; though as it grows, that’s definitely something to consider. The artwork was done by Zeke Wade, the design and layout by Silas Grant, and the coding (PHP, HTML 5, CSS and JavaScript) by me. The site works in IE6 with surprisingly little work – my favourite part is it serves a not-as-pretty GIF background if you’re using Internet Explorer 6 or older instead of any other browser. And as any web developer knows, if it works in IE6 it’ll work in just about anything else. Except IE5.

Feel free to check out the live site now, and make sure to admire the beautiful illustrations: Bedouin®.



Bedouin Foundry Development

Regex Practice Makes Perfect

Regex

I’ve finally got to the point when writing regex like the screenshot above doesn’t take me ten minutes anymore. Oh boy, it’s a pretty nice timesaver.

Google Chart Granularity

Google provide an API to create pretty graphs and charts. Along with that API, they provide a little information on how granular your data should be, which looks something like this:

Google Charts API

Google also own Feedburner, and they provide the pretty (and very, very detailed) graph shown below. Can you see where I’m going with this?

Feedburner Dashboard

My Rev is Very Canonical

It’s the day before exams start here at university, so needless to say I’ve got my priorities straight and am messing around with things on my blog.

There’s been big discussion on the Internet for a few weeks now, I think, on rev=canonical. If you need to get up to speed, take a quick look at Jeremy Keith’s post titled Revving up. I’ll wait, it’s ok. You can even skim or speed read if you’re desperate to get back here.

So, the benefits should be obvious. Providing short URLs from a domain that you have control of, so as not to rely on a third party service. That’s how I interpret it, anyway. It’s important to note that big sites like Flickr are already implementing this, taking links like http://www.flickr.com/photos/alexmuller/3473217214/ and turning them into http://flic.kr/p/6hV9tq. Cool stuff, definitely.

I have an incredibly short attention span. There, I said it. If you’re like me, with the concentration of a tired racoon, here’s what you need to do. Readers, consumers, everybody: grab the rev=canonical bookmarklet created by Simon Willison and use that to find short URLs before other services. Creators, bloggers, people with a website: if you’re using WordPress, install the WordPress rev=canonical plugin which will provide shortened URLs for your blog or site. Everybody’s trying to reduce the impact that linkrot could have, one step at a time.

And there you have it. Every article on this blog now has a short(er) URL, which you can find using the bookmarklet I linked above. Those links will be good for as long as this blog is around, which is potentially longer than URL shortening services. The link for this post is http://mullr.net/blog/pap.

Small update

The plugin broke fairly soon after I implemented it this morning, possibly because of a 301 redirect I have going on from mullr.net to alex.mullr.net. Duncan Robertson, the plugin’s author, replied to my plea for help within half a day with a fix for the issue, so massive thanks to him. I’m sure an updated version will be released on his site that sorts this problem.

Twitterrific’s grep Filter

I’d known this for ages, but only just consciously realised that there was a way to get rid of those tweets that make me sigh painfully to myself. These regex expressions are what I’ve put into Twitterrific’s built in tweet filter.

New blog post.*http

I hate these notifications of blog updates on Twitter. This is exactly what RSS is for, and it works just fine. If I might like your blog, put a link to it somewhere (ooh, how about that section on Twitter that’s handily labelled More Info URL?) and I’ll check it out in my own time and decide if I want to subscribe to it.

^@.*http.*twitterfall

I absolutely love Twitterfall as a product and use it whenever there’s breaking news or events, but following the two developers means a whole load of replies to people I’ve never met advertising their service. Using this is an easy way to keep up with the interesting stuff they post, while getting rid of the links I don’t want to see.

twizmaster and [mM]ac[hH]eist

These two annoy me. The former is an account that’s used as a Twitter quiz service which people reply to with their answers (and reply to all too much). The latter? Search it using search.twitter.com and see for yourself.

And how to implement them…?

The easiest way is to use Secrets.prefpane and add them to the Filter Tweettext option (separated using the pipe character, as they’re regular expressions.

Hack Day ‘08

The Last.fm Hack Day took place last month, and I can’t believe I didn’t post anything about it at the time.

Last.fm Hack Day

It was a great day spent (for me) learning the basics of Python and, a technical term here, "pissing about" with the Last.fm API. There was a Microsoft Surface and Xboxes on hand to entertain us, and plenty of free food and drink.

While I didn’t accomplish anything particularly amazing (at the time, it was noted that you could do everything I managed with the actual Last.fm website), the environment was incredibly conducive to producing good code. Plus, some of the people who were actually trying (Your Next Favourite Band?) made some great little things. See the official Last.fm blog post for links to all the apps.

Russ (from Last.fm) and I (and many, many others) both have some photos on Flickr, though his are just a little better. You can see a video that was created of the day on the group page, and I’ve put a copy on S3 in case the original disappears. And yes, unfortunately I do make an appearance… :D

PHP as a Tiny Database

Here’s a little bit of code I put together this evening to use PHP as a kind of miniscule database. OK, so that’s a bit of a crap analogy; but hopefully the idea makes sense…

Oh, and also: it doesn’t have a front end of any kind. Because I’m lazy (and I think it’s impossible).

Essentially, the code below generates a random number between 1 and 2 (inclusive), and decides which of the selection of variables should be used from $theURL and $theAuthor.

<?php
  $thePhoto = mt_rand(1, 2);
  $theURL = ‘url’ . $thePhoto;
  $theAuthor = ‘author’ . $thePhoto;
  $url1 = ‘http://flickr.com/photos/hortulus_aptus/2367460316/’;
  $author1 = ‘Seán A. O'Hara’;
  $url2 = ‘http://flickr.com/photos/jule_berlin/571121649/’;
  $author2 = ‘Jule Berlin’;
?>

The parameters generated above are then placed into index.php using the following syntax:

<img src=”http://mullr.foo/img<?php echo $thePhoto; ?>.jpg” width=”340px” />
<p><a href=”<?php echo $$theURL; ?>“>Image</a> by <?php echo $$theAuthor; ?></p>

The procedure for increasing the number of images in the "database" is relatively simple: upload a new image with the name img#.jpg to the directory, and add $url# and $author# to the PHP file. Oh, and then increase the range of random numbers that the script can create.

I’m pretty much completely new to this whole server-side scripting thing, so this post is as much about you telling me a better way to do it as it is me sharing this "achievement". In any case, I’m pretty happy – it seems like a nice way of doing things and only took me an hour to get my head round.