Skip to content

Instantly share code, notes, and snippets.

View jimbojsb's full-sized avatar

Josh Butts jimbojsb

View GitHub Profile
@jimbojsb
jimbojsb / Bash script for remote PHP Debugging
Created February 11, 2010 01:53
Simple Bash script to enable remote debugging of PHP Scripts in Eclipse
#!/bin/bash
QUERY_STRING="start_debug=1&debug_host=127.0.0.1&debug_port=10137"
CMD_ARGS = "$@"
$QUERY_STRING $CMD_ARGS
---doctrine.php---
<?php
define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
PS1='[\u@\h \w\[\033[32m\]$(__git_ps1)\[\033[0m\]]$ '
@jimbojsb
jimbojsb / SwitchLayout.php
Created July 1, 2011 04:53
Module-specific layouts in Zend Framework
<?php
class Genoa_Controller_Plugin_SwitchLayout extends Zend_Controller_Plugin_Abstract
{
public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
{
$module = $request->getModuleName();
$layoutName = $module;
$layoutPath = APPLICATION_PATH . "/modules/$module/views/layouts";
Zend_Layout::startMvc();
$layout = Zend_Layout::getMvcInstance();
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@jimbojsb
jimbojsb / gist:1665191
Created January 23, 2012 19:48
Delete local / remote hotfix and RC branches
for i in $(git branch -a | grep "rc-"); do git push origin :${i#remotes/origin/}; done
@jimbojsb
jimbojsb / gist:1665345
Created January 23, 2012 20:20
Delete resolved jira ticket branches
#!/bin/bash
for i in $(git branch | grep "OFR-"); do
xml="`wget -qO- http://jira.office.vertive.com/si/jira.issueviews:issue-xml/$i/$i.xml`"
closed=`echo $xml | grep ">Closed</status"`
strlen=${#closed}
if [ ! $strlen == "0" ]
then
echo "Deleting $i"
git branch -D $i
fi
@jimbojsb
jimbojsb / gist:1749610
Created February 6, 2012 04:17
How to Re-Download everything from iTunes Match
1) Create a smart playlist
2) Set the settings on the smart playlist to be "date added greater than or equal to" and choose a ridiculously early date, like 1/1/1995
3) Click the cloud download button on the playlist
4) Wait
@jimbojsb
jimbojsb / header
Created February 10, 2012 21:46
Test Gist
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Harbormaster</title>
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/bootstrap-responsive.css" rel="stylesheet">
</head>
<body>