Skip to content

Instantly share code, notes, and snippets.

View trungdlp-wolffun's full-sized avatar
😘
One heart, one love

Trung Duong trungdlp-wolffun

😘
One heart, one love
View GitHub Profile
@trungdlp-wolffun
trungdlp-wolffun / find_closest.go
Last active October 17, 2022 03:13
Golang: Find closest element in array
func findClosest(arr []int, target int) int {
n := len(arr)
if n == 0 {
panic("empty array")
}
if target < arr[0] {
return arr[0]
}
@trungdlp-wolffun
trungdlp-wolffun / docker-compose.yaml
Created April 24, 2024 10:42
Github Runner Docker
version: "3.7"
services:
runner:
image: myoung34/github-runner:ubuntu-focal
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
RUNNER_SCOPE: repo
package echo_limiter
import (
"errors"
"net/http"
"strconv"
"time"
"github.com/go-redis/redis_rate/v10"
"github.com/labstack/echo/v4"
package main
import (
"fmt"
"math/big"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/lmittmann/w3"
"github.com/lmittmann/w3/module/eth"