Skip to content

Instantly share code, notes, and snippets.

@EpeeCheeze
EpeeCheeze / gist:32a83b173365b16b9c0f
Created September 5, 2014 18:58
PHPUnit Autoload function
<?php
define('__PHPUNIT_PHAR_ROOT__', 'phar:///usr/local/bin/phpunit.phar');
spl_autoload_register(
function ($class)
{
static $classes = NULL;
if ($classes === NULL) {
$classes = array(
'file_iterator' => '/php-file-iterator/Iterator.php',
@EpeeCheeze
EpeeCheeze / gist:6992506
Last active December 25, 2015 14:39
Rename all *.css files to *.scss files
find . -type f | grep \.css$ | egrep -v "(tiny_mce|jquery|tinymce|scss)" | sed 'p;s/\.css/\.scss/' | xargs -n2 git mv
@EpeeCheeze
EpeeCheeze / test.html
Created June 19, 2013 13:36
Basic Jasmine testing template
<html>
<head>
<link rel="stylesheet" type="text/css" href="<path to jasmine.css>">
<script type="text/javascript" src="<path to jasmine.js>"></script>
<script type="text/javascript" src="<path to jasmine-html.js>"></script>
<script type="text/javascript" src="<path to source>"></script>
<script type="text/javascript" src="<path to spec>"></script>
</head>
<body>
@EpeeCheeze
EpeeCheeze / gist:4279807
Created December 13, 2012 21:00
Commit script to prevent git from committing code with debugging in it
#!/bin/bash
for args in $@
do
case "$args" in
"-f"|"--force")
force=true
;;
esac
@EpeeCheeze
EpeeCheeze / gist:4235660
Created December 7, 2012 19:12
Move modified files to new repo in SVN
for x in `svn status | awk '{print $2}'`; do cp $x ../<new_branch>/$x; done
@EpeeCheeze
EpeeCheeze / run_files
Created February 14, 2012 22:29
Run PHPUnit on individual test files
#!/bin/bash
cd $1
for f in $(ls -l | grep -v ^d | awk '{print $8}')
do
echo "Running " $f
phpunit $f
echo
echo "*********************************"
@EpeeCheeze
EpeeCheeze / commit
Created November 14, 2011 19:00
Bash script to prevent committing debug code in Git
#!/bin/bash
for args in $@
do
case "$args" in
"-f"|"--force")
force=true
;;
esac
@EpeeCheeze
EpeeCheeze / makediff
Created November 14, 2011 18:57
Create a diff of code only if there is no debug code present
#!/bin/bash
#For creating a code review diff. Making sure that no debugging code is located in the diff.
#This file will not create the diff if there are dump, print_r or NOCOMMIT statements.
#As echo and alert statements may be valid code, a warning is generated and a diff is made.
cd ~/whitelabel
branchName=$2
diffName=$1
@EpeeCheeze
EpeeCheeze / gist:1299115
Created October 19, 2011 17:56
One Liner to get list of filenames
ls -l | grep ^- | awk '{print $8}'