Skip to content

Instantly share code, notes, and snippets.

@hrmshandy
hrmshandy / nginx-tuning.md
Created December 11, 2020 13:27 — forked from denji/nginx-tuning.md
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.

@hrmshandy
hrmshandy / facebook-normalize-wheel.js
Created December 6, 2018 05:54 — forked from akella/facebook-normalize-wheel.js
Facebook attempt at normalizing wheel event
/**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule normalizeWheel
* @typechecks
@hrmshandy
hrmshandy / multiple_ssh_setting.md
Created July 11, 2018 06:08 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@hrmshandy
hrmshandy / nginx-latest.sh
Created June 27, 2017 17:01 — forked from Globegitter/nginx-latest.sh
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
@hrmshandy
hrmshandy / v1
Created June 6, 2017 06:57 — forked from shazow/v1
post-receive hook to push-deploy with git
#!/bin/bash
# post-receive hook to push-deploy multiple branches using a git repo.
#
# Deploy by pushing $DEPLOY_BRANCH
# Rollback by force-pushing a new reference to $OVERRIDE_TAG
#
# 1. Setup your git repo:
#
# git init --bare
#
@hrmshandy
hrmshandy / leaflet.google.js
Created January 9, 2017 12:56 — forked from harshvb7/leaflet.google.js
Google Layer with custom style for leaflet
/*
* L.TileLayer is used for standard xyz-numbered tile layers.
*/
L.Google = L.Class.extend({
includes: L.Mixin.Events,
options: {
minZoom: 0,
maxZoom: 18,
@hrmshandy
hrmshandy / input.scss
Created April 27, 2016 07:10 — forked from lukasborawski/input.scss
Perfect media-queries screen breakpoints SASS @mixin. Tested on Apple Devices: iPhone4, iPhone5, iPad3, MacBook Pro, iPad Mini. http://sassmeister.com/gist/8529371
$media-queries: true;
@mixin bp($point) {
@if ($media-queries) {
$bp-large-screen: 1824px;
$bp-bigscreen: 1824px;
$bp-ipad-max: 1024px;
$bp-ipad-min: 768px;
$bp-iphone5-max: 568px;
$bp-iphone-max: 480px;
@hrmshandy
hrmshandy / HasEnums.php
Created April 22, 2016 03:47 — forked from themsaid/HasEnums.php
PHP Enumerated Type
trait HasEnums
{
/**
* The array of enumerators of a given group.
*
* @param null|string $group
* @return array
*/
static function enums($group = null)
{
@hrmshandy
hrmshandy / laravel deploy.sh
Created October 9, 2015 02:42 — forked from amite/laravel deploy.sh
laravel deploy on digitalocean
#!/usr/bin/env bash
echo "--- Good morning, master. Let's get to work. Installing now. ---"
echo "--- Updating packages list ---"
sudo apt-get update
echo "--- MySQL time ---"
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'