Skip to content

Instantly share code, notes, and snippets.

View raphaelportmann's full-sized avatar
🧙
hocus pocus

Raphael Portmann raphaelportmann

🧙
hocus pocus
View GitHub Profile
@raphaelportmann
raphaelportmann / crawl.sh
Created October 30, 2019 16:17
crawl website
lynx -dump https://example.com | awk '/http/{print $2}' | xargs curl
@raphaelportmann
raphaelportmann / remove-files-with-extension.sh
Created September 18, 2019 08:43
Remove all files with a specific extension
# Example with .webp images
# Test run without removal
find . -name "*.webp" -type f
# Delete files
find . -name "*.webp" -type f -delete
@raphaelportmann
raphaelportmann / remove-wp-db-images.php
Created June 13, 2019 14:39
remove images from wordpress db which no longer exist
<?php
// Only run the code if we are in the admin
if ( is_admin() ) :
class WordPressdeleteMissingImages {
// Action/Filter Hooks
function __construct() {
add_action( 'admin_menu', array( &$this, 'add_page' ) );
find . -type f -exec chmod 644 -- {} +
find . -type d -exec chmod 755 -- {} +