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
// Go to https://www.reddit.com/user/<username>/ and paste into your console. | |
// Reddit throttles these actions, hence the 1s timer. | |
let interval = setInterval(() => { | |
let deleteButtons = $('a.togglebutton[data-event-action="delete"]'); | |
if (deleteButtons.length === 0) { | |
clearInterval(interval); | |
if ($('.next-button > a')[0]) { | |
location.reload(); | |
} |
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
/** | |
* Auto update cart after quantity change | |
* | |
* @return string | |
**/ | |
add_action( 'wp_footer', 'cart_update_qty_script' ); | |
function cart_update_qty_script() { | |
if (is_cart()) : | |
?> | |
<script> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |