Skip to content

Instantly share code, notes, and snippets.

View JamoCA's full-sized avatar

James Moberg JamoCA

View GitHub Profile
@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
@JamoCA
JamoCA / whitespace.cfc
Last active March 27, 2024 19:39
ColdFusion/CFML function that Identifies and performs trim functions on white space-related characters
component displayname="whitespace" output="false" hint="Identifies and performs trim functions on white space-related characters" {
/*
author: James Moberg <james@ssmedia.com>
date: 2019-01-07
Description: Removes all whitespace-related characters (ie, Zero-Width SPaces (ZWSPs)) from a string... not just characters below U+0020.
.NET Trim() really trims a string - also trimming non-breaking-spaces. This is not the case in Java.
http://www.henrikbrinch.dk/Blog/2013/02/28/java-net-string-gotchas-of-the-day/
https://stackoverflow.com/a/4731164/693068
https://stackoverflow.com/a/4307261/693068
@JamoCA
JamoCA / mousever-event-test.htm
Last active July 28, 2023 16:35
Mouseover event testing. Doesn't matter if using delegation or individual TR events, it misses some rows.
<!DOCTYPE html>
<html lang="en"><head>
<meta charset="utf-8">
<!--
Date: 2023-07-28
Twitter: https://twitter.com/gamesover/status/1684964842418176000
GIST: https://gist.github.com/JamoCA/2ceb233bd4219fae92a69c5bd2fc86f8
-->
<script>
function highlightRow(elem, color="pink"){
@JamoCA
JamoCA / createIsoString-udf.cfm
Last active July 28, 2023 17:10
createIsoString - ColdFusion/CFML UDF - Converts date object/string into a UTC, ISO8601, RFC 339, ATOM or W3C string to a timezone with offset and optional millisecond precision
/* createIsoString UDF by James Moberg / SunStar Media
2023-07-16
Gist: https://gist.github.com/JamoCA/3e825f773d3bbb45f5c36ee85793e10e
Blog: https://dev.to/gamesover/createisostring-a-coldfusion-user-defined-function-udf-to-replace-datetimeformatiso-2p15
Tweet: https://twitter.com/gamesover/status/1680711586946891776
*/
public string function createIsoString(string date="", string timezone="local", string truncatedTo="MILLIS", string format="utc", boolean throwOnError=true) output=false hint="Converts date object/string into a UTC, ISO8601, RFC 339, ATOM or W3C string to a timezone with offset and optional millisecond precision" {
if (!len(arguments.date) || arguments.date eq "now"){
arguments.date = now();
};
@JamoCA
JamoCA / QoQ_ColumnName_Spaces_Fail.cfm
Last active May 24, 2023 18:12
Short, Self Contained, Correct (Compilable), Example (SSCCE) of ColdFusion Bug CF-4212034 (cfml)
<!--- 2023-05-24
Short, Self Contained, Correct (Compilable), Example (SSCCE) of ColdFusion Bug CF-4212034
https://tracker.adobe.com/#/view/CF-4212034 (Please upvote)
GIST: https://gist.github.com/JamoCA/19dd449408fbec923f7c21a173a0f0dc
REQUIRES: spreadsheet-cfml https://github.com/cfsimplicity/spreadsheet-cfml
--->
<cfscript>
savecontent variable="csv" {
@JamoCA
JamoCA / getSecondsDiff.cfm
Last active May 15, 2023 15:48
getSecondsDiff UDF: Returns timestamps difference in "decimal seconds" to include millisecond accuracy; returns -1 if invalid times #coldfusion #cfml
<cfscript>
/* 2023-05-15 getSecondsDiff()
Gist: https://gist.github.com/JamoCA/74b16f3a1594b585df79ea2c5800ecba
*/
public numeric function getSecondsDiff(required t1, required t2, string decimalPrecision="3") hint="Returns timestamps difference in decimal seconds; returns -1 if invalid times" {
if (!isdate(arguments.t1) || !isdate(arguments.t2) || arguments.t2 lte arguments.t1) {
return javacast("int", -1);
}
// writeoutput("<div><b>#datetimeformat(arguments.t1, "HH:nn:ss.lll")# - #datetimeformat(arguments.t2, "HH:nn:ss.lll")#</b></div>");
local.d = dateformat(arguments.t1);