@madpilot makes

And the results are in…

On Saturday I posted that 88 Miles was profiled on the Startups Carnival run by VS Consulting. Well, the results are out now, and 88 Miles came a extremely respectable 4th from 28 entries!

A big congratulations to Richard at Scouta for taking out the first prize and to GoodBarry and Suburb View for rounding out the top three.

Also hats off to OurWishingWell, who shared fourth place with 88 Miles.

88 Miles in the startup carnival

VS Consulting Group has been running an online startups carnival over the past two-weeks, profiling 28 up and coming Australian startups.

Today, 88 Miles is profiled.

It is well worth checking out some of the other entrants, including fellow West Australian Scouta.

A big thanks to Vishal for putting on such an “event” — it really goes to show that the SaaS-o-sphere is alive and well over here in Australia!

Spidermonkey and Ruby on Gentoo

Have you ever had had an inkling to interpret JavaScript with in your Ruby code? Well, I have, so I did some investigating and found Spidermonkey – the API that drives Firefox and Thunderbird’s JavaScript Engine. Being a C-library, it would be (relatively) trivial to write a Ruby interface – and thanks to the wonderful wold of the internets, someone has done just that. Unfortunately, the author is Japanese, and the documentation is sparse. Also, the code hasn’t really been updated since 2006 – but it still works, and thankfully someone else has decided to do a little work on it.

Anyway, here my instructions to install spidermonkey and the ruby library on Gentoo. These instructions may or may not work on other Linux distros or OSX (besides the obvious Gentoo specific emerge function).

Install Spidermonkey

Although the libraries links against Spidermonkey 1.7, running the tests ends in a segfault, so 1.6 is the way to go. If you have updated your portage tree, you will need to lock to the specific version:

emerge =spidermonkey-1.6

Install the library

I installed the updated version from matthewd’s git repository, although the extconf.rb file still needs a little tweaking. Also there are a few tests that will still fail – probably nothing that a little C-hacking can’t fix.

Anyway, open extconf.rb and make it look like this:

require 'mkmf'
require 'pkg-config'

def find_smjs(mozjs)
  dir_config(mozjs)
  #$CFLAGS += " -gdbg"
  case CONFIG['target_os']
  when /mswin32|mingw|bccwin32/
    $defs << " -DXP_WIN"
    lib = "js32"
  else
    $defs << " -DXP_UNIX"
    lib = mozjs
  end

  $defs << " -DNEED_#{mozjs.upcase}_PREFIX"
  have_library(lib)
end

if find_smjs('js') or find_smjs('mozjs') or (CONFIG['target_os'] =~ /mswin32|mingw|bccwin32/ and (find_smjs('mozjs') or find_smjs('smjs') or find_smjs('js'))) or
  %w(xulrunner-js thunderbird-js mozilla-js).any? do |package|
    PKGConfig.have_package(package)
  end

  create_makefile("spidermonkey")
else
  exit 1
end

Finally open spidermonkey.c and find the header include files. Change add these lines before the #else directive

#elif defined NEED_JS_PREFIX
#  include <js/jsapi.h>;
#  include <js/jshash.h>;
#  include <js/jsobj.h>;

Now run the following to build:

ruby extconf.rb
make
sudo make install

If you didn’t have any errors, you should sweet.

Using the library

Now, to parse, compile and execute some javascript code, you need to create a Context, then evaluate the code. So drop this into irb:

require 'spidermonkey'
js = << -JS
function test() {
  return 1 + 2;
}
JS

context = SpiderMonkey::Context.new
context.evaluate(js);
context.evaluate('test();')

Irb should output 3, which, last time I checked is still equal to 1+2!

As you can see, you can make multiple calls within the given context, and all of the functions and variables are persistent. I’ll post more notes as I find them.

RESTful Rails. Part II. Now with more Sitepoint article goodness

My follow up RESTful Rails blog post-cum-article has been released into the wild. If you have been looking at RESTful Rails, and wondering what the hell is going on, go and have a read. If you don’t know what REST is, go and check out the earlier blog post to get up to speed.

Personal promotion over.

Freelancer Friday February

Oh how I love alliteration. Especially on a leap year. This Friday, the 29th is the next installment of everyone’s favourite open house co-working day, Freelancer Friday. At this point I would make some smart-alec remark about how Freelance Fridays would only fall on a leap every x-number of years, however, I can’t be bothered working it out (I’m sure someone out there who will) so instead I’ll point you at the wiki, where you can put your name down. Hurry, time is limited.

88 Miles now supports OAuth

Now that the OAuth standard has been finalised and the Rails plugin (as well as libraries for a number of other languages) has stablised, I thought it time to become an early adopter and add it to 88 Miles.

OAuth works like this:

  1. A developer create a third-party application (a consumer). They login to the the provider website and add their application. The website will then given them a secret key and three URLs: one to get a request token, one to get an access token and one that users can use to authorize an application.
  2. When another user decides to use the third-party application, they first need to authorize it’s use. So the application will request a Request Token by posting some data to the request token URL.
  3. Once this returns, the application should redirect, or at least point to the authorization URL. On this page, the user is asked whether they really want to give access to the third party application.
  4. If the user says yes, the provider will redirect the user back to the consumer website, or at least notify the user that the consumer has authorization (It’s a bit hard to redirect to a desktop application for example).
  5. Once the consumer is notified that it has been given access, it will then swap it’s Request Token for an Access Token.
  6. Now the consumer can freely access resources from the provider by using this Access Token.

Obviously, if a given instance of an application has a valid Access Token, it can skip steps 1-5, and just continue using the Access Token.

Although the Rails plugin is aimed at people using acts_as_authenticated, a little bit of hacking and code diving meant it was relatively easy to shoe-horn it into my custom login system. Because I wanted 88 Miles to drop-back to basic authentication if OAuth wasn’t available, I needed to work out what authentication system each request required. This can be done by:

request_proxy = OAuth::RequestProxy.proxy(request)

if(request_proxy.signature_method != nil)

  # It's an OAuth request

  if oauthenticate

    # They get access

  else

    # Denied!

  end

end

Nice and easy. I did go through and spruce up some of the authentications screens, but if you aren’t that anal, the boilerplate code from the plugin would suffice.

EEE-PC. So cool!

I’m writing this blog post using my brand-spanking Eee PC – the 7″ mini-laptop brought out by Asus. This thing is small, I’ve taken a picture of it sitting on my regular 15″ widescreen laptop, and you can see the difference:

Asus Eee Pc compared to a Toshiba M30

They have managed to squeeze a pretty decent machine in there – it is a 900Mhz Celeron (under clocked to 630Mhz) with 512Mb of RAM and 4Gb of SDD drive space, not bad considering the size and the fact it weighs less than a kilo! Even with the specs, it is suprisingly zippy – I suppose because there isn’t really anything running on it. Boot up time is less than a minute, and shutdown is even quicker.

There is an 8Gb one as well (exactly the same, just with a bigger drive), but I threw in a $25 2GB SD card and that suits me plenty.

It comes loaded with Xandros Linux, a Debian derivative, and with a little hacking, you can unlock the less than useful “simple” mode to reveal KDE. So me further hacking still, and you can pretty much load up any software that will run on Linux. I have a LAMP stack, and I nearly have Rails working (getting Rails to work on Debian is a pain at the best of times).

One of the other great things about this machine is the hackability – many people have managed to install internal USB hubs and bluetooth adapters, touch screens and even digital tv tuners behind the screen (I’m very tempted by this…).

Alas, there are a few downsides. The battery life is pretty average (mind you I’ve been spoilt by my extended 5 hour battery on my main laptop) and hibernation takes longer than shutting down, so the default action when shutting the lid is sleep, which surprisingly chews through the battery. I had it fully charged the night I got it, closed the lid and it was almost dead by morning.

The keyboard takes a little getting used to (but what do you expect). For example, I keep hitting PgUp instead of shift.

The only other annoyance (and this is probably a Linux thing more than anything else) is the WiFi doesn’t auto-connect and it doesn’t seem to like JoikuSpot, so I’m still stuck with my iPod Touch on the train.

All in all though, for a $AU500 miniature laptop, it is freaking awesome!

Perth Ruby on Rails user group. Edition 1

Matt Didcoe has finally gotten the ball rolling on a Perth Ruby on Rails user group with the inaugural meetup happening at the Silicon Beach House on Wednesday 20 February 2008 from 5:30pm. The first one will be pretty informal – no talks (although, I’m sure there will be plenty of taking).

So if you you use Rails, have tried Rails, are thinking about learning Rails or have only just heard of Rails, come along and watch me and Matt try to out geek each other :P

Details in a nutshell:

Wanted: Dead or Alive. Some PHP developers

I’m in a bit of a predicament at the moment. As many of you know, I’m back doing the web consultancy thing full time again after a 18 month hiatus. I made a couple of rules that I’m trying hard not to break:

  1. I’m not supporting PHP4
  2. I’m not supporting or modifying badly written OpenSource projects  (basically crossing out WordPress, osCommerce or phpBB jobs)

Which (maybe un-)suprisingly I get asked for a lot. As a result, I’m looking for some PHP developers that haven’t become totally jaded by years of PHP4 abuse that I can sub-contract out to. I’d say I’m looking for mid-level developers, I’ll be there to help out find out WHAT needs to be done, and HOW it should be done – I just need someone to actually do the work.

I’m pretty anal about coding standards and software practice, so things like SVN are a must. I have a development server if you need an environment to work in.

If you think you might fit the bill, and want to work with someone who’s been around the development block a few times, email me on myles@madpilot.com.au with a short CV and your rates.

I didn’t get the meme-o

Finally, some kind souls have cared enough to tag me with the blog equivalent of a chain letter (or maybe that is the web equivalent of Amway) – the “8 things you didn’t know about me” meme. Rules are, you tell eight things about yourself that the web doesn’t know, then make eight others do the same. So….

  1. I have dual passports, one Australian and one Greek, even though my paternal grandparents are Macedonian and my father and I were born in Australia. I’m not sure how this could happen, although I’m sure goats changed hands. There was also a possibility that if I ever went to Greece (nope, never been) that I would get thrown in the Army to do national service, although I think my Dedo (grandad) paid me out of it. Viva la corruption.
  2. I started MadPilot Productions when I was 18 with my two best mates (and ex-housemates) Andrew and David. The Mad bit refers to our initials and I can’t remember where the Pilot bit came from. Andrew went on to become a lawyer and is now in his final year of musical theatre at WAAPA, and David is a reporter for the ABC, after graduating from WAAPA. I once went to WAAPA to watch someone give a recital.
  3. Myself, Andrew and David once won the Hammarskjold trophy – which is a mock UN Security Council debate for high school students. Our school had been trying to win it for ages – and the other teams we had entered had been together for two or three years, and had been training for months. The three of us were recruited the week before, stayed up until 3am the morning of as our preparation, and still to this day have absolutely no idea what we did or how we did it. I think this is completely representative of the real UN security council.
  4. MadPilot once did work for 96FM (a local radio station), on a promotion hilariously called Cunning Stunts. It was at this point I got to live out my childhood dream of riding in a Black Thunder drinking an Icy cold can of Coke, whilst listening to Triple J.
  5. I have an unnatural facination with late 80s sitcoms. I have many theme songs in my MP3 collection and own two seasons of the Golden Girls on DVD. My favourite 80s trival fact is that Estelle Geddy holds the record for playing the same character (Sophia Petrillo) in the most amount of shows (5: Golden Girls, Golden Palace, Empty Nest, Nurses and Blossom).
  6. I once did a fifteen hour stint at Little Creature Brewery in Fremantle. The only rules were weren’t allowed to leave the premises. We got there at 9am, had the first beer at 10am (It would have been 9am, but we didn’t realise that served beer that early) and had out last drink at midnight. we only got one free beer, despite spending over $600 between the three of us.
  7. I’ve never climbed a tree.
  8. My mum would never let me watch The Simpsons as a child. As a result, I own series 1-8 on DVD. Despite this child abuse, I picked up many Simpsons quotes from those more fortunate than I at school and have recently realised that pretty much everything I’ve ever said that is mildly witty was some sort of Simpsons quote.

Ok. Now to pass this thing on (I don’t want any fairies dying)

Previous Next