Author Archives: Keith Norman

Apple’s Fade In Intro With CSS3 3

Note: This is webkit only. Here’s a demo of this effect. Here’s sliced out view of the layers we’re working with: So, we have a “highlighted” layer that sits on top – this is the Beatles photo in this instance. Under that is an overlay div with width and height of 100%, and then below [...]

Porting Lowpro to jQuery, Now With More Awesome 0

I’ve been porting a major Rails application (Groupon) from prototype to jQuery lately. The approach I ended up taking was to write some jQuery extensions that would allow all of our existing code to run on top of jQuery with no changes. So, here is a completely Prototype syntax compatible version of Lowpro. However, this [...]

RailsConf Day 2 0

Couldn’t keep up with writing these everyday, and attending all the conference festivities so here we are a solid week late just getting down to write the day 2 wrap-up. Oh well. This was the rainy day, to give context to those of you that were there. Now onward to the talks.. Ruby on Rails: [...]

RailsConf Day 1 4

I’m a bit delirious from late nights and early mornings and lots of code talk. We all went out to Pratt’s Ale House the night before and weren’t our usual chipper selves this morning. Nonetheless, this is the first official day of RailsConf so let’s do it. Note: I just want to get this stuff [...]

Exclude Pages by Slug in WordPress get_pages 1

The typical way to exclude pages when using get_pages is like this: get_pages(array(   "exclude" => "1,2,3" )); Passing in comma-separated list of page id’s that you wish to exclude is easy for a machine to handle, but makes no sense for people. Also, page ID’s can get changed when migrating the site from your [...]

Using named_scope with finder_sql 0

Named scopes and associations using finder_sql don’t mix. And there really is no solution to that problem. Rails has no way to inject conditions into raw SQL that may or may not follow Active Record conventions. But, the need may come up that you want to return a set of records from an association driven [...]

Useful Regular Expressions for Ruby 0

I intend to make this post a running tally of useful regex’s that I use, but for now I just have one. This will extract a URL form a string. I’m using it to tinyurl URL’s in a twitter post that are posted from the Firebelly CMS. /(http|https):\/\/([a-z0-9]+)[-.]?([a-z0-9]+).[a-z]{2,5}(([0-9]{1,5})?[\/\?][[\S]]?)?/ix

Installing ffmpeg on Ubuntu Hardy 2

For the most part I followed this guide, but I kept getting this error: ffmpeg: error while loading shared libraries: libavfilter.so.0: cannot open shared object file: No such file or directory Turns out that the answer was also in a comment on that blog post ldconfig Then test the install again with ffmpeg -v and [...]

Parse Query String Into Associative Array With JavaScript 2

So, there are lots of functions out there to do this, but this one is my favorite for a couple of reasons. It parses the entire query string as soon as you call the function, whereas other functions require passing in a parameter which the value for the parameter is then extracted from the query [...]

So You’ve Got A New Computer… 0

Here’s a quick checklist of the steps I just took to get all my web dev stuff set up on my new MacBook with Leopard. I do mostly Ruby on Rails work with some PHP stuff thrown in there, so we’ll go through installing MySQL, PHP, Rails, Git and Passenger.