Skip to content

Instantly share code, notes, and snippets.

View boughtonp's full-sized avatar

Peter Boughton boughtonp

View GitHub Profile
<cfset qry=query(a:["susi's"])>
<cfset SampleText="Susi's">
<cfset i = 0/>
<cftry>
<cfset TestCase[++i].Label = "no attr,no func" />
<cfcomponent output="false">
<cffunction name="init">
<cfargument name="InputFile" type="String" />
<cfset Variables.SourceFile = Arguments.InputFile />
<cfset Variables.ContentXml = XmlParse( "zip://" & Variables.SourceFile & "!content.xml" ) />
<cfset Variables.MetaXml = XmlParse( "zip://" & Variables.SourceFile & "!meta.xml" ) />
variable [PLUS] doesn't exist
at railo.runtime.type.scope.UndefinedImpl.get(UndefinedImpl.java:256):256
at templates.error.error_cfm$cf.call(<webroot>\WEB-INF\railo\context\templates\error\error.cfm:15):15
at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:727):727
at railo.runtime.PageContextImpl.handlePageException(PageContextImpl.java:1789):1789
at railo.runtime.listener.ModernAppListener.onError(ModernAppListener.java:370):370
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1981):1981
at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:282):282
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820):820
<cfsilent>
<cfapplication name="Test_StringConcat" />
<cfif NOT StructKeyExists(application,'counter')>
<cfset application.counter = 0 />
<cfset application.m0_total = 0 />
<cfset application.m1_total = 0 />
<cfset application.m2_total = 0 />
<cfset application.m3_total = 0 />
</cfif>
<!---
WHAT IS THIS?
Railo support custom tags written as CFCs, providing more
flexibility than traditional CFM-based custom tag, and also
allowing a CFC to act as both a tag and an object.
ACF and OBD do not support CFC-based custom tags (yet?), so this
traditional custom tag will act as a proxy to a CFC of the same
name, calling appropriate functions to replicate the behaviour
@boughtonp
boughtonp / udf_getEveryDOW.cfm
Created July 24, 2011 23:02
modified version of getEveryDOW from http://cflib.org/udf/getEveryDOW to support a range of dates
function getEveryDOW( DowList , StartDate , EndDate )
{
var x = 0;
var ThisDow = 0;
var DayToAdd = 0;
var Result = ArrayNew(1);
var Day1 = Arguments.StartDate;
var InitialDow = InitialDow = DayOfWeek(Day1);
@boughtonp
boughtonp / getRequestTimeout.udf.cfm
Created January 24, 2012 01:23
Function to return request timeout for Railo.
<cffunction name="getRequestTimeout" output="false">
<cfadmin
type="web" password="yourwebadminpassword"
action="getApplicationSetting"
returnvariable="local.DefaultAppSettings"
/>
<cfif DefaultAppSettings.AllowURLRequestTimeout AND StructKeyExists(Url,'RequestTimeout')>
<cfreturn createTimespan( 0 , 0 , 0 , Url.RequestTimeout ) />
component
{
function init()
{
this.stuff = {'a a':'a','b b':'b','c c':'c'};
var keys = StructKeyList(this.stuff);
for (var i=1; i<=listLen(keys); i++)
{
@boughtonp
boughtonp / gist:6713441
Created September 26, 2013 12:26
Regex to find incorrectly var scoped rc variables in script-syntax CFCs
function\s+\w+\(event,rc,prc\)\s++([^v}]++|v(?!ar\s++rc)|(?<!\n\t)\})*var\s++rc
@boughtonp
boughtonp / gist:6731929
Created September 27, 2013 17:18
Regex to find all property types...
\b(orm|sql|)type\s*+=\s*+\S+(?<=<cfproperty\s[^>]{1,500}|\sproperty\s[^;]{1,500})