Skip to content

Instantly share code, notes, and snippets.

View chucktrukk's full-sized avatar

Charlie Madison chucktrukk

View GitHub Profile
@brettflorio
brettflorio / gist:749350
Created December 21, 2010 01:42
Adds a coupon code entry to the checkout page. For FoxyCart v0.7.0
// FOR TESTING PURPOSES ONLY
// FoxyCart v0.7.0+
// 2010.12.20
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');
}
@treffynnon
treffynnon / gist:608936
Created October 3, 2010 21:06
An Excellent Development Server for a Team of Developers
# This file is /etc/apache2/httpd.conf
# This file is automatically included by Ubuntu in /etc/apache2/apache2.conf
Include /etc/apache2/dev-server.conf
@joshuabaker
joshuabaker / gist:313648
Last active May 11, 2022 07:17
Get all images in a HTML string
<?php
/**
* Returns all img tags in a HTML string with the option to include img tag attributes
*
* @author Joshua Baker
*
* @example $post_images[0]->html = <img src="example.jpg">
* $post_images[0]->attr->width = 500
*
This example shows how to setup an environment running Rails 3 under 1.9.2 with a 'rails3' gem set.
∴ rvm update --head
# ((Open a new shell)) or do 'rvm reload'
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.2
# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist.
∴ rvm --create use 1.9.2@rails3