This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
void function test(string title, array values) { | |
writeOutput("<h3>#title#</h3>"); | |
for (var v in values) { | |
writeDump(var=v,expand=false); | |
try { | |
b = v ? true : false; | |
writeOutput ("#v# is true: #b#"); | |
} catch (any e) { | |
writeOutput ("#e.message# #e.detail#"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l.response.body.result = ArrayNew(1); | |
for(l.i=1;l.i lte l.events.recordcount;l.i = (l.i + 1)){ | |
arrayAppend(l.response.body["result"], { | |
"id" = l.events.id; | |
"start" = DateDiff("s","1/1/1970",l.events.startdate) * 1000; | |
"end" = DateDiff("s","1/1/1970",l.events.enddate) * 1000; | |
"title" = l.events.title; | |
"class" = "class"; | |
"url" = l.url; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Content before<br> | |
<cfset msg = "Content within"> | |
<cf_withoutput callback="#toUpper#"> | |
#msg#<br> | |
</cf_withoutput> | |
Content after<br> | |
<cfscript> | |
function toUpper(string){ | |
return ucase(string); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfhttp | |
method="get" | |
url="https://bugbase.adobe.com/index.cfm?event=qSearchBugs&page=1&pageSize=10&product=1149&version=7770&gridsortcolumn=AD_S_DEFECT_ID&gridsortdirection=DESC" | |
useragent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36" | |
> | |
<cfdump var="#cfhttp#"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
numbers = queryNew( | |
"id,en,ma", | |
"integer,varchar,varchar", | |
[ | |
[1, "one", "tahi"], | |
[2, "two", "rua"], | |
[3, "three", "toru"], | |
[4, "four", "wha"] | |
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset nullValue = null> | |
<cfoutput> | |
isSimpleValue(): #isSimpleValue(nullValue)#<br> | |
isObject(): #isObject(nullValue)#<br> | |
class: #nullValue.getClass().getName()#<br> | |
</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
public struct function defer(required function job, function onSuccess, function onFailure, function onError, function onTerminate){ | |
var deferThread = ""; | |
try { | |
cfthread.status = "Running"; | |
thread name="deferThread" action="run" attributecollection=arguments { | |
try { | |
successData.result = job(); | |
cfthread.status = "Completed"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f(){ | |
var foo = "bar"; | |
// 20-odd lines of code | |
for (){ | |
var variableOnlyUsedInLoop = "something"; | |
// etc | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// will result in floating point inaccuracy | |
all = precisionEvaluate((60 / 55) / (40 / 55)); | |
a = precisionEvaluate(60 / 55); | |
b = precisionEvaluate(40 / 55); | |
c = precisionEvaluate(a / b); | |
writeDump(var={ | |
all = all, | |
a = b, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfparam name="URL.required"> | |
Don't output this unless that required variable is set |