Skip to content

Instantly share code, notes, and snippets.

View ndamulelonemakh's full-sized avatar
🍸
Solution explorer

Ndamulelo Nemakhavhani ndamulelonemakh

🍸
Solution explorer
View GitHub Profile
@ndamulelonemakh
ndamulelonemakh / api_gateway.conf
Created December 24, 2024 11:47 — forked from nginx-gists/api_gateway.conf
Deploying NGINX Plus as an API Gateway, Part 2: Protecting Backend Services
include api_backends.conf;
include api_keys.conf;
limit_req_zone $binary_remote_addr zone=client_ip_10rs:1m rate=1r/s;
limit_req_zone $http_apikey zone=apikey_200rs:1m rate=200r/s;
server {
access_log /var/log/nginx/api_access.log main; # Each API may also log to a
# separate file
@ndamulelonemakh
ndamulelonemakh / data_split.R
Created June 29, 2021 16:36 — forked from duttashi/data_split.R
splitting a given dataset into train and test
# Method 1: Easiest and does not require any library
data(mtcars)
## 75% of the sample size
smp_size <- floor(0.75 * nrow(mtcars))
## set the seed to make your partition reproducible
set.seed(123)
train_ind <- sample(seq_len(nrow(mtcars)), size = smp_size)