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> | |
// inside Application.cfc is service constructor | |
application.EnterpriseService = new path.to.EnterpriseService(); | |
// inside site code somewhere | |
application.EnterpriseService.call(api_id=#, custom_args={}); | |
// EnterpriseService.cfc | |
init() { | |
// some shared constants set here |
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> | |
// testxy gives expected results | |
testxy.actual_dimensions = "144xy210"; | |
testxy.actual_dimension_width = listFirst(testxy.actual_dimensions, "x", true); | |
testxy.actual_dimension_height = listLast(testxy.actual_dimensions, "x", true); | |
writedump(testxy); | |
// testxx does not give expected results | |
// expected testxx.actual_dimension_height to be x210 | |
testxx.actual_dimensions = "144xx210"; |
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
<cfquery name="qryTest" datasource="dsnCommon"> | |
SELECT 0 AS col1, 0 AS col2 | |
</cfquery> | |
<cfquery name="qqTest" dbtype="query"> | |
SELECT (col1 / col2) AS col3 | |
FROM qryTest | |
</cfquery> | |
<cfdump var="#qqTest#"> |
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
SELECT | |
GETDATE() AS this_date_time | |
, CONVERT(VARCHAR, GETDATE(), 101) AS this_date | |
, RIGHT(CONVERT(VARCHAR, GETDATE(), 100),7) AS this_time | |
, ( CONVERT(VARCHAR, GETDATE(), 101) + ' ' + RIGHT(CONVERT(VARCHAR, GETDATE(), 100),7) ) AS this_date_time |
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
<cfcomponent name="utilities" output="false" hint="I provide various utility functionality"> | |
<cffunction name="init" access="public" returntype="any" output="false" hint="Initializes the Service"> | |
<cfreturn this /> | |
</cffunction> | |
<cffunction name="isNullFormat" access="remote" returntype="any" output="false" hint="I return whether something is null"> | |
<cfargument name="input" type="any" required="true" /> | |
<cfset var inputdatatype = ""> | |
<cftry> |
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
DECLARE @AlphaNumChars varchar(50) | |
SET @AlphaNumChars = 'a,1,m,s' | |
SELECT * | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE CHARINDEX(LEFT(TABLE_NAME,1),@AlphaNumChars) > 0 |
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
DECLARE @InvalidList varchar(50) | |
DECLARE @ValidList varchar(50) | |
SET @InvalidList = 'Item1-Item2-Item3' | |
SET @ValidList = 'Item1 > Item2 > Item3' | |
SELECT | |
CASE | |
WHEN CHARINDEX('>',@InvalidList) = 0 THEN @InvalidList | |
ELSE LTRIM(RTRIM(REPLACE(SUBSTRING(@InvalidList,1,CHARINDEX('>',@InvalidList)),'>',''))) | |
END |
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
<html> | |
<head> | |
<title>Data Error Message Sandbox</title> | |
<script type="text/javascript"> | |
function checkForm() { | |
var myformelement = document.getElementById('myformelement'); | |
var usermessage = document.getElementById('usermessage'); | |
if (myformelement.value == "") { | |
try { | |
alert(myformelement.dataset.errorMessage); |
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> | |
arr1 = [1]; | |
arr2 = [2,3]; | |
arr1.append(arr2); | |
writedump(arr1); | |
arr3 = [1]; | |
arr4 = [2,3]; | |
arr3.addAll(arr4); | |
writedump(arr3); |
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.scope" default=""> | |
<cfhttp url="http://#cgi.http_host#/sandbox/receiver.cfm?scope=#url.scope#" method="post" resolveurl="no"> | |
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" /> | |
</cfhttp> | |
<cfdump var="#cfhttp#"> |
OlderNewer