Skip to content

Instantly share code, notes, and snippets.

View ilokano's full-sized avatar

Jasper Espejo ilokano

View GitHub Profile
@westonruter
westonruter / basic-site-caching.php
Last active December 16, 2020 07:15
⚠️ This plugin is obsolete as of PWA v0.6.0. See https://github.com/GoogleChromeLabs/pwa-wp/pull/338
<?php
/**
* Plugin Name: Basic Site Caching
*
* @package Basic_Site_Caching
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
@kleo
kleo / backspace.md
Last active July 28, 2023 17:59
backspace

Project moved due to excessive amount of unicorns. Repo https://git.io/adminpldt

Our community of amazing people. Managed by a cat. Backspace https://discord.gg/C43625u

Gist here will not be updated anymore Discussion here on Gist is still allowed but I strongly recommend going over to the repository or Discord chat


<?php
/*
This script will allow you to send a custom email from anywhere within wordpress
but using the woocommerce template so that your emails look the same.
Created by craig@123marbella.com on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
@ilokano
ilokano / gist:a184cfae20cfd9be080fffd708f011ed
Last active December 11, 2017 14:05 — forked from mwolff44/gist:abfc7848e5cfa35b8c6a
remove jetpack unwanted css - Wordpress
<?php
/*
MU Plugin: remove-jetpack-css
Plugin Name: WP Remove Jetpack CSS
Plugin URI: http://www.blog-des-telecoms.com
Description: Remove jetpack CSS
Version: 1.0
Author: Mathias WOLFF
Author URI: http://www.mathias-wolff.fr
License: GPLv3
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active May 27, 2024 17:37
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@mwolff44
mwolff44 / gist:abfc7848e5cfa35b8c6a
Last active February 24, 2019 06:41
remove jetpack unwanted css - Wordpress
<?php
/*
MU Plugin: remove-jetpack-css
Plugin Name: WP Remove Jetpack CSS
Plugin URI: http://www.blog-des-telecoms.com
Description: Remove jetpack CSS
Version: 1.0
Author: Mathias WOLFF
Author URI: http://www.mathias-wolff.fr
License: GPLv3
@wkw
wkw / wp-exports-posts-csv.php
Created March 23, 2015 22:43
Export selected fields of all WordPress posts as CSV file
<?php
/*
* Stick this in your functions.php, or include it from a separate file,
* edit the post types you want to export,
* then use the URL: http://your-blog.com/?_inventory=1
*
*/
function return_csv_download($array_data, $filename){
header('Content-Type: text/csv'); // you can change this based on the file type
@luizcanet
luizcanet / behance.php
Last active December 30, 2017 20:23
Portifolio from Behance
<?php
$get = 'http://www.behance.net/v2/users/luizcanet/projects?api_key=4p1K31fR0mB3h4Nc3Th1Sd0NtW0rKs';
$portifolio = json_decode(file_get_contents($get));
?>
<?php if ($portifolio->http_code = 200) : ?>
<?php foreach ($portifolio->projects as $project) : ?>
<article class="project">
<a href="<?php print $project->url; ?>" target="_blank">
<h1><?php print $project->name; ?></h1>
<img src="<?php print $project->covers->{404}; ?>" alt="Project Image" />
@magnetikonline
magnetikonline / README.md
Last active June 6, 2024 06:16
Setting Nginx FastCGI response buffer sizes.
@denji
denji / nginx-tuning.md
Last active June 13, 2024 14:05
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.