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 / main.yml
Created Mar 28, 2015
Ansible Playbook to install PHP7
View main.yml
- 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
View gist:1b9687163fa2bfcf170dced75d4e6000
actionid: py37
msg: getenv
cmdargs: ['/usr/bin/env', 'LANG=C.UTF-8', 'pip', 'install', '-r/Users/stuart/Projects/HomeAssistant/home-assistant/requirements_test_all.txt', '-c/Users/stuart/Projects/HomeAssistant/home-assistant/homeassistant/package_constraints.txt']
Collecting asynctest==0.12.2 (from -r /Users/stuart/Projects/HomeAssistant/home-assistant/requirements_test_all.txt (line 5))
Using cached https://files.pythonhosted.org/packages/ee/29/9a9289a11b56ceb28dc18fc5b1af9b4223a387269252bb0f349c9da2ed10/asynctest-0.12.2-py3-none-any.whl
Collecting coveralls==1.2.0 (from -r /Users/stuart/Projects/HomeAssistant/home-assistant/requirements_test_all.txt (line 6))
Using cached https://files.pythonhosted.org/packages/7e/26/7a820800615866b624cb5612f7f661405f713b2292cd94ace8b648705747/coveralls-1.2.0-py2.py3-none-any.whl
Collecting flake8-docstrings==1.3.0 (from -r /Users/stuart/Projects/HomeAssistant/home-assistant/requirements_test_all.txt (line 7))
Using cached https://files.pythonhosted.org/packages/4e/a
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 record_video.sh
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
@Stubbs
Stubbs / install_jenkins.sh
Created Feb 3, 2012
Script to install everything you need for PHP CI on a Debian box.
View install_jenkins.sh
#!/bin/bash
## Install Git #########################################
apt-get install git
## Install Ant #########################################
apt-get install ant
## Install Jenkins #####################################
View prepare-commit-msg
#!/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##*/}"
@Stubbs
Stubbs / Debounce Node
Created Dec 22, 2016
Debounce node for Node Red.
View Debounce Node
// 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 = {};
}
@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 keybase.md

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 / 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'
You can’t perform that action at this time.