Share
Scroll down

My Latest Articles

Step into the mind of a long-time developer, long-time server manager, and full-time geek 🙂

We recently found ourselves needing a new incremental file backup system... something we could use to remotely store, something fast, something secure, and ultimately something reliable. In steps Duplicity. Duplicity allows us to sync incremental file backups to our cloud storage flawlessly; it has helped reduce backup file size, allows us to encrypt the backups, and reduce the amount of bandwidth needed for transferring both backups and restores. Overall giving our developers a much needed break from their manual backups. The script in our repo contains an installer that will setup everything you will need on your servers for this, though please do note that the restore is incomplete. While we have verified manual account & app restores, we have not been able to perfect…

Read more
01

Need a good way to resize your uploaded image?   While keeping the height/width ratio? Why would you need to do this?  Well, like most of you, I did not need to keep full sized images that I upload on page, and needed a good way to create thumbnails, and resize the originals down to a more manageable, more web friendly size. This will do the trick...  no words of caution, no instructions, just code... use it how you like :) <?php function ResizeImage($inputFile, $filepath, $ext, $maxWidth, $maxHeight){ /* Get some details about the image */ $srcDetails = getimagesize($inputFile); switch ($srcDetails[2]) { case 1: //GIF $source_image = imagecreatefromgif($inputFile); break; case 2: //JPEG $source_image = imagecreatefromjpeg($inputFile); break; case 3: //PNG $source_image = imagecreatefrompng($inputFile); break; case 6: //WBMP…

Read more
02

I found myself needing a really simple way to pull in my sites menu, but also wanted the ability to have some placeholders for the links as well.  The following code should be created as a snippet, and called un-cached [[!YOUR_SNIPPET_NAME]] What's it do? Well, simply put it generates a navigation block, and throws all your ModX site page links into a hierarchal un-ordered list of link items.  As well, as generates a bunch of dynamic placeholders in case you have a need for them.  Note:  the snippet needs to be called, prior to placing any placeholders in your content. How Do I Use This? Create your template or page and place the following snippet call (make sure to replace YOUR_SNIPPET_NAME, with whatever you named…

Read more
03

UPDATE 2.0!!! Wow, just realized it's been awhile since i posted anything... well kiddies, time for some new code. Although I have grown up loveing, carressing, and mutilating Visual Basic, I have decided to take a stab at some C# since most of my projects lately have comes across in the form of PHP.  While I do love VB still, I am starting to fall hard for some C# sexyness (<- spelling). I have a VB version of what I am about to post as well, and though the language structure is different, there really aren't very many differences between the 2.  I thought I may get some sort of performance boost out of this "conversion" but alas, I was mistaken.  Both languages performed admirably…

Read more
04

This is a neat and tidy way to have multiple TLDs for one installation of MODx. Within MODx Go to System > Contexts and Create New for each domain. Name each one using camelCase (e.g. websiteOne) as you can't use spaces here. This name will be seen in the site tree within the Manager and you will also refer to it later on. Once finished refresh the manager and they will appear down the left. Right click each one and then Quick Create > Document Here to make a home page. Add a small piece of text on each of the pages so when you test you know it's reaching the right destination. Now add content settings by clicking on each heading and add the following: site_start –…

Read more
05