Skip to content

Instantly share code, notes, and snippets.

View joao-fontenele's full-sized avatar

João Paulo Fontenele Brito joao-fontenele

View GitHub Profile
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active July 15, 2024 21:50
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

#!/bin/bash
# USAGE: ./copy-docker.sh nginx:stable-alpine /etc/nginx/nginx.conf nginx.conf
image=$1
src=$2
dest=$3
container_name="copy-docker-temp"
docker create -it --name ${container_name} ${image} bash
kubectl run myubuntu --image ubuntu --rm -ti --restart=Never --overrides='
{
"metadata": {
"labels": {
"diditwork": "itdid"
}
},
"spec": {
"containers": [
{
@rhossi
rhossi / s3upload.js
Created July 30, 2015 18:22
Uploading files to S3 validating ContentMD5 using AWS SDK for Node.js
var aws = require('aws-sdk'),
fs = require('fs'),
crypt = require("crypto");
function getMD5HashFromFile(file){
var hash = crypt.createHash("md5")
.update(file)
.digest("base64");
return hash;
}
@denji
denji / nginx-tuning.md
Last active July 17, 2024 13:48
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.