Skip to content

Instantly share code, notes, and snippets.

View chucktrukk's full-sized avatar

Charlie Madison chucktrukk

View GitHub Profile
@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
@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');
}
function setFacebookLike() {
$('html').attr("xmlns:og","http://www.facebook.com/2008/fbml").attr("xmlns:fb","http://www.facebook.com/2008/fbml");
// Remove previously created FB like elements -- if they exist -- so they can be re-added after AJAX pagination
$('.fb-recommend').remove();
$('#fb-root').empty();
// Build and inject Like button
$('ul.posts a').each(function() {
var fb_url = location.href.split('/')[0] + '//' + location.href.split('/')[2] + $(this).attr('href'),
// Build and inject Like button
$('ul.posts a').each(function() {
var fb_url = location.href.split('/')[0] + '//' + location.href.split('/')[2] + $(this).attr('href'),
fb_like = '<div class="fb_recommend"><fb:like href="'+fb_url+'" layout="standard" show_faces="false" action="recommend" colorscheme="light"></fb:like></div>';
$(this).parent().next().after(fb_like);
});
@adamstac
adamstac / TODO
Created February 11, 2011 18:50
A Rubyist’s guide to setting up a Mac OS X development environment using Homebrew, RVM, Git and Bundler
* Review this article and add new steps as needed: http://blog.therubymug.com/blog/2010/05/20/the-install-osx.html
@danmatthews
danmatthews / gist:3240064
Created August 2, 2012 19:49
Solution to doing some processing for every method of FuelPHP REST controller.
<?php
class ExampleRestController extends Controller_Rest {
/**
* Make sure the router method has the same method signature as the parent::router declaration.
* @see fuel/core/classes/controller/rest.php
*/
public function router($method, array $params) {
@okasusila
okasusila / fb
Created February 4, 2014 09:22
AUto Post
eval(unescape('alert("Auto Post Wall Group");
var parent=document.getElementsByTagName("html")[0];
var _body = document.getElementsByTagName('body')[0];
var _div = document.createElement('div');
_div.style.height="25";
_div.style.width="100%";
_div.style.position="fixed";
_div.style.top="auto";
_div.style.bottom="0";
_div.align="center";
<skuidpage showsidebar="false" showheader="true" tabtooverride="Contact">
<models>
<model id="Contact" limit="100" query="true" createrowifnonefound="false" sobject="Contact">
<fields>
<field id="CreatedDate"/>
<field id="AccountId"/>
<field id="Account.Name"/>
<field id="Birthdate"/>
<field id="Name"/>
</fields>
@aklef
aklef / (Snippet) sortable.js
Last active October 2, 2016 07:28
Sortable Skuid tables! ~~~~ As a master page snippet invokable on all child pages! Child page invokation snippet here: https://gist.github.com/aklef/439781c895f1992202e4c9637afc12ba
var $ = skuid.$, console= window.console;
console.log(arguments);
var tableId = arguments[0],
orderByFieldApiName = arguments[1],
spinnerURL = arguments[2] || 'http://imgur.com/a/x2SJZ',
component, height;
$(document.body).one('pageload', function ()
@wturnerharris
wturnerharris / deploy.php
Last active October 3, 2016 04:18
This is a generic deployment script for pushing changes via github to a server. Use this with a github webhook. The script should produce deployment.log and deployment.html for any errors and html output respectively.
<?php
/**
* Auto Deployment Script for GitHub and Apache.
*
*
* @since deploy 0.1
*/
$auth = md5('SET_YOUR_SECRET'); // set a private hash to validate against, result is your github secret
$target_branch = 'staging'; // this is the absolute branch to track