Skip to content

Instantly share code, notes, and snippets.

@Bogdaan
Bogdaan / leaky_bucket.lua
Created March 25, 2019 11:06 — forked from florentchauveau/leaky_bucket.lua
Redis script (Lua) to implement a leaky bucket
-- Redis script to implement a leaky bucket
-- see https://medium.com/callr-techblog/rate-limiting-for-distributed-systems-with-redis-and-lua-eeea745cb260
-- (c) Florent CHAUVEAU <[email protected]>
local ts = tonumber(ARGV[1])
local cps = tonumber(ARGV[2])
local key = KEYS[1]
-- remove tokens < min (older than now() -1s)
local min = ts -1
@Bogdaan
Bogdaan / Dockerfile
Created December 2, 2019 14:53 — forked from PurpleBooth/Dockerfile
Create a static binary in go and put it in a from scratch docker container
FROM golang:1.9
WORKDIR /go/src/github.com/purplebooth/example
COPY . .
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go
FROM scratch
COPY --from=0 /go/src/github.com/purplebooth/example/main /main
CMD ["/main"]
@Bogdaan
Bogdaan / visualization.ipynb
Created February 21, 2020 10:28 — forked from oinume/visualization.ipynb
Visualization MySQL data in Jupyter Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Bogdaan
Bogdaan / install-php_7.4.0.sh
Created December 13, 2021 13:30 — forked from abenevaut/# install php 7.4.0.md
Install phpbrew && php 7.4.0 on macOS
xcode-select --install
# You should install brew https://brew.sh/index_fr
brew install automake autoconf curl pcre bison re2c mhash libtool icu4c gettext jpeg openssl libxml2 mcrypt gd gmp libevent zlib libzip bzip2 imagemagick pkg-config oniguruma
brew link --force icu4c
brew link --force openssl
brew link --force libxml2
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew