Skip to content

Instantly share code, notes, and snippets.

Samuel Parkinson sjparkinson

Block or report user

Report or block sjparkinson

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
@sjparkinson
sjparkinson / RDS-Aurora-CloudFormation-Example.yaml
Last active Sep 11, 2019
A basic CloudFormation template for an RDS Aurora cluster.
View RDS-Aurora-CloudFormation-Example.yaml
---
AWSTemplateFormatVersion: 2010-09-09
Description: >
A basic CloudFormation template for an RDS Aurora cluster.
Parameters:
DatabaseUsername:
AllowedPattern: "[a-zA-Z0-9]+"
ConstraintDescription: must be between 1 to 16 alphanumeric characters.
@sjparkinson
sjparkinson / config.yml
Last active Aug 25, 2019
Deploy a Fastly service using Terraform and CircleCI 2.0.
View config.yml
version: 2
jobs:
validate_terraform:
docker:
- image: hashicorp/terraform
steps:
- checkout
- run:
name: Validate Terraform Formatting
View update-codeowners.sh
#!/bin/bash
# Remove the last line from CODEOWNERS
sed -i '' -e '$ d' CODEOWNERS
# Append the following line to CODEOWNERS
echo "* @Financial-Times/etg" >> CODEOWNERS
View caches-all-the-way-down.md

Caches all the way down

https://ldnwebperf.org/events/caches-all-the-way-down/

Layers of caching in the browser

(kind of Chromium specific here and there)

1. MemoryCache

  • same rendering process, short-lived
  • strict matching, same resource type, etc, CSP
  • everything (even no-cache, except for no-store)
@sjparkinson
sjparkinson / crate-gh-install.sh
Last active Mar 10, 2019
Install binaries from a GitHub release.
View crate-gh-install.sh
#!/bin/sh
# Heavily modified from https://github.com/japaric/trust/blob/gh-pages/install.sh.
help() {
cat <<'EOF'
Install a binary release of a Rust crate hosted on GitHub.
Usage:
install.sh [options]
@sjparkinson
sjparkinson / manage-github-topics.js
Last active Feb 13, 2019
Manage your GitHub repository topics with this command line tool.
View manage-github-topics.js
#!/usr/bin/env node
const yargs = require("yargs");
const Octokit = require("@octokit/rest");
const headers = {
accept: "application/vnd.github.mercy-preview+json"
};
/**
* manage-github-topics [command] [owner]/[repo] [topic ...topic]
* manage-github-topics list --token $GITHUB_API_TOKEN Financial-Times/tako
View Makefile
# To build the application run `make install`.
#
# This target depends on the `node_modules` target.
install: node_modules
# This target depends on a file called `package.json`.
#
# If `package.json` doesn't exist, make complains that you need one! Run `npm init` to generate one.
#
# If `package.json` exists, but `node_modules/` doesn't, make will run `npm install`.
View multi-region.tf
condition {
name = "request_is_us"
statement = "req.http.X-Geoip-Continent ~ \"(NA|SA|OC|AS)\" || (!F_eu_origin.healthy && F_us_origin.healthy)"
type = "REQUEST"
priority = 100
}
condition {
name = "request_is_eu"
statement = "req.http.X-Geoip-Continent !~ \"(NA|SA|OC|AS)\" || (!F_us_origin.healthy && F_eu_origin.healthy)"
@sjparkinson
sjparkinson / 00-type-hinted-array-arguments.php
Last active Aug 21, 2017
Type hint array arguments in PHP 5.6 using variadic functions and argument unpacking.
View 00-type-hinted-array-arguments.php
<?php
$run = function (callable ...$callables) {
foreach ($callables as $callable) {
$callable();
}
};
$callables = [
function () { echo 'Hello '; },
View README.md
You can’t perform that action at this time.