Archive for the ‘Uncategorized’ Category

Able Technology Sign

Wednesday, March 10th, 2010

Able Tech

Make your own sign here

Country and Currency Code Mappings

Monday, February 15th, 2010

I have had a to load a list of valid country and currency mappings for sharesight. It proved difficult to find a current correct list with the mapping between currency and country on the internet that is easily extractable.

wikipedia has a good source of current and obsolete codes – currency codes ISO 4217, country codes ISO 3166.

Here is what we came up with. If anyone knows of a reliable up to date source then please comment.

And to load into your rails app

Recession Busting Free Offer

Thursday, October 1st, 2009

special-offer
There’s a recession on at the moment, and we’re doing our bit to help ease the pain.

Able Technology is offering a free half-day session with one of our technical consultants. You can use us for any of our usual services during this time.

We have up to four slots available – one for each week in October. The weeks are:

  • 5 October – taken
  • 12 October – taken
  • 19 October
  • 26 October

To apply, speak to Nigel on 0800 14-ABLE (0800 142-253).

Small print

  • First-come, first-served
  • No strings attached
  • For new customers only
  • Not available to our competitors

Wanted: office space in Te Aro

Tuesday, March 3rd, 2009

We’re on the lookout for some office space in Te Aro. Somewhere between 75 and 125 square meters.

Our wish list includes:

  • Character
  • Earthquake safe
  • Showers
  • Cycle parking

Would appreciate a call if you’re aware of anything like this.

Sharesight article in the Herald

Saturday, May 24th, 2008

There was a great article in the Herald about Sharesight today. Shame it didn’t mention me or Marcus, but it did explain what we’ve been up to.

Check out Kiwi-made online share trading system hits the market.

2008 Budget Calculators

Thursday, May 22nd, 2008

We’ve just put together a calculator to work out your savings from Michael Cullen’s Budget 2008. It’s on the Sharesight website here:

http://www.sharesight.co.nz/tools/budget_2008_calculators/

Increment Ruby on Rails migration number

Thursday, May 1st, 2008

We recently needed to create a new database migration, and needed to insert it into at certain position. Normally what I have done in the past is to alter the migration index of an existing file or two.

But this time, it needed to go in at 003. I was going to have to manually increment about 30 or 40 migration scripts. So, it was time to apply my Ruby skills to do it automatically.

Here is the result:

So when you run it, you will get output such as:

Instructions

  1. Cut and paste the file, or download it from increment_migrations.rb.
  2. Save it somewhere
  3. Make it executable chmod 755 /path/to/increment_migrations.rb
  4. The change directory to ./db/migrations
  5. then run /path/to/increment_migrations.rb 3
  6. and if the output looks as expected
  7. finally run /path/to/increment_migrations.rb 3 RUN

Finally, thanks to the client for permission to publish. Thanks for giving back to the community!

Work-around for running Rails/Apache in a subdirectory

Friday, April 11th, 2008

I’ve just configured Rails to run in a subfolder on a client’s website. Ran into a few issues, that are worth documenting:

In this configuration, you can visit the Rails site by visiting something like http://www.hostname.com/coolsite/

1. There is a Rails bug (ticket 10913) that effects links to assets. I have a link to our combined stylesheets defined as:

The bug is that Rails looks for all of your stylesheets in /public/coolsite/stylesheets/*.css, where ‘coolsite’ is the name of your subdirectory. Obviously, it should not be including the ‘coolsite’ folder in the path.

The workaround I use, is to create a soft link after capistrano deploys the code to our production server. I added this to my /config/deploy.rb file.

Now, whenever you do a cap:deploy, a soft link will be created in your public software, and this will allow Rails to resolve the stylesheet (and other asses files) in the faulty path. When the ticket is fixed, just remove the capistrano task.

View YouTube videos in high def

Wednesday, March 26th, 2008

YouTube offer a higher definition version of their videos. It doesn’t seem to be available by default. You need to append this string to the end of your URL, and reload the page:

If you have Firefox, you can add this as a Bookmarklet. Then when you are viewing a video on the YouTuby website, click this bookmarklet, and the page will reload in HD.

Here is the bookmarklet

Right-click, and select “Bookmark this link”, or just drag it into your Bookmarks Toolbar.

View in HD

More details are available on the YouTube blog

spec’ing with BigDecimal

Wednesday, March 26th, 2008

If you are creating specs comparing BigDecimals to a hard coded float value, you may find that some comparisons just dont work even when the numbers are supposedly the same (see Floating point accuracy problems)

What we are testing is the value and the type, the correct way of achieving this may be…

If you want to round the big decimal to a float with 2 decimal places you could also use