Skip to content

Instantly share code, notes, and snippets.

View petrichor8's full-sized avatar

Dave Hunsberger petrichor8

  • Potomac Digitek
  • Maryland, USA
View GitHub Profile
@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
@bennadel
bennadel / Application.cfc
Created February 5, 2022 13:46
Normalizing 0xA0 (No-Break Space) And Other Special Characters Within ColdFusion Form Posts
component {
/**
* I get called once at the start of each incoming ColdFusion request.
*/
public void function onRequestStart() {
for ( var key in form ) {
if ( isSimpleValue( form[ key ] ) ) {
@kylemcdonald
kylemcdonald / Collect Parler Metadata.ipynb
Last active September 20, 2023 11:45
Collect video URLs and GPS data for Parler videos.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pauldenato
pauldenato / dsp_importContentCsv.cfm
Last active November 16, 2020 21:52
Load Mura Media Player Content via CSV
<!---
Modified from Steve Withington's Import users via CSV:
https://gist.github.com/stevewithington/5051646
--->
<cfscript>
param name='form.csvUrl' default='';
param name='form.isSubmitted' default='false';
param name='form.isTest' default='true';
param name='form.siteid' default='default';
@jsieber
jsieber / dsp_login.cfm
Created February 19, 2015 20:51
custom returnLoginCheck
<cfif variables.$.event('expired') eq true>
<div class="alert alert-error">#variables.$.rbKey('user.forgotexpired')#</div>
</cfif>
@bennadel
bennadel / code-1.cfm
Created March 24, 2014 23:20
Ask Ben: Converting A Query To A Struct
<cfset strCellValue = qData[ COLUMN_NAME ][ ROW_INDEX ] />
@stevewithington
stevewithington / muraMailingListManager.cfm
Created January 20, 2014 20:49
Mura CMS : This is a custom Mailing List Manager example. You could create a custom display object and simply include it on a page somewhere on your site. This example requires the user to log in to sign up.
<cfsilent>
<cfscript>
mailingListName = 'Your Mailing List Name Goes Here';
// MailingListBean : Loading by Mailing List Name
mlBean = $.getBean('mailinglistBean').loadBy(
name=mailingListName
, siteid=$.siteConfig('siteid')
);
mlid = mlBean.getMLID();
@stevewithington
stevewithington / muraCustomErrorFile.cfm
Last active January 19, 2024 08:52
Mura Error Handling: You could use any or even both of the attached methods to help with error handling in Mura CMS. This works better than the default "We're sorry, an error has occurred. Please try again later."
<!---
1) Drop this file under /config/ directory.
2) Add errortemplate=/muraWRM/config/customErrorFile.cfm to the settings.ini.cfm file.
3) Set debuggingenabled=false in the settings.ini.cfm file.
4) Reload Mura CMS
--->
<cftry>
<cfset msg = 'MURA ERROR - MESSAGE: #arguments.exception.Message# DETAIL: #arguments.exception.Detail# ' />
<cflog type="ERROR" file="MuraError" text="#msg#" />
<cfcatch></cfcatch>
@tiffon
tiffon / Find Results.hidden-tmLanguage
Created December 19, 2012 01:17
Tricked-out Find in Files... results
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Find Results</string>
<key>patterns</key>
<array>
<dict>
@stevewithington
stevewithington / dsp_custom_search.cfm
Last active March 19, 2021 16:25
Mura CMS: Custom Search Example
<cfoutput>
<div>
<form action="#$.content('url')#?keywords=#$.event('keywords')#">
<dl>
<dt>Keywords</dt>
<dd><input type="text" name="keywords" value="#HTMLEditFormat($.event('keywords'))#" /></dd>
<dd><input type="submit" value="Search" /></dd>
</dl>