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 | |
/** | |
* NOTICE: Consider the current version of the laguage (currently 7.4.12) when executing, | |
* since it may give you a wrong offset when uding older versions. | |
*/ | |
$now = new DateTime(); | |
$now->setTimezone(new DateTimeZone('America/Sao_Paulo')); | |
echo $now->format('Y-m-d H:i'); |
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
# Limpar o cache de DDL do Doctrine | |
php ./vendor/doctrine/doctrine-module/bin/doctrine-module orm:clear-cache:metadata | |
php ./vendor/doctrine/doctrine-module/bin/doctrine-module orm:schema-tool:update --force |
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
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" | |
" .vimrc - Vim/GVim Configuration File | |
" | |
" Er Galvão Abbott - https://github.com/galvao/dotfiles | |
" | |
" Official docs @ http://vimdoc.sourceforge.net/htmldoc/usr_toc.html | |
" | |
" Many thanks to Matthew Weier O'Phinney for his articles about it: | |
" - https://mwop.net/blog/249-vim-toolbox-2010-edition.html |
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 | |
$now = new DateTime(); | |
$then = new DateTime($_SERVER['argv'][1]); | |
$interval = $now->diff($then); | |
echo $interval->format('%a'); |
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
botoes = document.querySelectorAll('button'); | |
elementoJj = document.querySelector('#jj'); | |
elementoJc = document.querySelector('#jc'); | |
elementoS = document.querySelector('#s'); | |
elementoR = document.querySelector('#r'); | |
botoes.forEach(function (botaoAtual) { | |
botaoAtual.addEventListener('click', function () { | |
jogador = parseInt(this.innerHTML); |
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 FOO = 2; | |
const BAR = {"c": 42}; | |
const BAZ = [12, 14]; | |
BAR.e = 43; | |
console.log(BAR); | |
BAZ.push(16); | |
console.log(BAZ); | |
/** |
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
public function cadastrarAction() | |
{ | |
$requisicao = $this->getRequest(); | |
if ($requisicao->isPost()) { | |
$dados = $requisicao->getPost(); | |
$model = new Produto(); | |
$model->exchangeArray($dados); |
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
SELECT | |
ordinal_position, | |
table_name, | |
column_name, | |
data_type, | |
character_maximum_length, | |
numeric_precision, | |
numeric_precision_radix, | |
numeric_scale | |
FROM |
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
span { | |
border: 1px solid #000; | |
padding: 0; | |
background-color: #fff; | |
color: #000; | |
transition-property: padding, color, background-color; | |
transition-duration: 1s; | |
} | |
span:hover { |
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 declare(strict_types = 1); | |
/** | |
* isPalindromic - A function to determine if a string is or isn't a palindrome. | |
* Made for the AT sitepointdotcom challenge on Twitter . | |
* | |
* This function purposefully ignores the fact that PHP has a function that | |
* reverses a string, therefore making it trivial to solve the issue by | |
* just using $str === strrev($str). | |
* |