This file contains 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 | |
class Template | |
{ | |
private $data = []; | |
private $path; | |
public function __construct($path='') | |
{ | |
$this->path = $path; | |
} |
This file contains 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 getRangeDate($start, $end, $increment = '+1 days') { | |
$current = strtotime($start); | |
$end = strtotime($end); | |
$results = []; | |
while($current < $end){ | |
$results[] = date('Y-m-d', $current); | |
$current = strtotime($increment, strtotime(date('Y-m-d', $current))); |
This file contains 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
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE application/xhtml+xml | |
AddOutputFilterByType DEFLATE text/css | |
AddOutputFilterByType DEFLATE application/xml | |
AddOutputFilterByType DEFLATE image/svg+xml | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/atom_xml | |
AddOutputFilterByType DEFLATE application/x-javascript |
This file contains 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 | |
add_shortcode("star_rating", "fn_star_ratings"); | |
function fn_star_ratings($atts, $content=null){ | |
$data = shortcode_atts(["id" => 0], $atts); | |
return kk_star_ratings($data["id"]); | |
} | |
add_shortcode("star_rating_get", "fn_star_rating_get"); |
This file contains 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
<h1>Página Home</h1> |
This file contains 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 get_client_ip() { | |
$ipaddress = ''; | |
if (isset($_SERVER['HTTP_CLIENT_IP'])) | |
$ipaddress = $_SERVER['HTTP_CLIENT_IP']; | |
else if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) | |
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
else if(isset($_SERVER['HTTP_X_FORWARDED'])) | |
$ipaddress = $_SERVER['HTTP_X_FORWARDED']; |
This file contains 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 | |
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'http'){ | |
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; | |
header("Location: $redirect"); | |
} | |
This file contains 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
let data = [1,2,3,4,5,6,7,8,9,10]; | |
let factor = 2; | |
const sleep = async (ms) => { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
}; | |
const start = async (data) => { | |
let total = data.length; | |