Skip to content

Instantly share code, notes, and snippets.

@bewho
bewho / Remove SEO-plugin HTML comments.php
Created July 25, 2018 06:53 — forked from llgruff/Remove SEO-plugin HTML comments.php
Remove [All in One SEO Pack] or [Yoast SEO] HTML Comments in WordPress (for functions.php)
<?php
/**
* Remove [All in One SEO Pack] HTML Comments
* @link //gist.github.com/llgruff/a7ab776167aa0ed307ec445df54e5fdb
*/
if (defined('AIOSEOP_VERSION')) {
add_action('get_header', function() {
ob_start(
function($o) {
return preg_replace('/\n?<.*?One SEO Pack.*?>/mi','',$o);
@bewho
bewho / domain.conf
Created July 10, 2018 07:22
My nginx and virtualhost config
upstream domain_com {
server unix:/var/run/muay-domain.com-php-fpm.socket;
}
server {
listen *:80;
server_name domain.com www.domain.com;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
location / {
# "Performance Scalability of a Multi-Core Web Server", Nov 2007
# Bryan Veal and Annie Foong, Intel Corporation, Page 4/10
fs.file-max = 5000000
net.core.netdev_max_backlog = 4096
net.core.optmem_max = 10000000
net.core.rmem_default = 10000000
net.core.rmem_max = 10000000
net.core.somaxconn = 4096
net.core.wmem_default = 10000000
net.core.wmem_max = 10000000
@bewho
bewho / nginx.conf
Created June 26, 2018 01:29 — forked from apmarshall/nginx.conf
Boilerplate Config file for nginx, originally written for a Joomla instal. @nikosdion/master-htaccess
server {
######################################################################
## The Master .htaccess - NginX adaptation
##
## Version 3.3
##
## This file is designed to be the template NginX server configuration file
## for your Joomla! sites. You should go through all of its sections and
## modify it to match your site. Most notably, all instances of example.com
## and example\.com should be replaced with your real domain name.
body.wpex-noscroll {
position: static !important;
width: auto !important;
overflow-y: inherit !important;
top: auto !important;
bottom: auto !important;
}
@bewho
bewho / functions.php
Created June 8, 2018 08:06 — forked from designrubenz/functions.php
Wordpress: reduce to the max
<?php
function wp_customize_admin_menu() {
remove_menu_page( 'edit.php' );
remove_menu_page( 'edit-comments.php' );
remove_submenu_page( 'themes.php', 'theme-editor.php' );
remove_submenu_page( 'plugins.php', 'plugin-editor.php' );
remove_submenu_page( 'tools.php', 'tools.php' );
remove_submenu_page( 'tools.php', 'import.php' );
remove_submenu_page( 'options-general.php', 'options-discussion.php' );
@bewho
bewho / index.html
Created June 8, 2018 07:59 — forked from aFarkas/index.html
link[rel="preload"] polyfill
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<!-- we use 'preload_' instead of 'preload' to make it testable in chrome -->
<link rel="preload_" onload="console.log(this, 'script');" href="http://code.jquery.com/jquery-1.12.1.js" as="script" />
<link rel="preload_" onload="console.log(this, 'style');" href="https://cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css" as="style" />
<link rel="preload_" onload="console.log(this, 'font');" href="LatoLatin-Regular.woff" as="font" type="font/woff" crossorigin="" />
@bewho
bewho / functions.php
Created June 7, 2018 08:18 — forked from paulcollett/functions.php
Remove Yoast HTML Comments “This site is optimized with the Yoast WordPress SEO plugin”
// Add to your Wordpress Theme's functions.php
// Remove All Yoast HTML Comments
// https://gist.github.com/paulcollett/4c81c4f6eb85334ba076
add_action('wp_head',function() { ob_start(function($o) {
return preg_replace('/^\n?<!--.*?[Y]oast.*?-->\n?$/mi','',$o);
}); },~PHP_INT_MAX);
@bewho
bewho / tip.md
Created May 30, 2018 08:28 — forked from ahmadawais/tip.md
TIP: Write Better Articles

Write Better Articles

Here're a few good rules that you can make sure every writer follows to keep things civil and readable.

  • 📨No para should have less than three and more than four lines
@bewho
bewho / functions.php
Created May 30, 2018 08:26 — forked from ahmadawais/functions.php
SEO by Yoast Stuff
/**
* Filter Yoast SEO Metabox Priority to low
*/
add_filter( 'wpseo_metabox_prio', 'aa_filter_yoast_seo_metabox' );
function aa_filter_yoast_seo_metabox() {
return 'low';
}
/**
* Remove Yoast SEO Metabox