Skip to content

Instantly share code, notes, and snippets.

View fazlurr's full-sized avatar

Fazlur Rahman fazlurr

View GitHub Profile
@fazlurr
fazlurr / nginx-tuning.md
Created July 8, 2021 17:42 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

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.

<script>
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(f){return f.raw=f};$jscomp.createTemplateTagFirstArgWithRaw=function(f,g){f.raw=g;return f};
(function(f,g){g=void 0===g?!1:g;var l=function(c,a,d){d=void 0===d?!1:d;a||(a=window.location.href);c="[?&]"+c.replace(/[\[\]]/g,"\\$&")+"(=([^&#]*)|&|#|$)";a=(d?new RegExp(c):new RegExp(c,"i")).exec(a);if(!a)return null;if(!a[2])return"";a=(a=a[2].replace(/\+/g," "))?decodeURIComponent(a.replace(/%(?![0-9][0-9a-fA-F]+)/g,"%25")):a;return a=a.replace(/[&<>="#;]/g,"")},m=function(c){c+="=";for(var a=document.cookie.split(";"),d=0;d<a.length;d++){for(var b=a[d];" "===b.charAt(0);)b=b.substring(1,b.length);
if(0===b.indexOf(c))return b.substring(c.length,b.length)}return null},n=function(c,a){var d=encodeURIComponent,b=function(e){return e+"="+c[e]};(void 0===a?0:a)&&(b=function(e){return d(e)+"="+d(c[e])});return Object.keys(c).map(b).join("&")};setTimeout(function(){var c=f;c=void 0===c?"oo-link":c;var a=l("fbclid"),d=m("fbp")
<script>
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(f){return f.raw=f};$jscomp.createTemplateTagFirstArgWithRaw=function(f,g){f.raw=g;return f};
(function(f){var g=function(d,a,c){c=void 0===c?!1:c;a||(a=window.location.href);d="[?&]"+d.replace(/[\[\]]/g,"\\$&")+"(=([^&#]*)|&|#|$)";a=(c?new RegExp(d):new RegExp(d,"i")).exec(a);if(!a)return null;if(!a[2])return"";a=(a=a[2].replace(/\+/g," "))?decodeURIComponent(a.replace(/%(?![0-9][0-9a-fA-F]+)/g,"%25")):a;return a=a.replace(/[&<>="#;]/g,"")},l=function(d){d+="=";for(var a=document.cookie.split(";"),c=0;c<a.length;c++){for(var b=a[c];" "===b.charAt(0);)b=b.substring(1,b.length);if(0===b.indexOf(d))return b.substring(d.length,
b.length)}return null},m=function(d,a){var c=encodeURIComponent,b=function(e){return e+"="+d[e]};(void 0===a?0:a)&&(b=function(e){return c(e)+"="+c(d[e])});return Object.keys(d).map(b).join("&")};setTimeout(function(){var d=f;d=void 0===d?"oo-link":d;var a=g("fbclid"),c=l("fbp"),b=l("fbc");d=docume
const query = {};
query.until = until;
const params = { query };
this.$router.push(params);
cd %APPDATA%\nvm\v8.10.0 # or whatever version you're using
mv npm npm-old
mv npm.cmd npm-old.cmd
cd node_modules\
mv npm npm-old
cd npm-old\bin
node npm-cli.js i -g npm@latest
cd %APPDATA%\nvm\v8.10.0 # or whatever version you're using
rm npm-old
@fazlurr
fazlurr / ContentEditor.vue
Last active April 30, 2024 15:39
tiptap alignment And custom image handler
<template>
<!-- WYSIWYG Editor -->
<div class="editor mb-4">
<editor-menu-bar class="editor-bar" :editor="editor">
<div slot-scope="{ commands, isActive, focused, getMarkAttrs }">
<!-- Image -->
<label
class="btn btn-plain mb-0"
:class="{ 'is-loading': isUploading }"
v-tooltip="'Add Image'">
// Version 4.0
const pSBC=(p,c0,c1,l)=>{
let r,g,b,P,f,t,h,i=parseInt,m=Math.round,a=typeof(c1)=="string";
if(typeof(p)!="number"||p<-1||p>1||typeof(c0)!="string"||(c0[0]!='r'&&c0[0]!='#')||(c1&&!a))return null;
if(!this.pSBCr)this.pSBCr=(d)=>{
let n=d.length,x={};
if(n>9){
[r,g,b,a]=d=d.split(","),n=d.length;
if(n<3||n>4)return null;
x.r=i(r[3]=="a"?r.slice(5):r.slice(4)),x.g=i(g),x.b=i(b),x.a=a?parseFloat(a):-1
@fazlurr
fazlurr / ContentEditor.vue
Last active November 19, 2019 05:39
Vue WYSIWYG Editor using tip-tap library
<template>
<!-- WYSIWYG Editor -->
<div class="editor mb-4">
<editor-menu-bar class="editor-bar" :editor="editor">
<div slot-scope="{ commands, isActive, focused }">
<!-- Bold -->
<button
type="button"
class="btn btn-plain"
:class="{ 'is-active': isActive.bold() }"
/**
* Get Color Contrast
* @param {string} hex Hexa Color Code
*/
export const getColorContrast = (hex) => {
const color = hexToRgb(hex);
const treshold = 186;
const contrast = color
&& (color.r * 0.299 + color.g * 0.587 + color.b * 0.114) > treshold ? 'black' : 'white';
// for (const key in color) {
<?php
return [
// ...
'debug_blacklist' => [
'_ENV' => [
'APP_KEY',
'DB_PASSWORD',