Skip to content

Instantly share code, notes, and snippets.

foo.cfc
-----------
component accessors = true {
// accessors = true // syntax error here (it should be above,as per now)
property string username setter = true required=true;
property string password setter = true required=true;
property string WSURL setter=true required=true;
}
test.cfm
<cfoutput>
#LSIsNumeric("-1,0","nl_NL")#<br>
#LSNumberFormat("-1,0",".00","nl_NL")#<br>
</cfoutput>
@adamcameron
adamcameron / loops.cfm
Created April 15, 2014 15:36
Suggestion for Den
<cfscript>
for (iLanguage = 1; iLanguage LTE arrayLen(variables.languageData); iLanguage++) {
thisLanguageData = {
strPageURL = variables.languageData[iLanguage].baseURL
& variables.languageData[iLanguage].resourceBundle.getResource('terms_url')
& "/",
strNativeLangName = variables.languageData[iLanguage].nativeName
};
arrayAppend(languageLinks,thisLanguageData);
}
<cfscript>
param name="URL.sourceFile";
param name="URL.destinationFile";
if (!fileExists(URL.sourceFile)){
throw(type="FileNotFoundException", message="Source file not found", detail="The source file - #URL.sourceFile# - was not found");
}
httpResponse = new Http(
URL = "http://javascript-minifier.com/raw",
method = "POST",
@adamcameron
adamcameron / cffunctions.js
Created April 28, 2014 07:31
This is the cffunctions.js file from ColdFusion 11 beta. I note that it's a copyrighted file; however I am not actually using it here in any way other than for easy reference, so consider this to be "reasonable use", and not violating any copyright.
//Copyright 2013 Adobe Systems Incorporated. All Rights Reserved.
function arrayAppend(arrayObj, value, merge)
{
_validateParameters(arrayAppend.arguments.length, 2, "arrayAppend");
if("undefined" == typeof merge)
var merge = false;
if(value instanceof Array && merge)
@adamcameron
adamcameron / TestReflectionPerformance.java
Last active August 29, 2015 14:01
For Gert to eyeball
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class TestReflectionPerformance {
public static void main(String[] args)
throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
{
String toSearch = args[0];
@adamcameron
adamcameron / test.cfm
Created May 22, 2014 18:08
Jason, test.cfm is the code, test.html is the resultant mark-up. Seems to work. Win 7 64-bit, CF11 express install
<!doctype html>
<html lang="en">
<head>
<!-- top of head -->
<meta charset="utf-8">
<title></title>
<!-- bottom of head -->
</head>
<body>
Stuff in body
@adamcameron
adamcameron / console.log
Created May 23, 2014 10:04
Railo console output
C:\Windows\system32>cd C:\apps\railo-express
C:\apps\railo-express>java -Djetty.port=8888 -DSTOP.PORT=8887 -DSTOP.KEY=railo -
Xms256M -Xmx1024M -javaagent:lib/ext/railo-inst.jar -jar start.jar
railo-server-root:C:\apps\railo-express\lib\ext\railo-server
===================================================================
SERVER CONTEXT
-------------------------------------------------------------------
- config:C:\apps\railo-express\lib\ext\railo-server\context
- loader-version:4.3
@adamcameron
adamcameron / urlDecodeIssue.cfm
Created June 2, 2014 11:39
Trying to work out what the problem Andreas is having
<cfset original = "test string with a trailing ##">
<cfset encoded = urlEncodedFormat(original)>
<cfset decoded = urlDecode(encoded)>
<cfdump var="#[original,encoded,decoded]#">
<!---
outputs:
array
1 test string with a trailing #
@adamcameron
adamcameron / useAllMemory.cfm
Created June 10, 2014 18:35
Demonstrating out of memory error
<cfscript>
cfflush(interval=16);
base = {};
iteration = 0;
while (true){
id = createUuid();
base[id] = repeatString(chr(randRange(97,122)), 1024*1024);
writeOutput("#++iteration# #id# added <br>");
}
</cfscript>