Skip to content

Instantly share code, notes, and snippets.

View davidpanzarella's full-sized avatar

David Panzarella davidpanzarella

View GitHub Profile
@stevewithington
stevewithington / mura-json-api.cfm
Last active December 14, 2020 18:11
Mura CMS: JSON API Tests & Examples
<!---
Author: Stephen J. Withington, Jr.
Notes: Place this under a temp directory within your Mura CMS root to test.
For example: http://yourdomain.com/temp/json-test.cfm
--->
<cfscript>
param name="form.endpoint" default="content/new";
param name="form.method" default="GET";
param name="form.context" default="";
param name='session.siteid' default='default';
@jasonkmccoy
jasonkmccoy / sass-ghost-button.sass
Created March 14, 2015 21:44
Ghost button mixin
=ghost-button($font, $font-size, $font-color, $border-size, $border-color, $padding, $transition-speed, $hover-color)
display: inline-block
text-decoration: none
text-transform: uppercase
font-family: $font
font-size: $font-size
color: $font-color
border: $border-size solid $border-color
padding: $padding
-webkit-transition: color $transition-speed, background $transition-speed
@squarism
squarism / elk_stack_install.md
Last active October 22, 2023 12:25
Quick Elasticsearch / Kibana / Logstash (ELK stack) Install (for your local mac dev box)

Elasticsearch / Kibana / Logstash Quick Install

Instructions for getting an ELK stack set up quick on Mac. Paths are opinionated. You'll have to infer and change. Sorry mate. 🍰

Install Homebrew if not already. You probably have. If not, you should.

brew install elasticsearch nginx

do yourself a favor and get a better services command than launchctl

@stevewithington
stevewithington / muraContentStatus.cfm
Created January 9, 2015 20:06
Mura CMS: Get status of content (e.g., Draft, Pending Approval, Published, Archived)
<!--- Drop these methods in your Site or Theme contentRenderer.cfc, and get the status with $.getContentStatus() --->
<cffunction name="getContentStatusID" output="false">
<cfset var statusid = '' />
<cfif $.content('active') gt 0 and $.content('approved') gt 0>
<!--- 2: Published --->
<cfset statusid = 2>
<cfelseif len($.content('approvalstatus')) and $.content().requiresApproval()>
<!--- 1: Pending Approval --->
<cfset statusid = 1 />
<cfelseif $.content('approved') lt 1>
@JasPanesar
JasPanesar / EditProfileSnippet
Created October 11, 2014 15:49
Show Edit Profile and Logout Link in NavBar in a theme in Mura CMS
<!--- insert this in navbar.cfm in the appropriate place inside the MuraBootstrap theme to see an Edit Profile or Logout link if a user is logged in.
This example also outputs the users name into the nav bar. --->
<cfif $.currentuser().isLoggedIn()>
<div class="pull-right">
#$.currentUser().getFname()# #$.currentUser().getLname()#&nbsp;&nbsp;&nbsp;
<a href="/?display=editprofile" class="btn btn-default">Edit Profile</a>&nbsp;
<a href="/?doaction=logout" class="btn btn-default">Logout</a>
</div>
@cloudnull
cloudnull / iterm2-edit-or-restore-settings.rst
Created September 23, 2014 13:05
Edit or restore setting in iterm2

Restoring: replace the file ~/Library/Preferences/com.googlecode.iterm2.plist with your backed up version. run defaults read com.googlecode.iterm2 and killall cfprefsd to apply the changes:

Editing: Quit iTerm Edit the plist Run defaults read com.googlecode.iterm2 and killall cfprefsd Open iTerm

@stevewithington
stevewithington / muraGetAssociatedImageMetaData.cfm
Created September 10, 2014 00:23
Mura CMS: How to get the primary associated image metadata such as AltText, Caption, Credits, etc.
<cfset itKids = $.content().getKidsIterator() />
<cfif itKids.hasNext()>
<ul>
<cfloop condition="itKids.hasNext()">
<li>
<cfscript>
item = itKids.next();
fileid = item.getValue('fileid');
if ( item.hasImage() ) {
@stevewithington
stevewithington / muraOnAfterContentSave.cfm
Last active December 18, 2017 10:54
Mura CMS : How to reference information about a content item after it's been saved
<cfscript>
public any function onAfterContentSave($) {
// reference the new bean that was created
var newBean = arguments.$.event('contentBean');
// reference to the OLD bean
var oldBean = arguments.$.event('activeBean'); // can also use 'currentBean' to access the same bean
// you can now reference any of the attributes of the new bean ...
WriteDump(var=newBean.getAllValues(), abort=true);
<cfscript>
feedNavLvlOne = $.getBean('feed')
.setMaxItems(0)
.setNextN(0)
.setSortBy('orderno')
.setSortDirection('asc')
.addParam(
relationship='AND'
,field='tcontent.parentid'
,dataType='varchar'