This file contains 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 | |
class Sort | |
{ | |
public const SORT_ASC = 1; | |
public const SORT_DESC = -1; | |
public static function sortObjectsByProperty(array $objects, array $properties = ['id'], $direction = self::SORT_ASC): array | |
{ | |
usort( | |
$objects, |
This file contains 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 custom_wc_ajax_variation_threshold( $qty, $product ) { | |
return sizeof( $product->get_children() ); | |
} | |
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 ); |
This file contains 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 mircryption_decode($text, $key) | |
{ | |
$encodedTextIvBase64 = str_replace('*', '', $text); | |
$encodedTextIv = base64_decode($encodedTextIvBase64); | |
$iv = substr($encodedTextIv, 0, 8); | |
$encodedText = substr($encodedTextIv, 8); | |
$plaintext = mcrypt_decrypt(MCRYPT_BLOWFISH, $key, $encodedText, MCRYPT_MODE_CBC, $iv); | |
return trim($plaintext); |
This file contains 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 | |
$dayOfTheYear = date('z'); | |
if ((date('L') == 1) && ($dayOfTheYear >= 60)) { | |
$dayOfTheYear = $dayOfTheYear - 1; | |
} | |
$avMonthList = array( | |
'Praios', |
This file contains 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/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
apt-get update | |
apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev make | |
mkdir -p /etc/php7/conf.d | |
mkdir -p /etc/php7/cli/conf.d | |
mkdir /usr/local/php7 |