Skip to content

Instantly share code, notes, and snippets.

@imath
imath / bp-custom.php
Created December 23, 2023 14:24
Disable BuddyPress Signups feature.
<?php
function disable_bp_signups() {
add_filter( 'bp_get_signup_allowed', '__return_false' );
remove_filter( 'register_url', 'bp_get_signup_page' );
remove_action( 'bp_init', 'bp_core_wpsignup_redirect' );
remove_filter( 'wp_signup_location', 'bp_blogs_creation_location' );
remove_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1 );
}
add_action( 'bp_include', 'disable_bp_signups' );
@pirate
pirate / strip_bad_filename_characters.sh
Last active July 31, 2024 04:13
Bash script to remove accents and special characters from filenames recursively.
#!/usr/bin/env bash
# Recursively remove all special characters from filenames by renaming them to their ASCII normalized forms.
#
# By default it does a dry run, to actually move the files uncomment the `mv -vi ...` line.
#
# This is useful for cleaning up network shares that will be shared via SMB/NFS between Unix/macOS/Windows
# where non-ASCII filenames can sometimes cause "file does not exist" errors when trying to access the files.
#
# This script removes leading/trailing whitespace in filenames and replaces accents and non-english
# characters with their ASCII equivalent, if no ASCII equivalent exists, it removes the character e.g.:
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>