Skip to content

Instantly share code, notes, and snippets.

$redirectFacebook = false;
// Fix stupid Facebook button restriction by checking the referer link
// and if comes from FB, go to specifified
if ($redirectFacebook) {
$host = "https://domain.com/";
$uri = "final-uri/";
$location = "Location: " . $host . $uri;
@srokatonie
srokatonie / sendmail.php
Last active March 14, 2018 11:29
PHP Mail function
<script>
function submitForm() {
// Initiate Variables With Form Content
var name = $("#name").val();
var email = $("#email").val();
var msg_subject = $("#msg_subject").val();
var message = $("#message").val();
$.ajax({
type: "POST",
url: "php/contact.php",
#!/bin/bash
# run cron job to backup 'test' database to 'email@example.com' at 01:00 every day
# 0 01 * * * bash /home/maciek/scripts/backup_email.sh test email@example.com
DB=$1
EMAIL_TO=$2
MAX_FILE_SIZE=50000 #Mailgun email size <= 50MB
BACKUP_DIR="/var/backups/mongobackups"