Skip to content

Instantly share code, notes, and snippets.

View adomaskizogian's full-sized avatar

Adomas Kizogian adomaskizogian

View GitHub Profile
@adomaskizogian
adomaskizogian / Dockerfile
Created July 10, 2024 11:34
minmaxed multiplatform img build
FROM --platform=$BUILDPLATFORM golang:1.22.5-alpine AS base
WORKDIR /src
ENV CGO_ENABLED=0
COPY go.* .
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
FROM base AS builder-linux-amd64
RUN --mount=target=. \
--mount=type=cache,target=/go/pkg/mod \
@adomaskizogian
adomaskizogian / main.go
Created March 19, 2024 12:24
go http quick setup
package main
import (
"context"
"errors"
"fmt"
"log/slog"
"net/http"
"net/http/httputil"
"os"
let isWebpSupportedInstance = null;
const isWebpSupported = async (): Promise<boolean> => {
if (isWebpSupportedInstance !== null) {
return isWebpSupportedInstance;
}
if(checkWebpDecoding){
isWebpSupportedInstance = true;
} else if (await checkWebpLossySupport()){