Skip to content

Instantly share code, notes, and snippets.

View davidpanzarella's full-sized avatar

David Panzarella davidpanzarella

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 40px;
}
a {
display: inline-block;
<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>
@davidpanzarella
davidpanzarella / Location Extended Attributes
Last active December 25, 2015 07:29
This is a collection of Common Extended Attributes for Mura CMS. Pick and choose which is applicable to your project's content strategy.
<extension type="Page" subtype="Location">
<attributeset name="Location Options" container="Basic">
<attribute
name="locationAddress1"
label="Address Line 1"
hint="Enter Address Line 1 of the location"
required="true" />
<cfscript>
public any function getChildrenFeedByContentID(
required contentid
, string type=''
, string subtype=''
) {
var local = {};
local.feed = $.getBean('feed');
local.feed.setMaxItems(0);
@davidpanzarella
davidpanzarella / scrubEmptyParamRelationships
Last active August 29, 2015 14:05
Remove any empty grouping tags from the Current Params
<!--- start: scrub empty param relationships --->
<cffunction name="scrubEmptyParamRelationships" output="false" returntype="query">
<cfargument name="query" required="true">
<cfset local.openList = "" />
<cfset local.closeList = "" />
<cfset local.removeList = "" />
<cfloop query="arguments.query">
<cfif relationship eq "andOpenGrouping">
<cfoutput>
<!--- Read out an existing node from the default site.--->
<cfset contentBean=application.contentManager.getActiveContent('59280367-A98E-4F7D-B4463B3E405054FD','default')>
<!--- Pull out a content iterator of the nodes child content (all underlying pages within a given node).--->
<cfset it=contentBean.getKidsIterator(liveOnly='false') />
<!--- The number of Items to be listed is determined by the content.getNextN() value. Its default is 10. --->
<cfset it.setPage(1)>
<!--- You can also set the start row instead of setting a page number. --->
<cfset it.setStartRow(1)>
@davidpanzarella
davidpanzarella / xferrc-en-nl.cfm
Created October 15, 2015 23:03 — forked from JonnyHayes/xferrc-en-nl.cfm
Method to transfer related content from one siteID to another in mura cms.
<cfset siteID = "en">
<cfset remoteSiteID = "nl">
<cfset $ = application.serviceFactory.getBean('$').init(siteID)>
<cfset pluginConfig = $.getBean('pluginManager').getConfig('MuraTranslations')>
<cfset translationManager = createObject("component", "plugins.#pluginConfig.getDirectory()#.cfcs.translationManager").init($.getBean('configBean'), pluginConfig)>
<cfif not structKeyExists(session, "rs")>
<cfquery name="rs">
select distinct contentID, siteID from tcontentrelated where siteID = <cfqueryparam cfsqltype="cf_sql_varchar" value="#siteID#">
</cfquery>
// Brightness math based on:
// http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
$red-magic-number: 241;
$green-magic-number: 691;
$blue-magic-number: 68;
$brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number;
@function brightness($color) {
// Extract color components
@davidpanzarella
davidpanzarella / nginx.conf
Created March 21, 2016 16:18 — forked from tsucaet/ nginx.conf
Nginx Lucee Mura configuration
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log error;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@davidpanzarella
davidpanzarella / 0_reuse_code.js
Created June 19, 2016 02:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console