Dr Dustin Joel Massingale
PMP, MBA-IT, Certified Web Developer

IT Library

As a developer, there are often codes worth re-using. This library may be used by anyone who needs it. To use, just copy the code snippets below, and paste into your project!

Template Engine

Want a simplified editor for making a website fast? Download Dustin's quick to use template engine from the repository here

An Open Source project using software licensed by Navicat

Template Engine Forum - Main

DustinM on Feb 10, 2015:

Please post any questions or bugs found here. They will be reviewed before being posted in this forum section

NukemBro on Feb 12, 2015:

I can't figure out how to make this work with the MySQL database on my site. When I installed wordpress it asked for a location. I'm my server contract says that I get MySQL for free and I don't want to pay for the built in database.

DustinM on Feb 12, 2015:

Thanks NukemBro, I don't have MySQL support right now, but I put in a request to get a tool that helps with that. For now, I'm using SQLite, and that runs for free. Your server does have to support a few drivers (like sqlite and PDO). Is it working now?

Javascript Functions

Get a URL Parameter

Some systems use URL parameters (especially those using for get mehtods). If availalble I use server side code to gather this, but this is a handy way of grabbing it using only JavaScript.

Taken from stackoverflow
function getParam(P_name) { return decodeURI( (RegExp(P_name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] ); }

Trim Strings

This handy set of functions allow removal of unneeded whitespace before or after a given string. This is something that I used a lot in SQL, but when I tried in JavaScript, many browsers didn't recognize the command. This one allows most browsers to trim strings.

Based on somacon.com
function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); } function ltrim(stringToTrim) { return stringToTrim.replace(/^\s+/,""); } function rtrim(stringToTrim) { return stringToTrim.replace(/\s+$/,""); }