Skip to content

Instantly share code, notes, and snippets.

@PurpleBooth
PurpleBooth / Dockerfile
Last active March 21, 2024 09:33
Create a static binary in go and put it in a from scratch docker container
FROM golang:1.9
WORKDIR /go/src/github.com/purplebooth/example
COPY . .
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go
FROM scratch
COPY --from=0 /go/src/github.com/purplebooth/example/main /main
CMD ["/main"]
@kostiklv
kostiklv / remember_password.html
Created May 12, 2011 16:53
How to make browser's remember password work with dynamic/AJAX login form
<html>
<!--
This is an example of how to make browsers
offer to remember password and later fill in those passwords
for dynamic login forms.
To make the browser offer to remember passwords the form should be actually submitted.
Since we are handling login with AJAX we don't want the form to submit, so we are still submitting it
into a dummmy iframe with dummy URL.
It's good idea to actually create empty dummy.html file, otherwise you'll flood you error.log with 404s