Skip to content

Instantly share code, notes, and snippets.

View fieldse's full-sized avatar

Matt fieldse

View GitHub Profile
@zmb3
zmb3 / static_cgo.md
Created October 5, 2020 15:45
Compile static binaries for Go programs that leverage Cgo.

In order to compile a fully static binary when using Cgo you'll need to link in a C library like musl.

I find it convenient to have a Docker image ready for building these artifacts.

FROM golang
RUN wget https://www.musl-libc.org/releases/musl-1.2.0.tar.gz && \
   tar -zf musl-1.2.0.tar.gz && \
   cd musl-1.2.0 && \
 ./configure --enable-static --disable-shared && \
@jflasher
jflasher / intelligent-tiering.md
Created February 1, 2019 15:21
Instructions for setting up a lifecycle policy for S3 Intelligent-Tiering

Amazon S3 now supports a new storage class called Intelligent Tiering. This will be a very attractive option for many customers who have datasets that are accessed in unpredictable patterns. You can set this storage class when uploading any new data. However, the below instructions will allow you to set up a lifecycle policy that will change the storage class of data that already exists in your bucket.

To set up a lifecycle policy to change the storage class of the data currently stored in your Amazon S3 bucket, follow the below steps.

  1. Visit the S3 console and go to your bucket of interest.

  2. Click on the Management tab at the top and select + Add lifecycle rule.

  3. Enter a rule name of your choice (e.g., Convert to Intelligent Tiering storage class). Unless you want to filter which data is converted to the new storage class, you can leave the prefix/tag filter field

@GabrielCzar
GabrielCzar / DOCKER_COMPOSE.md
Last active March 16, 2024 21:42
Docker compose samples

Scripts to run specific services

@PaulBradley
PaulBradley / deterministic-UUID.md
Last active April 14, 2024 21:01
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 {
@stigok
stigok / atom-commands.md
Last active September 7, 2022 01:47
List of key bindable Atom commands

Atom Commands

Application

application:about
application:show-preferences
application:show-settings
application:quit
application:hide

application:hide-other-applications