Skip to content

Instantly share code, notes, and snippets.

Joe Devon joedevon

Block or report user

Report or block joedevon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

View gist:1371524
<script src="LAB.js"></script>
// put whatever here, for your page's other scripts that you load with <script> tags.
window.fbAsyncInit = function() {
FB.init({appId: 'your app id', status: true, cookie: true,
xfbml: true});
westonruter /
Created Aug 5, 2011
Bash shortcut function to cd you to an ancestor directory, named as first argument. Stop having to cd ../../../..
# Usage: cdup [DIRNAME]
# Bash shortcut function to cd you to ancestor directory named as first argument.
# If DIRNAME is not supplied, then .. is used.
# Stop having to cd ../../../..
# Use `cd -` to undo, to restore old working directory.
# Use aliases for common directories, like: alias docroot="cdup docroot".
# Add function to your ~/.profile
# Example:
westonruter / filterable.php
Created Mar 11, 2011
Adding filtering to any class simply by having it extend the Filterable class.
View filterable.php
// Builds off of Aspect-Oriented Design demo by Garrett Woodworth:
// <>
class Filters {
protected static $_filters = array();
* Register a new filter; note there could be an array index also provided
* to indicate where in the list order that a callback filter should be applied
getify / gist:713779
Created Nov 24, 2010
loading google analytics using LABjs
View gist:713779
<!DOCTYPE html>
<title>LABjs Demo</title>
<!-- some stuff -->
<script src="/js/LAB.js"></script>
johnkary / gist:635035
Created Oct 19, 2010
What is best practice for building a mock used across several tests?
View gist:635035
* Having trouble building the same mock in my setUp() method.
* What is best practice for building a mock used across several tests?
* Error:
* 1) SystemUnderTestTest::testSecondTest
* PHPUnit_Framework_Exception: Class "MockStaffCredential" already exists.
class SystemUnderTest
johnkary / gist:634490
Created Oct 19, 2010
Using PHPUnit 3.5 MockBuilder to create a mock concrete object of an abstract class
View gist:634490
//Create mock BaseCredential called 'MockAdminCredential' whose 'calculate'
//function will always return true. All other methods will return NULL
//as per the default behavior of a stub.
$this->mockAdminCredential = $this->getMockBuilder('BaseCredential')
View gist:581868
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
<!-- Disable automatic DNS prefetching.
View Sg_Session_SaveHandler_Cache.php
class Sg_Session_SaveHandler_Cache implements Zend_Session_SaveHandler_Interface {
protected $_cache;
* Session lifetime
* @var int
protected $_lifetime = false;
raphaelstolt / redis-glue-test.php
Created May 15, 2010
Redis installation test script
View redis-glue-test.php
define('TEST_KEY', 'are_we_glued');
$redis = new Redis();
try {
$redis->connect('localhost', 6379);
$redis->set(TEST_KEY, 'yes');
$glueStatus = $redis->get(TEST_KEY);
if ($glueStatus) {
$testKey = TEST_KEY;
echo "Glued with the Redis key value store:" . PHP_EOL;
You can’t perform that action at this time.