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 | |
$codes = Array( | |
100 => 'Continue', | |
101 => 'Switching Protocols', | |
200 => 'OK', | |
201 => 'Created', | |
202 => 'Accepted', | |
203 => 'Non-Authoritative Information', | |
204 => 'No Content', | |
205 => 'Reset Content', |
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
<!--(?!<!)[^\[>].*?--> |
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 | |
/** | |
* Edit a Word 2007 and newer .docx file. | |
* Utilizes the zip extension http://php.net/manual/en/book.zip.php | |
* to access the document.xml file that holds the markup language for | |
* contents and formatting of a Word document. | |
* | |
* In this example we're replacing some token strings. Using | |
* the Office Open XML standard ( https://en.wikipedia.org/wiki/Office_Open_XML ) | |
* you can add, modify, or remove content or structure of the document. |
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 hasher($password, $salt){ | |
$result = base64_encode(hash('md5', $password.$salt)); | |
$result = substr($result, 5, -5); | |
return strrev($result); | |
} | |
//Example | |
print hasher('myPassword', time()); | |
?> |
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 keygen($length='40'){ | |
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
$size = strlen($chars); | |
for($i = 0; $i < $length; $i++): | |
$str .= $chars[ rand( 0, $size - 1 ) ]; | |
endfor; | |
return $str; | |
} |
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 | |
spl_autoload_register(function($class){ | |
$directorys = array(PATH.VERSION.MODULES, INSTALL.MODULES, INSTALL.THEME.'modules/'); | |
foreach($directorys as $directory): | |
if(file_exists($directory.'class.'.$class.'.php')): | |
require($directory.'class.'.$class.'.php'); | |
return; | |
endif; | |
endforeach; |
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
$(document).ready(function($) { | |
if(window.location !== window.parent.location){ | |
$('header, footer').hide(); | |
} | |
}); |
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
AddHandler application/x-httpd-php5 .htm .html |
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 PORT 80 (insecure / regular traffic) | |
RewriteEngine On | |
RewriteCond %{HTTPS} on | |
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
########################################################### | |
#FORCE PORT 443 && REMOVE WWW. (secure / SSL) | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L] |