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(
Verifying that +stubbs is my blockchain ID. https://onename.com/stubbs
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
Verifying that +stuartgrimshaw is my blockchain ID. https://onename.com/stuartgrimshaw
@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'
@Stubbs
Stubbs / keybase.md
Last active February 5, 2016 20:18

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 5E48 F78E 2904 478C F209 4A37 C446 73C2 684C F089

To claim this, I am signing this object:

@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: \{[^}]+\}
@Stubbs
Stubbs / Debounce Node
Created December 22, 2016 14:22
Debounce node for Node Red.
// A little function to debounce messages
// that tend to flip flop a lot
// Uses the message topic as the key.
var debounceTracker = global.get("debounceTracker");
if (!debounceTracker) {
debounceTracker = {};
}
#!/bin/sh
# Download to your project's .git/hooks/prepare-commit-msg and make it executable.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
NAME=/mnt/hendry/media/Videos/cctv/cctv
if [[ -e $NAME.h264 ]] ; then
i=0
while [[ -e $NAME-$i.h264 ]] ; do
let i++
done
NAME=$NAME-$i
fi
/usr/bin/raspivid -n -t 30000 -o $NAME.h264