Skip to content

Instantly share code, notes, and snippets.

View jsteenkamp's full-sized avatar

Johan Steenkamp jsteenkamp

View GitHub Profile
@jsteenkamp
jsteenkamp / gist:1721864
Created February 2, 2012 06:16
Bootstrap v2 legend with nested columns
<!-- fix legend margin with nested row and row-fluid in bootstrap - https://github.com/twitter/bootstrap/issues/1578 add this:
legend+.row, legend+.row-fluid{margin-top:18px;-webkit-margin-top-collapse:separate;}
-->
<div class="row">
<div class="span12">
<fieldset>
<legend>My Legend</legend>
<div class="row">
<div class="span6">form control group</div>
<cfcomponent name="PostMarkAPI" hint="Send email messages using Postmarkapp.com API">
<cffunction name="sendMail" output="false" access="remote" returntype="struct" returnformat="json" description="Assembles JSON packet and sends it to Postmarkapp">
<cfargument name="mailTo" required="true" type="string" displayname="Recipient" />
<cfargument name="mailFrom" required="true" type="string" displayname="Sender" default="xxx@xxx.com" />
<cfargument name="mailSubject" required="true" type="string" displayname="Subject" default="Testing Postmark" />
<cfargument name="apiKey" required="true" type="string" displayname="API key" default="xxx-xxx-xxx-xxx" />
<!--- optional --->
<cfargument name="mailReply" required="false" type="string" displayname="Reply-To (optional)" />
<cfargument name="mailCc" required="false" type="string" displayname="CC (optional)" />
<cfargument name="mailHTML" required="false" type="string" displayname="HTML body (optional)" />
@jsteenkamp
jsteenkamp / upload.cfc
Created July 30, 2011 21:43
ColdFusion code for Plupload file uploading including chunked transfers
<cfcomponent>
<cffunction name="upload" access="remote" returntype="struct" returnformat="json" output="false">
<cfscript>
var uploadDir = expandPath('.') & '/uploads/'; // should be a temp directory that you clear periodically to flush orphaned files
var uploadFile = uploadDir & arguments.NAME;
var response = {'result' = arguments.NAME, 'id' = 0};
var result = {};
// if chunked append chunk number to filename for reassembly
if (structKeyExists(arguments, 'CHUNKS')){