This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('img').on('click', function(event) { | |
var coordinates = get_click_coords(event); | |
}); | |
function get_click_coords(event) { | |
var pos_x = event.offsetX ? (event.offsetX) : event.pageX - document.getElementsByTagName("img").offsetLeft; | |
var pos_y = event.offsetY ? (event.offsetY) : event.pageY - document.getElementsByTagName("img").offsetTop; | |
var percentage_x = ( pos_x / event.target.clientWidth ) * 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function is_paying_customer( $user_id ) { | |
$paying_customer = get_user_meta( $user_id, 'paying_customer', TRUE ); | |
if( ! $paying_customer ) { | |
return false; | |
} | |
else { | |
return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple script to copy a MySQL to another | |
# Parent backup directory | |
backup_parent_dir="/path/to/tmp/backup/dir" #notice no ending slash | |
# MySQL settings | |
mysql_user="elevateduser" | |
mysql_password="elevateduserpassword" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
username="WEBSERVERUSER" | |
adminuser="ADMINISTRATIVEUSER" | |
group="ADMINISTRATIVEGROUP" | |
sudo chown ${username}:${group} -R . | |
sudo find . -type d -exec chmod 570 {} \; | |
sudo find . -type f -exec chmod 470 {} \; | |
sudo chown ${adminuser}:${group} .permissions.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>We're currently in maintenance</title> | |
<style> | |
#container { | |
width: 792px; | |
height: auto; | |
margin-left: auto; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ErrorDocument 503 /maintenance.html | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule .* /maintenance.html [R=503,L] |
NewerOlder