Skip to content

Instantly share code, notes, and snippets.

jevgen /
Created Nov 6, 2020 — forked from holmberd/
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
jevgen / perlbrew_libgcc_s.txt
Created Sep 10, 2020 — forked from Dreyer/perlbrew_libgcc_s.txt
[perlbrew] ld: library not found for -lgcc_s.10.4
View perlbrew_libgcc_s.txt
$ cd /usr/local/lib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.4.dylib
jevgen / force-ssl-url-scheme.php
Created Aug 7, 2019 — forked from webaware/force-ssl-url-scheme.php
For WordPress, force the protocol scheme to be HTTPS when is_ssl() doesn't work, e.g. on a load-balanced server where _SERVER['HTTPS'] and _SERVER['SERVER_PORT'] don't indicate that SSL is being used. NB: may not be needed now, see SSL Insecure Content Fixer and HTTP Detection:
View force-ssl-url-scheme.php
Plugin Name: Force SSL URL Scheme
Plugin URI:
Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work
Version: 1.0.0
Author: WebAware
Author URI:
jevgen /
Created Aug 13, 2017 — forked from tatemz/
A quick way to get a WordPress installation up and running with Docker
mkdir wordpress-site && cd wordpress-site
touch docker-compose.yml
cat > docker-compose.yml <<EOL
version: "2"
jevgen /
Created Aug 10, 2017 — forked from johnbillion/
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This is accurate as of WordPress 4.8, and includes some upcoming changes in WordPress 4.9.

There are a few TODOs left. Please bear with me.

jevgen / gist:f78acc925ba9e1e9212a3a6941db5888
Created Feb 24, 2017
Set custom cookie upon completion of Gravity Form
View gist:f78acc925ba9e1e9212a3a6941db5888
function set_form_1_complete_cookie() {
setcookie( 'form-1-complete', 1, strtotime( '+30 days' ), COOKIEPATH, COOKIE_DOMAIN, false, false );
add_action( 'gform_after_submission_1', 'set_form_1_complete_cookie' );
jevgen / float2rat.js
Created Jan 19, 2017 — forked from anonymous/float2rat.js
JavaScript function to convert a floating point number into a ratio with the help of some continued fractions.
View float2rat.js
function float2rat(x) {
tolerance = 1.e-4;
h1=1; h2=0;
k1=0; k2=1;
b = x;
do {
a = Math.floor(b);
aux = h1; h1 = a*h1+h2; h2 = aux;
aux = k1; k1 = a*k1+k2; k2 = aux;
b = 1/(b-a);
jevgen / Gravity Forms Reset Styles
Created Nov 16, 2016 — forked from forgeandsmith/Gravity Forms Reset Styles
Gravity Forms SCSS reset styles for easy style editing and management
View Gravity Forms Reset Styles
// These styles are made in mind to be used with SCSS or LESS
// If you use these styles, you must go to the Gravity Forms settings in the WordPress back end and set Output CSS to No.
////----- Core Containers
jevgen / inline-validation.js
Created Nov 16, 2016 — forked from guyroutledge/inline-validation.js
Inline form validation with Gravity Forms
View inline-validation.js
// if an invalid form field has been made valid,
// remove the shouty error highlighting - if a valid
// required field has been made invalid, start shouting
$('input, textarea, select').on('change', function(){
var $input = $(this);
var isRequired = $input.parents('.gfield').is('.gfield_contains_required');
var isValid = $':valid');
if ( isRequired && isValid ) {
jevgen / latency.markdown
Created Oct 9, 2016 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs