Skip to content

Instantly share code, notes, and snippets.

@mntmn
mntmn / fbactivityclean.js
Created August 7, 2017 08:30
Hacky script for bulk deleting FB timeline activities (posts)
// use on the page https://www.facebook.com/YOUR_USER_NAME/allactivity?privacy_source=activity_log&log_filter=cluster_11
// scroll down to as many posts you want to delete (make pencil icons visible)
// recommended to delete small batches as the process gets really slow for many deletes in parallel (UI issues)
// we do stuff in parallel because a single delete can take up to 7 seconds
// to launch, call deletePost()
var knownPencils={};
function deletePost() {
var pencils=document.querySelectorAll('[data-testid="pencil_icon_link"]');
var pencilFound=false;
@mikejolley
mikejolley / functions.php
Created March 10, 2016 09:39
WooCommerce Disable guest checkout for certain products
<?php
// Code goes in theme functions.php or a custom plugin
add_filter( 'pre_option_woocommerce_enable_guest_checkout', 'conditional_guest_checkout_based_on_product' );
function conditional_guest_checkout_based_on_product( $value ) {
$restrict_ids = array( 1, 2, 3 ); // Replace with product ids which cannot use guest checkout
if ( WC()->cart ) {
$cart = WC()->cart->get_cart();