Skip to content

Instantly share code, notes, and snippets.

James Moberg JamoCA

Block or report user

Report or block JamoCA

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
JamoCA / Cliboard_to_SQL_Column_as_Tablename.ahk
Last active Aug 22, 2019
AutoHotKey script to prepends a prompted tablename variable to a list of SQL field names or variables from the clipboard.
View Cliboard_to_SQL_Column_as_Tablename.ahk
; 20190822
; CTRL+Q prepends a tablename to list of SQL field names or variables from the clipboard.
; (Copy the column names from a query and this script will remove extra spaces and prepend user-defined tablename to each column.)
InputBox, UserInput, Prepend Scope To List, Enter variable scope., ,300 ,125 , , , ,2147483, a
if ErrorLevel
AutoTrim, on
string = %clipboard%
JamoCA / Clipboard_to_SQL_List.ahk
Last active Aug 22, 2019
AutoHotKey script to convert a column of clipboard data (copied from Excel, Word, Outlook, text file, etc) to a SQL list for use in a IN() query.
View Clipboard_to_SQL_List.ahk
; 20190822
^+l:: ;CTRL+Shift+L Takes clipboard and converts tab-delimited data to SQL-compatible comma-delimited row (adds single quotes if data consists of non-numeric values)
StringGetPos, pos, clipboard, ID`, ; remove "ID" if it is the first item in the list.
if pos = 0
StringRight, clipboard, clipboard, StrLen(clipboard)-3
testString = %clipboard%
testString := testString * 1
JamoCA / getPeerCertificates.cfm
Created Aug 17, 2019
Samples ColdFusion script to retrieve SSL certificate data to determine expiration date
View getPeerCertificates.cfm
<cfset HostToTest = "">
<cfset factory = CreateObject("java", "").getDefaultSSLSocketFactory()>
<cfset socket = factory.createSocket(HostToTest, JavaCast("int",443))>
<cfset socket.startHandshake()>
<cfset certs = socket.getSession().getPeerCertificates()>
<cfif IsArray(certs)>
<cfloop from="1" to="#ArrayLen(certs)#" index="i">
<cfset cert = certs[i]>
JamoCA /
Last active Aug 8, 2019
Spammy Feedback Form Abuse from IP Address
As of 8/7/2019, I have logged 791 spammy solicitations sent to to my clients feedback forms using
these domains originating from an (Ireland) using IP address
JamoCA / isValidIPAddress_UDF.cfm
Last active Aug 6, 2019
ColdFusion UDF to test string to determine if valid IP address or not.
View isValidIPAddress_UDF.cfm
<!--- 20190801
ColdFusion UDF to test string to determine if valid IP address or not. --->
function isValidIPAddress(inputString){
var response = false;
var IPAddressUtils = createObject("java","coldfusion.util.IPAddressUtils");
response = javacast("boolean", IPAddressUtils.validateIPAdress( javacast("string", arguments.inputString) ));
if (response and listfind(",", javacast("string", arguments.inputString))){
JamoCA / FutureDate.cfm
Last active Jul 22, 2019
During ColdFusion 2016 server-side date validation, invalidish futuristic years (ie, "star dates") were being identified as "valid dates".
View FutureDate.cfm
<!--- 2019-07-22
Blog Post
GitHub Gist
Try it at (or paste online at
Reported as "crash/data loss" CF2016 bug to Adobe (7/22/2019 3:15 PM Pacific)
JamoCA / Block-HTML5-Ping-Click-Tracking.cfm
Last active Jun 27, 2019
Blocking HTML5 Ping Requests using ColdFusion
View Block-HTML5-Ping-Click-Tracking.cfm
<!--- 20190627
Block/Track Ping HTTP Requests using ColdFusion
If you are not expecting or do not need to receive ping requests to your web server, block any
web requests that contain "Ping-To" and/or "Ping-From" HTTP headers on the edge devices (Firewall,
WAF, etc.). If you can't do that, you can still detect it in ColdFusion and abort prior to wasting
any resources processing the request further.
More info:
JamoCA / Operator_ShortCut_error.cfm
Last active Jun 18, 2019
ColdFusion Operator Shortcut to Return Remainder throws error (depending on spacing)
View Operator_ShortCut_error.cfm
ColdFusion Operator Shortcut to Return Remainder throws error (depending on character spacing)
5/22/2019: Not sure where this came from; dated ~2017. Operator shortcut throws error in ColdFusion 2016/2018, but not CF10/11.)
Unsure if actually reported to Adobe, but this is when I tweeted it:
6/18/2019: Appears to be fixed in CF2018??? CF2016 is not end-of-core or end-of-life. Hopefully it gets fixed too.
NOTE: If you manually add spaces around the "%" operator, the error is resolved.
JamoCA / Unicode_Email_URL.cfm
Last active Jun 18, 2019
Test to determine if unicode entered in either email or URL is "valid" when using ColdFusion.
View Unicode_Email_URL.cfm
<h1>ColdFusion Unicode Email/URL Validation Test</h1>
<p><b>Adobe Bug ID:</b> <a href="" rel="nofollow noopener noreferrer">CF-4204516</a><br>
<b>TryCF:</b> <a href="" rel="nofollow noopener noreferrer">Link</a><br>
<b>GIST:</b> <a href="" rel="nofollow noopener noreferrer">Link</a></p>
function testJavaURL(u){
var response = true;
var test = {};
var jURL = CreateObject("java", "");
JamoCA / normalizeUTF.cfc
Created Jun 14, 2019
ColdFusion script to normalize UTF characters by combining character sequences into a single character
View normalizeUTF.cfc
/* NFKC: UTF Compatibility Decomposition, followed by Canonical Composition */
/* Recommend using Junidecode */
function normalizeUTF(inputString){
var normalizer = createObject( "java", "java.text.Normalizer" );
var normalizerForm = createObject( "java", "java.text.Normalizer$Form" );
return normalizer.normalize( javaCast( "string", arguments.inputString ), normalizerForm.NFKC );
You can’t perform that action at this time.