Here, you'll find chunks of PHP, MySQL, HTML, JavaScript, and Ajax code that we've put together while working through various projects. Hopefully they'll help you out in your coding adventures too.
Evaluate Arithmetic Strings
Use PHP's eval function, with a little added security, to allow users to evaluate simple math equations through a form. Handy in the context of larger projects. » View Post
Linux Cheatsheet
A few handy references for common Linux command line commands, like how to add a user, restart Apache, etc. » View Post
Title Sort MySQL Results
Shows you how to sort MySQL results by title, ignoring indefinite and definite articles (a, an, the). » View Post
Resize an Image on the Fly with PHP
Easy PHP functions that let you resize images automatically using PHP. One keeps the same aspect ratio by cropping. Another function allows you to set a max width or height and shrink to fit. Or you can force to specific dimensions. » View Post
Form Helper Class
Helper for generating and processing HTML forms with PHP. Includes functions for easy creation of text input, dropdowns, radio buttons, checkboxes, hidden fields, date dropdowns, and more. » View Post
Get All Twitter Posts of a Specific Hashtag in PHP
A quick and easy PHP function that uses Twitter's Search API to return recent Tweets with a specific hashtag. » View Post
Different Types of Intelligence
A random question (what are the odds of getting a four of a kind dealt in a 6 card hand) led to a mini-exploration into the different kinds of logic that people use to solve problems. Includes code on how I figured out the answer. » View Post
Delete an Entire Google Apps Account Domain
This is a quick guide explaining how to cancel an entire free or premium Google Apps domain. It took me a while to figure out how to shut my testing one down, so I figured I'd share the knowledge. » View Post
Get Website Screenshots Using PHP
Tutorial and code showing how to use PHP's built-in imagegrabwindow function to take a screenshot of a website and then crop, resize, and save it as a JPEG image. » View Post
How to Forward Email on a Linux Server
A few tips on setting up email forwarding on your Linux (or UNIX) box. Includes instructions on how to forward to multiple email addresses from one account. » View Post
Calculate the Distance Between Two Points in PHP
A simple, easy-to-understand PHP function that calculates the distance between two sets of latitude and longitude coordinates in miles, km, feet, and meters. » View Post
How to Create a Symbolic Link in Windows Vista
Quick step-by-step instructions explaining how to create shortcuts to another directory in your file system using mklink when using Windows Vista. » View Post
Shortening URLs in PHP with the bit.ly API
A quick, easy-to-use PHP function that takes your long URL's and converts them into something short and ready to post on Twitter, etc. Just plug in your bit.ly username and API Key and you're ready to go. » View Post
Convert an Entire MySQL Table to UTF-8
A PHP function (with lots of comments) that converts a MySQL table and its data to UTF-8. It updates the collation of the table itself and of each text-based column. Additionally, it goes through each row and updates existing data automatically. » View Post
List of Latitudes and Longitudes for Every State
A list of the center latitude and longitude for all fifty of the United States (generated by taking the average latitude and longitude from each zip code within the state). In both HTML table and MySQL format. » View Post