Skip to content

Instantly share code, notes, and snippets.

function properize($string) {
return $string.'\''.($string[strlen($string) - 1] != 's' ? 's' : '');
}
echo 'Properize: '.properize("Chris"); //returns Chris'
echo 'Properize: '.properize("David"); //returns David's
// Source: https://davidwalsh.name/php-possessive-punctuation
@CamdenJaxx
CamdenJaxx / vesta-backup-status.sh
Last active May 11, 2019 20:34
View running log of VestaCP backup log
#!/bin/bash
tail -f /usr/local/vesta/log/backup.log
exit 0
@CamdenJaxx
CamdenJaxx / vesta-backup-stop.sh
Last active March 8, 2022 01:47
Vesta Stop Backup In Progress
#!/bin/bash
rm /usr/local/vesta/data/queue/backup.pipe
touch /usr/local/vesta/data/queue/backup.pipe
chmod 750 /usr/local/vesta/data/queue/backup.pipe
echo "Current backup in progress has been stopped. You can now create a new backup."
exit 0
#!/bin/sh
#----------------------------------------------------------#
# settings #
#----------------------------------------------------------#
#text colors
redtext() { echo "$(tput setaf 1)$*$(tput setaf 9)"; }
greentext() { echo "$(tput setaf 2)$*$(tput setaf 9)"; }
yellowtext() { echo "$(tput setaf 3)$*$(tput setaf 9)"; }
@CamdenJaxx
CamdenJaxx / create_wp.sh
Last active April 27, 2019 03:25 — forked from luisintosh/create_wp.sh
Create a fresh Wordpress installation within a VestaCP environment. Added default .htaccess file with redirect to https by default.
#!/bin/bash
if [ $# -lt 1 ]; then
echo usage: create_wp domain [email]
exit 1
fi
domain=$1
PATH=$PATH:/usr/local/vesta/bin