Docker info:
docker info
List Images:
| <?php | |
| if ( ! function_exists( 'wc_rest_get_product_images' ) ) { | |
| add_filter( 'woocommerce_rest_prepare_product_object', 'wc_rest_get_product_images', 10, 2 ); | |
| /** | |
| * Get the images for a product or product variation | |
| * and returns all image sizes. | |
| * | |
| * @param WP_REST_Request $request Request object. | |
| * @param WC_Product|WC_Product_Variation $product Product instance. |
| <?php | |
| /* | |
| * THE FILTER | |
| * | |
| */ | |
| function custom_responsive_image_sizes($sizes, $img_name, $attachment_id) { | |
| $sizes = wp_get_attachment_image_sizes($attachment_id, 'original'); | |
| $meta = wp_get_attachment_metadata($attachment_id); | |
| $width = $meta['width']; |
| //Woocommerce Checkout JS events | |
| $( document.body ).trigger( 'init_checkout' ); | |
| $( document.body ).trigger( 'payment_method_selected' ); | |
| $( document.body ).trigger( 'update_checkout' ); | |
| $( document.body ).trigger( 'updated_checkout' ); | |
| $( document.body ).trigger( 'checkout_error' ); | |
| //Woocommerce cart page JS events | |
| $( document.body ).trigger( 'wc_cart_emptied' ); | |
| $( document.body ).trigger( 'update_checkout' ); |
| // Config / constants | |
| const baseUrl = 'http://localhost:4000' || 'example.herokuapp.com' // or use an environment variable like this: process.env.URL || 'http://localhost:4000' | |
| const JWT = 'Whatever-token' | |
| /* | |
| * Examples of using native fetch | |
| * REST API - CRUD convention (Create/POST, Read/GET, Update/modify/PUT/PATCH, Delete/DELETE) | |
| * | |
| **/ |
| if (!function_exists('mime_content_type')) { | |
| function mime_content_type($filename) | |
| { | |
| $mime_types = array( | |
| 'txt' => 'text/plain', | |
| 'htm' => 'text/html', | |
| 'html' => 'text/html', |
| # | |
| # Sources: | |
| # http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites | |
| # http://codex.wordpress.org/Output_Compression | |
| # http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086 | |
| # http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/ | |
| # http://gtmetrix.com/configure-entity-tags-etags.html | |
| # http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014 | |
| # http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress | |
| # https://andreashecht-blog.de/4183/ |