Skip to content

Instantly share code, notes, and snippets.

@jeremyharris
jeremyharris / TimerPrinter.php
Created Sep 25, 2018
A printer for PHPUnit that includes top 10 slowest tests in results. With `--verbose` it will show the top 10 slowest test methods.
View TimerPrinter.php
<?php
namespace App\TestSuite;
use Cake\Collection\Collection;
use PHPUnit\Framework\Test;
use PHPUnit\Util\Test as TestUtil;
use PHPUnit\TextUI\ResultPrinter;
class TimerPrinter extends ResultPrinter
{
View QueueManager.php
<?php
namespace App\Queue;
use Cake\Event\Event;
use Cake\Event\EventManager;
use josegonzalez\Queuesadilla\Job;
use Josegonzalez\CakeQueuesadilla\Queue\Queue;
/**
* QueueManager
View AssertionTest.php
<?php
class CallbackCaller
{
public function on($callback)
{
// whoops doesn't fire, perhaps due to code error
}
}
View keybase.md

Keybase proof

I hereby claim:

  • I am jeremyharris on github.
  • I am jeremyharris (https://keybase.io/jeremyharris) on keybase.
  • I have a public key whose fingerprint is A7EC 4BE9 E2BA 76B7 BA7E 1CD0 DD51 37B6 19AA 86B4

To claim this, I am signing this object:

View FixtureTestCase.php
<?php
// we're loading the Database TestCase here
require 'PHPUnit' . DIRECTORY_SEPARATOR . 'Extensions' .
DIRECTORY_SEPARATOR . 'Database' . DIRECTORY_SEPARATOR .
'TestCase.php';
class FixtureTestCase extends PHPUnit_Extensions_Database_TestCase {
public $fixtures = array(
'posts',
@jeremyharris
jeremyharris / backup.sh
Created Jul 10, 2012
Quick bash script to backup mysql databases as separate files similar to how MySQL Workbench does
View backup.sh
#!/bin/bash
#
# Script to backup all mysql tables as separate files
#
# $BACKUP_PATH/<date>/<db_name>/<host>_<table_name>.gz
# MySQL settings
MYSQL_USER="root"
MYSQL_PASS=""
MYSQL_HOST="localhost"
@jeremyharris
jeremyharris / gist:2654088
Created May 10, 2012
A small collection of useful git commands for beginners.
View gist:2654088
# This is a handful of git commands I use on a daily basis, some of
# which are pretty basic, some of which took a little research to
# figure out how to do (so hopefully this is a time saver). It's
# by no means an exhaustive list as git is really freaking robust.
########################
# logs
########################
# unmerged differences between dev and master (not including extra master commits)
@jeremyharris
jeremyharris / gist:2032026
Created Mar 13, 2012
CSS 3d translation discrepancies
View gist:2032026
<!DOCTYPE html>
<html>
<head>
<title>translate/perspective test</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
.wrapper {
position: absolute;
left: 50%;
top: 50%;