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
<!--- 20221028 Starting with CF2021, CFHTMLHead text is no longer added after a reset using CFContent. (Undocumented) | |
Tweet: https://twitter.com/gamesover/status/1586142456491298816 | |
Gist: https://gist.github.com/JamoCA/a56dfd74aa4ae9dad57747f516d6196a | |
---> | |
<cfhtmlhead text="<meta name=""info"" content=""I should be in the HEAD section."">"> | |
<cfcontent type="text/html; charset=UTF-8" reset="true"> | |
<p>View Source (Check for existence of metatag above this line.)</p> | |
<p>In Adobe ColdFusion 9-2018 & Lucee, the CFHTMLHead text is correctly added. CF2021 fails to add anything after cfcontent.</p> |
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="attributes.var1" default="value1"> | |
<cfparam name="attributes.var2" default="value2"> |
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
<!--- 2022-10-07 by James Moberg / SunStar Media | |
Requires ColdFusion 2016+ or Lucee CFML | |
GIST: https://gist.github.com/JamoCA/f2ae1a8140f857aa4fc264a5474b56ad | |
---> | |
<h2>Identify Scope Class Names using ColdFusion Safe Navigation Operator</h2> | |
<cfoutput> | |
application = #application?.getClass()?.getName()#<br> | |
form = #form?.getClass()?.getName()#<br> |
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
<!--- 2022-10-07 getScopedVariable UDF by James Moberg / SunStar Media | |
GIST: https://gist.github.com/JamoCA/7e544f1488a703d868cecc2b7ae5c2ed | |
BLOG: https://dev.to/gamesover/safely-fetching-scoped-variables-while-avoiding-scope-injection-2ee3 | |
TWEET: https://twitter.com/gamesover/status/1578522152600424449 | |
This getScopedVariable UDF tests to determine if a valid scope + variable exists w/o throwing an error. | |
If non-existent, a default value is returned. ---> | |
<cfscript> | |
// This is only test code. | |
// The reason for this is to 1) attempt to validate scoped variables when session, client or application variables aren't enabled |
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> | |
/* justNumericList - Filters a text string to return int/float numeric values w/optional min/max restrictions. | |
* 2022-10-06 | |
* GIST: https://gist.github.com/JamoCA/92ddc1d7cf04aa021321ba7e9185f16f | |
* Forked from https://cflib.org/udf/justNumericList by James Moberg / SunStar Media | |
* Refactor/modernized (CF2016+ or Lucee required); | |
* Parameters: | |
* @param nList List to filter. (Required) | |
* @param strDelim List delimiter. (default: ",") | |
* @param integersOnly Boolean to restrict returned list to only signed integers (default: false) |
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
<!--- areBracesValid ColdFusion/CFML UDF (2022-09-16) | |
Useful to determine if braces are correctly matched before processing. Helps reduce SQLi. | |
By James Moberg - SunStar Media https://www.sunstarmedia.com/ | |
Gist: https://gist.github.com/JamoCA/a35ffaabc00e0339a9996e27825159a7 | |
Blog: https://dev.to/gamesover/arebracesvalid-udf-for-coldfusioncfml-21fg | |
Tweet: https://twitter.com/gamesover/status/1570911352138641408 | |
20220918 Updated to use single refind/replaceAll expressions | |
20221108 Updated to use "while" instead of cfloop/condition (which isn't supported by Lucee in cfscript.) | |
---> | |
<cfscript> |
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
<!--- getIntsFromRangeString 2022-9-013 | |
getIntsFromRangeString UDF for ColdFusion / CFML | |
Parses integers using min/max rules to generate sorted array of INTs and visual display summarizing string. | |
By James Moberg / SunStar Media https://www.sunstarmedia.com/ | |
Blog: https://dev.to/gamesover/getintsfromrangestring-udf-for-coldfusion-n74 | |
Gist: https://gist.github.com/JamoCA/db753001d64a6fd4d46d2f591769c589 | |
Tweet: https://twitter.com/gamesover/status/1569843303084101633 | |
2022-09-15 Add support to parse "INT+" syntax. | |
2022-09-15 Add support for LT, LTE, GT and GTE syntax / Use byte temp value when generating struct of unique INTs | |
2022-09-15 Remove default minInt/maxInt arguments. (Assuming a default maximum of 2147483647 = extremely poor performance.) |
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
<!--- 20220718 CustomTag CFScript "Nuance" | |
Blog: https://dev.to/gamesover/customtag-cfscript-nuance-4nig | |
Tweet: https://twitter.com/gamesover/status/1549111965523386368 | |
---> | |
<p>This executes the custom tag only one (1) time.</p> | |
<cf_helloCount> | |
<P>When called from cfscript, this CFM-based custom tag is executed twice.</p> |
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> | |
/* 2016-02-16 Exiv2 (shared on 2022-07-06) | |
By James Moberg - SunStar Media | |
Requires command-line version of Exiv2 http://www.exiv2.org/ | |
All data returned in a struct. Based on different filetypes & available metadata, keys may not always exist. | |
Requirements: CF2016u3+ or Lucee 4.5+ | |
Blog: https://dev.to/gamesover/use-exiv2-to-extract-gps-data-from-images-using-cfml-3maa | |
Tweet: https://twitter.com/gamesover/status/1544747532881903616 | |
Forum: https://community.adobe.com/t5/coldfusion-discussions/using-imagegetexifmetadata-to-try-to-get-gps-coordinates-of-an-image/m-p/13053016 | |
*/ |
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
<cfsilent><!--- | |
CF_Timer: Like Adobe's built-in CFTimer, but without requiring admin IP rule and also including nanoTime. | |
Author: James Moberg | |
Date: 9/20/2013 | |
Shared: 7/3/2022 | |
Notes: Called like cftimer but without enabling debugging. (NOTE: "debug" mode not supported.) | |
Types: outline (default) | |
Credit: Initial "myTimer" CFTag by Chris Phillips ( http://www.cfchris.com/cfchris/index.cfm/2007/4/5/My-CFTIMER-Custom-Tag ) | |
Adobe CFTimer Docs: https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-t/cftimer.html | |
Blog Entry: https://dev.to/gamesover/cftimer-no-debugging-ip-address-required-introducing-nanotime-1k8h |