Skip to content

Instantly share code, notes, and snippets.

View alanbchristie's full-sized avatar

Alan B. Christie alanbchristie

View GitHub Profile
@alanbchristie
alanbchristie / .cz.yaml
Created April 12, 2022 14:21
IM commitizen CHANGELOG configuration
---
# Commitizen custom configuration.
# Here we extend it to add all our recognised types into the changelog.
# The default ignores pretty-much anything other than 'feat' and 'fix'.
#
# See the default at...
# https://github.com/commitizen-tools/commitizen/
# blob/095f02e6c419b60c90aa84b8cebc9e9eacc8a391/commitizen/defaults.py#L83
commitizen:
name: cz_customize
@alanbchristie
alanbchristie / build-it.sh
Last active April 30, 2022 06:56
Build ARM64 images with buildx
# See https://docs.docker.com/buildx/working-with-buildx
# Here I'm on macOS (11.6.5)
# and using Docker Desktop (4.7.1)
# Multi-architecture build (Docker Desktop)
# Create an isolated buildx instance...
docker buildx create --name mybuilder
docker buildx use mybuilder
# Build something for amd64 and arm64...
@alanbchristie
alanbchristie / group_contractor.py
Created September 22, 2022 14:00
Optimised group compression
#!/usr/bin/env python
"""A recursive Python 3 utility to combine ('contract') a numerical sequence of
'objects' ensuring that combinations of consecutive objects only occurs once.
The sequence of objects is referred to by a numerical index with a minimum value of
'1' and a contiguous unbroken sequence of values up to 'N'.
This optimises the calculation of different combinations by ensuring that
no two consecutive combinations are computed more than once. The user is expected to
iteratively combine 'M' groups of objects using different 'partitions'.
@alanbchristie
alanbchristie / useful-vs-extensions.txt
Last active December 22, 2022 10:18
Useful VS Code Extensions
I find the following VisualStudio Code extensions useful for general development.
- Python Extensions Pack (Don Jayamanne)
- SQLTools (Matheus Teixeira)
- SQLTools PostgreSQL/Cockroach Driver (Matheus Teixeira)
- Code Spell Checker (Street Side Software)
- Conventional Commits (vivaxy)
@alanbchristie
alanbchristie / dm.code-workspace
Last active December 21, 2022 08:19
VS Code DM Workspace file
{
"folders": [
{
"path": "squonk2-data-manager.wiki"
},
{
"path": "squonk2-data-manager"
},
{
"path": "squonk2-data-manager-ansible"
@alanbchristie
alanbchristie / as.code-workspace
Last active December 21, 2022 08:15
VS Code AS Workspace file
{
"folders": [
{
"path": "squonk2-account-server.wiki"
},
{
"path": "squonk2-account-server"
},
{
"path": "squonk2-account-server-ansible"
@alanbchristie
alanbchristie / dm-job.code-workspace
Created December 21, 2022 08:30
VS Code Job Workspace file
{
"folders": [
{
"path": "squonk2-data-manager-job-tester"
},
{
"path": "squonk2-data-manager-job-decoder"
},
{
"path": "squonk2-data-manager-job-utilities"
@alanbchristie
alanbchristie / token-demo.py
Last active July 26, 2023 14:14
API access to a Token-based REST service (Python/requests)
#! /usr/bin/env python
import os
import base64
# Use the Python requests module
# (you'll need to have PIP-installed this - it's not part of core Python)
import requests
# The keycloak credentials (sensitive).
{
"folders": [
{
"path": "Diamond/fragalysis-backend"
},
{
"path": "Diamond/dls-fragalysis-stack-kubernetes"
},
{
"path": "Diamond/fragalysis-stack"
{
"folders": [
{
"path": "squonk2-python-cl-tools"
},
{
"path": "squonk2-admin"
},
{
"path": "squonk2-deck"