Skip to content

Instantly share code, notes, and snippets.

View bradmarshall's full-sized avatar

Brad Marshall bradmarshall

View GitHub Profile
@krmgns
krmgns / Element.prototype.classList.js
Last active October 28, 2020 01:25
Polyfill: Element.prototype.classList for IE8/9, Safari.
/**
* Element.prototype.classList for IE8/9, Safari.
* @author Kerem Güneş <k-gun@mail.com>
* @copyright Released under the MIT License <https://opensource.org/licenses/MIT>
* @version 1.2
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
*/
;(function() {
// Helpers.
var trim = function(s) {
@stevewithington
stevewithington / mura-scope.cfm
Last active December 14, 2023 10:11
Mura CMS : There will be times when you need to access the Mura Scope ($), but you're not in the context of a front end request. Here's an example of how you could do that, assuming your within the Application scope of Mura.
<cfscript>
// The Mura Scope : in order to access site-specific helpers (e.g., $.siteConfig()), we'll initialize it with a siteid.
$ = StructKeyExists(session, 'siteid')
? application.settingsManager.getBean('$').init(session.siteid)
: application.settingsManager.getBean('$').init('default');
// If you're not in the context of a Front-End Request, then there is NO ContentBean!
// So, we need to set it if we want to access it
// contentBean = $.getBean('content').loadBy(filename='home');
// $.setContentBean(contentBean);
@stevewithington
stevewithington / dspNestedCategories.cfm
Last active June 11, 2024 17:57
Mura CMS : Display nested categories with links (only if the category has been set to allow content assignments)
<cfscript>
/**
* @parentID Category ParentID
*/
public any function dspNestedCategories(
string siteid='#variables.$.event('siteid')#'
, string parentID=''
, string keywords=''
, boolean activeOnly=false
, boolean InterestsOnly=false