Skip to content

Instantly share code, notes, and snippets.

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

Luca Sepe lucasepe

🎯
Focusing ...
View GitHub Profile
@zdebra
zdebra / throttled_transport.go
Created June 15, 2021 14:48
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
@jorgerance
jorgerance / figlet_fonts.txt
Last active February 10, 2022 16:22
[Figlet Hamburgefonstiv test] Testing all figlet fonts #fonts #typography #bash #script #Hamburgefonstiv #Hamburgevons
0 ✓ steve@hal9000 ~ $ figlist | \
awk '/fonts/ {f=1;next} /control/ {f=0} f {print}' |\
while read font; do\
printf "\n\n\n>>> Font: $font\n\n"
echo 'Hamburgefonstiv' | \
figlet -w 150 -f $font
done
@peterhellberg
peterhellberg / ebiten-gfx-blocks.go
Last active November 11, 2020 15:23
Blocks rendered by Ebiten with gfx.
package main
import (
"github.com/hajimehoshi/ebiten"
"github.com/peterhellberg/gfx"
)
const (
title = "Ebiten GFX Blocks"
scale = 4
@asukakenji
asukakenji / 0-go-os-arch.md
Last active February 14, 2026 09:48
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@tuannvm
tuannvm / 0.12.tf
Last active February 23, 2026 10:59
#terraform #hashicorp #cheatsheet #0.12
#### first class expresssion
variable "ami" {}
resource "aws_instance" "example" {
ami = var.ami
}
#### list & map
resource "aws_instance" "example" {
vpc_security_group_ids = var.security_group_id != "" ? [var.security_group_id] : []
}
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active June 23, 2025 01:06
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@tajchert
tajchert / gist:73422616624090851fa5
Last active August 16, 2019 00:01 — forked from mediavrog/gist:5625602
Due to Facebook not handling any text in share intent (ACTION_SEND), and not trying to fix it (it is a "feature"), lets remove it from share dialog - as otherwise it results in broken user experience and most likely users will blame us not the Facebook. Bug on Facebook issue tracker https://developers.facebook.com/bugs/332619626816423
// Usage:
// your share intent
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "some text");
intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "a subject");
// invoke custom chooser that contains all apps just without Facebook
startActivity(Tools.customChooserIntentNoFb(intent, "Share using", context));
// Method:
@ifels
ifels / golang_pipe_http_response.go
Last active March 12, 2026 08:18
golang pipe the http response
package main
import (
"io"
"net/http"
"os/exec"
)
var (
BUF_LEN = 1024
# Makefile template for a shared library in C
# https://www.topbug.net/blog/2019/10/28/makefile-template-for-a-shared-library-in-c-with-explanations/
CC = gcc # C compiler
CFLAGS = -fPIC -Wall -Wextra -O2 -g # C flags
LDFLAGS = -shared # linking flags
RM = rm -f # rm command
TARGET_LIB = libtarget.so # target lib
SRCS = main.c src1.c src2.c # source files