Skip to content

Instantly share code, notes, and snippets.

View ricleal's full-sized avatar
☢️
Coding the World a Better Place

Ricardo Ferraz Leal ricleal

☢️
Coding the World a Better Place
View GitHub Profile
@ricleal
ricleal / main.go
Last active September 17, 2022 07:23
Go Clean Archicture
package main
import "fmt"
// Reference: https://user-images.githubusercontent.com/20016700/47955442-f0a66c00-dfa0-11e8-83f9-2856ed6ba159.png
// outer
// starts the call
type Controller struct {
@ricleal
ricleal / n-producers_n-consumers.go
Last active June 23, 2023 02:37
N-Producers fanout N-Consumers with registry
package main
import (
"fmt"
"math/rand"
"sync"
"time"
)
var ch chan int
@ricleal
ricleal / http_server.py
Last active January 21, 2024 15:31
colorized simple echo http server
#!/usr/bin/env python3
'''
start as: http_server.py -p 8080
'''
from email import header
import http.server
import socketserver
import argparse
@ricleal
ricleal / rate_limiter.go
Created January 28, 2024 21:17
go rate limiter
package main
import (
"context"
"encoding/json"
"fmt"
"net/http"
"sync"
"time"