Use Applescript to post to Pastie

March 7th, 2008

Using the same code as my last post I’ve been trying to create an Applescript I can use to post to pastie using TextExpander.

Trouble is, as I’m very short on time and not an Applescript developer I’ve not been able to find out how to post to Pastie and preserve line breaks so the formatting comes out incorrectly (often all on one line).

If anyone would care to glance over this script its in dire need of some proper encoding, and obviously something to grep out the actual pastie number and construct a URL to return from the script.

Check out some loose code I’ve been playing with over at Pastie


Use TextExpander to create a TinyUrl

March 7th, 2008

I’m a big TextExpander user, so much so that I always find myself typing strange key combinations to do things even when I’m not on my own machine. Whilst I do appreciate that unix has a perfectly good alias command that could be used instead, I like that my text shortcuts work even when I’m ssh’d into a remote machine (TextExpander is just watching your keyboard input and converting it as you type).

Recently I’ve found myself doing a lot of TinyUrl links (mainly because of Twitter) and decided to knock up an Applescript to instantly convert whatever is on my clipboard into a tiny url as I type.

Go and check out the code on pastie – once you’ve got this its just a case of creating a new Applescript snippet in TextExpander and pasting in this code.

Update: I got linked from the SmileOnMyMac Blog (developers of TextExpander) – thanks guys! Glad you like the tip :) They also have a pre-packaged version of my script ready to download straight into TextExpander so head over there to get hold of it.

Another Update: Looks like Jack-Daniyel Strong devised a much nicer version of my applescript that is faster, and has error checking. Nice work! I’m now using his script :)


A productive morning for Litmus

March 6th, 2008

This is a somewhat self-congratulatory post today, after a few weeks of hard slog and testing we finally put the Litmus 24 hour passes live!

We’ve received lots of requests from customers for a credits based system, but we felt this didn’t fit the model of how people would use Litmus. When fixing a template bug people want to fire off lots of tests as they iteratively work through a problem without fearing how much each test is costing them. So we decided that a pass to use Litmus for 24 hours for as many tests as you care to do works perfectly. From the response we are getting from customers we know this was the right thing to do. We even got a nod from John Gruber over on Daring Fireball

That’s not all though…

In light of the growing demand for Litmus and our booming API/Whitelabel deals the current database server was taking a beating. So at 7am this morning we managed to successfully move the database over to a much more powerful server with only 20 minutes of downtime. So far the load looks to have eased and we look forward to the increased response times for our customers.

If that wasn’t enough, Matt managed to launch IE 8 Beta testing which should be available to all our customers immediately!

So if you haven’t already, swing by and give us a try – there’s a 7 day trial included in the monthly plans, or the new 24 hour pass is only €12.


Ruby on Rails: Quick tip for Find :conditions

January 11th, 2008 I stumbled across a sneaky tip for conditions when using find. When you might normally be doing this:

1
2
Account.find(:all, :conditions => ['name LIKE ? AND updated_at < ?', 
"aname", 3.days.ago])
You can just do this instead:
1
2
Account.find(:all, :conditions => ['name LIKE :name AND updated_at < 
:date', {:name => "aname", :date => 3.days.ago}])

This isn't the best example of using this symbol placeholder method, but imagine using it in a situation where you're repeating the same search param a few times. I know I've had a few times that my conditions has been something like
1
2
['created_at > ? AND updated_at < ? 
AND invoiced_at > ?'], Time.now, Time.now, Time.now].
Using the hash at the end you could just pass this in as :time => Time.now and reuse :time in multiple places in your conditions hash. Neat.

Update: See ActiveRecord::Base on Noobkit for more info


Async Observer start/stop scripts

January 11th, 2008

Recently I’ve been adding some filters to Litmus which are firing off calls to remote services based on actions performed by our customers. Unfortunately this started to bring some “Timeout::Error” exceptions bubbling up when the remote services didn’t respond in time.

The functions these remote services provide are easily hidden if we get a failure when trying to contact them, the problem for us is that this meant a long wait time for customers whilst we tried to contact the service, followed by a 500 error once the connection had timed out.

I read about beanstalkd – its ability to asynchronously process jobs from a memcached like queue would be the perfect solution to the problem, allowing us to take a shot at reaching the remote services but not tying up mongrels and making our users wait.

Using it with Rails was easy using the async-observer plugin – I managed to get the whole thing up and running in around 30 minutes.

When it came to deploy I noticed that the async observers were in need of scripts to start and stop them so I hacked up a couple of scripts you can stick in your scripts directory and chmod +x ready to use in Capistrano.

I’ve literally just finished these scripts and they’ve had about 5 minutes of testing, so all comments/suggestions/corrections and even your own modifications posted elsewhere are welcome. Just drop any links/suggestions in the comments.

async-start-stop.zip

Update: I’ve just noticed that the “puts” returned by the async observer is causing Capistrano to hang during deployment. I’ll have to have a look at it when I get a chance. Any suggestions welcome. Ideally the scripts will still output some text to let you see something is happening during deployment…

Update: I’ve updated the script and it now works really well for us… get it here


Lighthouse: Basecamp for developers?

March 29th, 2007

I just received the launch announcement for Lighthouse hot off the press from the two guys that brought you Mephisto – the Rails blogging software I use to run this blog.

With an app authored by Rick Olson and Justin Palmer you expect something good and at first glance Lighthouse seems to deliver. Rick is a member of the Rails core team and a big contributor to the Rails plugin scene, his subversion repository alone leaves you in no doubt as to the strength of his Rails-Fu. Jason is a member of the Prototype core team and based on the visuals and javascript magic on the back-end of Mephisto I’d say he’s pretty good as well. So really, a pretty awesome partnership…

A first look picture.png

Recognise that screen cap? Looks a lot like Basecamp to me, but I think that’s ok… 37 Signals have really hit on a winning formula with their interface, it works well in Mephisto which as a similar layout and it works well here as well.

The ticket tab Picture2.png

Lighthouse allows you to manage what is going in within your projects, it tracks tickets and milestones much like industry staple Trac but does it with a lot more style, sophistication and importantly – simplicity. An interesting addition, also in the style of Basecamp, is the “Messages” tab which allows you to track messages and keep track of communications over time, something which is definitely important to any project and in the past was solved with a developers mailing list.

The messages tab Picture 1.png

It’s late and I don’t want to do this product an injustice so I’ll quickly skim over the other features of note… an api to allow external integration (examples are with subversion commit notices at the moment), ability to set projects as public, ability to create and respond to tickets via email as well as watching other tickets (and getting email notification of changes).

Prices seem pretty good as well – although the way features map to price points I’m not sure I’ve seen an ‘ideal’ plan for me. In terms of the number of projects you can manage the Bronze price plan is the best for me personally. However I don’t think the number of people per account reflects the number of people that may wish to report bugs. If every member of staff at one client company wanted a login to report bugs then that might use up my entire allowance, but at the same time what does it mean to make the project “public”. I might want people from that company to come and report bugs but I don’t want the whole world to see it – am I supposed to give that company one login to share?

Picture 2.png

I intend to give Lighthouse a good test out on a few project I’m working on at the moment so I’m sure I’ll have a few more points to add in the immediate future.

4 comments »

Rails Plugin - Shiny-render

December 21st, 2006

Dave of Shiny Development and Afeeda fame has released a new plugin for Rails called Shiny Render

It’s a simple patch but one I think would be quite suited for merging with simply_helpful

Basically it allows you to pass an HTML tag to wrap around any collections that are rendered in a partial and suppresses the tag if nothing is rendered.

The example Dave gave me was:

<%= render partial => "tag", :collection => current_user.tag_names, parent_tag => 'ul' %>

Very nice, visit the RubyForge project for Shiny-render to submit your patches and ideas to Dave


Rails Documentation Project

December 18th, 2006

What has happened to the attempts to fully document Rails? A while back, caboo.se launched a drive to raise money for paying authors to write up the largely undocumented and #nodoc Rails API but after collecting $16000 we still don’t seem to be getting anywhere.

I will put my hands up and admit that I have yet to contribute any money, but the reason I am posting about this now is because I do keep checking to see if anything is happening with the intent of throwing in $50 or so once the project gets moving – so far I’m not seeing this.

Considering that the original article says they are looking for $5000 to get the project started, then what’s the hold up?

What we really need in Rails is a solid documentation project aimed at developers working with the language everyday, which is fast to lookup, contains well researched examples of how to use the api and which offers the content in a variety of different formats (XML, RSS, HTML) for use in things such as dashboard widgets/custom browsers/textmate bundles.

So far all that seems to exist is a Stikipad Wiki for the project – come on guys, we need to keep up with the Django book project