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
######################### | |
# Begin Rewrite Rules | |
######################### | |
# | |
# Turn on Rewrite Engine | |
RewriteEngine on | |
# | |
# Add a trailing slash at the end of URL | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} !/$ |
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
# How to Install Apache 2.4 & PHP 8.0 on Amazon Linux | |
[https://tecadmin.net/install-apache24-php7-on-amazon-linux/](https://tecadmin.net/install-apache24-php7-on-amazon-linux/ | |
## Install Apache | |
``` | |
sudo yum update -y | |
sudo yum install -y httpd httpd-tools mod_ssl | |
sudo systemctl enable httpd | |
sudo systemctl start httpd | |
``` |
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 Router( config ) | |
{ | |
/** | |
* Default values unless they are set in the call to the constructor | |
*/ | |
this.routes = []; | |
this.root = "/"; | |
this.notFound = "/404/"; | |
this.hash = "#" | |
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 Util() | |
{ | |
this.url = { | |
parse_search : function(s) { | |
var search = (!s) ? window.location.search.substring(1) : s; | |
return (!search) ? {} : JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}'); | |
} | |
}; | |
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
var search_account = { | |
apihost : location.protocol + '//' + location.host, | |
protocol : location.protocol, | |
version : location.pathname.replace(/\//gi, ''), | |
skin : location.hash.split("/")[0], | |
account : location.hash.split("/")[1], | |
site : location.hash.split("/")[2], | |
getElement : function(n, v, t){ | |
n = document.createElement(n); | |
for (var p in v) |
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 | |
/** | |
* CORS for PHP allowing the Authorization header to be used with Javascript | |
*/ | |
# | |
# Array holding allowed Origins | |
foreach ([ | |
'(https://)?(www\.)?remotedomain\.com' // Remote Domain | |
] as $o) { | |
if (preg_match("#$o#", $_SERVER['HTTP_ORIGIN'])) { |
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 parse_url(url){ | |
var a = url.split("/").filter(b => b), | |
p = a.shift(), | |
h = a.shift(), | |
t = a.join("/").split("?"); | |
return { | |
protocol : p, host : h, port : h.split(":")[1] || null, path : t[0], | |
query : t[1] ? t[1].split("#")[0] : null, | |
hash : (t[1] ? t[1].split("#")[1] : null) || null |
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
Date.prototype.format = function( format = 'Y-m-d' ) | |
{ | |
var LZ = function( x ){ return ( parseInt(x) < 10 ? '0' : '' ) + x }; | |
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); | |
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat'); | |
var y = this.getFullYear().toString(); | |
var M = this.getMonth()+1; | |
var d = this.getDate(); | |
var E = this.getDay(); | |
var H = this.getHours(); |