This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Requires PHP 5.6+ due to the use of the splat operator and the [] "array declaration". | |
*/ | |
class Rest_Aggregator { | |
/** | |
* Page number to fetch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@rem *** Disable Some Service *** | |
sc stop DiagTrack | |
sc stop diagnosticshub.standardcollector.service | |
sc stop dmwappushservice | |
sc stop WMPNetworkSvc | |
sc stop WSearch | |
sc config DiagTrack start= disabled | |
sc config diagnosticshub.standardcollector.service start= disabled | |
sc config dmwappushservice start= disabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################## | |
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2020 | |
# ---------------------------------------------------------------------- | |
# @Author: Andreas Hecht | |
# @Author URI: https://seoagentur-hamburg.com | |
# License: GNU General Public License v2 or later | |
# License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
######################################################################## | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allow sorting orders screen by purchased product | |
* Modified version of https://github.com/wp-plugins/woocommerce-filter-orders-by-product/blob/master/woocommerce-filter-orders-by-product.php | |
*/ | |
if ( function_exists('WC') && is_admin() ): | |
add_action( 'restrict_manage_posts', 'aa_product_filter_in_order', 50 ); | |
add_filter( 'posts_where' , 'aa_product_filter_where' ); | |
endif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce Box Packer | |
* | |
* @version 2.0.1 | |
* @author WooThemes / Mike Jolley | |
*/ | |
class WC_Boxpack { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This script allows you to specify products as "already packed". They will not be added to separate boxes, and will not be combined with other products. | |
// This is useful if you have products that are already packed and ready to ship that should not be put into another box. | |
// | |
// IMPORTANT: | |
// The plugin 'WooCommerce UPS Shipping' does not currently support the filter "woocommerce_shipping_ups_skip_packing". | |
// For now, you must manually edit the UPS plugin directly. The two edits are located below (for version 3.2.18): | |
// 1. https://gist.github.com/RadGH/ad8d8e599366a27c81bc84dd1f66aaa9 | |
// 2. https://gist.github.com/RadGH/b7b69f65bbeb7212083058d1d644b0c9 | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi | |
exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit | |
on run | |
set pathCSVFile to (choose file with prompt "Select the CSV file" of type "csv") | |
set strCSV to read pathCSVFile | |
set pathTemplateFile to (choose file with prompt "Select the message template" of type "txt") | |
set messageTemplate to read pathTemplateFile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getUtf8String($string) { | |
if ( !isUtf8($string) ) | |
return utf8_encode($string); | |
return $string; | |
} | |
function isUtf8($string) { | |
if ( function_exists("mb_check_encoding") ) { | |
return mb_check_encoding($string, 'UTF8'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function transcribe_cp1252_to_latin1($cp1252) { | |
return strtr( | |
$cp1252, | |
array( | |
"\x80" => "e", "\x81" => " ", "\x82" => "'", "\x83" => 'f', | |
"\x84" => '"', "\x85" => "…", "\x86" => "+", "\x87" => "#", | |
"\x88" => "^", "\x89" => "0/00", "\x8A" => "S", "\x8B" => "<", | |
"\x8C" => "OE", "\x8D" => " ", "\x8E" => "Z", "\x8F" => " ", | |
"\x90" => " ", "\x91" => "`", "\x92" => "'", "\x93" => '"', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get available disk space | |
df -h | |
# Get the top 10 biggest folders in the current directory | |
du -h --max-depth=1 | sort -rh | head -10 | |
# Get the top 10 biggest folders in the current directory and their first child directories | |
du -h --max-depth=2 | sort -rh | head -10 | |
# Get sizes of all folders in the current directory |