Skip to content

Instantly share code, notes, and snippets.

View PaulBradley's full-sized avatar
🎯
Focusing

Paul Bradley PaulBradley

🎯
Focusing
View GitHub Profile
@PaulBradley
PaulBradley / deterministic-UUID.md
Last active September 5, 2024 07:24
Generating Deterministic UUID's Within Go #golang

Generating Deterministic UUID's Within Go

I recently worked on a project which needed to interface five hospital systems to one national system. As part of the SOAP submission to the national system I needed to provide a unique UUID which would identify each user from the source hospital system. I wanted to generate the UUID on the fly as the message was being created - so I needed a way to regenerate the same UUID for the same user.

Each hospital system had their own unique user account reference. So by combining this unique account reference with an organisation identifier, I could generate a unique UUID for users with the same account reference across different facilities.

This is the function I came up with. I made use of this package to generate the UUID.

func deterministicGUID(organisation string, account string) string {
@PaulBradley
PaulBradley / crontab.bash
Last active June 29, 2018 15:42
Start a Go service 30 seconds after a Ubuntu Linux Server reboots
@reboot sleep 30 && /path/to/file/startup.bash
@PaulBradley
PaulBradley / install_service.bat
Last active April 11, 2018 16:49
Install Go web application as a Windows Service - using the Non-Sucking Service Manager (https://nssm.cc) #golang
@echo off
nssm install toucan c:\toucan\toucan.exe
nssm set toucan Description "Toucan Extensions"
nssm set toucan Start SERVICE_AUTO_START
nssm start toucan