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>
<cfscript>
public any function getChildrenFeedByContentID(
required contentid
, string type=''
, string subtype=''
) {
var local = {};
local.feed = $.getBean('feed');
local.feed.setMaxItems(0);
<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
@davidpanzarella
davidpanzarella / SassMeister-input.scss
Created July 25, 2016 21:55
Precise control over responsive typography for Sass
// ----
// libsass (v3.3.2)
// ----
// =========================================================================
//
// PRECISE CONTROL OVER RESPONSIVE TYPOGRAPHY FOR SASS
// ---------------------------------------------------
// Indrek Paas @indrekpaas
//
<mura name="Custom Form" contenttypes="*"></mura>