Skip to content

Instantly share code, notes, and snippets.

View benc-uk's full-sized avatar
🎲
𝚁 𝚃𝚊𝚙𝚎 𝚕𝚘𝚊𝚍𝚒𝚗𝚐 𝚎𝚛𝚛𝚘𝚛, 𝟶:𝟷

Ben Coleman benc-uk

🎲
𝚁 𝚃𝚊𝚙𝚎 𝚕𝚘𝚊𝚍𝚒𝚗𝚐 𝚎𝚛𝚛𝚘𝚛, 𝟶:𝟷
View GitHub Profile

Graphics

@benc-uk
benc-uk / sns.http
Last active May 2, 2024 13:53
Fake and mock SNS messages with VSCode HTTP extension
# Fake SNS messages with VSCode REST Extension
# Install this - https://marketplace.visualstudio.com/items?itemName=humao.rest-client
@TOPIC_ARN = "arn:aws:sns:us-east-1:286528903076:BenTestTopic"
###
# Fake SNS message subscription
POST http://localhost:8000/sns/subscription
x-amz-sns-message-type: SubscriptionConfirmation
@benc-uk
benc-uk / sns_fastapi.py
Last active May 2, 2024 13:46
Simple FastAPI web app to subscribe & receive from an SNS Topic
from fastapi import FastAPI, Request
from dotenv import load_dotenv
import uvicorn
import requests
import os
load_dotenv()
app = FastAPI()
@benc-uk
benc-uk / jwt_fast_api.py
Last active February 8, 2024 13:38
Python
from fastapi import FastAPI, Request, status
from fastapi.responses import PlainTextResponse
import jwt
import logging
logger = logging.getLogger(__name__)
app = FastAPI()
@app.middleware("http")
async def auth_middleware(request: Request, call_next):
@benc-uk
benc-uk / adr.md
Last active February 21, 2023 11:53
Architectural Decision Records

Architectural Decision Records (ADRs)

An architectural decision record (ADR) is a document that describes a choice the team makes about a significant aspect of the software architecture they’re building. Each ADR describes the architectural decision, its context, and its consequences. Many ADRs represent cross cutting concerns which will impact the project as a whole.

The ADR process outputs a collection of architectural decision records. This collection creates the decision log. The decision log provides the project context as well as detailed implementation and design information. Project members skim the headlines of each ADR to get an overview of the project context. They read the ADRs to dive deep into project implementations and design choices.

When the team accepts an ADR, it becomes immutable. If new insights require a different decision, the team proposes a new ADR. When the team accepts the new ADR, it supersedes the previous ADR.

Personal ADR Manifesto

@benc-uk
benc-uk / # GitHub Actions.md
Last active October 26, 2022 11:08
GitHub Actions

GitHub Actions

@benc-uk
benc-uk / #Linting.md
Last active October 26, 2022 11:08
Linting

Linting config and tools

@benc-uk
benc-uk / Demo Apps.md
Last active June 4, 2024 09:56
Demo Apps - Collection

This a collection of demo apps, all of which are aimed at for deployment as containers, mainly into Azure but could obviously run anywhere. These are designed for demos and hands on lab exercises, to be used with Azure and DevOps CI & CD scenarios, where you need "something" to deploy and push through the pipeline.

The apps are all small, simple standalone web applications but they are designed for ease of deployment, showcasing use of cloud native deployment scenarios and running as containers, rather than complete examples of a fully functioning architecture.

Example deployment scenarios

  • Run locally
  • Run as Docker container
  • Run in Kubernetes & AKS
  • Run in Azure App Service
  • Run in Azure Container Instance & Container Apps
@benc-uk
benc-uk / #go.md
Last active October 31, 2023 21:40
Go

Go Language

Snippets of Go code etc