Skip to content

Instantly share code, notes, and snippets.

View davidpanzarella's full-sized avatar

David Panzarella davidpanzarella

View GitHub Profile
@jebenexer
jebenexer / gist:5790236
Last active December 18, 2015 13:29 — forked from beaudierman/gist:5444977
#!/usr/bin/env bash
# I recently had to install MySQL 5.6 on Ubuntu 12.04 from a .deb package on the MySQL website. It seems that either the package has been updated recently or nobody uses this method to install so I ended up running into endless problems. Through trial and error I found the following method works for me.
#Install libaio-dev:
sudo apt-get install libaio-dev
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.12-debian6.0-x86_64.deb/from/http://cdn.mysql.com/ -O mysql-server.deb
#Now install your package(mine was enterprise edition, community may have a different filename):
sudo dpkg -i mysql-server.deb
@jvandevelde
jvandevelde / install_elasticsearch_ubuntu.sh
Last active June 5, 2017 10:50
Install ElasticSearch 0.90.1 on Ubuntu 12.04.2 LTS
#!/bin/bash
cd ~
# Install JDK
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
# Install & Start ES 0.90.1
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.1.deb
@stevewithington
stevewithington / dspCustomNavWithChildren.cfm
Last active July 19, 2019 07:28
Mura CMS : display a custom navigation based on a content collection/local index and include children up to a specific depth level.
<cfset feed = $.getBean('feed').loadBy(name='Your Feed Name')>
<cfset it = feed.getIterator()>
<cfif it.hasNext()>
<ul class="nav nav-list">
<li class="nav-header">Your Nav Header</li>
<cfloop condition="it.hasNext()">
<cfset item = it.next()>
<li<cfif $.content('contentid') eq item.getContentID()> class="active current"</cfif>>
<a href="#item.getURL()#">#HTMLEditFormat(item.getMenuTitle())#</a>
<!--- This is where you can specify how deep you want to go --->
@stevewithington
stevewithington / getCustomSearch.cfm
Created June 27, 2013 21:13
Mura CMS : Another custom search example. I would not necessarily recommend using this for production purposes, although it should work. Search in general is quite complicated ... hence why we have such companies as Google, Yahoo, Ask, etc. ... so if you truly want a custom search interface, you may actually want to consider using one of the cus…
<!--- First, you could copy the file located under /{SiteID}/includes/display_objects/dsp_search_results.cfm
and then paste it under either /{SiteID}/includes/display_objects/custom/dsp_search_results.cfm
OR under /{SiteID}/includes/themes/{ThemeName}/display_objects/dsp_search_results.cfm
and then change the line of code that sets the variables.rsNewSearch to this --->
<cfset variables.rsNewSearch = variables.$.getContentRenderer().getCustomSearch()>
<!--- Then, place this in your Site's contentRenderer.cfc --->
<cffunction name="getCustomSearch">
<cfscript>
var local = {};
@stevewithington
stevewithington / mura-form-results.cfm
Last active April 27, 2018 19:23
Mura CMS : Iterating over form results. Mura CMS form structures can change, which means fields may be added and/or deleted by Content Managers and thus the form data is stored as XML packets (WDDX, to be exact).
<cfscript>
formName = 'Information Request';
rsData = QueryNew('');
dcm = $.getBean('dataCollectionManager');
</cfscript>
<cfoutput>
<cfif !Len($.event('responseid'))>
<!--- All Form Submission Results --->
<cfscript>
@stevewithington
stevewithington / muraSummarize.cfm
Created July 10, 2013 22:00
Mura CMS : Use these methods to auto-summarize any content.
<cfscript>
// drop these methods into either the Site or Theme's contentRenderer.cfc and use as necessary
public any function summarize(string str='', numeric count='26') {
var local = {};
local.str = arguments.str;
local.count = Val(arguments.count);
if ( Len(Trim(local.str)) ) {
local.str = REReplace($.stripHTML(stripTagContent(local.str)), '[\s|\r\n?|\n]+', ' ', 'ALL');
javaArray = CreateObject('java', 'java.util.Arrays');
wordArray = javaArray.copyOf(local.str.Split(' '), local.count);
@mezrin
mezrin / UBUNTU-INSTALL-MYSQL-5.6
Last active February 11, 2017 00:22
Install MySQL 5.6 on the Ubuntu 12.10
Installation of the MySQL 5.6 on the Ubuntu 12.10.
Should work for 12.04, 13.10
It's a fresh installation. On the computer should not be installed any previous versions of MySQL
Another tutorials:
https://gist.github.com/jebenexer/5790236
https://gist.github.com/michfield/5578726
http://www.peterchen.net/2013/02/20/en-how-to-install-mysql-5-6-on-ubuntu-12-04-precise/
@stevewithington
stevewithington / muraImage.cfm
Last active April 28, 2020 15:26
Mura CMS : Meta Image / Primary Associated Image Output
<!---
This is one way to generate a custom meta image based on the content item's primary associated image.
You could use this method in several other ways as well, such as inside a content iterator, etc.
If the fileid passed into this method is not a valid image, then it will return an empty string
--->
<cfif Len($.getURLForImage($.content('fileid')))>
<cfscript>
img = $.getURLForImage(
fileid = $.content('fileid') // could be _any_ fileid in Mura
,size = 'custom' // small, medium, large, custom, or any other pre-defined image size
@stevewithington
stevewithington / muraCFStatic.cfm
Last active December 22, 2015 00:49
Mura CMS : You don't have to rely on Mura's $.static() method ... you can create your own reference to CFStatic.
<cfscript>
// drop this in your eventHandler.cfc's onSiteRequestStart() method
var themeAssetPath = arguments.$.siteConfig('themeAssetPath');
arguments.$.cfStatic = new requirements.org.cfstatic.CfStatic(
staticDirectory = ExpandPath('#themeAssetPath#')
, outputDirectory = 'compiled'
, staticURL = '#themeAssetPath#/'
, minifyMode = 'package'
, checkForUpdates = !arguments.$.siteConfig('cache')
);
@erikflowers
erikflowers / gist:6710372
Created September 26, 2013 06:01
An easy way to include just super standard 1px text shadows. No frills.
.textShadowBlack(@shadow: 0 1px 0px rgba(0,0,0,1)) {
text-shadow: @shadow;
}
.textShadowWhite(@shadow: 0 1px 0px rgba(255,255,255,1)) {
text-shadow: @shadow;
}