Avoiding “Method code too large” error with CFWheels and ColdRoute..

I recently hit a major snag with a 1,200 line config/routes.cfm with Lucee 4.5 throwing a nasty "Method code too large" exception..

After the wave of panic had subsided.. the fix was relatively simple. By the grace of Odin, coldroute’s drawRoutes() function can be called multiple times and results in the same routes structure as if it were called a single time.

I split my monstrous routes file into smaller includes located in a new config/routes directory, then simply included them in the main config/routes.cfm


  .get(to="admin.Foo##index", name="fooIndex", pattern="admin/foo")
  .post(to="admin.Foo##update", name="fooUpdate", pattern="admin/foo/update/[key]")


  .get(to="public.Pages##index", name="pagesIndex", pattern="/pages")
  .post(to="public.Pages##show", name="pagesShow", pattern="/pages/show/[key]")


  .get(to="users.Bar##index", name="barIndex", pattern="/bars")
  .get(to="users.Bar##new", name="barNew", pattern="/bars/new")

And simply include in the main routes  like so:


include "routes/admin.cfm";
include "routes/public.cfm";
include "routes/user.cfm";
// default routes

I hope this saves you that wave of panic..


Install Python 3.4, Django 1.7 on Ubuntu 14.04 in a venv Virtual Environment

Python’s venv module provides support for creating lightweight “virtual environments” with their own site directories, isolated from system site directories. Each virtual environment has its own Python binary (allowing creation of environments with various Python versions) and can have its own independent set of installed Python packages in its site directories. – python.org

It’s well worth the trouble of setting up your Django projects this way, as system updates (eg: a system Python upgrade) won’t break your “virtual” projects. The venv concept has a big advantage over a traditional virtual machine, as there are no extra resources required to run another operating system. Win!

Run the following commands at the terminal to install Python 3.4 in a “virtual environment” and install Django inside the venv.

Install python3 and curl

sudo apt-get install python3 curl -y

Go to your home directory

cd ~

Create a virtual environment called “myvenv”

pyvenv-3.4 ~/myvenv --without-pip

Activate your new virtual environment

source ~/myvenv/bin/activate

Go to your new virtual environment directory

cd ~/myvenv

Create a directory and extract the python setup tools into it

mkdir pypioffline
cd pypioffline
curl -O https://pypi.python.org/packages/source/s/setuptools/setuptools-6.1.tar.gz
tar xvzf setuptools-6.1.tar.gz

Run the setup tools

cd setuptools-6.1
python ez_setup.py

Install pip

easy_install pip

Install django

pip install django

Run the Django web server

python manage.py runserver

Now visit to (hopefully) see your “Welcome to Django” page!

Other handy commands you’ll use…

Deactivate your new virtual environment


Reactivate your new virtual environment

source ~/myvenv/bin/activate

Credits: Code Ghar

jQuack Coldfusion Component for jQuery

Update: JQuack is now a Coldfusion on Wheels plugin!

A CFC wrapper for including jQuery core files, plugins, UI components and themes. Explicitly including jQuery files is no big deal, but jQuack’s strength is being able to bundle a plugin’s core and any dependencies into a single function call with a single parameter (or no parameter at all!)

Is a dependency shared between plugins (e.g. bgiframe.js)? No problem, jQuack prevents files from being included more than once per request.

It makes application-wide or server-wide version changes simple.

Download it @ GitHub

Example Plugin Package Structure

<!--- Setup your plugin packages (structure of arrays) --->
<cfset pluginStruct = {} />
<cfset pluginStruct.foo = ["foo/foo.js","foo/foo.css"] />
<cfset pluginStruct.bar = ["bar/bar.css","bar/bar.js","bar/foobar.js","jquery.barfoo.js"] />
<cfset pluginStruct.CFJS = ["cfjs/jquery.cfjs.packed.js"] />

Example init params

<cfset initArgs = {} />
<!--- Name of the jQuery core file --->
<cfset initArgs.coreFileName = "jquery-6.6.6.min.js" />
<!--- URL Path to your javascript directory, defaults to /jquery/ --->
<cfset initArgs.rootPath = "/jquery/" />
<!--- Name of the jQuery UI bundle --->
<cfset initArgs.UIBundleName = "jquery-ui-1.0.0.custom" />
<!--- Name of the theme directory --->
<cfset initArgs.themeName = "sunny" />
<!--- 	URL Path to your plugins directory, defaults to /{rootPath}/plugins/ --->
<cfset initArgs.pluginPath = "/jquery/plugins/"	/>
A structure of arrays. Plugins will be reference by their structure key,
the array will contain URLs to the plugin files relative to the {pluginPath}
See Example pluginStruct above
<cfset initArgs.pluginStruct = pluginStruct />
<!--- Intialising jQuack --->
<cfset jQuack = CreateObject("component","{your_cfc_path}.jQuack").init(argumentCollection=initArgs) />

Example Function Calls

<!--- Calling jQuack in your views --->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

		<!--- a different core file --->

		<!--- from an external URL --->
		#jQuack.core(coreFileName="jquery.min.js", rootPath="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/")#

		<!--- a single plugin --->

		<!--- multiple plugins --->

		<!--- ALL plugins --->

		<!--- a plugin not defined in the pluginStruct --->

		<!--- a plugin from an external URL --->
		#jQuack.plugin(file="penelopepitstop.js", pluginPath="http://plugins.wackyraces.com/")#

		<!--- UI with a different theme --->

Example Directory Structure

Core File


UI & Themes