Skip to content

Instantly share code, notes, and snippets.

@jsteinshouer
jsteinshouer / download_csv.cfm
Last active April 22, 2016 18:04
CSV Download Example
<cfset csv = io.queryToCSV(query=qMyQuery,fields="field1,field2,field3,...")>
<cfheader name="Content-disposition" value="attachment;filename=MyCSVFile.csv">
<cfcontent type="text/csv">
<cfoutput>#csv#</cfoutput>
@jsteinshouer
jsteinshouer / contentRenderer.cfc
Created June 1, 2015 21:05
Mura method for getting a feed based on restrict groups
<cffunction name="getFeedByRestrictGroups" output="false">
<cfargument name="restrictGroups" required="true">
<cfargument name="maxItems" default="20">
<!--- Get the feed object by name --->
<cfset var feed = $.getBean("feed")>
<cfset var item = "">
<cfset feed
.setSortBy("OrderNo")
@jsteinshouer
jsteinshouer / rerelaceNoCaseExample.cfm
Created January 20, 2014 22:14
Coldfusion rereplace example to remove iframes
<cfsetting showdebugoutput="false">
<!--- Here is some html content with iframes --->
<cfset sOriginalContent = "
<h3>Title Here</h3>
<pHere is a paragraph</p>
<iframe width=""560"" height=""315"" src=""//www.youtube.com/embed/B7UmUX68KtE"" frameborder=""0"" allowfullscreen></iframe>
<p>another paragraph</p>