Skip to content

Instantly share code, notes, and snippets.

Stuart Grimshaw Stubbs

Block or report user

Report or block Stubbs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Stubbs
Stubbs / multitail.conf
Last active Feb 12, 2016
Basic Multitail config for colourising Symfony2 log files.
View multitail.conf
colorscheme:symfony
cs_re:cyan:^\[....-..-.. ..:..:..\]
cs_re:blue: .*\.(INFO|NOTICE).*
cs_re:red: .*\.(ERROR|CRITICAL).*
cs_re:blue: \{[^}]+\}
View gist:8698962
$login = $client->post("/rest/login", array("Content-Type" => "application/json"), '', array('debug' => true));
$login->setBody("{'username':'stuart.grimshaw','password':'strongpassword'}");
$login->send();
@Stubbs
Stubbs / pre_commit
Created Oct 16, 2013
Git Hook to reject PHP syntax errors & any php that directly calls "error_log"
View pre_commit
#!/bin/bash
PLATFORM='unknown'
UNAMESTR=`uname`
XARGS_EXIT=1
if [[ "$UNAMESTR" == 'Linux' ]]; then
PLATFORM='linux'
XARGS_EXIT=123
elif [[ "$UNAMESTR" == 'FreeBSD' ]]; then
PLATFORM='freebsd'
View debug_log
INFO global: Vagrant version: 1.2.2
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/init/plugin.rb
INFO manager: Registered plugin: init command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/package/plugin.rb
View bootstrap.php
<?php
require_once __DIR__ . '/bootstrap.php.cache';
require_once __DIR__ . '/AppKernel.php';
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Input\ArrayInput;
use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand;
View AppKernel.php
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
@Stubbs
Stubbs / gist:5004858
Created Feb 21, 2013
Can you use wild cards in Puppet exec?
View gist:5004858
exec {"load-crm-fixtures":
command => "mysql -u db_user -ppassword db_name < *.sql",
cwd => "${rootDir}/sites/${siteDirectory}/db/crm/fixtures/",
path => ['/usr/bin'],
require => Exec['clean-crm-db'],
logoutput => true
}
@Stubbs
Stubbs / gist:3497762
Created Aug 28, 2012
Sublime text 2 phpunit plugin error.
View gist:3497762
# Running in folder: /Users/stuart/Projects/lpsite/modules/recurring_payments/tests
$ phpunit -c phpunit.xml /Users/stuart/Projects/lpsite/modules/recurring_payments/tests/recurring_payments/RecurringPaymentErrorTest.php
-c: phpunit: command not found
View fc_player
YUI.add('fc_cone', function(Y)
{
Y.ConeIcon = Y.Base.create("coneIcon", Y.Shape, [Y.Circle], {}, {
ATTRS: {
radius: {
value: 5
},
stroke: {
weight: 2,
color: '#fff'
@Stubbs
Stubbs / gist:2724564
Created May 18, 2012
Dirty hack for Macvim when it hangs trying to add new lines to files.
View gist:2724564
" DIRTY!
" For some reason, Macvim hangs when trying to insert a new line when editing
" mysql & javascript file.
"
" You can work around that by switching to another filetype that doesn't have
" the problem, then back again, hence these two hacks.
"
augroup mysqlhack
au!
You can’t perform that action at this time.