Skip to content

Instantly share code, notes, and snippets.

jeffochoa / Response.php
Last active September 15, 2023 20:54
Laravel HTTP status code
View Response.php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
View Date.prototype.toDatetimeLocal.js
Date.prototype.toDatetimeLocal =
function toDatetimeLocal() {
date = this,
ten = function (i) {
return (i < 10 ? '0' : '') + i;
YYYY = date.getFullYear(),
MM = ten(date.getMonth() + 1),
remarkablemark /
Last active August 14, 2023 16:57
Classes - ES5 vs ES6
denji /
Last active September 22, 2023 16:31
NGINX tuning for best performance

Moved to git repository:

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.