Skip to content

Instantly share code, notes, and snippets.

View davidpanzarella's full-sized avatar

David Panzarella davidpanzarella

View GitHub Profile
@thomaspark
thomaspark / subnav.css
Last active April 27, 2025 16:39
Subnav for Bootstrap 2
section {
padding-top: 60px;
}
.subnav {
margin-bottom: 60px;
width: 100%;
height: 36px;
background-color: #eeeeee; /* Old browsers */
background-repeat: repeat-x; /* Repeat the gradient */
@stevewithington
stevewithington / dropSlatwallDBTables.sql
Created January 7, 2013 19:58
SQL Server Script to delete all FK in the DB and drop any table that starts with XXX
DECLARE @sqlForeignKeys VARCHAR(MAX)
SELECT @sqlForeignKeys = ISNULL(@sqlForeignKeys,'') +
'ALTER TABLE dbo.[' + OBJECT_NAME(FK.parent_object_id) + '] DROP CONSTRAINT [' + FK.name + '];' + CHAR(10)
FROM SYS.FOREIGN_KEYS FK
//PRINT(@sqlForeignKeys)
EXEC(@sqlForeignKeys)
<cfscript>
//Get current content's category assignments
rsCategories=$.content().getCategoriesQuery();
//Build a feed of images with matching categories
images=$.getBean("feed")
.setCategoryID( valueList(rsCategories.categoryID) )
.addParam(field='tcontent.type',condition="EQ",criteria='File')
.addParam(field='tfiles.fileEXT',condition="in",criteria='jpg,png,gif,jpeg')
.getIterator();
@cameroncf
cameroncf / gist:4974631
Last active December 13, 2015 21:08
In a Mura Plugin, drop this in [plugin]/includes/eventHandler.cfc:onApplicationLoad() to load plugin specific extension sets at application startup
local.rsSites = arguments.$.getBean('settingsManager').getList(); // all sites
local.rsPlugin = arguments.$.getBean('pluginManager').getPlugin( variables.framework.package ); // plugin record
local.pluginAssignments = arguments.$.getBean('pluginManager').getAssignedSites( local.rsPlugin.moduleID ); // recordset of sites this plugin belongs to
local.pluginXML = arguments.$.getBean('pluginManager').getPluginXML( local.rsPlugin.moduleID );
// loop assigned sites and make sure they are setup per the plugin requirements
for (site in local.pluginAssignments) {
// make sure all class (defined in plugin/config.xml.cfm) extentions exist
application.configBean.getClassExtensionManager().loadConfigXML( local.pluginXML, site.siteID );
@justinvw
justinvw / es_simple_autocomplete_example_config.sh
Last active January 26, 2021 17:15
Simple ElasticSearch autocomplete example configuration. The 'autocomplete' functionality is accomplished by lowercasing, character folding and n-gram tokenization of a specific indexed field (in this case "city").
# Delete the possibly existing autocomplete test index
curl -X DELETE localhost:9200/autocomplete_test
# Put the config of the autocomplete index
curl -X PUT localhost:9200/autocomplete_test -d '
{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {
@stevewithington
stevewithington / muraImportUsersViaCSV.cfm
Last active January 19, 2024 09:02
Example of how to import Users into Mura CMS via .CSV file. Also see https://gist.github.com/stevewithington/4742829 to import content from an RSS Feed.
<cfscript>
param name='form.csvUrl' default='#getPageContext().getRequest().getScheme()#://#cgi.server_name##getDirectoryFromPath(getPageContext().getRequest().getRequestURI())#users.csv';
param name='form.group' default='Temp';
param name='form.isSubmitted' default='false';
param name='form.isTest' default='true';
param name='form.siteid' default='default';
$ = application.serviceFactory.getBean('$').init(form.siteid);
if ( !$.currentUser().isSuperUser() && !$.currentUser().isInGroup('admin') ) {
@stevewithington
stevewithington / muraDynamicLayoutTemplate.cfc
Last active April 27, 2018 19:24
Mura CMS: dynamically change layout templates (e.g., Allow for a "View As PDF" link, or only open children of a calendar in a blank.cfm layout template ... this way you could open it in a modal window using shadowboxjs, etc.)
component extends='mura.cfobject' {
// drop this in your site or theme eventHandler.cfc
public any function onRenderStart($) {
// allow for a 'View As PDF' link (e.g., <a href="./?viewAsPDF=1">View As PDF</a>)
if ( IsBoolean(arguments.$.event('viewAsPDF')) && arguments.$.event('viewAsPDF') ) {
arguments.$.content('template', 'pdf.cfm');
}
@stevewithington
stevewithington / muraCustomErrorFile.cfm
Last active January 19, 2024 08:52
Mura Error Handling: You could use any or even both of the attached methods to help with error handling in Mura CMS. This works better than the default "We're sorry, an error has occurred. Please try again later."
<!---
1) Drop this file under /config/ directory.
2) Add errortemplate=/muraWRM/config/customErrorFile.cfm to the settings.ini.cfm file.
3) Set debuggingenabled=false in the settings.ini.cfm file.
4) Reload Mura CMS
--->
<cftry>
<cfset msg = 'MURA ERROR - MESSAGE: #arguments.exception.Message# DETAIL: #arguments.exception.Detail# ' />
<cflog type="ERROR" file="MuraError" text="#msg#" />
<cfcatch></cfcatch>
@beaudierman
beaudierman / gist:5444977
Created April 23, 2013 16:11
How to install MySQL 5.6 on Ubuntu 12.04
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
Now install your package(mine was enterprise edition, community may have a different filename):
sudo dpkg -i mysql-advanced-5.6.10-debian6.0-x86_64.deb
This will install your files to the /opt directory, instead of the more common /etc directory. No worries, all we need to do is point our system at this new directory.
@lxcodes
lxcodes / content_iterator.cfm
Last active December 18, 2015 08:59
Mura CMS Basic CFScript Content Iterator from Local Content Index
<cfscript>
// Grab local content index (feed) by name. I believe siteid is optional, but I have always included it.
var feed = application.feedManager.readByName('Banners', $.event("siteid"));
// Create a content iterator from the feed.
var banners = feed.getIterator();
// HTML to add to.
var html = "";