tech tips, code snippets, etc.

Managing Privacy

This is a concise (though not exactly short) guide to managing your online privacy. Why should you be concerned? Really? Okay, there are lots of people who want to gain unauthorized access to your accounts, perhaps you are the rare breed of person who don't want everyone you went to high school to know how to find you and last but not least, companies are harvesting massive amounts of data Read More

Alternating Table Rows with PHP

Using PHP and CSS , it's very easy to create a report-style table with alternating colors on each row. This setup assumes a connection to a MySQL database (though any supported DBMS will work), and that you have already queried your database and are ready to work with the results in your php code. CSS .norm{ color:#fff; background-color:#000; } .alt{ color:#000; background-color:#fff; } PHP Code: That's all, not much to it really. Edit: It should be stated that this could be accomplished in Read More

Setting up a PHP Development Environment in Windows

Getting started developing can be very difficult, one of the most difficult things to do is to setup a quality development environment. This article aims to ease those frustrations by showing you what tools you will need and how to configure them to maximize your development time. Step 1: Download an *AMP binary Download WAMP. This binaries package for Windows contain Apache (web server), MySQL (database), PHP and Perl. WAMP also comes Read More

jQuery U.S. States Autocomplete

Yes, I looked too; but it's not out there. Here is a quick plugin I wrote utilizing the popular jQuery Autocomplete function found here Add it to your form element by using: <input type="text" id="state_search" /> <input type="hidden" name="state" /> ... <script type="text/javascript"> $('#state_search').states(); </script> Here is the list and the jQuery function: var state_autocomplete = [ {full:"Alabama",abbr:"AL"}, {full:"Alaska",abbr:"AK"}, {full:"Arizona",abbr:"AZ"}, {full:"Arkansas",abbr:"AR"}, {full:"California",abbr:"CA"}, {full:"Colorado",abbr:"CO"}, {full:"Connecticut",abbr:"CT"}, {full:"Delaware",abbr:"DE"}, {full:"District of Columbia",abbr:"DC"}, {full:"Florida",abbr:"FL"}, {full:"Georgia",abbr:"GA"}, {full:"Hawaii",abbr:"HI"}, {full:"Idaho",abbr:"ID"}, {full:"Illinois",abbr:"IL"}, {full:"Indiana",abbr:"IN"}, {full:"Iowa",abbr:"IA"}, {full:"Kansas",abbr:"KS"}, {full:"Kentucky",abbr:"KY"}, {full:"Louisiana",abbr:"LA"}, {full:"Maine",abbr:"ME"}, {full:"Maryland",abbr:"MD"}, {full:"Massachusetts",abbr:"MA"}, {full:"Michigan",abbr:"MI"}, {full:"Minnesota",abbr:"MN"}, {full:"Mississippi",abbr:"MS"}, {full:"Missouri",abbr:"MO"}, {full:"Montana",abbr:"MT"}, {full:"Nebraska",abbr:"NE"}, {full:"Nevada",abbr:"NV"}, {full:"New Hampshire",abbr:"NH"}, {full:"New Jersey",abbr:"NJ"}, {full:"New Mexico",abbr:"NM"}, {full:"New York",abbr:"NY"}, {full:"North Carolina",abbr:"NC"}, {full:"North Dakota",abbr:"ND"}, {full:"Ohio",abbr:"OH"}, {full:"Oklahoma",abbr:"OK"}, {full:"Oregon",abbr:"OR"}, {full:"Pennsylvania",abbr:"PA"}, {full:"Rhode island",abbr:"RI"}, {full:"South Carolina",abbr:"SC"}, {full:"South Dakota",abbr:"SD"}, {full:"Tennessee",abbr:"TN"}, {full:"Texas",abbr:"TX"}, {full:"Utah",abbr:"UT"}, {full:"Vermont",abbr:"VT"}, {full:"Virginia",abbr:"VA"}, {full:"Washington",abbr:"WA"}, {full:"West Virginia",abbr:"WV"}, {full:"Wisconsin",abbr:"WI"}, {full:"Wyoming",abbr:"WY"} ]; $.fn.states = function(){ this.autocomplete(state_autocomplete,{ Read More

Getting Started: How the Interwebs Work

There are a ton of places on the web to learn HTML, so I kind of wonder why I am writing this in the first place. I think that it was important in my quest to learn how to program that I was looking ahead at what I would be able to do, because the stuff I made at first was less than impressive. This is a guide to hopefully help Read More

jQuery Form Validation: theory and practice

jQuery makes it very easy to validate forms. There are a number of useful plugins, the most prominent being validate. If you are wanting something very lightweight or are just interested in how something like this works, read on. The $.each function allows you to iterate over collections in jQuery, it is really one of the most useful utility methods available. We can iterate over all input elements on a Read More

Better Google Searching

I wrote my first Greasemonkey script to allow you to navigate through many page search results using the left and right arrow keys (mainly because I like to use the mouse as little as possible). Install it here: Google Key

Zend Framework on Apache 1.3.x

If you are having problems with the .htaccess file for Zend Framework and getting 500 errors, and are running apache 1.3.x (like at GoDaddy), add a slash before index.php in the rewrite rule. Here is one of my htaccess files for reference <IfModule mod_expires.c> ExpiresActive On ExpiresByType text/html "access plus 1 seconds" ExpiresByType image/gif "access plus 2 years" ExpiresByType image/jpeg "access plus 2 years" ExpiresByType image/png "access plus 2 years" ExpiresByType text/css Read More