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 | |
/** | |
* Classe de Banco de Dados com conexão e métodos para cadastro, alteração e exclusão dinâmicos | |
* @package Sql | |
*/ | |
class Sql{ | |
public $conn; | |
private $server = 'localhost'; |
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 | |
/*! | |
* @AUTHOR João Rangel | |
* [email protected] | |
* | |
* Qualquer alteração não autorizada neste arquivo implicará na perda de manutenção e/ou ganrantia de funcionamento do sistema. | |
* | |
* Date: 2013-12-19 | |
*/ | |
class Model { |
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 __autoload($class){ | |
require_once("class/".strtolower($class).".php"); | |
} | |
function removeSimplesQuotes($val){ | |
return str_replace("'", "", $val); | |
} | |
function request($key){ | |
return removeSimplesQuotes($_REQUEST[$key]); | |
} |
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 | |
/* ********************************************************* */ | |
$siteForderName = ''; | |
if($_SERVER["HTTP_HOST"]=="localhost"){ | |
//Instruções | |
/* Altere a variável ServerAdmin no arquivo httpd.confvdo | |
* seu apache com o valor do seu e-mail para configurar a | |
* pasta de desenvolvimento local. | |
*/ | |
switch($_SERVER['SERVER_ADMIN']){ |
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 Page { | |
public $options = array( | |
"data"=>array( | |
"js"=>array(), | |
"title"=>"", | |
"meta_description"=>"", | |
"meta_author"=>"João Rangel" | |
) |
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
int numPin = 13; //número do pino digital no qual LED está conectado | |
void setup() { | |
pinMode(numPin, OUTPUT); //declara o pino digital como saída | |
} | |
void loop() { | |
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
alertify | |
.confirm('Você deseja realmente excluir?') | |
.set('title', 'Confirmação') | |
.set('onok', function(closeEvent){ | |
rest({ | |
url:PATH+'/rest', | |
method:"DELETE", | |
success:function(r){ | |
alertify.success('Excluído com sucesso.'); | |
}, |
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
function isValidCPF(value: string) { | |
if (typeof value !== 'string') { | |
return false; | |
} | |
value = value.replace(/[^\d]+/g, ''); | |
if (value.length !== 11 || !!value.match(/(\d)\1{10}/)) { | |
return false; | |
} |
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
function isValidCPF($number) | |
{ | |
$number = preg_replace('/[^0-9]/', '', (string) $number); | |
if (strlen($number) != 11) | |
return false; | |
for ($i = 0, $j = 10, $sum = 0; $i < 9; $i++, $j--) | |
$sum += $number{$i} * $j; |
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
const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
let encode64 = function (input) { | |
input = escape(input); | |
var output = ""; | |
var chr1, chr2, chr3 = ""; | |
var enc1, enc2, enc3, enc4 = ""; | |
var i = 0; | |
do { |
OlderNewer