Wednesday, 1 January 2014

Hyde (backend)

I recently introduced my response to Jekyll on GitHub pages (which I've called Hyde) and promised that I'd go into more detail about it's usage, here goes...

In order to get started with Hyde let us start with the backend first. All you need is a Google Sheet to start with so head over to Drive and create a new Sheet - I've called mine mdblog but it really doesn't matter what it's called. We'll need 4 columns which I've called id, date, title and content. I'm guessing that we could also end up adding further columns like tags but for now that will do us I reckon.

Once the Sheet is made we need to make sure that we hit Publish to the web... on the File menu (don't forget to tick the Automatically republish when changes are made tickbox, and especially don't forget to click the button Start publishing) I've also named it but left it as that as I think that that will do in terms of sharing permissions. Now we need to look at the URI, it will be in the form of something like: https://docs.google.com/spreadsheet/ccc?key=0AiRgQIhodQXfdGVOMEZTcHFJbm95R1l0V1ljRWlBTHc#gid=0. That there long string of seemingly random numbers and letters after key= and before #gid=0 is what we're interested in (so: 0AiRgQIhodQXfdGVOMEZTcHFJbm95R1l0V1ljRWlBTHc). Copy that string and keep it somewhere safe. In order to check that we're cooking we'll need to populate at least one row so why not add some data? Keep things simple and add 1 to the id, a date in the format DD/MM/YYYY HH:MM:SS to the date, Hello World to the title and some markdown formatted text to the content.

Now with some data in our backend let's see if we can access it. Go back to your copied long string and copy it again onto another line then put https://spreadsheets.google.com/feeds/list/ in front and /od6/public/values?alt=json behind (you should end up with something like this : https://spreadsheets.google.com/feeds/list/0AiRgQIhodQXfdElYTEg2SmtBZTBrNjVlcC1ST3c1VEE/od6/public/values?alt=json). You should end up seeing a long string of json formatted text (Sometimes the ordering/naming of the pages within a spreadsheet can get confusing - if you're not seeing any json then take the same string and put https://spreadsheets.google.com/feeds/worksheets/ in front and /private/full behind (https://spreadsheets.google.com/feeds/worksheets/0AiRgQIhodQXfdElYTEg2SmtBZTBrNjVlcC1ST3c1VEE/private/full), this should give you an idea of the id of the specific page (in our case it is od6)).

That's it for your backend for now - that'll give you enough structure and data in order to get things working.

Tuesday, 31 December 2013

Who needs Jekyll for GitHub pages? Introducing Hyde!

I've been playing with various blogging/CMS engines since I started messing about with code. I even played with the fore-runner of WordPress for a long time before moving my own blog over to WordPress and now over to blogger. I created another one a little while ago that could be hosted on Google Drive but it didn't really peak my interest TBH, then along came a lovely article via Feedly (I love Feedly - I love it so much I've paid for it! Why don't you?) about GitHub pages. The article was lovely except that it wasn't really aimed at Windows users (what can I say? Windows works for me and seems to work a treat with most things I ask it to do... there's something about messing with Ruby though that leaves me feeling cold).

Anyway, the article talked about using Ruby to generate a static site using a combination of markdown and a Ruby gem by the name of Jekyll. This, after thrashing around trying to get the bloody thing to work on Windows 8 for a little while, got me thinking about my original GDB and about how cool it would be if I stored markdown rather than Base64 encoded HTML within my spreadsheet. So I got to work making that happen.

Thankfully all this happened during the Xmas and New Year break so I had some time to play (plus ample opportunity to play seeing as whenever I'm not playing/coding, driving, drinking or sleeping I'm an emotional mess) so I got to work and created a markdown powered dynamic blogging engine that seems to work a treat as a replacement for Jekyll on GitHub pages while using Google Sheets as a backend! Strangely enough I decided to call it Hyde. It's not likely to be fast but it does the job a treat and I'm going to write some instructions about it's use later on, in the meantime you can see it an action here.

Friday, 20 December 2013

gMusic

I love music, I really do, which is just as well seeing as I'm tone deaf. #1 son makes and produces music and some of it is really to my taste (very little not TBH) so along with SoundCloud I've tried most of the online music services going. Rdio was lovely but I found Spotify a wee bit intrusive... then Google Music came along and I was in heaven. A wee few squid a month means I get to listen to nigh on anything that takes my fancy... and I do do so... all day long! As well as all the music I've been collecting since my adolescence. Coding with music should really be obligatory!

Thing is though, I do need to talk to other people sometimes and I end up losing the Google Music tab while I'm away with the music fairies. I end up getting reminded that there's a meeting or a scrum that I need to attend and whilst I can always go without pausing the music I find that my headphones (without my head between the speakers to muffle the sound) tend to distract others with that there tinny noise! Thus I decided to spend a few days of my annual leave creating a remote control in the form of a Chrome Extension. It should just display a play/pause icon that, when clicked, plays or pauses the music I'm listening to.

It seems to work for me but I reckon that the whole spirit of opensource should mean that if anyone else can see an improvement then I should embrace it - thus it's hosted on GitHub. Please do take it and play, but please do help others by sending your enhancements back.

Eventually I'll work up the bottle to submit it to the Chrome Store but I think I need to do a wee bit more research along the way yet.

UPDATE [21/12/2013]: Research is done and the extension is now available on the Chrome Store here: gMusic.

Cool ehh?

Friday, 29 November 2013

Less for Murder

In retrospect looking up criminal offences associated with a 5 year term at work probably wasn't the best use of my time for the 20 minutes I thought I'd spend being romantic this morning (as you may or may not know I've been wed to Katrina Myers for 5 years today - sometimes feels like forever*).

I'd like her to know how ever-so grateful I am to her and apologise for the damaged nature of the goods she's ended up taking on.

I love you darling!

(Didn't say who was serving the prison term did I? Still, I'm aiming to make it a life sentence)

* forever in a good way!

Saturday, 16 November 2013

Urbanisation

#2 son has been doing an awful lot of stuff on Urbanisation in his iGCSE Geography at InterHigh of late and then I came across this fantastic article on GIGAOM: Catering to employee demand: Tech companies relocate downtown which is well worth a read. I was mainly interested in that the developers I know have rarely had a university based background...

Tuesday, 29 October 2013

14 years ago

14 years ago my youngest was born. He was the cause of me leaving work early after dealing with a shit-storm of a night-shift and the reason for me falling ever-so-slightly in love with a settee. He was born on it and I slept on it with him over the first year or so of his life. He spent months strapped to my chest and hated the sound of the vacuum cleaner and lawn mower. We sang and burbled and he must have spent months listening to my heart beating. Even when he got older he seemed to relax when sat upon my lap. I miss him.