Skip to content

Instantly share code, notes, and snippets.

View chucktrukk's full-sized avatar

Charlie Madison chucktrukk

View GitHub Profile
source ~/bin/aliases
source ~/bin/gitprompt
export PATH="/usr/local/bin:~/bin:$PATH"
export SVN_EDITOR="mate -w"
export GIT_EDITOR="mate -w"
<?php
function GetDocumentData() {
$Database = $this->modx->db;
$DocIDs = $this->modx->getChildIds($this->Configuration['StartID'], $this->Configuration['Level']);
$Select = array(
'ID' => 'sc.id',
'Parent' => 'sc.parent',
'Hidden' => 'sc.hidemenu',
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function(){
// Set the indexes for the countries you want to allow
var usIndex = -1;
var caIndex = -1;
// Find their positions in the array using the 2 character ISO code
for (var i = 0; i < FC.locations.config.locations.length; i++) {
if (FC.locations.config.locations[ i ].cc2 == "US") {
usIndex = i;
} else if (FC.locations.config.locations[ i ].cc2 == "CA") {
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function(){
// Set the indexes for the countries you want to allow
var usIndex = -1;
var caIndex = -1;
// Find their positions in the array using the 2 character ISO code
for (var i = 0; i < FC.locations.config.locations.length; i++) {
if (FC.locations.config.locations[ i ].cc2 == "US") {
usIndex = i;
} else if (FC.locations.config.locations[ i ].cc2 == "CA") {
(function($){
$.each(["live", "die"], function( i, name ) {
var method = $.fn[ name ];
$.fn[ name ] = function( types, data, fn, origSelector ) {
if ( typeof types === "object" && !types.preventDefault ) {
for ( var key in types ) {
method.call( this, key, data, types[key], origSelector );
}
// FOR TESTING PURPOSES ONLY
FC.checkout.InitCoupon = function() {
fc_cart_foot_discount_new = '<tr id="fc_cart_foot_discount_new"><td class="fc_col1" colspan="2"><a href="#" onclick="FC.checkout.AddCoupon(); this.blur(); return false;">Add a coupon</a></td><td class="fc_col2"><input type="text" name="coupon" id="fc_coupon" class="fc_text fc_text_short" value="" style="display:none;" /><a id="fc_coupon_apply" href="javascript:;" style="display:none;">Apply!</a></td></tr>';
if (jQuery('#fc_cart_foot_discount_new').length == 0) {
jQuery(fc_cart_foot_discount_new).insertBefore('#fc_cart_foot_shipping');
}
jQuery('#fc_coupon_apply').unbind('click').click(function(){
<?php
// SNIPPET: PhotoDimensions
//
// Parameters:
// image
// classWide
// classTall
if (!$image) {
return '';
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function(){
// Set the indexes for the countries you want to allow
var usIndex = -1;
var caIndex = -1;
// Find their positions in the array using the 2 character ISO code
for (var i = 0; i < FC.locations.config.locations.length; i++) {
if (FC.locations.config.locations[ i ].cc2 == "US") {
usIndex = i;
} else if (FC.locations.config.locations[ i ].cc2 == "CA") {
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array