Skip to content

Instantly share code, notes, and snippets.


Andrew Betts triblondon

View GitHub Profile

Keybase proof

I hereby claim:

  • I am triblondon on github.
  • I am triblondon ( on keybase.
  • I have a public key whose fingerprint is 7B4B 0965 A224 FC49 0EB1 9D77 70F9 96E8 4701 AE13

To claim this, I am signing this object:

triblondon / http-structured-headers.peg
Last active Dec 3, 2018
PEG parser for HTTP Structured headers
View http-structured-headers.peg
expression "expression" =
first:param rest:(OWS FIELD_SEP OWS param)* {
return [first]
.concat( => entry[3]))
.reduce((obj, entry) => Object.assign(obj, {[entry.label]: entry.value}), {})
param "param" =
label:label val:(OWS "=" OWS (number / label / string))? {
const op = { type: 'param', label: label.value };
triblondon / 1. INIT
Created Aug 3, 2018
Fiddle workshop snippets (exercise 7)
View 1. INIT
table auth_config {
"secret": "my-super-secret-string",
"sessionTTL": "3600"
View gist:06264253749bef68bc9a8278780c648c
.map(line => {
const parts = line.match(/<a href=['"](.*?)['"]>(.*?)\s+(\S+)\s*<\/a>/);
if (parts) {
return {givenName: parts[2], familyName: parts[3], url: parts[1]};
} else {
.sort((a,b) => a['familyName'] > b['familyName'] ? 1 : -1)
View gist:ca7b68a093a1c9375332a879cd12f703
curl -s "[1-408].patch" | egrep "^\+\s+"
triblondon / auth.js
Created Jun 30, 2017
Vary middleware
View auth.js
'use strict';
const USER_ID_HEADER = 'Fastly-Auth-UserID';
const RANK_HEADER = 'Fastly-Auth-Rank';
const TOKEN_HEADER = 'Fastly-Auth-Token';
module.exports = () => {
return (req, res, next) => {
const uid = req.get(USER_ID_HEADER);
const rank = req.get(RANK_HEADER);
triblondon / apps-script.js
Last active Aug 31, 2022
Google apps script for form data to gsheet
View apps-script.js
// Submit form data directly to Google sheets
// (Based on
// ## Setup
// 1. Create a Google spreadsheet and name it
// 2. Choose Tools > Script editor
// 3. Replace the sample code with the contents of this file
// 4. Name the script project something like "Submit form data to Google sheet" (click on 'Untitled project' to change name)
triblondon /
Created Nov 17, 2016
CLA for

All contributions to the polyfill service are made under the MIT licence. It is important therefore that you agree to the following when contributing code to the service:

  • Any contribution I make to the polyfill service by way of Pull Request contains only data that is:
    • wholly my own work, upon which I am legally permitted to grant a licence; or
    • wholly the work of individuals within the same organisation to which the copyright in all work created by employees is assigned, of which I am a current employee and authorised representive for the purposes of this contribution, and which is legally permitted to grant a licence; or
    • licensed by the original author under the MIT licence or equivalent terms
  • In respect of any part of my contribution that is not already available under an MIT or compatible licence, I hereby grant to the Financial Times Limited (FT) and to recipients of software distributed by the FT a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable license to make,
triblondon /
Last active Oct 31, 2016
W3C TAG Developer summit

The W3C TAG (Technical Architecture Group) is in charge of coordinating cross-technology architecture and the principles of web architecture at the World Wide Web Consortium. In other words, it’s kind of a technical steering group for web standards. We’re having a face to face meeting in November in Tokyo (hosted by Nikkei).

As part of our time here we'll be holding an evening developer event (followed by party) on the evening of November 2nd where we can let you know what we're up to and get feedback from the web developer community about your priorities. The event is a partnership between Front End Meetup Tokyo and W3C/Keio. The format of the event will be as follows:

Time Description
18:30 Registration opens
19:00 Welcome, followed by four lightning talks (20 mins)
19:20 Break-out Sessions (1 hour)
20:20 Wrap-up session where we will summarize what has been discussed in the break-outs (15 mins)
View EY GlobalOne bugs
I use Google Chrome, stable, version 52.