Skip to content

Instantly share code, notes, and snippets.

View jonphipps's full-sized avatar

Jon Phipps jonphipps

  • Metadata Management Associates
  • Ottawa, Ontario Canada
View GitHub Profile
@jonphipps
jonphipps / index.php
Created October 29, 2012 21:05
Laravel: test
// --------------------------------------------------------------
// Set the core Laravel path constants.
// --------------------------------------------------------------
require '../paths.php';
// --------------------------------------------------------------
// Unset the temporary web variable.
// --------------------------------------------------------------
unset($web);
@jonphipps
jonphipps / gist:4111945
Created November 19, 2012 17:07
VisualJSON cannot be opened log
Process: VisualJSON [31509]
Path: /Applications/VisualJSON.app/Contents/MacOS/VisualJSON
Identifier: org.3rddev.VisualJSON
Version: 1.2.2 (1.2.2)
App Item ID: 488709442
App External ID: 11814081
Code Type: X86-64 (Native)
Parent Process: launchd [308]
Date/Time: 2012-11-19 12:06:17.310 -0500
@jonphipps
jonphipps / DbmigrateController.php
Last active August 29, 2015 14:26 — forked from bruceoutdoors/DbmigrateController.php
Laravel 4 Convert existing MySQL database to migrations. This is a fork of Christopher Pitt's work http://laravelsnippets.com/snippets/convert-an-existing-mysql-database-to-migrations, which is based off michaeljcalkins's work at http://paste.laravel.com/1jdw#sthash.0nEgQzQR.dpuf. His original source code doesn't really work out of the box in my…
<?php
/* * **
*
* This script converts an existing MySQL database to migrations in Laravel 4.
*
* 1. Place this file inside app/controllers/
*
* 2. In this file, edit the index() method to customize this script to your needs.
* - inside $migrate->ignore(), you pass in an array of table
<?php
class BulkUpdateModelTest extends TestCase
{
/** @expectedException ReflectionException */
public function testItthrowsAnException_if_the_requested_model_is_invalid()
{
$status = $this->artisan('mynamespace:bulkupdate',['model' => 'foo']);
}
public function testItDisplaysAnError_if_the_requested_model_is_invalid()
@jonphipps
jonphipps / .env
Last active January 30, 2016 22:14
LOCAL_HOME=/Users/joeblough
VAGRANT_HOME=/home/vagrant
...
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_PORT_VM=33060
...
@jonphipps
jonphipps / Handler.php
Last active February 7, 2016 21:24
app/Exceptions/Handler.php
<?php
...
if ($request->ajax()) {
$whoops->pushHandler(new \Whoops\Handler\JsonResponseHandler());
} else {
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
}
@jonphipps
jonphipps / Handler.php
Last active February 7, 2016 21:23
Modified app/Exceptions/Handler.php
<?php
...
if ($request->ajax() || $request->wantsJson()) {
$whoops->pushHandler(new JsonResponseHandler());
} else {
$handler = new PrettyPageHandler();
//$handler->setEditor('phpstorm');
$handler->setEditor(
function ($file, $line) {
@jonphipps
jonphipps / .env
Last active February 7, 2016 21:23
Modified .env
LOCAL_HOME=/Users/joeblough
SERVER_HOME=/home/vagrant
...
DB_CONNECTION=mysql
...
@jonphipps
jonphipps / whoops.base.css
Created January 30, 2016 22:38
Small fix to whoops 2.0 css
.frame-file .editor-link {
color: #67B3FF;
text-decoration: underline;
}
@jonphipps
jonphipps / .bash_profile
Created March 3, 2016 21:52
Enabling debug on the command line
...
alias phpx="/usr/local/bin/php \
-dxdebug.remote_enable=1 \
-dxdebug.remote_mode=req \
-dxdebug.remote_port=9000 \
-dxdebug.remote_host=127.0.0.1 \
-dxdebug.remote_autostart=1 \
-dzend_extension=/usr/local/opt/php56-xdebug/xdebug.so"