Skip to content

Instantly share code, notes, and snippets.

Avatar

ablears

  • New Zealand
View GitHub Profile
@ablears
ablears / gist:273b6107c502736c2b24bcdca87220d6
Last active Aug 17, 2020
Add store locale to allowed country list in WooCommerce's Stripe plugin which whitelists countries since 4.5.1
View gist:273b6107c502736c2b24bcdca87220d6
function moso_add_country_to_stripe( $countries ) {
$wc_default_country = substr( get_option( 'woocommerce_default_country' ), 0, 2 );
if ( ! in_array( $wc_default_country, $countries ) ) {
$countries[] = $wc_default_country;
}
return $countries;
}
@ablears
ablears / Expires headers
Created Dec 11, 2017
Expires headers .htaccess
View Expires headers
<IfModule mod_expires.c>
ExpiresActive on
# Media: images, video, audio
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
</IfModule>
View php-crud-api-w2ui.php
<!DOCTYPE html>
<html>
<head>
<title>W2UI Demo: grid-3</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script type="text/javascript" src="http://rawgit.com/vitmalina/w2ui/master/dist/w2ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://rawgit.com/vitmalina/w2ui/master/dist/w2ui.min.css" />
</head>
<body>