Archive for the ‘Software’ Category

Readability

Sunday, October 9th, 2011

So I realize that I am a hypocrite. I love to preach the wonder of black text on a white background! Yet for the time my website has been with this new design, the text has been cyan on a transparent blue with a dark background. Yes, it looks kinda cool (I think so, anyway), but I realize that not everyone might be able to read it.

I was ironing my shirts (yes, domesticated programmer is domesticated) and it hit me: I’m a damn programmer with tons of experience in Javascript and CSS. I should solve this problem! It’s what I do!

So, a little CSS, a little Javascript and here you have it: E-Ink Mode

At the top of the website there is now a little button that turns the content portion of the site into (tada!) black text on a white opaque background with sans serif fonts for easy reading!

I’m too lazy to have it persist across pages, but it’s just a click to turn it on and a click to turn it off so it’s not something difficult. Plus, not enough people read this thing for it to be a problem. :P

Enjoy.

Superfish Menu Fix for Joomla 1.5

Friday, July 2nd, 2010

So after moving some menu items around on a website, a client calls up noting issues with the ordering of items in the menu. This site is not using the usual mainmenu module from Joomla, but another module called “Superfish Dropdown Menus“. Apparently this is a pretty common issue and only affects people that have moved or removed anything in their menu. So, after much head scratching and trying things out, I finally came up with a fix for the menu ordering issue:

First, add the following functions to the “superfish_modMainMenuHelper” class in the “helper.php” file:

function sortParent($x, $y){
  if($x->parent==$y->parent){
    return 0;
  }else if($x->parent < $y->parent){
    return -1;
  }else{
    return 1;
  }
}

function sortByOrdering($x, $y){
  if($x->ordering==$y->ordering){
     if($x->parent==$y->parent){
        return 0;
     }else if($x->parent < $y->parent){
       return -1;
     }else{
       return 1;
     }
   }else if($x->ordering < $y->ordering){
      if($x->parent==$y->parent){
         return 0;
      }else if($x->parent < $y->parent){
         return -1;
      }else{
        return 1;
      }
   }else{
      return 1;
   }
}

Next, just above the line “$user =& JFactory::getUser();” in the buildXML function, insert the following lines of code:

usort($rows, array("superfish_modMainMenuHelper", "sortParent"));
usort($rows, array("superfish_modMainMenuHelper", "sortByOrdering"));

This will sort the items by what their parent is and then sorts by the ordering, taking into account the ordering of the parent items. After that, the buildXML function will take care of putting the menu together.

A really strange issue and really frustrating fix.

I also make no warranty on the above fixes. I’ll answer questions, but don’t expect me to repair your site for you (backups are your friend).

WP 3.0

Friday, June 18th, 2010

Well, WordPress 3.0 is out and I updated to it. Things seem to be working properly thus far. Finally got around to playing with the Widgets in the left  panel (since they seem to be working right now). So far so good.

I really need to post more.

Descending Explorer

Sunday, November 15th, 2009

Some time ago, I wrote a little PHP script for my home server so I could look at all the images in a folder in the server without having to click on file after file.

I wrote it mostly because my little brother would upload funny images that he found and then ask me if I had seen them yet. Being the lazy programmer I am, put together the following to show thumbnails of the images so I don’t have to click on every single images to find the ones he was talking about (since he could never rememer the file names).

An example can be seen here.

So decided to polish it a little and put it up for people to use. Have fun with it. :D

You can download a copy of  Descending Explorer v2.1.

ZipIt…ZipIt good

Saturday, October 3rd, 2009

Managed to jump on the bandwagon with the ZipIt hackers. Purchased a ZipIt Z2 from E-Bay and flashed it with a new linux kernel. Now I can boot the thing from a microSD [in a miniSD adapter] and run Debian! :D

In fact, I’m posting this from the device itself. WEP works ok…just have to get WPA working better and I’m set.

Thanks to HunterDavis.com for coverage of Z2 hacking and the ZipIt Forge for their work.

More info to follow!