Fix for uGallery
On a current project I’m working on, we’re using uGallery to implement an image carousel. Despite the JS code being a bit rough it’s very easy to integrate and the output is quite elegant. I like it a lot.
Unfortunately the current version of uGallery (1.1) has a minor bug. If you’re displaying fewer thumbnails whose width will exceed the interior of the thumbnail viewport, the horizontal scrolling goes wonky. This wee patch fixes that issue.
In uGallery.js wrap the margin calculation and style assignment in this conditional:
// Only bother to scroll the content if its area is greater than the viewport
if ( contentWidth > viewWidth ) {
var margin = -Math.round( ( e.clientX / viewWidth ) * movableWidth ) + 20;
thumbs.css( {"margin-left": margin+"px"} );
}
Handy DataMapper uninstall script
gem list '\A(?:(?:d[mo])[_-]|data_?(?:mapper|objects)|extlib)' --no-versions | xargs sudo gem uninstall -aIx
(Via Dan Kubb and gist: 31187.
TextMate, ImageMagick and “Command not found”
Two days ago I did a clean install of Snow Leopard, TextMate and all the associated goodies. All was going well until I tried running my spec’s that referenced Rmagick from within TextMate. They started returning the following error:
sh: convert: command not found
This was fixed by opening TextMate’s preferences, Advanced -> Shell Variables and adding a new variable:
Variable: PATH
Value: see below.
For the curious, my $PATH is currently:
/usr/local/bin:/usr/local/sbin:/usr/bin:/opt/local/bin:/usr/local/mysql/bin:/opt/local/sbin:/bin:/usr/sbin:/sbin:/usr/X11/bin