Moving…

28
Oct
5

I’ll be blogging from http://alexmaccaw.co.uk in the future.

Some recent posts include:

Filed under: Socialmod

MissTweets

28
May
8

MissTweets is a Twitter app I made for the Techcrunch Disrupt conference.

The app uses various algorithms to calculate your friend’s most interesting tweets, providing a daily Atom feed with the top 50. The idea is that you potentially miss out on a lot of interesting Tweets during the day – there’s just too many tweets to read. MissTweets solves this by showing you your friend’s top tweets once a day.

MissTweets

Filed under: Socialmod

FlareVideo

27
May
8

FlareVideo is a project I was hacking on last week – it’s a HTML5 video player with a Flash fallback. You can customize all the controls using CSS and it’s completely free and open source.

Check out the site.

Flare Video

Filed under: Socialmod

YMockup – UI Mockups in CSS and HTML

26
Mar
3

Yesterday I was looking for way to create UI mockups, but nothing I found was quite what I wanted. I needed a way of quickly creating mockups that looked realistic, and could be reused in the actual implementation of the design.

CSS has advanced so far recently, that I believe it can go some way to replacing Photoshop in the design process. With that in mind, I present YMockup – UI mockups using HTML and CSS.

With YMockup, you can code up a general theme for your site – and then drag/edit/resize elements to your hearts content! It’s really flexible, and you can create any kind of element that your site needs.

The best part of it, is that you can reuse all the CSS and HTML in your actual site – no need to cut up the designs in Photoshop.

Try out the demo here (only supports WebKit based browsers, such as Chrome or Safari).

YMockup Features:

  • Customisable for any HTML/CSS
  • Edit elements in place
  • Drag and drop
  • Snap to grid dragging
  • z-index control
  • Move elements with the arrow keys (hold ctrl)

If you want to use your own themes/elements, clone the repository and follow the README – it’s designed to be used locally, so you can edit the HTML and CSS in your preferred editor.

As you can see, I’ve include the aristo theme – since I’m primarily using this to build Bowline applications.

Of course this won’t be everybody’s cup of tea, and does require a good knowledge of HTML/CSS. However, I believe it’s perfect for design minded hackers, like myself.

Screen shot 2010-03-26 at 11.37.12

Filed under: Socialmod

Bowline updates and more!

23
Mar
6

A lot of work has been going into Bowline recently. Here are the latest features:

  • New desktop app framework using wxWidgets, WebKit and Ruby 1.9.
  • Improved and faster binding API
  • New API for asynchronous Ruby/JS callbacks
  • Bundler support
  • Background updating
  • Loads of fixes and optimizations

There’s also a new JavaScript framework for Bowline which will be released soon. It’s designed to be fairly de-coupled from Bowline – so you can use it for web applications. The idea is that you can share a lot of code between your desktop apps and your web applications.

Additionally I’ve been working on a project for in-memory models called SuperModel.
SuperModel works particularly well inside Bowline apps. Here are the main features:

  • Serialisation
  • Validations
  • Callbacks
  • Observers
  • Dirty (Changes)
  • Ruby Marshaling to disk
  • Redis support

I’ve also re-written SuperModel in JavaScript – it’ll be integral to the next Bowline release.

Syncro is another recent project – it’s like Juggernaut on steroids! Syncro let’s you easily synchronise Ruby classes and state between remote clients. It’s also has some fancy features like offline support. You can now make Bowline apps, that function fully offline, and then can synchronize up to your servers (and any other clients) when they come back online.

All that work has made Taskforce possible. Taskforce is a collaborative work manager. Think of it as a cross between Things.app and Google Wave. Here’s a recent screenshot of Taskforce working on top of Bowline on OSX.

If you’re interested, sign up.
Taskforce

Filed under: Socialmod

Sending or receiving email with Rails? Easy

22
Mar
51

Sending emails from Rails can be a pain, receiving them even more so. You have to set up queues, pollers, smtp servers etc – it’s a hassle.

There is another way though. Remail is a project I’ve just released that brings REST to email.

Remail proxies emails through Google App Engine:

  • To send an email – just send a POST request to your Remail Google App Engine.
  • To receive an email – Remail will send a POST request to a callback URL.

It’s that simple. App Engine gives you 2000 free emails a day, and if you need more – the prices are very reasonable.
It’s worth mentioning, that at the moment, Remail only works with Rails 3.

Step 1 – App Engine

So, firstly create a App Engine project:

App Engine

Next, install the Python developer SDK.

Clone the remail-engine git repository:

git clone git://github.com/maccman/remail-engine.git

Configure the remail-engine application.yaml file, by adding the name of your App Engine project (the yaml key is called application).
Then, you’ll need to configure the settings.yaml file. Specify the public url of your site as outbound_url, and a random string as api_key (you can generate one using uuidgen).

Add the remail-engine to the App Engine SDK and deploy.

Screen shot 2010-03-22 at 20.00.05

Step 2 – ActionMailer

Install the remail gem:

sudo gem install remail

Add add it to your Gemfile:

gem "remail"

Now configure Remail, either in application.rb, or in the environment files:

  config.action_mailer.delivery_method = :remail
  config.action_mailer.remail_settings = {
    :app_id  => "remit-yourappname",
    :api_key => "changeme"
  }

Right, so now we can send email. How about receiving them? We need to specify a callback controller like this:

class EmailsController < ApplicationController
  skip_before_filter :verify_authenticity_token

  def create
    if request.headers["Authorization"] != "yourapikey"
      return head(:unauthorized)
    end
    UserMailer.receive(params[:email][:raw])
    head :ok
  end
end

Remail will send a POST request to that controller when it receives any emails.
If your Rails app isn’t available – Remail will try again and again – backing off as time goes by.

Right, so those are the two steps to using Remail in your application. You can now generate mailers as usual – everything should just work.

There’s a good Railscast on using ActionMailer with Rails 3, and a good Rails Guide on the subject.

Filed under: Socialmod

The problem with Amazon’s Load Balancing

15
Feb
0

A year later, Amazon still haven’t fixed a fundamental problem with their load balancing product (Amazon ELB).

Amazon don’t provider customers with a fixed IP for a ELB, only a CNAME.
Since a CNAME can’t be the root of your domain (it must be an A record) – you can’t fully balance traffic to your domain.

At the moment, customers have to forward all traffic to a CNAME, from http://example.com to http://www.example.com, to load balance their domains. This introduces a single point of failure. If the server you allocate to serve traffic from the root of your domain goes down, nobody gets forwarded.

In addition, this root server isn’t load balanced, so it receives all the initial traffic to your site. This defeats ELB’s purpose somewhat.

There’s a post that’s been on Amazon’s ELB forums for about a year – with about 60 replies, this clearly is a popular ‘feature’ (or I would argue requirement). It’s a deal breaker for some.

Amazon’s response is this:

Thanks for all the feedback. We understand your concerns and supporting this feature is on our roadmap. Unfortunately, we do not have a specific timeline for its availability.

As one commentator puts it:

Serving HTTP traffic off your root domain out of your core stack is really a basic thing that any load balancing solution needs to support.

Amazon, when do you expect to launch this feature?

Filed under: AWS

P2P using TCP & Ruby

31
Aug
14

This is going to be a fairly technical post about the technologies behind Machsend and using P2P over TCP rather than UDP. I’v written a lot of context to the problem, so if you want to skip to the juicy protocol details look for the set of bullet points.

We recently launched Machsend, which enables people to send unlimited amounts of data from inside the browser. You literally drag a file onto the site, send the recipient a link, and they can download it straight away. Machsend uses TCP P2P connections to transfer data between clients.

Filed under: Machsend

Bowline Roadmap – Call for contributors

30
Aug
3

I’ve been fairly overwhelmed in the amount of coverage my last post on Bowline got, more than 10,000 hits and in the top 50 Delicious links for the day – it’s great to see the Ruby community’s support for building desktop applications. This post is just to put out a brief roadmap and show any potential contributers how to get involved.

Currently I’m working on getting Ruby Threads working, Bowline would be a bit useless if it locked up every time you called out to Ruby. This involves upgrading upgrading Titanium’s Ruby version to 1.9, and using a rather obscure API for blocking the threads when Titanium calls Ruby (since Ruby isn’t thread safe). You can find the ticket here – if you’ve any experience with C++ please feel free to weigh in and help. This is the one major bottleneck to Bowline development – once it’s resolved we can get on with more interesting things.

I’m also working on closing the tickets – most of them to do with Windows support. At the moment I don’t have a Windows environment, just Linux and OSX – so more testers are welcomed.

I’ll be writing more documentation, tutorials, and a website. You can also expect a “twitter client in 5 minutes” screencast.

I’ve started up a Google Group for Bowline development here. This is one of the best times to contribute since the project is fairly young and can accommodate API changes without  any issues.

Filed under: Bowline

Bowline – A Ruby GUI framework

4
Aug
61

Recently I’ve been working on a Ruby GUI framework called Bowline.

In a nutshell, Bowline lets you build cross platform desktop applications with Ruby, HTML and JavaScript. The idea is to make building desktop apps as simple (and fun) as building Rails websites.

Bowline is built on top of Titanium, a desktop SDK which essentially provides a Webkit window (and loads of useful APIs). The fact that Titanium uses Webkit (and a fairly edge version at that) means that you can take advantage of all those nice CSS3 and HTML5 features, and you can design for one browser.

On top of Titanium, Bowline provides:

  • A way of binding up Ruby and HTML
  • MVC development
  • Helpers, Models etc
  • Gem packaging
  • Generators, console & more

In a desktop app you don’t have the request/response cycle that web frameworks, like Rails, are built around. So, to replace that, Bowline has the idea of ‘Binders’ – Ruby classes that you can bind HTML to – so when the Ruby class changes, the HTML automatically updates.

Additionally I’ve ported the beautiful Aristo theme to CSS3, you can find it on Github here.

Using Titanium’s Developer tool, you can package your applications up for all three OSes, it’ll be sent up to the cloud and built.

Titanium

The rule is show, don’t tell – so here’s a basic Twitter client I’ve written with Bowline. Download the app (OSX only at the moment) here.

Twitter clients are truly the new ‘Hello World’.

Bowline Twitter

It’s early days for both Bowline and Titanium, but progress is quick and I hope we’ll have a fully fledged desktop framework soon.

Filed under: Bowline