✓ I'm available for hire! Check out my open source work on Github or drop me an email

Douglas F Shearer

Posts Tagged with rubygems

There are 3 matching posts.

Flic.kr - Flickr Short URLs Explained

Flic.kr links recently began appearing on Twitter and around the web, so I did a little bit of digging. Twitter has brought about a wild storm of URl shortening services, and some issues surrounding them. James Duncan Davidson has a good summing up of these, and some of the solutions.

One of these solutions is to use a link tag on a page to give an alternative short URL. Flickr has started to support this, as so…

On a photo page, say http://www.flickr.com/photos/douglasfshearer/3447346323/, we find in the source:

<link rev="canonical" type="text/html" href="http://flic.kr/p/6fCxXz" >

Twitter clients can now take a pasted Flickr link, and go look up this short url on the Flickr page, without making use of a third party service such as tr.im. Good stuff.

This also works for user accounts, as an example, mine would be http://flic.kr/douglasfshearer.

Tools

The short photo URL is the photo ID converted to Base58, so you need to turn one into the other.

The item that really brought this to my attention was Fraser Speirs Base58Encode Objective-C class, ideal for those of you making Twitter clients.

I’ve released a RubyGem for this, Base58, and a CLI script that takes a flickr URL and gives you the short version.

 
 

Leopard

I installed Leopard this morning before work. From a day’s work I can say it’s faster (better multi-core support) is general use. A bonus too is having most of the development tools I use day to day build in. No more struggling to get the Ruby version changed and Gems installed.

One issue though, ScreenCapture (Command + Shift + 3 | 4) won’t capture screnshots, and instead crashes.


Process:         screencapture [98636]
Path:            /usr/sbin/screencapture
Identifier:      screencapture
Version:         ??? (???)
Code Type:       X86 (Native)
Parent Process:  launchd [1]

Date/Time:       2007-10-29 20:26:40.211 +0000
OS Version:      Mac OS X 10.5 (9A581)
Report Version:  6

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread:  0

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString _getValue:forType:]: unrecognized selector sent to instance 0xa0752a70

*snip*

Why? I have no idea at the moment, but it does leave me without a feature I use several times a day.

A few sites mention this if you do a Google search, but none suggest a fix. I’ll post a fix here once I discover one.

Update. There is now a thread on the Apple Support Forums about this. It seems to be caused by importing a user and their files from a previous install. If you create a new user on the same machine, the problem does not exist.

The Fix. The thread I linked to above has the solution. Basically if you delete the file ~/Library/Preferences/.GlobalPreferences.plist, then log out and in, the problem should be resolved. Enjoy.

 
 

Ruby Gems Installation And Compilation On OpenSolaris

I’ve had a bit of trouble installing various Rubygems on my system, mostly Hpricot and Ferret which both require some code compilation. In an effort to save others the same trouble, I’ve compiled a list of tips here to make life easier…

  • Change your rbconfig.rb file in the RubyGems folder using the one created by Joyent’s Benr. This will help RubyGems find make, cc, gcc etc, which are not in their usual places in Solaris/OpenSolaris.
  • Install cc by getting the Sun Studio. You have to be registered, but if you downloaded OpenSolaris from Sun, you’ll already have an account.
  • Install gcc3. If you are using BlastWave to manage your packages simply run pkg-get install gcc3 to get it.

Hopefully this will help some of you out.

Other Great OpenSolaris/Solaris Tips

Fellow Edinburgh Rubyist Graeme Mathieson has put together some great posts on his experiences with Solaris on his new Sun Thumper. Very lucky man!