Skip to content

Instantly share code, notes, and snippets.

$(function(){
$('#jqt').ajaxComplete(function(){
add_ga(); // add google analytics on each page load
});
$(document).ready(function() {
add_ga(); // add google analytics to the first page
});
function add_ga() {
@enminc
enminc / indexer.plugin.php
Created February 23, 2012 06:36
MODX Revo indexer plugin. Allows fast TV filter searches using custom snippet (not included)
<?php
/*
* MODX Revo indexer plugin. Allows fast TV filter searches using custom snippet (not included)
*
* License: public domain
*
* Created by: Jeroen Kenters / www.kenters.com
* First released: 2012-02-21 (yyyy-mm-dd)
*
* !!!!!!!Important!!!!!!!
@enminc
enminc / snippet.rand.php
Created January 26, 2012 02:13
MODX Snippet/OutputFilter that outputs the results of php rand() function
$min = 0;
$max = 10000000;
$input = $modx->getOption('input',$scriptProperties,null);
if(($input) && ($input != '')){ // used when used as output filter
$nums = explode(',',$input);
if($nums[0] != '' && is_numeric($nums[0])){
$min = intval($nums[0]);
}
@enminc
enminc / galleryRedirector.modx.plugin.php
Created January 6, 2012 04:55
Quick and dirty query sting redirector
/*
Quick plugin I just wrote to redirect querystring based uri's used in old site to new modx resource location.
Not intended to be anything more then a quick fix until search engines are no longer indexing the old links.
Might be useful in helping someone learn how to write a dynamic 301 redirect
*/
/*
NOTE: For a more robust controller I would recommend you checkout http://modx.com/extras/package/simplxcontroller by larscwallin
*/
@enminc
enminc / vcGetProductCustomField-rc4Fix
Created June 28, 2011 17:53
Temporary Fix for VisionCart "vcGetProductCustomField" Snippet. The changes to this snippet have been logged in big tracker
<?php
/**
* @package visioncart
*/
$vc =& $modx->visioncart;
# !!! FIXED: Fixed statement to be !isset rather then isset
#####################################################
if (!isset($scriptProperties['id']) || !is_numeric($scriptProperties['id'])) {