Skip to content

Instantly share code, notes, and snippets.

Chris Roos chrisroos

Block or report user

Report or block chrisroos

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
chrisroos / hsbc-friendly-account-names.user.js
Created Feb 7, 2014
A simple Greasemonkey style user script to replace account numbers with friendly names in the HSBC business banking user interface
View hsbc-friendly-account-names.user.js
// ==UserScript==
// @name HSBC - Friendly account names
// @namespace
// @description Replace account numbers with friendly names to help differentiate accounts in HSBC UK Business banking
// @include*
// ==/UserScript==
(function() {
var accounts = {
'12345678': 'Current account',
chrisroos /
Last active Aug 29, 2015
JavaScript utility to list the pages with most activity on the wiki

I've created this to make it easier to see the pages with most activity on

It's designed to be used on the recent changes page of the wiki, e.g.

Paste this script into Chrome's JavaScript console (it might work in other browsers but I haven't tested it) and inspect the output there.

The easiest way to exclude some dates is to remove the ul for that date using the Chrome developer tools.

chrisroos /
Last active Aug 29, 2015
Example of the "not supported" error message problem in video.js

In Chrome 34.0.1847.116 on Mac OS X 10.9.2, this configuration (specifically the lack of type="video/mp4" on the source element) of video.js causes the notSupportedMessage error message to be dislayed by the video.js player. Although I can see the error message has been added to the DOM, it's not visible and it causes the vjs-poster element to be pushed down the page, resulting in one copy of the poster image overlaying the other.

I've raised this as issue 1164 in the video.js repo.

chrisroos /
Last active Aug 29, 2015
Testing the video.js error messages plugin

This is a test of the video.js errors plugin. I'm not sure it's quite working reliably enough for us to use it. I got it to display an error in Chrome by faking a 504 response from the video source, but that error wasn't shown in Safari or Firefox. Firefox tells me that the source couldn't be loaded in the developer console but Safari just shows the spinning loader and nothing in the developer tools that I can see.

NOTE I had to explicitly reference the plugin in the data-setup attribute as per issue 5 on the original videojs-errors repo.

chrisroos /
Created Oct 3, 2014
Parse CloudStore results and display as markdown


Parse a CloudStore search results page and display the results as markdown.

NOTE. It only displays the first page of search results

Usage example

$ curl -s "" | \
  ruby cloudstore-results-parser.rb
chrisroos / honeybadger-helper.js
Last active Aug 29, 2015
Functions that help when dealing with large numbers of exceptions in Honeybadger
View honeybadger-helper.js
// Mark all Honeybadger exceptions as resolved if
// they don't have any error text
// This suggests they are Cloudflare errors in the
// current project
$('td.error').each(function() {
var overview = $('.overview', $(this));
if (overview.text().trim() == '') {
var toggleButton = $('input[name="fault[resolved]"]', $(this).parent());;

Investigation into Rails routing

I wanted to understand how combinations of resources :format and resources :constraints affected the HTTP response codes from Rails.

I created a new Rails 4.1.8 app and used scaffolding (rails g scaffold people name:string) to create a very simple app.

I started the Rails server and created a single person (with ID 1).

I updated the Routes and recorded the results of a request to GET the Person using cURL.

chrisroos /
Last active Aug 29, 2015
Installing aisdecoder on Ubuntu in VirtualBox
chrisroos /
Last active Aug 29, 2015
The problem I had when installing gems under Ruby 2.1.5

I'm getting this error when installing eventmachine in one project, and therubyracer in another.

I tried re-installing Command Line Tools for XCode 6.3 but that didn't work.

I tried re-installing Ruby 2.1.5 but that didn't work.

Having re-read "Missing c++ header <__debug> after updating OSX Command Line Tools 6.3" I noticed that it said to reinstall the Command Line Tools for XCode 6.2. I've now done that and can successfully compile eventmachine and therubyracer gems.

Another Stack Overflow post, "Unable to install therubyracer on clean install of Yosemite and clean version of ruby", talks about the same problem but doesn't have an answer listed.

chrisroos /
Created Apr 17, 2015
Configuring Apache, Passenger and Dnsmasq of Mac OS X

Configure Dnsmasq to respond to *.dev

Assuming it's been installed using Homebrew.

Add the following to dnsmasq.conf (/usr/local/etc/dnsmasq.conf).


Stop and start the service:

You can’t perform that action at this time.