Skip to content

Instantly share code, notes, and snippets.

View GiovaniFerraroTrivelli's full-sized avatar
🏠
Working from home

Giovani Ferraro Trivelli GiovaniFerraroTrivelli

🏠
Working from home
View GitHub Profile
@GiovaniFerraroTrivelli
GiovaniFerraroTrivelli / output-transparent-pixel.go
Created May 14, 2024 19:15 — forked from RobinUS2/output-transparent-pixel.go
Output a 1x1 transparent gif pixel in Go webserver response. Please note, this is only the relevant code, does not work "out-of-the-box".
import (
"fmt"
"net/http"
"time"
)
const transPixel = "\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"
func pixelHandler(w http.ResponseWriter, r *http.Request) {
// Pixel
@GiovaniFerraroTrivelli
GiovaniFerraroTrivelli / output-transparent-pixel.go
Created May 14, 2024 19:15 — forked from RobinUS2/output-transparent-pixel.go
Output a 1x1 transparent gif pixel in Go webserver response. Please note, this is only the relevant code, does not work "out-of-the-box".
import (
"fmt"
"net/http"
"time"
)
const transPixel = "\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"
func pixelHandler(w http.ResponseWriter, r *http.Request) {
// Pixel