Skip to content

Instantly share code, notes, and snippets.

View Stubbs's full-sized avatar

Stuart Grimshaw Stubbs

  • Sheffield, South Yorkshire, UK
View GitHub Profile
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
@Stubbs
Stubbs / bootstrap.php
Created May 26, 2013 00:22
Isolate unit tests in Symfony2 http://php-and-symfony.matthiasnoback.nl/2011/10/symfony2-use-a-bootstrap-file-for-your-phpunit-tests-and-run-some-console-commands/ and then use this as your bootstrap to load migrations & fixtures.
<?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;
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
@Stubbs
Stubbs / pre_commit
Created October 16, 2013 10:37
Git Hook to reject PHP syntax errors & any php that directly calls "error_log"
#!/bin/bash
PLATFORM='unknown'
UNAMESTR=`uname`
XARGS_EXIT=1
if [[ "$UNAMESTR" == 'Linux' ]]; then
PLATFORM='linux'
XARGS_EXIT=123
elif [[ "$UNAMESTR" == 'FreeBSD' ]]; then
PLATFORM='freebsd'
$login = $client->post("/rest/login", array("Content-Type" => "application/json"), '', array('debug' => true));
$login->setBody("{'username':'stuart.grimshaw','password':'strongpassword'}");
$login->send();
@Stubbs
Stubbs / multitail.conf
Last active February 12, 2016 08:50
Basic Multitail config for colourising Symfony2 log files.
colorscheme:symfony
cs_re:cyan:^\[....-..-.. ..:..:..\]
cs_re:blue: .*\.(INFO|NOTICE).*
cs_re:red: .*\.(ERROR|CRITICAL).*
cs_re:blue: \{[^}]+\}

Keybase proof

I hereby claim:

  • I am stubbs on github.
  • I am stubbs (https://keybase.io/stubbs) on keybase.
  • I have a public key whose fingerprint is 74A6 E90F 9B31 AC04 CE3A D430 7596 314A 6514 191E

To claim this, I am signing this object:

@Stubbs
Stubbs / main.yml
Created March 28, 2015 14:31
Ansible Playbook to install PHP7
- name: Install Packages Needed To Compile PHP 7
apt: pkg={{ item }} state=latest
with_items:
- git
- autoconf
- bison
- libxml2-dev
- libbz2-dev
- libmcrypt-dev
- libcurl4-openssl-dev
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
clean: ['build'],
concurrent: {
dev: ['nodemon:app', 'webpack:dev'],
options: {
logConcurrentOutput: true
}
Verifying that +stubbs is my blockchain ID. https://onename.com/stubbs