Skip to content

Instantly share code, notes, and snippets.

Arif Hazwan arifhazwan

Block or report user

Report or block arifhazwan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View object-cache.php
<?php
/*
Plugin Name: Redis Object Cache Drop-In
Plugin URI: http://wordpress.org/plugins/redis-cache/
Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, HHVM, replication, clustering and WP-CLI.
Version: 1.4.1
Author: Till Krüss
Author URI: https://till.im/
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@arifhazwan
arifhazwan / woocommerce.vcl
Created Mar 7, 2019 — forked from lukecav/woocommerce.vcl
Varnish v4 VCL for WooCommerce Stores - Beta
View woocommerce.vcl
/* SET THE HOST AND PORT OF WooCommerce
* *********************************************************/
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# SET THE ALLOWED IP OF PURGE REQUESTS
# ##########################################################
@arifhazwan
arifhazwan / disable-wp-load-css.php
Created Mar 3, 2019
Wordpress Functions Disable CSS Load
View disable-wp-load-css.php
add_filter( 'style_loader_src', function($href){
if(strpos($href, "stylesheet.min.css") == true) {
return false;
}
return $href;
});
@arifhazwan
arifhazwan / install-comodo-ssl-cert-for-nginx.rst
Created Mar 3, 2019 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@arifhazwan
arifhazwan / nginx-tuning.md
Created Feb 24, 2019 — forked from denji/nginx-tuning.md
NGINX tuning for best performance
View nginx-tuning.md

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.

@arifhazwan
arifhazwan / default.vcl_PREFACE.md
Created Feb 23, 2019 — forked from fevangelou/default.vcl_PREFACE.md
The perfect Varnish configuration for Joomla, WordPress & other CMS based websites
View default.vcl_PREFACE.md

The perfect Varnish configuration for Joomla, WordPress & other CMS based websites

IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).

USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.

IMPORTANT: The following setup assumes a 3 minute (180 sec) cache time. You can safely increase this to 5 mins for less busier sites or drop it to 1 min or even 30s for high traffic sites.

This configuration requires an HTTP Header and a user cookie to identify if a user is logged in a site, in order to bypass caching overall (see how it's done in the Joomla section). If your CMS provides a way to add these 2 requirements, then you can use this configuration to speed up your site or entire server. You can even exclude the domains you don't want to cach

View wp_disable_feed-functions.php
function wpfeed_disable() {
wp_die( __( 'Not available, check out <a href="'. esc_url( 'https://www.facebook.com/' ) .'">Facebook</a>!' ) );
}
add_action('do_feed', 'wpfeed_disable', 1);
add_action('do_feed_rdf', 'wpfeed_disable', 1);
add_action('do_feed_rss', 'wpfeed_disable', 1);
add_action('do_feed_rss2', 'wpfeed_disable', 1);
add_action('do_feed_atom', 'wpfeed_disable', 1);
add_action('do_feed_rss2_comments', 'wpfeed_disable', 1);
View Has weird right-to-left characters.txt
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
You can’t perform that action at this time.