Skip to content

Instantly share code, notes, and snippets.

View AvicennaJr's full-sized avatar

Avicenna AvicennaJr

View GitHub Profile
@jgould22
jgould22 / Dockerfile
Last active June 19, 2024 18:52
Postgres 15 - Alpine - pg_partman with pg_jobmon
FROM postgres:15-alpine
LABEL maintainer="Jordan Gould <[email protected]>"
# Based on https://github.com/andreaswachowski/docker-postgres/blob/master/initdb.sh
ENV PG_JOBMON_VERSION v1.4.1
ENV PG_PARTMAN_VERSION v4.7.1
# Install pg_jobmon
RUN set -ex \
\
@lummie
lummie / custom_time.go
Last active August 14, 2024 14:14
Golang custom date / time formats when marshalling to JSON
// CustomTime provides an example of how to declare a new time Type with a custom formatter.
// Note that time.Time methods are not available, if needed you can add and cast like the String method does
// Otherwise, only use in the json struct at marshal/unmarshal time.
type CustomTime time.Time
const ctLayout = "2006-01-02 15:04:05 Z07:00"
// UnmarshalJSON Parses the json string in the custom format
func (ct *CustomTime) UnmarshalJSON(b []byte) (err error) {