Docker info:
docker info
List Images:
| { | |
| "require": { | |
| "phpoffice/phpspreadsheet": "^1.18", | |
| "mpdf/mpdf": "^8.0" | |
| } | |
| } |
| <?php | |
| /** | |
| * Hook: Empty cart before adding a new product to cart WITHOUT throwing woocommerce_cart_is_empty | |
| */ | |
| add_action ('woocommerce_add_to_cart', 'lenura_empty_cart_before_add', 0); | |
| function lenura_empty_cart_before_add() { | |
| global $woocommerce; | |
| // Get 'product_id' and 'quantity' for the current woocommerce_add_to_cart operation |
| //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' ); |
| <?php | |
| // Get headers for 100 unique random domains with get_headers() and cURL to determine which is faster. | |
| /* | |
| TL;DR -> cURL is significantly faster. | |
| get_headers (GET) vs cURL: | |
| Execution time : 139.95884609222 seconds | |
| Execution time : 65.998840093613 seconds |
| <div id="google_translate_element"></div> | |
| <script> | |
| function googleTranslateElementInit() { | |
| new google.translate.TranslateElement({ | |
| pageLanguage: 'en' | |
| }, 'google_translate_element'); | |
| } | |
| </script> | |
| <script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> |
| install node | |
| install npm | |
| put package.json | |
| npm i | |
| create _src/ and dest/ folders | |
| put image files to _src/ folder | |
| then "npx gulp" to run |
| docker ps (for get name of my container like "ant_database_1") | |
| docker exec ant_database_1 sh -c 'exec mysql -D wordpress -uwordpress -pwordpress' < local.sql | |
| * will not work because default max_allowed_packet in mysql configuration so: | |
| docker exec -it ant_database_1 bash -c "echo 'max_allowed_packet = 1G' >> /etc/mysql/mysql.conf.d/mysqld.cnf" | |
| Now it might work. | |
| But to be shure i am prefere the way with copy and manual import inside the container |
| Upload this file to your php app and run like this: | |
| http://localhost/translate-text-google-api-free.php | |
| OR with translating parameters http://localhost/translate-text-google-api-free.php?tl=ru | |
| Also there is limit with 5000 simbols, and the google api can ban your ip if you will abise to much. |
Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
| Working with DOM | Working with JS | Working With Functions |
|---|---|---|
| Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
| Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle/Debounce Functions |
| Create DOM Elements | Conditionals |