Skip to content

Instantly share code, notes, and snippets.

View SydneyUni-Jim's full-sized avatar

Jim Nicholls SydneyUni-Jim

View GitHub Profile
@SydneyUni-Jim
SydneyUni-Jim / custom_rich_handler.py
Last active August 8, 2026 11:31
Rich logging handler that uses emoji to represent the log levels
import logging
from logging import LogRecord
from typing import override
from rich.logging import RichHandler
from rich.text import Text
class CustomRichHandler(RichHandler):
@SydneyUni-Jim
SydneyUni-Jim / make-change-batch.jq
Last active March 15, 2024 03:29
Converts the output of route53 list-resource-record-sets into the change batch input for change-resource-record-sets.
{"Changes": .ResourceRecordSets | map({"Action": "UPSERT", "ResourceRecordSet": .})}
@SydneyUni-Jim
SydneyUni-Jim / parallelTransform.js
Last active March 15, 2024 03:37
Node.js Transform that executes in parallel with an async transformer
import { strict as assert } from 'node:assert'
import { Transform } from 'node:stream'
import os from 'node:os'
export class ParallelAsyncTransform extends Transform {
constructor(maxParallel = os.availableParallelism(), options = {}) {
super({
highWaterMark: maxParallel,
@SydneyUni-Jim
SydneyUni-Jim / pipeline.ts
Last active July 6, 2022 00:25
Custom logical ids for CodeBuild projects
import * as cdk from 'aws-cdk-lib'
import * as codebuild from 'aws-cdk-lib/aws-codebuild'
import * as pipelines from 'aws-cdk-lib/pipelines'
import { Construct } from 'constructs'
export class PipelineStack extends cdk.Stack {
public readonly pipeline: pipelines.CodePipeline