Consuming your GitHub Recent Activity feed

If you have a GitHub account and actively push code to it and you also have a website then this post is for you! Oh and also it’s in C#. Deal with it.

Prerequisites over and here we go. Very quick jobbie this was although I still hate XML. Whose idea was it?!

Here is the code that you can just pop into your Controller, Model or wherever else you want (replacing my username adaam2 with your GitHub username):

And just stick this in your View:

And hey presto you have your recent commits for GitHub for all repos.

Philip Larkin – The Mower

The Mower

The mower stalled, twice; kneeling, I found
A hedgehog jammed up against the blades,
Killed. It had been in the long grass.

I had seen it before, and even fed it, once.
Now I had mauled its unobtrusive world
Unmendably. Burial was no help:

Next morning I got up and it did not.
The first day after a death, the new absence
Is always the same; we should be careful

Of each other, we should be kind
While there is still time.

Handy C# String Extensions for the manipulation of Tweets

I’ve recently been working on a big data project that involves analyzing incoming tweets en mass from the Twitter Streaming API. It’s been a mammoth task getting to grips with the mahoosiveness of the .NET framework. Anyway I’ve collated together a series of Extension methods useful for turning raw tweet text into HTML prettified output (i.e. making plain text representations of Tweets into HTML entities complete with hyperlinks etc.)

In order to use the extension method below, all you need to do is get a tweet into a string variable and call anyone of these methods below using a static method call such as s.ParseUsername()  and you’re set! The extensions below are designed to extend the System namespace.


Combining two List together, merging instances of T based on instance member using LINQ

Recently I encountered an issue whereby I had two List<T> objects with containing objects of a custom class – I needed to join these two lists together, ensuring that in the new joined List<T> the instances of T were not duplicated at all (i.e. two objects with an instance field of Name with a value of “Adam” were not added twice to the new list).

I formulated this code which works rather well and of course you are welcome to pat me on the back a hundred and one times for this beaut:



New E-Cig Gear

Adam’s a very happy boy today. I received new e-cig gear in the mail – I got a Vision Spinner 2, a Kanger Mini ProTank and a Kanger EVOD Glassomizer. My original Vision Spinner was broken on a night out – boo hoo.

Anyway here are some picz of the new aforementioned gear:


AnyVape’s Davide Bottom Coil Glassomizer


The new Vision Spinner 2 is a lot better than the original. They have fixed the poor design of the button.


My Kanger ProTank 3 on the Spinner 2 body


Totally Wicked 30ml 5 pack assortment of flavours


Cheapo CE4 clearomizer (just in case)


Pushing WordPress to Heroku via Git

This post is partly based on the instructions found at Matt Hoofman’s public GitHub repo wordpress-heroku that you can download for free at

So you just found out about Heroku and want to deploy WordPress to your new Heroku app?

Well here’s how you do it..


Once you have installed the command-line interface (CLI), you login via the command-line like so:

The CLI will ask you for the email address you signed up with, and it will also ask for the password you chose. Once authenticated, you are ready to go!

First steps

  1. Open up Terminal in OS X or alternatively iTerm 2 or whatever it is you use to create the magic. Firstly we need to git clone the remote repository that I have spoken about above:
  2. Once the repo has been cloned, you will need to use the cd (change directory) command to go to the newly created git-cloned directory:
  3. Now you can create your new Heroku app on the fly. Bear in mind that Heroku only allows free users to create 5 apps so if you are over this, then you will receive some form of error message telling you where to go. Type this into the command line:

    There will be lots of whirring noises, and a message will pop up telling you that you app has been created. It will be something along the lines of
  4. You will then need to create and attach a postgresql database (also hosted with Heroku) to the app that you have just created:
  5. You will then need to “promote” the database – this means that you are telling Heroku that the newly created database is the main database for the application. You will need to replace the HEROKU_POSTGRESSQL_COLOR_URL with the colour Heroku tells you above:
  6. Once this is all done, create a branch and switch to the new branch automatically via the CLI. Creating a new branch means that you can customized the original installation without f*ing anything up. You can switch back to the original branch easily if anything goes wrong. Anyway type in the command below to create a new branch:
  7. Once this has done, you are ready to do your first push to Heroku’s servers. Copy and paste the name of the branch you created a minute ago and replace the branch name below:

Navigate to the app’s url (i.e. and you should see the WordPress setup page. Follow these steps and you will soon be all setup with WordPress.

Adding themes / plugins to your Heroku WordPress installation

As the newly created WordPress installation doesn’t have I/O access to the underlying file system, installing themes through the WordPress interface is a no-no. Instead you will have to use the command line to push new files (including plugin and themes files to the Heroku servers).

Let’s take a theme as an example – download your theme from where-ever it is you get your WordPress themes, and then do a copy and paste in Finder to the themes/ folder inside of your WordPress installation. This can be found at root/wp-content/themes/

You will then need to go back into the command line and cd to the themes folder. You can traverse the directory tree by using cd .. to go up a folder in the tree and cd and then tab to autofill the folder name once you have typed a few letters. Once you are in the themes folder you need to tell git that to look for new files:

A simple way of checking if Git has detected any file changes (whether they are additions or deletions) is to use the command below:

If Git finds any new files or any deletions, then it will write them to the console.
In order to ready any changes to files for pushing to the Heroku servers you will now need to use the command below to commit changes ready for pushing, complete with a commit message:

Once the changes have been committed you are ready to push the changes to the Heroku servers using the command we have used before:

If you can’t see your new plugins / themes, then first try a hard refresh (cmd + R), but if the new plugins / themes aren’t visible in the admin interface, go back to the command line and check that the new files have been tracked by Git:

In a nutshell, you will use git add to start tracking new files and also to stage changes to already tracked files, then git status and git diff to see what has been modified and staged and finally git commit to record your snapshot into your history. This will be the basic workflow that you use most of the time.

If you want to edit the theme’s source or tweak the WordPress installation, you can use git add -A to push changes to Heroku.

Running for the uninitiated.

Screenshot 2014-05-20 14.00.36

Big news! I have been coaxed into exercising by my “caring” colleagues. I am now a proud member of the Strava community. This evening’s run is the second run I have done since my run-aissance (geddit) began; I did a 1.8 mile run last Saturday with the girlfriend in the searing heat of the British summer, but unfortunately I didn’t have my phone to hand to create proof that I had done so. Anyway, this evening I kitted myself out in some clothes that were vaguely “sporty” and headed out on the open road to find out what all the fuss was about with this “running” thing.

As you can see from the map and graph above,  I didn’t fair very well. I did little over a mile in 9 minutes which for someone who used to smoke and booze and eat anything they want I think is okay. But still a 9 minute mile pace over 1 mile is rubbish and I should be ashamed of myself. I am going to try and go running every day or so and hopefully come a couple of months time I will literally become Linford Christie.

Adam & out.

Conditionally select parent of element in SCSS

I’ve been playing around a lot with SCSS lately, particularly Susy and Compass. It’s a great language (much better than LESS). I recently ran into a problem where I needed to style a parent HTML <section> element only if it had children of a certain class. Of course this would be easy to do with Javascript / jQuery but up until very recently (CSS3), in vanilla CSS it was impossible to traverse the DOM tree in reverse.

In SCSS it is very simple to select a parent element if it has children of a certain class (and of course many many other attributes):

The whole of the Where Lions Roam website is built on SCSS, particularly the Typeplate [] typographic starter kit which is very useful when it comes to styling elements according to some form of typographic scale. In particular I used a very good mixin to fix H1 to H6 elements so that their sizes were proportionate in relation to one another.

More SASS / SCSS stuff coming soon! It feels weird to be back!

Welcome to my new blog

It’s been a while since I last posted online due to the fact that my hosting package expired – I have now moved across to the Cloud with the help of Heroku (to host my CodeIgniter app and also my WordPress installation) and Cloudflare for DNS management and CNAME forwarding at the domain apex.

This may seem like your typical “first post” but even by having gotten to the point of posting this, I have learnt all kinds of new stuff. Anyway, I will post some more interesting stuff very soon!