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
Para remover os arquivos deletados que antes haviam sido versionados, executar: | |
git ls-files --deleted | xargs git rm | |
git add . | |
git commit | |
Ou: | |
git add -u |
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
RewriteRule ^pagina/([a-z0-9-]+)/([0-9]+)/?$ /pagina.php?lang=pt-br&id=$2&%{QUERY_STRING} [NC] |
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 | |
/* | |
* Problem: RollbackTrans() command doesn't work | |
* | |
* FIX: | |
* The problem happens whenever I use the "mysql" driver to connect in the database | |
* To fix it, I used the "mysqli" driver in ADODB Connection | |
* | |
* The next example is the correct use of Transactions in ADODB | |
*/ |
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
Se o vídeo for em HD, a thumbnail de máxima resolução é esta: | |
http://img.youtube.com/vi/[ID do vídeo]/maxresdefault.jpg | |
Se não for, você pode resgatar a melhor thumbnail possível por aqui: | |
http://img.youtube.com/vi/[ID do vídeo]/mqdefault.jpg | |
Veja exemplos funcionando: | |
http://img.youtube.com/vi/UJtB55MaoD0/maxresdefault.jpg | |
http://img.youtube.com/vi/UJtB55MaoD0/mqdefault.jpg |
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
SetEnv APPLICATION_ENV production | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !-f | |
RewriteRule (.*) public/$1 [L] | |
RewriteCond %{REQUEST_URI} !-d | |
RewriteRule (.*) public/$1 [L] | |
</IfModule> |
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
# Put * in Subdomains in cPanel to setup Wildcard | |
# Put this in .htaccess | |
Options +FollowSymLinks | |
RewriteEngine On | |
RewriteRule ^([aA-zZ])$ subslug.php?username=$1 | |
RewriteCond %{HTTP_HOST} ^(^.*)\.yourdomain.com | |
RewriteRule (.*) subslug.php?username=%1 |
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
//Arquivo shared/libs/fckconfig.js | |
FCKConfig.FillEmptyBlocks = false |
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
sudo a2enmod rewrite | |
sudo service apache2 restart |
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
{# Laço de repetição de array #} | |
{% for fruta in listFrutas %} | |
- {{fruta.nome}} <br> | |
{% endfor %} | |
or | |
{% for i in 0..10 %} | |
{# Laço de repetição #} | |
{% for i in 1..10 %} |
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 | |
$page = 1; // Página Atual | |
$numByPage = 5; // Número de registros por Página | |
$Empresa = $em->createQuery("SELECT e FROM Empresa e ") | |
->setFirstResult( ( $numByPage * ($page-1) ) ) | |
->setMaxResults( $numByPage ); | |
$Empresa = new \Doctrine\ORM\Tools\Pagination\Paginator($Empresa); |
NewerOlder