Sam Farmer head shot

Sam Farmer

Growing up I never imagined I would play bass guitar for the Dave Matthews Band. And indeed it never happened.

But I have become a passionate and pretty good web developer.


debugClean, fixed for most Windows installs

D'oh, I realized that debugClean had an issue with IIS and the different CGI variables it passes back.

Anyhoo, its now fixed and can be downloaded from the project home page.

What it does

Checks a file or folder for any debug code that should probably be stripped before moving to staging or production.

Looks for ColdFusion tags:
- cfdump
- writeDump
- cflog
- writeLog

Looks for JavaScript:
- console.log

The tags and functions it looks for can be configured to your taste in the _config.cfm file.

Update to debugClean and an interesting use of URL scope

Two updates to debugClean:

1. Bug fixed
For some users the same results would not refresh on subsequent uses of debugClean. This was caused by the underlying browser in Eclipse not refreshing. You may be shocked to hear that the browser causing this problem was Internet Explorer! At first I tried adding another variable to the url that is created when debugClean in fired up (its handlers/index.cfm if you want to see). However, this caused error after error and I eventually deduced that only one URL variable could be passed.

To solve this I created the name of the URL variable with createUUID() like so:

view plain print about
1work.cfm?#createUUID()#=#urlEncodedFormat( theXML.event.ide.projectview.resource.XmlAttributes['path'] )#

and in work.cfm have the following code to read in that variable:
view plain print about
1<cfloop collection="#url#" item="u">
2    <cfset path = url[ u ]>
3</cfloop>

2. Check for application/javascript
This one has caught me out a few times. will work in every browser except one. That missing browser? Internet Explorer! Though, by now, I should know better than to use application/javascript and instead to use text/javascript. Anyhoo the default configuration of debugClean will know check for application/javascript. This was as simple as adding it to the array in _config.cfm:

view plain print about
1request.lookFor = ["cfdump","writeDump","cflog","writeLog","console.log","application/javascript"];

Go to the main project page to download the latest version.

debugClean, a ColdFusion Builder Extension to Check for Debug Free Code

Recently I wrote some code that ran beautifully on my machine. So beautiful in fact that if it was a painting it would be the Mona Lisa. I pushed it to stage and no one could get it to run.

The reason?

I had left in a console.log and cfdump output to file. The staging environment didn't like this one bit and laughed at my suggestion of the code being like the Mona Lisa.

So, I wrote ColdFusion Builder extension to check for debug code and called it debugClean. Its now up and downloadable on RIAForge. Full description:

Checks a file or folder for any debug code that should probably be stripped before moving to staging or production.

Looks for ColdFusion tags: - cfdump - writeDump - cflog - writeLog

Looks for JavaScript: - console.log

The tags and functions it looks for can be configured to your taste in the _config.cfm file.



Go get it, install it and only push our production ready code!

BlogCFC was created by Raymond Camden. This blog is running version 5.9.7. Contact Blog Owner