Quick jQuery email address obfuscator

Here's a quick little jQuery script I created just now. Don't give your email address to spam bots! Instead, try this.


view plain print about
1<a href="/contact"><span class="no-script">Contact Us</span><span class="obfuscate">com/mydomain//me</span></a>
(Use your email address in the format above, where your original address is me@mydomain.com)


File Locator Lite

As part of his presentation " CF911: Solving Frequent CF Server Problems in New/Better Ways ", Charlie Arehart showed a series of examples, searching CF log files with impressive speeds. He mentioned the tool that was being used, File Locator Lite and gave it a great review. Anything that is two thumbs up with @carehart is generally worth checking out.

Today I got tired of Notepad++ text search, which is great but seems to just quit working at random times, and just didn't feel like using Eclipse. So I downloaded and fired up File Locator and bam! it is just what I needed. The link above has examples and screenshots so I won't bother here, but all the options I could think of are visible at first glance, and it does what it says... locates files, fast and light.

Dynamic Bootstrap Layout on any markup with make-column and make-row via LESS

If you've spent any time working with bootstrap templates, or the new Bootstrap grid system in BS3, you've probably seen markup with the col-x grid classes, for example a two column layout:

view plain print about
1<div class="container">
2<div class="row">
3<div id="primary" class="col-lg-9 col-md-9 col-sm-8 col-xs-12">
5<div id="sidebar" class="col-lg-3 col-md-3 col-sm-4 col-xs-12">

This will result in a two column layout on large screens, with the proportions shifting for "sm" or small screens, and stacked columns on "xs" or extra-small screens.

While amazingly simple to use once you get the hang of it, maintaining this code is messy and can be both a visual and mathematical challenge when working in a multi-column layout.


Reviving an old BlogCFC blog

If you've been blogging for any length of time in the ColdFusion / CFML community, you're familiar with and probably using BlogCFC, as is this old blog. I've been intending to be more active blogging for a while now, and the recent CF Summit has me all the more eager to get back to writing in this space. 

Lately I've been working a lot with Bootstrap and jQuery, so I decided to give my blog a new skin.


Adobe ColdFusion Summit 2013 #CFsummit2013

Prompted by Ray Camden's post on this week's CF Summit in Las Vegas, I want to CFdump a few thoughts while the mental ink is still wet. There will no doubt be recaps of sessions, slide decks posted, and other technical follow-up (search twitter for #CFsummit2013 to find all sorts of useful links and posts). What I'm left with on the day after, more than anything, is the experience.


Access Restricted message in Mura: a workaround

When creating custom display objects using ajax, the response from any file inside of the site /includes directory will be a simple message, "Access Restricted". This is by design, but it is easy to get around.

The message comes from Mura's default Application.cfc file, which is inside the /includes directory, and contains only the message, and a tag. The purpose of this file is to keep any content stored inside the /includes directory from being delivered directly, i.e. if a user guessed the path to a display object, or some poorly-executed code was to somehow direct a user to a file in /includes.

But, since the Application.cfc has a cascading priority, you can simply place your own Application.cfc file inside the directory where your desired content is stored.


Tell Github to ignore folders with .gitignore

Use simple rules in your Github project's .gitignore file to keep out the clutter!

view plain print about
5## ignore directory where name matches string
8## ignore specific folder by name
11## ignore folder capitalized or not
14## ignore backup directories (root.bak, etc)

More at https://help.github.com/articles/ignoring-files

Log as user out of Mura with a URL (custom logout link)

Easy: ?doaction=logout


view plain print about
1<a href="http://www.mydomaincom/any-page-name/?doaction=logout">Log Out</a>

or for example to redirect to the home page, logged out

view plain print about
1<cflocation url="/?doaction=logout" addtoken="false">

Log in a Mura user programmatically with loginByUserID()

I'm writing a routine that creates some content in a front end form and attaches it to a Mura user. At that point I need to log in the user automatically, just as if they had used the site's log in form.

I spent a while looking for this. Here it is to save you (and me) time when you need it:

view plain print about
1<cfset userLogin = application.serviceFactory.getBean("userUtility").loginByUserID([USER ID HERE], [SITE ID HERE])>

Of course, the userID can be a literal string, or usually, a variable containing the user id (like $.getCurrentUser().getUserID() ). Same for the siteid.

To see the results (i.e. whether you're logged in or not, and some other related stuff), simply dump out 'session.mura' which contains a flag called isLoggedIn

view plain print about
1<cfdump var=#session.mura#>

Note: I also found a loginByUserID function in the loginManager, but it is not the right one to be using inline in your code. It takes a struct of values from the userbean, and triggers the redirection to a login screen as used when logging into the admin. Use the userUtility function above instead.

Add content to a category in Mura content bean, and how to see other methods

A quick 'n easy one that took me a while to find...

When managing Mura content via the content bean, it is really easy to add your content to a Mura category.


Mura Extended Attributes not being saved, a headsmack! solution

I'm working on a system for a Mura site to allow creation and updating of existing Mura content items from front end forms. As much as possible I am attempting to mimic the Mura admin functionality, creating forms via XML much like the way class extensions and extended attributes can be configured in an XML file for the admin. Neat stuff, with lots of trial and error as I make my way through.

I've had a lot of victories as I battle on, but just spent way too long on something way too simple, so I'm repeating here for anyone else who may come this way. In the part of this little system that saves the form submission and updates the actual content, we use the mura contentBean to assemble our values and then write the whole thing into the database with "save()". So simple!


...Show Newer