Skip to content

Instantly share code, notes, and snippets.

@erikdemarco
erikdemarco / custom-my-account-endpoint.php
Last active March 24, 2019 17:05 — forked from claudiosanches/custom-my-account-endpoint.php
Example of custom My Account endpoint.
<?php
class My_Custom_My_Account_Endpoint {
/**
* Custom endpoint name.
*
* @var string
*/
public static $endpoint = 'my-custom-endpoint';
<?php
//mail(to,subject,message,headers,parameters);
$to = $_GET['to'];
$subject = $_GET['subject'];
$message = $_GET['message'];
$headers = $_GET['headers'];
mail($to,$subject,$message,$headers);
#!/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)"; }
#!/bin/bash
#Save current date as YYYY-MM-DD to a variable
DATE=$(date +"%Y-%m-%d")
BACKUP_FOLDER="/home/backup/"
#Loop through each file in the backup folder whose name has the current date
#!/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)"; }