Skip to content

Instantly share code, notes, and snippets.

@mhenke
mhenke / HothReporter.cfc
Created February 17, 2011 02:40
hoth report interface - coldfusion
/**
Aaron Greenlee
http://aarongreenlee.com/
This work is licensed under a Creative Commons Attribution-Share-Alike 3.0
Unported License.
// Original Info -----------------------------------------------------------
Author : Aaron Greenlee
Created : 01/12/2011
@mhenke
mhenke / HothConfig.cfc_github
Created February 16, 2011 14:31
hoth config files from github and sample code
/**
Aaron Greenlee
http://aarongreenlee.com/
This work is licensed under a Creative Commons Attribution-Share-Alike 3.0
Unported License.
// Original Info -----------------------------------------------------------
Author : Aaron Greenlee
Created : 10/01/2010
@mhenke
mhenke / js_validation_not_working.html
Created February 10, 2011 02:28
validation for js not working
<html>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>ValidateThis! Demo Page</title>
<link href="/stylesheets/demostyle.css" media="all" rel="stylesheet" type="text/css" />
<link href="/stylesheets/uni-form-styles.css" media="all" rel="stylesheet" type="text/css" />
@mhenke
mhenke / captcha.cfm
Created December 27, 2010 21:11
captcha custom tag
<!---
This will create two variables for the page too be outputted:
OUTPUT:
CAPTCHA_DISPLAY - captcha fields/image
CAPTCHA_ERROR - error message of captcha failure
blnIsBot - is this a bot
http://www.bennadel.com/blog/873-Using-CAPTCHA-In-ColdFusion-8.htm
--->
<!--- place in /controllers folder--->
<cfcomponent extends="Controller">
<cffunction name="getdemo" returntype="Query" access="private" >
<cfset var entries = model("entry").findAll(select="BODY,CATEGORYID,TITLE,dateCreated") />
<cfreturn entries />
</cffunction>
<cffunction name="init">
<cfset filters(through="turnOffDebugging",only="processing")>
<!--- place in views/say folder --->
<cfoutput>
#javaScriptIncludeTag("jquery-1.4.2.min")#
</cfoutput>
<script language="JavaScript">
// Listen to the "click" event of the "alert-button" link and make an AJAX request
$(document).ready(function(){$("#alert-button").click(function() {
$.ajax({
type: "POST",
@mhenke
mhenke / run.cfm
Created September 26, 2010 18:43
<!---
Let's generate our default HTML documentation on Wheels:
--->
<cfscript>
version = "1.0.5";
wheels = createObject("component", "ColdDoc").init();
strategy = createObject("component", "colddoc.strategy.api.HTMLAPIStrategy").init(
expandPath("docs"),
"ColdFusion On Wheels #version#");
<!--- on initial request, run query --->
<cfset "session.#attributes.myactionfile#" = "" />
<cfsavecontent variable="datasorter_js">
<style type="text/css" title="currentStyle">
@import "css/datatables_table.css";
</style>
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
<cfcomponent extends="Controller" output="false">
<cffunction name="show">
<cfset student = model("Student").findByKey(key=1, include="Enrollments") />
<cfset course = model("Course").findByKey(key=2, include="Enrollments") />
</cffunction>
</cfcomponent >
<cfcomponent extends="Controller" output="false">
# ...
<cffunction name="show">
<!--- Find the record --->
<cfset entry = model("Entry").findByKey(params.key)>
# ...
</cffunction>
<cffunction name="edit">