This file contains hidden or 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
| /*-------------------------------------- | |
| Woocommerce - Allow Guest Checkout on Certain products | |
| ----------------------------------------*/ | |
| // Display Guest Checkout Field | |
| add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' ); | |
| function woo_add_custom_general_fields() { | |
| global $woocommerce, $post; | |
| echo '<div class="options_group">'; |
This file contains hidden or 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
| /** | |
| * Flexible media embeds | |
| * | |
| * For use with media embeds – such as videos, slideshows, or even images – | |
| * that need to retain a specific aspect ratio but adapt to the width of their | |
| * containing element. | |
| * | |
| * Based on: http://alistapart.com/article/creating-intrinsic-ratios-for-video | |
| */ |
This file contains hidden or 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
| // Promise.prototype.finally | |
| fetch('http://foo.bar') | |
| .then(response => console.log(response)) | |
| .catch(error => console.log(error)) | |
| .finally(_ => console.log('finally')) | |
| // try/catch/finally with Async/Await |
This file contains hidden or 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
| require "rspec/expectations" | |
| RSpec::Matchers.define :allow_content_type do |*content_types| | |
| match do |record| | |
| matcher.matches?(record, content_types) | |
| end | |
| chain :for do |attr_name| | |
| matcher.for(attr_name) | |
| end |
This file contains hidden or 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
| for(i = 1; i<=9999; i++) { | |
| console.log("Iteration # --> " + i); | |
| document.querySelectorAll('div[role=checkbox]').forEach(div=>div.click()); | |
| document.querySelectorAll('div[aria-label*="Select all photos"]').forEach(div=>div.click()); | |
| await new Promise(r => setTimeout(r, 3000)); | |
| try{console.log("Selected documents count for iteration [" + i + "]: " + document.evaluate('/html/body/div[1]/div/c-wiz/c-wiz[2]/span/div[1]/div/span', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.innerText);}catch(ex){/*do nothing*/} | |
| document.querySelector('button[title=Delete]').click(); | |
| await new Promise(r => setTimeout(r, 5000)); | |
| document.evaluate('//span[text()="Move to trash"]', document, null, XPathResult.ANY_TYPE, null ).iterateNext().click(); |
OlderNewer