Skip to content

Instantly share code, notes, and snippets.

View alexnovelli's full-sized avatar
🎯
Focusing

Alex Novelli alexnovelli

🎯
Focusing
View GitHub Profile
@alirezas
alirezas / fade.js
Created February 13, 2017 10:54
fadeIn & fadeOut in vanilla js
function fadeOut(el){
el.style.opacity = 1;
(function fade() {
if ((el.style.opacity -= .1) < 0) {
el.style.display = "none";
} else {
requestAnimationFrame(fade);
}
})();
@kelvearagao
kelvearagao / dateEn.js
Created January 6, 2016 18:15
Função javascript para converter a data do formato brasileiro para formato inglês.
/**
* Recebe um data no formato dd/mm/yyyy e retorna yyyy-mm-dd.
*
* @param string date - Data no formato 'dd/mm/yyyy'.
* @return string - Data no formato 'yyyy-mm-dd'.
*/
function dateToEN(date)
{
return date.split('/').reverse().join('-');
}