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
View gist:8698962
$login = $client->post("/rest/login", array("Content-Type" => "application/json"), '', array('debug' => true));

Keybase proof

I hereby claim:

  • I am stubbs on github.
  • I am 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:

View Gruntfile.js
'use strict';
module.exports = function (grunt) {
clean: ['build'],
concurrent: {
dev: ['nodemon:app', 'webpack:dev'],
options: {
logConcurrentOutput: true
Stubbs / watchr.rb
Created Mar 9, 2011
This is a watchr config script that watches all the Python files in the directories specified by the "watch" command. You can specify one for each Django app in your project.
View watchr.rb
require "ruby-growl"
watch ('project/(.*).py') {|md| code_changed "#{md[0]}"}
def code_changed(file)
# Get the path of the file that changed
dir = File.dirname(file)
View gist:999180
buildstats@buildstats-desktop:~/statsd$ node stats.js config.json
"graphitePort": 2003,
SyntaxError: Unexpected token :
at Module._compile (node.js:458:37)
at Module._loadScriptSync (node.js:469:10)
at Module.loadSync (node.js:338:12)
at loadModule (node.js:283:14)
Stubbs /
Created Nov 23, 2011
Behat Bash Autocompletion
# Add this to your /etc/bash_completion.d directory for behat parameter auto completion.
local cur prev opts
Stubbs / pre-commit
Created Jan 17, 2012
pre-commit hook to stop you commiting broken tests.
View pre-commit
# Script to check the status of the last test run & cancel the commit if there are any errors or failures
# Check the test results exist, and have results in them.
if [ ! -s $RESULTS ]
echo "WTF is this shit? You've not even tried to run the tests. You suck, man."
Stubbs / watchr.rb
Created Feb 2, 2012
watchr script to auto-run phing tests
View watchr.rb
# Watchr config script to run phing tests every time you save PHP or fixtures.
# See
watch('./(.*).(php|inc)') { |m| code_changed(m[0]) }
watch('./fixtures.sql') { |m| code_changed(m[0]) }
watch('phpdebug_trigger') { |m| code_changed(m[0]) }
def code_changed(file)
run "phing test"
Stubbs / gist:2724564
Created May 18, 2012
Dirty hack for Macvim when it hangs trying to add new lines to files.
View gist:2724564
" 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
View fc_player
YUI.add('fc_cone', function(Y)
Y.ConeIcon = Y.Base.create("coneIcon", Y.Shape, [Y.Circle], {}, {
radius: {
value: 5
stroke: {
weight: 2,
color: '#fff'
You can’t perform that action at this time.