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
# Add the -c flag and set the core.fileMode option to false, e.g.: | |
git -c core.fileMode=false status |
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(); | |
$freeze = new DateTimeImmutable(); | |
$now->setTimeZone(new DateTimeZone('UTC')); | |
$freeze->setTimeZone(new DateTimeZone('UTC')); | |
echo $now->format('Y-m-d H:i:s P'); | |
// 2020-12-11 12:50:48 +00:00 | |
$freeze->format('Y-m-d H:i:s P'); | |
// 2020-12-11 09:50:51 -03:00 |
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
console.clear(); | |
function oddOrEven(n) | |
{ | |
return new Promise((resolve, reject) => { | |
if (typeof(n) != 'number') { | |
reject(new TypeError('n must be a number')); | |
} | |
if ((n % 2) == 0) { |
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); |