Category: Development

  • Resize to a Specific Element’s Dimensions

    Here’s a snippet to resize a background image to the dimensions of an element. In this case, #bkgImage. var resizeBkg = function() { var h = self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; var w = self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var e = document.getElementById(‘bkgImage’); if (w > h) { e.width = w; e.height = w; }…

  • Delete .SVN Directories

    Ever accidentally do an svn checkout instead of an export? Here’s a command-line snippet to take care of those hidden .SVN directories: rm -rf `find . -type d -name .svn` Warning: Take great care when using “rm -rf” always.

  • Detect Operating System with JavaScript

    Here’s a snippet of JS code that might come in handy if you, let’s say, would like to filter out what type of content to display depending on your website user’s OS. A real-life example would be having a download link show up to user’s who have a client that was only published on Windows.…

  • WordPresss Plugins Search

    Searching for WordPress Plugins seems to not be very helpful. The results that comes up on the page ain’t helping out. Although, there’s a “you may also try your search at Google” link below the results page—it should be easier to find the right ones. Hmmm… will see if I have time to create maybe…

  • jQuery onLoad for Body-tag