Pimping your Github Commits JS-styley
Posted by lachlanhardy on 20081029 at 2352
If you, like me, have developed strong feelings towards the geeky hotness that is Git sometime in the last 12 or so months, then you’ve probably also got pretty excited about the convivial oldskool swap meet for Git repos known as Github. If not, please do try to keep up. The first day of the rest of your life begins here.
For a long list of dumb reasons beginning with the fact I’ve not yet written my own roughly passable blogging engine to replace this shopworn and shabby edifice constructed with Simplelog 2, I am unable to write server-side shenanigans for my homepage and so have taken to Frankensteining it experimentally with concoctions made of HTML5 and jQuery. One of these little monsters shows glimmers of potential and thus is being released into the world to find its destiny.
You want to brag about your Github commits?

Skitchshot: Lachlan Hardy
Wouldn’t you love a JavaScript badge that looks just like this?! Me too! Boy, have you come to the right place!
I assumed such a badge would already exist. I knew, of course, of Dr Nic’s project-based badge and I quickly discovered the commit badge by Johannes Gilger. The former doesn’t show commits and the latter is targeted at the latest commit of a specific project. Neither of these met my needs in terms of function or code, thus my own Github commit badge project was born!
How does it work?
One of the current limitations of the Github API is that it doesn’t provide any methods to gain details about other people’s projects you might be committing to. Given a project, you can check that. But given a user, you can’t see what projects belonging to other users they’ve contributed to. Which is at least two thirds of the fun of Github! Luckily, they publish that kind of data in your public activity feed.
So, given a username, the script calls a specially crafted Yahoo! Pipe that converts Github’s Atom into delicious usable JSONP for processing into a badass little badge for your blog.
How do I set it up?
Here’s the juicy bit. Be sure to follow along at home for maximum enjoyment. You can download the files from Github.
Dependencies
jQuery 1.2.6 - as you’ll see in the example file, I just point to those nice folks at Google who are hosting jQuery for me.
JavaScript Pretty Date - I also grabbed a copy of John Resig’s Pretty Date to save myself long hours in front of the mirror getting ready.
The Action
github-activity.js is where the main action goes down. You’ll need that one.
Then you need to add a div with an id of ‘github’, containing a p, somewhere on your page. There’s a nice sample in the example file.
After that, you just need to call the function githubActivity(); onDOMready. I have a Go file for that, but you can do it directly in your document if you like.
I’ve included some sample CSS to get you started on prettifying the whole shebang. It includes blank selectors for every element created, just in case you want to go buck wild in Style Town.
All things being equal, you should end up with something that looks pretty much like this one I prepared earlier.
What next?
You’ll have noticed that I keep calling my commit badge an ‘activity badge’. That’s because it feels like such a waste to pull down all that other data and not use it. There’s no reason we can’t publish Follow, Gist, Wiki and Member events too. And any others Github may have up their sleeves. I plan on setting it up with defaults and options to make it easily customisable.
The glaringly ugly bit of code (to my eyes, but please point out any you see) is the parseDate() function. It’s ugly, dumb, badly written, and inaccurate. Kindly suggest replacements or write them yourselves and let me know.
I’m going to keep working on functionality, but in the interest of Just Fucking Shipping, here it is, a Github Commit Badge that’s still got some room to grow. Feel free to use it, change it, fix it, share it and abuse it.
Let me know what you think!
Gitjour: the Quickening
Posted by lachlanhardy on 20081019 at 1926
Back in June, a whole lot of folks in the Ruby world were getting excited about Gitjour and it’s *jour brethren. Read Dr Nic for the lowdown. He was particularly excited about the potential of using all these automated DNSSD-powered advertising services at the forthcoming Railscamp #3. And so was I.
I installed every one of those suckers, and fired them up, and had a play. They were awesome ideas but I thought they were a bit limited in their execution. Don’t get me wrong, as a quick conference hack, they’re brilliant. And for quickly sharing some cool shiz with your friends in the back of a session - perfect. Not so good for 4 days of intense hackery with 60-something coders on the one network. Not so good as a day-to-day tool in a work environment.
Railscamp #3
I spent the first portion of Friday night at Railscamp catching up with folks, as you do. Having a few beers, seeing what they’ve been doing and talking about what we’re going to build over the weekend. I think I might have pointed out the potential for new features in Gitjour just a few times. Just once or twice, you know?
Finally, Mike Bailey calls me on it and we get coding. And everybody I’d whinged to about the potential of Gitjour joins in.
By the end of last Railscamp, we’d refactored significantly, squished many bugs, added proxies for cloning and remotes as well as a search. Not to mention spawned a couple of side-projects: Gitman and Gitnotify.
All our code ended up in the Railscamp repo where, except for an excellent summary post from Lachie Cox, we all forgot about it.
Fedex IX
Atlassian has a quarterly hacking event called Fedex (“deliver overnight”). Basically, everybody gets from 2pm Thursday (in Sydney) to 4pm Friday to hack up whatever they like as long as it is somewhat associated with the company. Then they present, and everybody votes for awesomeness. You’ll have heard of similar events at other companies etc.
Fedex IX was a week ago, and Don Brown hit me up, asking for a method to allow easy local sharing of git repositories. He has a grand master plan I’m sure he will reveal in time.
That’s when I realised we never told anybody about our revamp of Gitjour. We never pimped all the badass improvements we made. That’s dumb for so many reasons, but the biggest is easily that there are hackers out there who need a sweet tool for sharing git repos with colleagues and friends and we didn’t tell them. This makes me sad.
So, my Fedex project quickly became shaping our Gitjour into something nice and stable for everybody else to enjoy. I forked Chad Fowler’s original and I worked out how to mash it together with ours. There are probably faster and neater methods, but I found one that worked. Boy, did I learn a few things about Git that day!
Then I made a couple of bug fixes, tidied things up, battled multiple methods of gem building until I got them to work and made my first ever pull request on Github. Hopefully, Chad will be happy to merge all our work in, but meanwhile you can get all that railscamping goodness on my Github account, or just install the gem:
sudo gem install lachlanhardy-gitjour
Railscamp #4
Very soon, a bunch of hackers are going to be stuck in the middle of nowhere on one network and need to share their work. And I’m going to be there, pointing out what’s wrong with Gitjour and why we should merge in Gitnotify and Gitman so that we have one seriously badass tool that’ll make working with Git the easiest thing you’ve ever done. Sharing those repos can be easier than it is now. And it should be.
And when we’ve built more crazy awesomeness, I’m going to remember to scream it from the rooftops because I want everybody to know that the tools are already here - they just need a little more work. Do you want to help?
Podcast For Your Pleasure
Posted by lachlanhardy on 20080904 at 1036

Photo: Local Government Web Network
The Video
The moment I’ve been dreading for the last few weeks has arrived. The footage of my closing keynote at the LGwebnetwork conference is up on their website. Diana Mounter has posted a very nice introduction to it, you can watch the full video in a few different formats and I have a post with more details and the slides.
I’ve been feeling masochistic this week, so I’ve watched it myself and cringed at the appropriate moments, like when my mic fell off. Diana promised to have that edited out, but I knew at the time they wouldn’t… and they didn’t.
I want to apologise for neglecting to repeat the questions from the audience and for the few gross generalisations I dropped in to keep things moving along. Hopefully, you can pick up the context of the questions from my responses.
In other related news, I am loving the very cool thank you gift from the conference organisers.
It was an honour to deliver this presentation. I’m really excited about the Open Web I see developing and I want to share that with everybody. Thanks to all of you who’ve contacted me with your own comments, opinions and passion. I really do believe we’re building a beautiful, free, and open web!
Local Government on the Open Web
Posted by lachlanhardy on 20080825 at 1519

Photo: Ben Buchanan
The Presentation
The awesome team of Diana Mounter and Reem Abdelaty from the LGwebnetwork asked if I would deliver the closing keynote for their first ever web conference, WE Believe in Community. I was honoured to accept.
I wanted to show people what I see in the web. What I see happening. Where I think everything is going. But I’m a firm believer in showing people techniques and technologies they can use right now. All of which made it very easy for me to talk about the Open Web. There’s an entire blog post I’ve been meaning to write for a long time about that, so we won’t get into it here. This is just to post my slides and to say that video and a podcast will be forthcoming at some point in the future. (I hear end of the week.) Update: Video is now available.
view presentation tags: eaut oauth microid openid
The conference
Put together in only a few months to meet a pressing need for stronger networking and more formal professional development for local government web workers, the entire experience was amazing. Both Reem and Diana radiate energy and passion and they communicated this to every attendee. There was a huge buzz of engagement and involvement. It was a real privilege to be a part of it!
The other big win of the two days was the outstanding quality of the content. John Allsopp delivered a stirring opening keynote of what constitutes the web and how you can expect to access it going forward. He delivered some concepts I’m going to be thinking about for a long time. I particularly enjoyed these quotes too:
- “the web just connects stuff together, do you really think you need a screen?”; and
- “local government should be be building the networks, they’re the sewers of the 21st century”.
Another presentation that I really enjoyed was Matthew Hodgson on the death and rebirth of intranets. He had a clever premise and great solid content that intertwined really well. He also managed to record himself, so he has audio up already! Unfortunately, I missed Ruth Ellison’s as she was just before me (and I was in the tea room doing the obsessive compulsive slide check), but she has her (and Adrian’s) slides up already along with a great summation of each presentation she saw. There were lots of other great speakers, so hopefully they’ll be putting their slides up soon too.

Photo: Ruth Ellison
All up, a fantastic couple of days. Thanks to all the great new people I met for arguing with me over drinks about the open web and why it’s important. And thanks again to Diana and Reem for creating such a charged event! Not to mention the incredibly generous gift thanking speakers &emdash; a customised iPod Shuffle.
Internet Gurus
Posted by lachlanhardy on 20080818 at 2030
Questions
A couple of weeks ago, I got an email from Nick Galvin, a Features Writer with the Sydney Morning Herald, asking if I’d be interested in answering some quick questions about what’s hot on the web for a feature in their weekly technology supplement for the “interested home user”, Icon. I jumped at the chance and thanks must go to John Allsopp recommending me.
The piece was published today and I finally got see who the other people were. I put a scan on my Flickrstream so you can read the full text at either Large or Original (bloody large). Huge thanks must go to the legendary Seng Mah for yet again allowing me to use his photo of me from last August as my publicly respectable face.
Update: Turns out the article did get published online, so it’s much easier to read there.
Answers
What I found most interesting is comparing my answers with those of Cheryl, Virginia, Tim and John. The differences are more telling than the similarities, I think. Cheryl’s answers are consumer-focused, John talks about the big picture and Tim can’t help but dish on what’s important to developers. Of the four, Virginia’s are probably closest to mine in ideas, although hers are expressed far more beautifully. (And she led me to a gorgeous new theme for my tumblelog!)
I copped a bit of a ribbing at work about the reference in the standfirst to ‘internet gurus’. Fair enough. I find it amusing too. Thing is, though, that I know some other internet gurus.
Anybody willing to spend any time at all reading my infrequent posts is automatically qualified as pretty damn interested in the internet (or related to me. Hi, Mum!). So I want to know what you would have answered. What are your responses to the three questions? You don’t have to stick to 180 words like we did!
- What are the three things online that are exciting you most?
- What gadget do you never leave home without? And given most everybody will say their phone or their laptop, why?
- What will be the Next Big Thing?
Add answers or links to answers below.
