Skip to content

Instantly share code, notes, and snippets.

@sjparkinson
sjparkinson / docker-compose.yml
Created January 4, 2024 16:26
OTel Collector carbon receiver with Prometheus remote write exporter.
version: '3.8'
services:
prometheus:
image: prom/prometheus
ports:
- 9090:9090
volumes:
- ./prometheus.yml:/prometheus/prometheus.yml
command:
- '--web.enable-remote-write-receiver'
@sjparkinson
sjparkinson / config.yaml.diff
Last active October 19, 2020 08:55 — forked from wheresrhys/1. Overview.md
Update your .circleci/config.yml files to add Docker Hub authentication.
version: 2.1
+ # Docker Hub authentication managed by the shared `dockerhub-shared` context.
+ docker-auth: &docker-auth
+ auth:
+ username: $DOCKERHUB_USERNAME
+ password: $DOCKERHUB_ACCESS_TOKEN
jobs:
test:
@sjparkinson
sjparkinson / ocado.sh
Last active April 30, 2020 14:14
Usage: ./ocado.sh $OCADO_SESSION_ID
#!/bin/bash
echo 'Starting Ocado slot checker...'
COUNT=0
CURRENT_STATUS_CODE=404
echo
ocado_slot_status() {
@sjparkinson
sjparkinson / update-codeowners.sh
Created June 20, 2019 15:56
Update CODEOWNERS
#!/bin/bash
# Remove the last line from CODEOWNERS
sed -i '' -e '$ d' CODEOWNERS
# Append the following line to CODEOWNERS
echo "* @Financial-Times/etg" >> CODEOWNERS
@sjparkinson
sjparkinson / crate-gh-install.sh
Last active November 25, 2019 21:01
Install binaries from a GitHub release.
#!/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 February 13, 2019 16:44
Manage your GitHub repository topics with this command line tool.
#!/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
# 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`.
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 / config.yml
Last active August 18, 2022 08:27
Deploy a Fastly service using Terraform and CircleCI 2.0.
version: 2
jobs:
validate_terraform:
docker:
- image: hashicorp/terraform
steps:
- checkout
- run:
name: Validate Terraform Formatting

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)