Skip to content

Instantly share code, notes, and snippets.

View lukaszmn's full-sized avatar

Łukasz Nojek lukaszmn

View GitHub Profile
@barsa-net
barsa-net / Dockerfile
Last active February 29, 2024 16:14
wagoodman/dive image builder for ARM64/aarch64
FROM golang:alpine AS builder
RUN apk update && \
apk add git make
WORKDIR /go/src
ARG DIVE_VERSION=${DIVE_VERSION:-v0.10.0}
RUN git clone https://github.com/wagoodman/dive.git dive && \
git -C /go/src/dive checkout ${DIVE_VERSION}
@endofcake
endofcake / Dockerfile
Last active May 6, 2024 17:20
Copy *.csproj files during a docker build, preserving the directory structure (kudos to @aidansteele)
COPY src/*/*.csproj ./
RUN for file in $(ls *.csproj); do mkdir -p ${file%.*}/ && mv $file ${file%.*}/; done
@vkobel
vkobel / underscoreCase.cs
Created August 7, 2014 14:22
Simple C# extension method to convert a camel case string to underscore notation without any regex
public static class ExtensionMethods {
public static string ToUnderscoreCase(this string str) {
return string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "_" + x.ToString() : x.ToString())).ToLower();
}
}