Skip to content

Instantly share code, notes, and snippets.

View JamoCA's full-sized avatar

James Moberg JamoCA

View GitHub Profile
@JamoCA
JamoCA / ColdFusion-2025-bugs-fixed.md
Last active February 28, 2025 01:18
ColdFusion 2025 - Bugs Fixed
@JamoCA
JamoCA / commandbox.yaml
Last active February 26, 2025 17:32
CommandBox Yaml launch config file for Warp Terminal (Windows)
# Warp Launch Configuration for CommandBox (initial)
# 2/26/2025 09:29:57 This doesn't work. It launches CommandBox, displays the banner output and then exits.
# Need to set as a shell in Settings | Features | Sessions | Shell | custom... but this doesn't appear to be working at this time either.
# Box.exe can be run manually withing Warp and works as expected, but not sure how to configure as one of the primary shell options.
#
# Use this to start a certain configuration of windows, tabs, and panes.
# Open the launch configuration palette to access and open any launch configuration.
#
# This file defines your launch configuration.
# More on how to do so here:
@JamoCA
JamoCA / stringHashCode.cfm
Last active February 3, 2025 19:25
stringHashCode UDF: Returns a consistent string hashCode 32bit integer regardless of how Java may have hashCode() configured
<cfscript>
/* stringHashCode UDF: Returns a consistent string hashCode 32bit integer regardless of how Java may have hashCode() configured
2025-02-01
Author: James Moberg http://sunstarmedia.com @sunstarmedia
GIST: https://gist.github.com/JamoCA/111cb4ef9855c1bdbfc4a8409b1d8db9
Blog: https://dev.to/gamesover/java-hashcode-identity-crisis-307a
X/Twitter: https://x.com/gamesover/status/1886495587320901725
LinkedIn: https://www.linkedin.com/posts/jamesmoberg_coldfusion-activity-7292261743089590274-HTPA
*/
numeric function stringHashCode(inputString) hint="Returns a consistent 32bit integer regardless of how Java may have hashCode() configured" {
; AutoHotkey hotstring: auto-replace "hack" terms with friendlier random phrase
; 2025-01-23
; Author: James Moberg http://sunstarmedia.com @sunstarmedia
; GIST: https://gist.github.com/JamoCA/d5d7a1b6098f7582e2c22c4d357b3650
; TWEET: https://x.com/gamesover/status/1882495718809853997
; This hotstring will use a random phrase whenever a "poorly chosen hack-related word" is typed, followed by a space or punctuation; text case is not preserved. (2025-01-23)
::hack::
::bypass::
::glitch::
::trick::
@JamoCA
JamoCA / city-state-zip-mssql-cte-join-example.sql
Last active January 22, 2025 18:01
Cross-database query example to join data from a different MSSQL database containing ZIP data using a CTE
-- city-state-zip-mssql-cte-join-example.sql (Cross-database query example to join data from a different MSSQL database containing ZIP data using a CTE)
-- 2025-01-22
-- Author: James Moberg http://sunstarmedia.com @sunstarmedia
-- GIST: https://gist.github.com/JamoCA/f082d8ca1b42f4d5474edf5e367a4df1
-- TWEET: https://x.com/gamesover/status/1882125235996254489
-- Using MSSQL with "U.S. ZIP Code Database (5 Digit)" data from https://www.zip-codes.com/zip-code-database.asp
-- NOTE: Some ZIPs may be assigned to one-or-more cities. For this use, only the primary (P) city record is returned.
WITH ZipCTE AS (
SELECT ZipCode, CityAliasMixedCase AS City, State, TimeZone, TimeZoneOffset, DayLightSaving, Latitude, Longitude
@JamoCA
JamoCA / IMPLICITARRYSTRUCTVAR.cfm
Created January 6, 2025 23:58
Not sure if this works or not... testing.
<cfscript>
// https://www.bennadel.com/blog/4748-strange-implicitarrystructvar-behavior-in-coldfusion.htm
// 2025-01-06 This syntax appears to work.
arrayNew( 1 )
// Create a collection that is large(ish).
.resize( 1000 )
.set( 1, 1000, 1 )
// Iterate over the collection using PARALLEL THREADS.
.each(function(){
local.value = false
@JamoCA
JamoCA / makeLastModifiedDate.cfm
Created December 30, 2024 19:02
Generates an RFC9110 8.8.2 compliant Last-Modified date string for use in an HTTP header using ColdFusion / CFML.
<cfscript>
public string function makeLastModifiedDate(date date=now(), boolean isLocal=true) hint="Generates an RFC9110 8.8.2 compliant Last_Modified date string for use in an HTTP header" {
local.d = (arguments.isLocal) ? dateConvert('local2Utc',now()) : arguments.date;
return datetimeformat(local.d, "ddd, d mmm yyyy hh:nn:ss") & " GMT";
}
</cfscript>
@JamoCA
JamoCA / unicode-strings-for-unit-test.txt
Created December 18, 2024 22:55
Unicode strings for Junicode Unit Testing
𝐂𝐚𝐥𝐥𝐞 𝐁𝐥𝐚𝐧𝐜𝐨𝐬, 𝐂𝐨𝐬𝐭𝐚 𝐑𝐢𝐜𝐚
𝕮𝖆𝖑𝖑𝖊 𝕭𝖑𝖆𝖓𝖈𝖔𝖘
辻󠄁直𣘺
E�l�e�c�t�r�o�n�i�c
readme ∕ .txt
I like 🍕
cámara
caméra
愛忍和
1300395 陆小姐,你好!现在方便接电话吗
@JamoCA
JamoCA / sumologic-fastly-cdn-log.txt
Created December 13, 2024 17:34
Fastly configuration to collect CDN request logs for Sumo Logic (2021-12-13)
{
"service_id":"%{req.service_id}V",
"service_version":"%{fastly_info.version}V",
"time_start":"%{begin:%Y-%m-%dT%H:%M:%S%Z}t",
"time_end":"%{end:%Y-%m-%dT%H:%M:%S%Z}t",
"time_elapsed":%{time.elapsed.usec}V,
"client_ip":"%{req.http.Fastly-Client-IP}V",
"request":"%{req.request}V",
"protocol":"%{req.proto}V",
"host":"%{req.http.Fastly-Orig-Host}V",
@JamoCA
JamoCA / sumologic-fastly-waf-log.txt
Created December 13, 2024 16:52
Fastly configuration to collect WAF request logs for Sumo Logic (2021-12-13)
{
"service_id":"%{req.service_id}V",
"service_version":"%{fastly_info.version}V",
"time_start":"%{begin:%Y-%m-%dT%H:%M:%S%Z}t",
"time_end":"%{end:%Y-%m-%dT%H:%M:%S%Z}t",
"time_elapsed":%{time.elapsed.usec}V,
"client_ip":"%{req.http.Fastly-Client-IP}V",
"request":"%{req.request}V",
"protocol":"%{req.proto}V",
"host":"%{req.http.Fastly-Orig-Host}V",