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
$params = array ( | |
'parameter_one' => 'some_value', | |
'parameter_two' => | |
array ( | |
'parameter_array_option' => $some_variable, | |
) | |
); | |
//JSON encoded | |
$payload = json_encode($params); |
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
location / { | |
proxy_pass http://localhost:3000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} | |
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
zip -r filename.zip folder | |
zip -r filename.zip folder1 folder2 | |
zip -r filename.zip /path/to/folder1 /path/to/file2 |
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
location ~* \.(eot|ttf|woff|woff2)$ { | |
add_header Access-Control-Allow-Origin *; | |
} |
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
function getVisIpAddr() { | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
return $_SERVER['HTTP_CLIENT_IP']; | |
} | |
else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
return $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} | |
else { |
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
add_action( 'woocommerce_before_checkout_form', 'custom_apply_matched_coupons' ); | |
add_action( 'woocommerce_before_cart', 'custom_apply_matched_coupons' ); | |
function custom_apply_matched_coupons() { | |
$coupon_code = 'coupon_code_here'; | |
$cat_in_cart = false; | |
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { | |
if ( has_term( 'product-category-slug', 'product_cat', $cart_item['product_id'] ) ) { |
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
var accordion_items = document.querySelectorAll('.accordion-item'); | |
if (accordion_items != null) { | |
var i = 0; | |
accordion_items.forEach(function (e) { | |
i++; | |
e.addEventListener('click', function () { | |
e.querySelector('.accordion-content').classList.toggle('active'); | |
}); | |
}) | |
} |
OlderNewer