Skip to content

Instantly share code, notes, and snippets.

View JamoCA's full-sized avatar

James Moberg JamoCA

View GitHub Profile
@JamoCA
JamoCA / miller-tsv.cfm
Last active September 5, 2024 22:07
Transforming TSV data using ColdFusion & Miller (Commandline FTW!) #cfml
<!--- Transforming TSV data using ColdFusion & Miller (cfml) - 2024-09-05
Gist: https://gist.github.com/JamoCA/94f614fa1b2d881f26f26f9926a9b1fa
Blog: https://dev.to/gamesover/transforming-tsv-data-using-coldfusion-miller-command-line-ftw-3kd
Tweet: https://x.com/gamesover/status/1831816238089302139
Miller: https://github.com/johnkerl/miller
--->
<cfscript>
public void function fixTSVPostalCode(string filename, string fileDir) hint="I perform an inline update to a TSV file and set ZIP+4 to ZIP" {
local.dh = datetimeformat(now(),'yyyymmddHHnnsslll');
@JamoCA
JamoCA / language-detect-compare.cfm
Last active September 5, 2024 00:04
Comparing Language Detection Libraries (& API) Using Java/ColdFusion/CFML.
<!--- Language Detect Comparison 2024-09-04
Gist: https://gist.github.com/JamoCA/b883fbddf0303df8f4b0d597cfc2ae25
Blog: https://dev.to/gamesover/comparing-language-detection-libraries-api-using-javacoldfusioncfml-gkf
Tweet: https://x.com/gamesover/status/1831483382687265201
--->
<cfscript>
tests = [
["type": "English", "text": "A great way to learn Spanish vocabulary is by reading texts, stories or articles that are completely in the language. That is why we have written are own short reading passages in Spanish about different topics."]
,["type": "Greek", "text": "Βίβλος γενέσεως Ἰησοῦ Χριστοῦ υἱοῦ Δαυεὶδ υἱοῦ Ἀβραάμ."]
@JamoCA
JamoCA / convertExcelFile.cfm
Last active August 30, 2024 18:46
convertExcelFile: ColdFusion UDF to convert an Excel file (XLS/XLSX) to CSV/TSV/XML/JSON/SQL/HTML/MHT/DOC/PDF using TotalExcelConverter (command line)
<!---
2024-07-02 convertExcelFile: ColdFusion UDF to convert an Excel file (XLS/XLSX)
to CSV/TSV/XML/JSON/SQL/HTML/MHT/DOC/PDF using TotalExcelConverter (command line)
For use with Windows; Requires https://www.coolutils.com/CommandLine/TotalExcelConverter
Blog: https://dev.to/gamesover/importing-data-from-a-pre-95-excel-2-worksheet-xls-file-56md
Tweet: https://x.com/gamesover/status/1829591479100342454
--->
<cfscript>
public struct function convertExcelFile(
@JamoCA
JamoCA / TempCache.cfm
Last active August 3, 2024 12:36
ColdFusion UDF to temporarily cache data and return a UUID. Good for verifying form posts (ie, like CSRF) or building magic link passwordless logins for monolith web application.
<!--- tempCache UDF (2019-11-22) By SunStar Media
ColdFusion UDF to temporarily cache data and return a UUID. Used for verifying form posts (ie, like CSRF) or building magic
link passwordless logins for monolith web application.
GIST: https://gist.github.com/JamoCA/fd43c189379196b6a52884affea3ad51
Twitter/X: https://x.com/gamesover/status/1803866104491839620
Blog: https://dev.to/gamesover/tempcache-coldfusion-udf-32f9
--->
<cfscript>
public any function tempCache(
any inputObject,
@JamoCA
JamoCA / coldfusion-cfml-markdown-test.md
Last active June 3, 2024 18:26
ColdFusion / CFML / CFScript Code Block Syntax Markdown Test

ColdFusion / CFML / CFScript Code Block Syntax Markdown Test

GitHub uses Linguist to perform language detection and to select third-party grammars for syntax highlighting. You can find out which keywords are valid in the languages YAML file.

CFML tag syntax using cfm

```cfm
<!--- CFML goes here --->
```
@JamoCA
JamoCA / zip-codes.com-database-specifications.md
Created January 3, 2024 16:57
Zip-Codes.com Database Specifications (markdown format)

Zip-Codes.com Database Specifications

Our ZIP Code Database contains over 78,000 precise data records. You can download the database once per month (if needed) for a full year. We have made every effort to provide the most accurate and up to date information.

Field Name Data Type Description

# Field Name Data Type Description
01 ZipCode Char(5) 00000-99999 Five digit numeric ZIP Code of the area.
02 City VarChar(35) Name of the city as designated by the USPS.
@JamoCA
JamoCA / quoteFonts
Last active December 8, 2023 02:09
QuoteFonts UDF to use regex to add missing single quotes to font names
<!--- 20231207180156
James Moberg / SunStar Media
This is a ColdFusion UDF that uses regex to adds missing single quotes to font names. (CKEditor doesn't consistently quote inline CSS values.)
Fixes HTML generated with this CKEditor4 shortcoming: https://ckeditor.com/old/forums/CKEditor-3.x/Ckeditor-external-fonts-problem
--->
<cfsavecontent variable="test">
style="font-family:'Times New Roman'; Times New Roman"
style="font-family:Times New Roman"
style="font-family:'Times New Roman'; "
@JamoCA
JamoCA / apple-att-iphone-merge-call-not-working.md
Last active October 20, 2023 23:56
Apple iPhone Call Merge and Call Hold Features Are Disabled. AT&T

iPhone Call Merge and Call Hold Features Are Disabled

I encountered an odd issue while upgrading from an iPhone 12 to iPhone 15 Pro Max. I successfully transferred all data from my old iPhone 12 to the new iPhone 15 in order to set it up. I also fully wiped the iPhone 12 and traded it in to AT&T for the rebate. Both of this upgrade practices are fairly normal and is what I also did when I received the iPhone 12 year ago... however this time, "merge calls" and the ability to place a call on hold were both disabled in the user interface.

I found similar posts and they were either closed due to inactivity or had a simple cut-and-paste solution with no follow-up regarding whether or not the issue was fixed.

@JamoCA
JamoCA / gist:c7cdeaf9842c6233fe8e55b0c37642d5
Last active October 12, 2023 18:08
Basic ColdFusion example to post an audio file to Deepgram's "listen" API to transcribe audio files. #cfml
<!---
2023-10-12 Basic ColdFusion example to post an audio file to Deepgram's "listen" API to transcribe audio files
Gist: https://gist.github.com/JamoCA/c7cdeaf9842c6233fe8e55b0c37642d5
Adobe Community Post: https://community.adobe.com/t5/coldfusion-discussions/help-converting-curl-to-cfhttp/m-p/14152562
Deepgram documentation: https://developers.deepgram.com/docs/transcribing-pre-recorded-audio
My Twitter: https://twitter.com/gamesover
--->
<cfscript>
myApiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
@JamoCA
JamoCA / CheckSSLCertificate_udf_demo.cfm
Last active September 28, 2023 21:25
CheckSSLCertificate UDF - Using ColdFusion & CURL to connect to remote HOST to identify SSL data (start/end dates, subject, subjectAltName, issuer & status) #cfml
<!--- checkSSLCertificate UDF - I use ColdFusion & CURL to connect to remote HOST to identify SSL data (start/end dates, subject, subjectAltName, issuer & status) #cfml
GIST: https://gist.github.com/JamoCA/fa7449d1f1a8b920d901b9b14a773e96
BLOG: https://dev.to/gamesover/how-to-check-ssl-certificate-using-coldfusion-curlexe-2c92
TWITTER: https://twitter.com/gamesover/status/1707506769466216593
NOTE: This UDF requires CURL. https://curl.se/
--->
<cfscript>
struct function checkSSLCertificate(required string targetUrl, string userAgent="", string resolveIp="", string exePath="", boolean debug=false) output=false hint="I use CURL to connect to remote HOST to identify SSL data (start/end dates, subject, subjectAltName, issuer & status)" {
arguments.exePath = (len(arguments.exePath)) ? arguments.exePath : "C:\CURL\CURL.exe"; // set to default CURL exe path