Skip to content

Instantly share code, notes, and snippets.

jeffochoa / Response.php
Last active May 22, 2024 04:06
Laravel HTTP status code
// 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;
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 June 8, 2024 21:48
Classes - ES5 vs ES6

JavaScript Classes - ES5 vs ES6

An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.


denji /
Last active June 13, 2024 14:05
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.