Author Archives: danhigham

Personalised URL shortener (in Ruby)

Quick one! Bought the domain high.am the other day, vain I know! Anyway, decided one of the must haves for said domain was a decent URL shortener. Created a shortener based on some PHP code found at http://high.am/rnhyi4, running it on Passenger using Redis for storage. https://github.com/danhigham/URL-Shortener

Posted in Uncategorized | Leave a comment

Say hello to “Deskimus Prime”

Okay, so for a while now I had heard standing desks were a really good thing and I have had, for quite some time, an IKEA desk more than capable of this. After seeing @ollylegg transform his office desk with coke cans I decided to take the plunge. So, @first65, I will see your “Megadesk” [...]

Posted in Uncategorized | Leave a comment

Deserializing classes in Ruby using YAML.load

Quick note: when using YAML.load to deserialize an instance of a class that was serialized using to_yaml may end up not working! I have an object called ApplicationProvision, call to_yaml and it looks like this ; “— !ruby/object:ApplicationProvision \nconfiguration: \n- !ruby/object:InstantStack::StackConfigurationOption \n default_value: NginX\n possible_values: \n – Apache\n – NginX\n question_key: web_server\n question_text: Do you [...]

Posted in Uncategorized | Leave a comment

Vimeo “Watch Later” RSS feeds

I am a big fan of Vimeo, the content is great and the site is really nice too. Having bought a Boxee box a few months ago I have been getting more and more in to watching online content on my TV at home. Last night I started to add some RSS feeds from Vimeo, [...]

Posted in Uncategorized | 3 Comments

Managing CoffeeScript in Sinatra / Ruby

Over the last couple of weeks I have been working on a project for a client that involved building a couple of small applications in Sinatra (a light web framework for Ruby). Both applications have a RESTful interface, as is the nature of Sinatra, and a javascript frontend using jQuery to make asynchronous requests. I [...]

Posted in Uncategorized | Leave a comment

First jQuery extension method, in CoffeeScript!

I have never been one to write extension methods in jQuery, I suppose that’s because I have not written anything that hasn’t already been done already or it’s just not useful! I have been getting in to using CoffeeScript recently and having written a quick extension for Radiant to allow its use, and also integrating [...]

Posted in Uncategorized | Leave a comment

Database backed DNS server in Ruby

Wether you want to be able to register silly domain names like check.out.this.silly.domain.iamhigham.com or you wish to create domain entries programmatically, the following handy piece of Ruby is for you. One of the reasons I enjoy using Ruby so much is the wider community’s passion for creating just about anything in this awesome language, for [...]

Posted in Uncategorized | 1 Comment

Heroku: I was a little slow on the bandwagon, but I like, a lot!

Seems I have been a little slow to pick up on just how awesome Heroku is. I have been aware of it for a while but was never really bothered enough to take a proper look. Having done so, I am glad I have! I decided to just do a quick app to host a [...]

Posted in Uncategorized | 1 Comment

Generate website headers using RMagick

I needed to generate some headers in a particular font for a client and rather than do the task using the GIMP I decided to write a ruby script to do it instead. The following code creates separate images with the phrases from the array rendered in a particular font. #!/usr/bin/ruby require ‘rubygems’ require ‘rmagick’ [...]

Posted in Uncategorized | Leave a comment

Customising an embedded google calendar

A recent client requested a calendar she could use on her website to display events, immediately my thoughts turned to Google calendar. After creating and embedding the Google calendar in an iframe I noticed the style didn’t quite fit with the rest of the site, it looked ok but just didn’t follow suit. I was [...]

Posted in Uncategorized | 21 Comments