Category Archives: Uncategorized

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 [...]