Skip to content

Instantly share code, notes, and snippets.


Ryan Brooks spikeheap

View GitHub Profile
spikeheap /
Last active Aug 20, 2017
Introduction to Coaching Workshop, Oxford 2017-08-12

Workshop sessions

First we split into groups of 5 and asked:

What experience do you have of coaching or mentoring? What’s the difference between mentoring and coaching?

Session 1

Once we’d committed to confidentiality and making the workshop a safe space, in pairs we covered:

What is it like doing your job?

# Requires the following environment variables:
source .env.docker
curl -s -H "Authorization: token $GITHUB_OAUTH_TOKEN" "$COMMIT_REF" \
| jq '.content' --raw-output \
| base64 --decode \
> Gemfile
View build.log
root@58857b49d831:/openMVS_build# make -j2
Scanning dependencies of target Common
[ 1%] Building CXX object libs/Common/CMakeFiles/Common.dir/Timer.cpp.o
[ 3%] Building CXX object libs/Common/CMakeFiles/Common.dir/Common.cpp.o
In file included from /openMVS/libs/Common/Types.h:357:0,
from /openMVS/libs/Common/Common.h:176,
from /openMVS/libs/Common/Timer.cpp:8:
/openMVS/libs/Common/HalfFloat.h: In static member function 'static short int SEACAVE::hfloat::fromFloat(float)':
/openMVS/libs/Common/HalfFloat.h:62:29: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
const int& fltInt32((int&)fv);
spikeheap / test.rb
Last active Jan 2, 2017
Rails Docker DB with migrations
View test.rb
require 'docker'
Rails.application.configure do
config.after_initialize do "db:migrate"
ActiveRecord::Migrator.migrate(Rails.root.join("db/migrate"), nil)
spikeheap / env_var_perf_test.php
Created Nov 17, 2016
A naïve perftest of EmonCMS settings logic
View env_var_perf_test.php
// 10,000,000
$run_count = 10000000;
$start_time = time();
for ($i = 0; $i < $run_count; $i++) {
//1 #### Mysql database settings
if (isset($_ENV["MYSQL_HOST"])) $server = $_ENV["MYSQL_HOST"];
if (isset($_ENV["MYSQL_DATABASE"])) $database = $_ENV["MYSQL_DATABASE"];
spikeheap / stdin_reader.rb
Last active Jun 29, 2016
Reading STDIN with threads in Ruby
View stdin_reader.rb
require 'thread'
queue =
producer = do
loop do
key = STDIN.getch
queue << key if key
spikeheap / Dockerfile
Created Apr 29, 2016
Nginx HTTPS proxy for Rails
View Dockerfile
FROM alpine:3.2
RUN apk add --update nginx openssl && rm -rf /var/cache/apk/*
COPY ./nginx.conf /etc/nginx/nginx.conf
# Generate certificates
ENV CERTIFICATE_DIR=/usr/local/app/certs
spikeheap / add_m_attribute.xsl
Last active Nov 9, 2015
Add `m` attribute to all leaf nodes
View add_m_attribute.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=""
xmlns:xs="" exclude-result-prefixes="xs" version="2.0"
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:variable name="dateNow" select="format-date(current-date(), '[Y0001]-[M01]-[D01]')"/>
<xsl:template match="node()|@*">
export XMLLINT_FILE=xmllint_20151103_1930.log
xmllint --schema docs/NHIC_ICU_v8.3.2-Final.xsd --noout docs/output/NIHRHIC_CC_8.3.2_Oxford\ 03112015.xml 2>&1 | grep -v "The attribute 'm' is required but missing." > $XMLLINT_FILE
# get an overview of the failure counts
cut -d':' -f3 $XMLLINT_FILE | sort | uniq -c | sort
# lookup a particular error (_0085 in this case):
cat $XMLLINT_FILE | grep _0085 | cut -d: -f7 | sort -u
spikeheap /
Last active Oct 8, 2015
Git Flow start the day

Add this function to your ZSH/BASH init to do a sane update of develop and master. Handy when you come back to a project after a couple of days.

Note that this doesn't merge develop into your current branch, but I'll leave that to you to add if you need it :).

You can’t perform that action at this time.