Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Butts jimbojsb

View GitHub Profile
@jimbojsb
jimbojsb / Bash script for remote PHP Debugging
Created Feb 11, 2010
Simple Bash script to enable remote debugging of PHP Scripts in Eclipse
View Bash script for remote PHP Debugging
#!/bin/bash
QUERY_STRING="start_debug=1&debug_host=127.0.0.1&debug_port=10137"
CMD_ARGS = "$@"
$QUERY_STRING $CMD_ARGS
View Doctrine CLI with ZF Bootstrapper
---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(),
View Zend Framework Doctrine Resource
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
View Git Bash Prompt
PS1='[\u@\h \w\[\033[32m\]$(__git_ps1)\[\033[0m\]]$ '
@jimbojsb
jimbojsb / SwitchLayout.php
Created Jul 1, 2011
Module-specific layouts in Zend Framework
View SwitchLayout.php
<?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 Jan 18, 2012
Code highlighting for Keynote presentations
View gist:1630790

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 Jan 23, 2012
Delete local / remote hotfix and RC branches
View gist:1665191
for i in $(git branch -a | grep "rc-"); do git push origin :${i#remotes/origin/}; done
@jimbojsb
jimbojsb / gist:1665345
Created Jan 23, 2012
Delete resolved jira ticket branches
View gist:1665345
#!/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 Feb 6, 2012
How to Re-Download everything from iTunes Match
View gist:1749610
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
View header
<!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>
You can’t perform that action at this time.