Skip to content

Instantly share code, notes, and snippets.

View davidpanzarella's full-sized avatar

David Panzarella davidpanzarella

View GitHub Profile
@ronnieduke
ronnieduke / config.xml.cfm
Last active August 29, 2015 14:05
Get Mura Site's Custom Image Sizes to use in a component or any other extended attribute
<theme>
<imagesizes>
<imagesize name="carouselimage" width="939" height="479" />
</imagesizes>
<extensions>
<extension type="Component" subType="Slider" hasBody="0">
<attributeset name="Slider Options" container="Basic">
<attribute
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
public any function onBeforeContentSave($) {
var newBean = $.event('newBean');
if( !len(trim(newBean.getCredits())) ) {
newBean.setCredits( $.currentUser().getFullName() ); // autoinsert name
//newBean.setCredits( $.currentUser().getUserID() ); // autoinsert id
}
}
@stevewithington
stevewithington / dspColumnizedChildren.cfm
Last active February 20, 2020 09:38
Mura CMS : How to iterate over a content item's children and output an image and link, in a columnized format.
<!---
1) Drop this in your Site or Theme contentRenderer.cfc
2) Call this on a template: #$.dspColumnizedChildren(columns=3, imageSize='medium')#
3) Or within the editor via Mura tags [m]$.dspColumnizedChildren(columns=3, imageSize='medium')[/m]
--->
<cffunction access="public" output="false" returntype="any" name="dspColumnizedChildren">
<cfargument name="columns" default="3" type="numeric" />
<cfargument name="imageSize" default="medium" type="string" />
<cfscript>
var str = '';
@learncodeacademy
learncodeacademy / gist:5850f394342a5bfdbfa4
Last active December 4, 2024 21:28
SSH Basics - Getting started with Linux Server Administration

###SSH into a remote machine###

ssh [email protected]
#or by ip address
ssh [email protected]

exit: exit ###Install Something###

#If it's a new server, update apt-get first thing
@learncodeacademy
learncodeacademy / gist:5f84705f2229f14d758d
Last active July 16, 2024 04:56
Getting Started with Vagrant, SSH & Linux Server Administration
// 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
@ronnieduke
ronnieduke / script.js
Created May 6, 2014 18:10
Treat responsive mobile nav differently
/*================================================================*/
/* DESKTOP MENU
/*================================================================*/
if (document.documentElement.clientWidth > 767) { //if client width is greater than 767px
ddsmoothmenu.init({
mainmenuid: "main_menu",
orientation: 'h',
contentsource: "markup",
showhidedelay: {showdelay: 300, hidedelay: 100} //set delay in milliseconds before sub menus appear and disappear, respectively
@dedy-purwanto
dedy-purwanto / gist:11312110
Created April 26, 2014 05:00
Bulk remove iTerm2 color schemes.
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist
@razwan
razwan / _baseline.scss
Created April 14, 2014 16:20
Aligning type to baseline the right way with SASS
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {