Skip to content

Instantly share code, notes, and snippets.

View gsarig's full-sized avatar

Giorgos Sarigiannidis gsarig

View GitHub Profile
@gsarig
gsarig / remove_greek_accents.php
Last active September 6, 2018 20:58
PHP function to remove accents from Greek text
<?php
/*
* Run it like so:
*
* $text = 'Your text';
* echo remove_greek_accents( $text );
*/
function remove_greek_accents( $string )
{
@gsarig
gsarig / wp-cli_batch_db_backup.sh
Last active January 28, 2021 15:07
Batch backup a server's WordPress databases with WP-CLI (read more at: https://www.gsarigiannidis.gr/wp-cli-batch-backup-wordpress-databases/)
#!/bin/bash
# A bash script to batch backup a server's WordPress databases with WP-CLI. It requires WP-CLI, obviously (https://wp-cli.org/).
# The script will search for all WordPress installations under a given directory and will backup their databases. You can declare more than one such directories.
# You don't have to modify the script every time you add a new site. As long as the new site is under a declared parent directory, its database will be backed up.
# After creating the file, don't forget to make it executable by doing:
# chmod +x wp-cli_batch_db_backup.sh
# Also, you might want to add this in a cron job for scheduled backups.
# Set PATH environment variable