- Princípios básicos
- Tipos de ameaças
- Tipos de ataques
- Proteção
- Serviços
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
convert(cast(convert(titulo using latin1) as binary) using utf8) |
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 Imprimir(array $values){ | |
foreach($values as $value){ | |
echo $value['id'].' - '.$value['label']; | |
echo '<br />'; | |
} | |
} | |
function Sort_Array(array &$values, $field=NULL){ | |
if (is_null($field) === false){ | |
for($i = 0; $i < sizeof($values); $i++){ |
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
# Install Dependencies | |
# sudo apt-get install build-essential | |
# sudo apt-get build-dep php5 | |
sudo apt-get install libmysqlclient-dev mysql-client libcurl4-openssl-dev libgd2-xpm-dev libjpeg-dev libpng3-dev libxpm-dev libfreetype6-dev libt1-dev libmcrypt-dev libxslt1-dev bzip2 libbz2-dev libxml2-dev libevent-dev libltdl-dev libmagickwand-dev libmagickcore-dev imagemagick libreadline-dev libc-client-dev libsnmp-dev snmpd snmp libvpx-dev libxpm-dev libgmp3-dev libicu-dev libpspell-dev libtidy-dev freetds-dev unixodbc-dev librecode-dev libglib2.0-dev libsasl2-dev libgeoip-dev imagemagick libmagickcore-dev libmagickwand-dev | |
# Stop Apache | |
sudo service apache2 stop | |
# Cleanup Packages | |
sudo apt-get autoremove |
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
$recaptcha = new Zend_Service_ReCaptcha('6Ldxo8YSAAAAAD2Q1bc5PCqYA2TPef_wj1JDpmm0','6Ldxo8YSAAAAAOxFKB3hwN1f_3cEaeyMT646RL5X'); | |
$recaptcha->setOption('theme', 'clean'); | |
$captcha = new Zend_Form_Element_Captcha('captcha', | |
array('captcha' => 'ReCaptcha', | |
'captchaOptions' => array('captcha' => 'ReCaptcha', | |
'service' => $recaptcha))); |
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
DELIMITER $$ | |
DROP FUNCTION IF EXISTS `database`.`HTML_UnEncode`$$ | |
CREATE DEFINER=`root`@`127.0.0.1` FUNCTION `HTML_UnEncode`(x VARCHAR(255)) RETURNS varchar(255) CHARSET latin1 | |
BEGIN | |
DECLARE TextString VARCHAR(255) ; | |
SET TextString = x ; | |
#quotation mark |
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
if (window != top) top.location.href = location.href; | |
var id = 0; | |
var maxid = 0; | |
var zoom = false; | |
function addEvent(obj, method, func) { | |
if (obj.addEventListener) { | |
obj.addEventListener(method, func, false) | |
} else if (obj.attachEvent) { | |
if (!obj.events_size) obj.events_size = 0; |
A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).
- Composer/Packagist - A package and dependency manager.
- Composer Installers - A multi framework Composer library installer.
- Symfony2 - A framework comprised of individual components.
- Zend Framework 2 - Another framework comprised of individual components.
- Laravel 4 - A simple PHP framework.
- Lithium - Another framework of components.
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
#!/usr/bin/env php | |
# This function prints the difference between two php datetime objects | |
# in a more human readable form | |
# inputs should be like strtotime($date) | |
# Adapted from https://gist.github.com/207624 python version | |
function humanizeDateDiffference($now,$otherDate=null,$offset=null){ | |
if($otherDate != null){ | |
$offset = $now - $otherDate; | |
} |
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
$('#enviaremail').on('click',function (e) { | |
var link = 'mailto:?body='+document.URL+'&subject='+document.title; | |
window.open(link, 'Enviar notícia por e-mail', 'width=600,height=600'); | |
e.preventDefault(); | |
}); |