Skip to content

Instantly share code, notes, and snippets.


Ihor Mukovoz themkvz

View GitHub Profile
miniMAC / functions.php
Created Dec 20, 2018
Fix WooCommerce orders list bug + WordPress 5.0.2
View functions.php
// 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 Dec 1, 2022
Best Zend OpCache Settings / Tuning / Configurations
View opcache.ini
; 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 Dec 19, 2016
Print certain div / elements using window.print()
View example.html
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 Apr 19, 2020
WordPress :: Divi Theme :: Include Tags In Post Meta When Displayed On Frontend
View child-functions-php-snippet.php
/* 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 Nov 7, 2022
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 Dec 2, 2022
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 Aug 24, 2022
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: "