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
| <style> | |
| /* ... */ | |
| /*--- Preheader declaration in style block in addition to inline for Outlook */ | |
| .preheader { display:none !important; visibility:hidden; opacity:0; color:transparent; height:0; width:0; } | |
| </style> | |
| </head> | |
| <body> | |
| <!-- PRE-HEADER TEXT --> | |
| <span class="preheader" style="display: none !important; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;">Preheader text shows up in GMail, iOS, Mail.app, & more: 75 text char limit</span> |
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
| wget \ | |
| -e robots=off \ | |
| --referer="http://www.google.com" \ | |
| --user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" \ | |
| --recursive \ | |
| --no-clobber \ | |
| --page-requisites \ | |
| --convert-links \ | |
| --domains website.com \ | |
| website.com/ |
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
| function send_email( $to, $from, $subject, $message, $html=true ){ | |
| // Set the headers | |
| $headers = "From: ".$from."\r\n"; | |
| $headers .= "Reply-To: ".$from."\r\n"; | |
| if( defined('BCC_CONTACT_EMAIL') ) { | |
| $headers .= 'Bcc: ' . BCC_CONTACT_EMAIL . "\r\n"; | |
| } | |
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
| function uuid() { | |
| $data = openssl_random_pseudo_bytes(16); | |
| $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0010 | |
| $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10 | |
| return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); | |
| } |
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
| function get_months_in_range($start, $end, $format='timestamp', $create_empty_array=false) { | |
| $i = $formatted_i = $start = strtotime($start); | |
| if( $format != 'timestamp' ) $formatted_i = date($format, $i); | |
| $end = strtotime($end); | |
| $dates = $create_empty_array ? array($formatted_i => array()) : array($formatted_i); | |
| while($i < $end) { | |
| $month = $formatted_day = mktime(0, 0, 0, date('m', $i)+1, date('d',$i), date('Y', $i)); | |
| if( $format != 'timestamp' ) { | |
| $formatted_month = date($format, $month); | |
| } |
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
| SELECT table_schema AS DatabaseName, | |
| table_name AS TableName, | |
| update_time AS LastAccessTime, | |
| check_time AS LastCheckTime | |
| FROM information_schema.tables | |
| WHERE update_time < 'yyyy-mm-dd' | |
| GROUP BY table_schema | |
| ORDER BY update_time ASC; |
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
| ### Force https:// | |
| RewriteCond %{HTTPS} !=on | |
| RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301] |
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
| ### Force www | |
| RewriteCond %{HTTP_HOST} !^www\. | |
| RewriteRule (.*) http://www.%{SERVER_NAME}%{REQUEST_URI} [R=301] |
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
| div#page-menu { | |
| float: left; | |
| width: 250px; | |
| margin: 0; | |
| } | |
| div#page-menu ul { | |
| border: 2px solid #ccc; | |
| border-top: none; | |
| padding: 0; |
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
| // Report ALL errors, and show them to the user | |
| error_reporting(E_ALL); | |
| ini_set('display_errors', 1); | |
| // Log errors to log file, and do NOT show them to the user | |
| ini_set('log_errors', 1); | |
| ini_set('display_errors', 0); |