Skip to content

Instantly share code, notes, and snippets.

@jabley
Created March 29, 2018 16:02
Show Gist options
  • Save jabley/b2647b7329187a3180db05b6e8466cfe to your computer and use it in GitHub Desktop.
Save jabley/b2647b7329187a3180db05b6e8466cfe to your computer and use it in GitHub Desktop.
Generate a tracking pixel image
package main
import (
"encoding/base64"
"log"
"os"
)
func main() {
b64 := "R0lGODlhAQABAID/AP///wAAACwAAAAAAQABAAACAkQBADs="
b, err := base64.StdEncoding.DecodeString(b64)
if err != nil {
log.Fatal(err)
}
f, err := os.Create("1x1.gif")
if err != nil {
log.Fatal(err)
}
if _, err := f.Write(b); err != nil {
log.Fatal(err)
}
if err := f.Close(); err != nil {
log.Fatal(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment