Skip to content

Instantly share code, notes, and snippets.

// matches DD/3 Letter Month Abv/YYYY (01/Jan/2014)
[0-9]{1,2}/[a-zA-Z]{3}/[0-9]{4}
@mccar2cm
mccar2cm / gist:5dd4dc0d40e0e866e8d4
Last active August 29, 2015 14:10
Stripe Configuration
// Application.cfc
function onApplicationStart() {
application.stripeApiKey = 'your key here';
application.Stripe = createObject('component','stripe.Stripe').init(stripeApiKey=application.stripeApiKey);
return true;
}
//-----------
@mccar2cm
mccar2cm / javascriptStuff
Last active December 27, 2015 12:19
Javascript stuff I seem to keep forgetting
plural check
($(this).val() == 1) ? "day" : "days")
class manupilation
$( "p" ).removeClass( "myClass noClass" ).addClass( "yourClass" );
grab all selects without data-eventId = 21 and disable
$( "select[data-eventId!=21]" ).attr('disabled', false);
@mccar2cm
mccar2cm / gist:7256954
Last active December 27, 2015 03:09
Some basic MURA stuff I can't seem to ever remember
datasource:
#application.configBean.getDatasource()#
init mura scope:
<cfset $=application.serviceFactory.getBean("MuraScope").init("SITEID")>
get a feed to show items with nav set to 0 and 1
<cfset feed.setShowNavOnly(0)>
@mccar2cm
mccar2cm / gist:6202693
Created August 10, 2013 23:49
RegEx Tag Replacement
//get rid of all tags:
rereplacenocase(variable, "<[^<]*>","","all")
//get rid of image tag only:
rereplacenocase(variable, "<img[^<]*>","","all")
//get rid of two or more specific tags:
rereplacenocase(variable, "<(img|/?div|br)[^<]*>","","all")