Skip to content

Instantly share code, notes, and snippets.

View JamoCA's full-sized avatar

James Moberg JamoCA

View GitHub Profile
@JamoCA
JamoCA / symbolsToASCII.cfm
Last active November 15, 2023 20:58
Coldfusion UDF to convert Unicode UTF-8 punctuation and symbols to ASCII7 punctuation for natural language processing (NLP).
<cfscript>
/* 20200604 Map Symbols & Punctuation to ASCII
Convert the Unicode punctuation and symbols to ASCII punctuation and symbols is imperative in Natural language processing (NLP) for preserving the original documents.
Based on mapping from Lexical Systems Group: https://lexsrv3.nlm.nih.gov/LexSysGroup/Projects/lvg/2013/docs/designDoc/UDF/unicode/NormOperations/mapSymbolToAscii.html
Blog: https://dev.to/gamesover/convert-symbols-punctuation-to-ascii-using-coldfusion-java-3l6a
TryCF: https://trycf.com/gist/6f35220d47caa7fdbf75eb884ff1cec7 */
string function symbolsToASCII(required string inputString){
var TempContent = javacast("string", arguments.inputString);
TempContent = TempContent.replaceAll("[\u00B4\u02B9\u02BC\u02C8\u0301\u2018\u2019\u201B\u2032\u2034\u2037]", chr(39)); /* apostrophe (') */
TempContent = TempContent.replaceAll("[\u00AB\u00BB\u02BA\u030B\u030E\u201C\u201D\u201E\u201F\u2033\u2036\u3003\u301D\u301E]", chr(34)); /* quotation mark (") */
@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 / generateEmailHashCode.cfm
Last active October 18, 2023 18:16
Sanitize email and generate a unique integer hash using java hashCode & ColdFusion/CFML.
<cfscript>
/* 2023-03-21 by James Moberg (SunStar Media)
Sanitize email and generate a unique integer hash using java hashCode & ColdFusion/CFML.
GIST: https://gist.github.com/JamoCA/b02a8e86f8f082b28ecb494d910e092d
BLOG: https://dev.to/gamesover/generate-sanitized-email-hash-as-integer-4n3e
TWEET: https://twitter.com/gamesover/status/1638213875853307904
*/
public numeric function generateEmailHashCode(required string email) hint="I sanitize email and generate a unique integer hash using java hashCode" {
local.d = javacast("string", listlast(trim(arguments.email), "@"));
local.u = javacast("string", trim(listfirst(trim(arguments.email), "@")));
@JamoCA
JamoCA / AutoHotKey_sample.ack
Created October 24, 2016 16:28
Sample AutoHotKey script with some shortcuts I use daily (and take for granted)
; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a
; semicolon, such as this one, are comments. They are not executed.
; This script has a special filename and path because it is automatically
; launched when you run the program directly. Also, any text file whose
; name ends in .ahk is associated with the program, which means that it
; can be launched simply by double-clicking it. You can have as many .ahk
; files as you want, located in any folder. You can also run more than
; one ahk file simultaneously and each will get its own tray icon.
@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 / JUnidecode-ColdFusion-Demo.cfm
Last active September 21, 2023 13:34
JUnidecode ColdFusion Demo - Convert Unicode strings to somewhat reasonable ASCII7-only strings then strip diacritics and convert strings.
<cfprocessingdirective pageEncoding="utf-8">
<cfsetting enablecfoutputonly="Yes">
<!---
BLOG: https://dev.to/gamesover/convert-unicode-strings-to-ascii-with-coldfusion-junidecode-lhf
--->
<cfscript>
function JUnidecode(inputString){
var JUnidecodeLib = "";
var response = "";
@JamoCA
JamoCA / ColumnToSQLList.ahk
Created July 26, 2013 15:30
AutoHotKey script to convert clipboard columnar data (from Excel or text file) to SQL-compatible comma-delimited list (adds single quotes if data consists of non-numeric values) (Windows+C)
#c:: ;Window+C Convert Columnar Data to SQL-Compatible List
StringReplace,clipboard,clipboard,`n,`,,All
StringReplace,clipboard,clipboard,`r,,All
StringGetPos, pos, clipboard, ID`, ; remove "ID" if first item in the list (Access).
if pos = 0
StringRight, clipboard, clipboard, StrLen(clipboard)-3
testString = %clipboard%
StringReplace,testString,testString,`,,,All
testString := testString * 1
if (testString is integer) {
@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 / 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"){