Skip to content

Instantly share code, notes, and snippets.

@bobthemighty
bobthemighty / pants.toml
Created March 20, 2023 13:49
Failure to parse torch requirement
[GLOBAL]
pants_version = "2.15.0"
backend_packages = [
"pants.backend.python"
]
[source]
root_patterns = ["/"]
[python]
@bobthemighty
bobthemighty / naya.py
Last active February 14, 2022 07:19
Streaming spikes
def sip(stream):
"""
NAYA will handle our json just fine so long as it starts with an
open bracket, so it thinks it has a list.
"""
def f():
# Yield a dummy `[`
yield TOKEN_TYPE.OPERATOR, "["
# Followed by the rest of the tokens in the stream
for t in tokenize(stream):
resource "aws_cloudwatch_log_group" "debug" {
name = "API-Gateway-Execution-Logs_${aws_api_gateway_rest_api.stats.id}/${var.stage_name}"
retention_in_days = 1
}
resource "aws_iam_role" "apig_cw" {
name = "stats-apig-cloudwatch-logger"
assume_role_policy = <<-EOF
{
"Version": "2012-10-17",
@bobthemighty
bobthemighty / clamcard.ts
Created September 30, 2021 14:15
ponicode
import { Station, bill } from "../lib";
describe("A single journey in zone A", () => {
const taps: Array<Station> = [Station.Asterisk, Station.Aldgate];
it("should charge £2.50 for the journey", () => {
const [charge] = bill(taps);
expect(charge.amount).toEqual(250);
});
});
@bobthemighty
bobthemighty / production-readiness-checklist.md
Created April 18, 2018 13:14
Production Readiness Checklist

Production Readiness April 2018

Although the pace of change at Made has slowed over the last 12 months, we are still testing new techniques and re-examining best practices. It's useful to periodically reflect on what good practice looks like and make sure we're spreading that knowledge to our dev teams. This is a quick guide to what the Ops team need from developers in 2018. If your systems don't comply with these guidelines, you should chat to a friendly ops person so we can help you prioritise and fix issues.

Operator.MD

Ops can't operate your system if they don't know how to work it. Every system should have an operators.md file in the root of the github repository that describes:

  • What the system does.
  • What the business impact of an outage is.

Keybase proof

I hereby claim:

  • I am bobthemighty on github.
  • I am pathogenix (https://keybase.io/pathogenix) on keybase.
  • I have a public key ASCMDRUTDeWMXR5rO3tRehTbTMjSs00XaWOhIFjSxp8WBQo

To claim this, I am signing this object:

@bobthemighty
bobthemighty / walking-skeleton.md
Last active November 8, 2016 09:48
Comms-todo
  • Connect to eventstore using consul for discovery
    • Do you want to use Consul-template or a consul client for this? CT is going to be easier for AtomicPuppy, I think.
  • Read an event with atomicpuppy and log it
    • Suggest starting with the heartbeat message that we already use for ERP and Availability.
  • Restart the app on SIGHUP
  • Set up proper json logging using the msg_id and msg_type fields
  • Metric: Eventstore response code
  • Metric: Eventstore latency
    • These two may not be possible without changing AtomicPuppy, in which case we should probably not put them in scope.
  • Metric: Event processing time
def doSomethingThatMightFail():
attempts = 0
success = False
retry = True
while retry and not success:
success = call_the_service()
if attempts ++ > MAX_ATTEMPTS:
module(load="imuxsock" SysSock.Use="on")
module(load="omhiredis")
input (type="imuxsock" Socket="/dev/log")
template(name="plain-syslog"
type="list") {
constant(value="{")
constant(value="\"@timestamp\":\"") property(name="timereported" dateFormat="rfc3339")

Keybase proof

I hereby claim:

  • I am bobthemighty on github.
  • I am pathogenix (https://keybase.io/pathogenix) on keybase.
  • I have a public key whose fingerprint is 49CE FED3 0B35 4794 00CA 20C6 710A 1AA3 2A42 69F8

To claim this, I am signing this object: