Skip to content

Instantly share code, notes, and snippets.

View lucasepe's full-sized avatar
🎯
Focusing ...

Luca Sepe lucasepe

🎯
Focusing ...
View GitHub Profile
@lucasepe
lucasepe / throttled_transport.go
Created June 26, 2023 11:30 — forked from zdebra/throttled_transport.go
NewThrottledTransport wraps transportWrap with a rate limitter, improvement of https://gist.github.com/MelchiSalins/27c11566184116ec1629a0726e0f9af5 since it allows use of *http.Client
package main
import (
"net/http"
"time"
"golang.org/x/time/rate"
)
// ThrottledTransport Rate Limited HTTP Client
@lucasepe
lucasepe / ebiten-gfx-blocks.go
Created November 11, 2020 15:22 — forked from peterhellberg/ebiten-gfx-blocks.go
Blocks rendered by Ebiten with gfx.
package main
import (
"github.com/hajimehoshi/ebiten"
"github.com/peterhellberg/gfx"
)
const (
title = "Ebiten GFX Blocks"
scale = 4
@lucasepe
lucasepe / golang_pipe_http_response.go
Created July 10, 2019 15:55 — forked from ifels/golang_pipe_http_response.go
golang pipe the http response
package main
import (
"io"
"net/http"
"os/exec"
)
var (
BUF_LEN = 1024