Skip to content

Instantly share code, notes, and snippets.

<?php
class DescribeIndex extends View
{
function itRendersTheSelectedVideo()
{
$video = \Mockery::mock(
'Application_Model_Video', array('getName' => 'Revolution OS'));
$output = $this->render('MyBundle:Video:detail.html.twig', array(
@jjbohn
jjbohn / gist:1584781
Created January 9, 2012 20:30
Is Array test
<?php
$array = array('test' => array());
var_dump($test = $array['test'] && is_array($test));
@jjbohn
jjbohn / pre-commit.sh
Created January 17, 2012 23:15
jjbohn pre-commit hook
#!/bin/bash
diff=`git diff-index --name-status HEAD -- | cut -c3-`
echo "Checking for stray debugging code..."
for FILE in $diff ; do
if [[ -f $FILE && `egrep "(console.log)|(var_dump)|(print_r)" $FILE` ]]; then
echo $FILE 'contains debugging code. Commit canceled.'
exit 1
fi
@jjbohn
jjbohn / .gitconfig
Created June 20, 2012 14:49
.gitconfig
[user]
name = John Bohn
email = jjbohn@gmail.com
[core]
excludesfile = /Users/jbohn/.gitignore
autocrlf = input
sparseCheckout = on
[color]
ui = true
[alias]
<?php
namespace OpenSky\Bundle\MainBundle\Controller;
use OpenSky\Bundle\MainBundle\Document\Sellable\Sellable;
use OpenSky\Bundle\MainBundle\Document\Seller\Category;
use OpenSky\Bundle\MainBundle\Document\User;
use OpenSky\Component\Date\DateRange;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
<script type="text/javascript" src="//assets.zendesk.com/external/zenbox/v2.5/zenbox.js"></script>
<style type="text/css" media="screen, projection">
@import url(//assets.zendesk.com/external/zenbox/v2.5/zenbox.css);
</style>
<script type="text/javascript">
if (typeof(Zenbox) !== "undefined") {
Zenbox.init({
dropboxID: "20149816",
url: "https://gobigwin.zendesk.com",
tabID: "Support",
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
@jjbohn
jjbohn / fabs.rb
Created March 3, 2014 21:54
Fabricator example for Lori
Fabricator(:user) do
username "jjbohn"
email "jjbohn@gmail.com"
password "P@$$w0rd"
end
Fabricator(:movie) do
title "The Big Lebowski"
end