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
################################################################################ | |
#################### | |
### Virtual Host for entuhogar.dev subdomain | |
################################################################################ | |
#################### | |
server { | |
listen *:80; | |
server_name entuhogar.dev | |
### Front public folder |
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
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script> | |
<script> | |
/* | |
Color percentage-based generator - by Jack | |
https://jsfiddle.net/xjmjjvdf/1/ | |
*/ | |
function percentage_to_color( perc ){ //0 = red, 100 = green | |
var mod = perc%101; // 0 > perc <= 100 | |
var v = Math.floor( mod * 5.1 ); | |
var r = ("00"+(v>255? 255-(v%256): 255).toString(16)).slice(-2); |
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 | |
/* | |
RFC Regex by Jack | |
Valid: | |
JACK880229AA1 | |
JACK880229 | |
Invalid: | |
JACK880230AA1 | |
JACK890229AA1 |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
//application/controllers/Test.php | |
class Test extends MY_Controller { | |
private $username = 'admin'; | |
private $salt = 'immaveryveryveryverylongsalt'; | |
private $password = 'c25c068f620bae40f6de49aa32bc7a036989baae382f64d7cc41f89a741ff6ae'; //supersecret | |
function __construct(){ | |
parent::__construct(); | |
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 | |
/* PHP Headers for CSV File with UTF-8 - By MrJack*/ | |
header("Content-type: text/csv"); | |
header("Content-Disposition: attachment; filename=reporte_ganadores_".date("d-m-Y").".csv"); | |
header("Pragma: no-cache"); | |
header("Expires: 0"); | |
echo "\xEF\xBB\xBF"; //<--- here is the magic | |
echo "WHATÉVER"; |
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
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
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 | |
/* Regex generator for valid TLDs - By MrJack*/ | |
$txt = file_get_contents('http://data.iana.org/TLD/tlds-alpha-by-domain.txt'); | |
$tlds = preg_split('/\s+/', $txt); | |
$valid_tld = array(); | |
foreach($tlds as $tld){ | |
if (! preg_match('/[^a-z]+/i', $tld, $matches)){ | |
if(strlen($tld) > 3){ | |
array_push($valid_tld, strtolower($tld)); | |
} |
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 | |
/* | |
AES256 v1.0 MrJack | |
https://gist.github.com/1077723/0a9a7c5299a7fb4340e4b2064fd383ef236a5aa5 | |
https://gist.github.com/RiANOl/1077723 | |
*/ | |
function aes256Encrypt($key, $data, $mode = MCRYPT_MODE_CBC) { | |
if(32 !== strlen($key)) $key = hash('SHA256', $key, true); | |
$padding = 16 - (strlen($data) % 16); |
NewerOlder