Skip to content

Instantly share code, notes, and snippets.

View tomysaman's full-sized avatar

Tomy Saman (Wu) tomysaman

  • Flywire / StudyLink
  • Sydney, Australia
  • 02:32 (UTC +11:00)
View GitHub Profile
@tomysaman
tomysaman / structToTable.cfm
Created November 11, 2024 02:22 — forked from JamoCA/structToTable.cfm
ColdFusion UDF that accept a struct with simple key-value pairs to generate legacy-valid, email-friendly html table and text-only key-value output
<cfscript>
/**
* structToTable UDF
* @displayname structToTable
* @author James Moberg http://sunstarmedia.com, @sunstarmedia
* @version 1
* @lastUpdate 10/28/2024 15:58
* @gist https://gist.github.com/JamoCA/bc5c58e829e191947f2e34289fd98a5a
* @blog https://dev.to/gamesover/structtotable-generate-htmltext-output-for-displayemail-1mk4
* @twitter https://x.com/gamesover/status/1851046259387469955
@tomysaman
tomysaman / structToTable.cfm
Created November 11, 2024 02:22 — forked from JamoCA/structToTable.cfm
ColdFusion UDF that accept a struct with simple key-value pairs to generate legacy-valid, email-friendly html table and text-only key-value output
<cfscript>
/**
* structToTable UDF
* @displayname structToTable
* @author James Moberg http://sunstarmedia.com, @sunstarmedia
* @version 1
* @lastUpdate 10/28/2024 15:58
* @gist https://gist.github.com/JamoCA/bc5c58e829e191947f2e34289fd98a5a
* @blog https://dev.to/gamesover/structtotable-generate-htmltext-output-for-displayemail-1mk4
* @twitter https://x.com/gamesover/status/1851046259387469955
@tomysaman
tomysaman / whitespace.cfc
Created September 24, 2023 22:32 — forked from JamoCA/whitespace.cfc
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 <[email protected]>
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
@tomysaman
tomysaman / code-1.cfm
Created August 11, 2023 05:57 — forked from bennadel/code-1.cfm
Generating Random Passwords In ColdFusion Based On Sets Of Valid Characters
<!---
We have to start out be defining what the sets of valid
character data are. While this might not look elegant,
notice that it gives a LOT of power over what the sets
are without writing a whole lot of code or "condition"
statements.
--->
<!--- Set up available lower case values. --->
<cfset strLowerCaseAlpha = "abcdefghijklmnopqrstuvwxyz" />
@tomysaman
tomysaman / Amazon S3 Upload.cfm
Created April 6, 2022 09:27 — forked from atuttle/Amazon S3 Upload.cfm
Upload files to Amazon S3 with ColdFusion. This is heavily based on code from Joe Danziger's s3.cfc: http://amazons3.riaforge.org/
<cffunction name="uploadToAmazonS3">
<cfargument name="fileName" required="true" />
<cfargument name="contentType" required="true" />
<cfargument name="data" required="true" />
<cfargument name="acl" default="public-read" />
<cfargument name="storageClass" default="STANDARD" />
<cfargument name="HTTPtimeout" default="300" />
<cfargument name="bucket" default="#getProperty('EmailAttachmentS3Bucket')#" />
<cfargument name="accessKeyId" default="#getProperty('EmailAttachmentS3AccessKeyId')#" />
<cfargument name="secretKey" default="#getProperty('EmailAttachmentS3SecretKey')#" />
@tomysaman
tomysaman / docker-compose.yml
Created March 28, 2019 03:09 — forked from ju2wheels/docker-compose.yml
docker-compose reference YAML file with comments
# https://docs.docker.com/compose/yml/
# Each service defined in docker-compose.yml must specify exactly one of
# image or build. Other keys are optional, and are analogous to their
# docker run command-line counterparts.
#
# As with docker run, options specified in the Dockerfile (e.g., CMD,
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to
# specify them again in docker-compose.yml.
#
service_name:
@tomysaman
tomysaman / gist:4df2d5f89d57121c6c684dd6b1b40e39
Created March 12, 2019 02:52 — forked from jeaguilar/gist:83a3e784d4b02f390887
Mura Settings.ini.cfm documented and undocumented settings
@tomysaman
tomysaman / mura-form-builder-getdata.cfc
Created September 6, 2018 01:48 — forked from stevewithington/muraFormCustomObjectOptions.cfc
Mura CMS : Example of how to populate a Mura CMS Form Builder select menu, radio group, or checkbox options with data from a SQL recordset.
<cfscript>
component output=false {
// On the form, select 'Custom Object' then for the 'Source' enter the dotted notation path to wherever you placed this file.
// For example 'includes.myCustomValues' if your file was called 'myCustomValues.cfc' and placed under the 'includes' directory.
// Mura will automatically invoke the getData() method below
// See http://www.getmura.com/blog/populating-form-builder-dropdowns-via-remote-objects/ for more information
private any function getRS() {
// example recordset : this could come from your own db, of course
@tomysaman
tomysaman / mura-json-api.cfm
Created September 5, 2018 06:23 — forked from stevewithington/mura-json-api.cfm
Mura CMS: JSON API Tests & Examples
<!---
Author: Stephen J. Withington, Jr.
Notes: Place this under a temp directory within your Mura CMS root to test.
For example: http://yourdomain.com/temp/json-test.cfm
--->
<cfscript>
param name="form.endpoint" default="content/new";
param name="form.method" default="GET";
param name="form.context" default="";
param name='session.siteid' default='default';
@tomysaman
tomysaman / nginx.conf
Created March 20, 2018 02:38 — forked from davidpanzarella/ nginx.conf
Nginx Lucee Mura configuration
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log error;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}