Skip to content

Instantly share code, notes, and snippets.

View themkvz's full-sized avatar

Ihor Mukovoz themkvz

View GitHub Profile
miniMAC / functions.php
Created December 20, 2018 09:23
Fix WooCommerce orders list bug + WordPress 5.0.2
// FIX WooCommerce orders list bug
function fix_query_args_woo_orders( $query_args ) {
if ( isset( $query_args['post_status'] ) &&
empty( $query_args['post_status'] ) ) {
unset( $query_args['post_status'] );
return $query_args;
rohankhudedev / opcache.ini
Last active May 7, 2024 08:36
Best Zend OpCache Settings / Tuning / Configurations
; Determines if Zend OPCache is enabled
; Determines if Zend OPCache is enabled for the CLI version of PHP
; The OPcache shared memory storage size.
andrewlimaza / example.html
Created December 19, 2016 11:31
Print certain div / elements using window.print()
function printDiv(divName){
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
document.body.innerHTML = originalContents;
lots0logs / child-functions-php-snippet.php
Last active April 19, 2020 08:16
WordPress :: Divi Theme :: Include Tags In Post Meta When Displayed On Frontend
/* DON'T copy the first line (above) if your functions.php already has it.
* ----------------------------------------------------------------------- */
function et_pb_postinfo_meta( $postinfo, $date_format, $comment_zero, $comment_one, $comment_more ){
$postinfo_meta = '';
if ( in_array( 'author', $postinfo ) )
$postinfo_meta .= ' ' . esc_html__( 'by', 'et_builder' ) . ' <span class="author vcard">' . et_pb_get_the_author_posts_link() . '</span>';
if ( in_array( 'date', $postinfo ) ) {
if ( in_array( 'author', $postinfo ) ) $postinfo_meta .= ' | ';
julianxhokaxhiu /
Last active May 23, 2024 08:34
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
# Improved as per feedback from @pascal -
find . -type f -iname "*.png" -exec optipng -nb -nc {} \;
find . -type f -iname "*.png" -exec advpng -z4 {} \;
find . -type f -iname "*.png" -exec pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow {} \;
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim -f --strip-all {} \;
denji /
Last active June 13, 2024 14:05
NGINX tuning for best performance

Moved to git repository:

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.

bgallagh3r /
Last active March 24, 2024 03:12
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "