Skip to content

Instantly share code, notes, and snippets.

View TiagoFuelber's full-sized avatar

Tiago Fuelber TiagoFuelber

View GitHub Profile
@TiagoFuelber
TiagoFuelber / index.html
Created September 29, 2016 18:29
Tribute Page
<div class="container"> <!--contains all the page-->
<h1 class="text-primary text-center">Tim Ferriss</h1>
<h2 class="text-center"><em>The Human Guinea Pig</em></h2>
<div class="image-box"><img class="col-xs-12 .img-responsive" id="tim-pic" src="https://goo.gl/CFkbCe" alt="Tim Ferriss among his books"><h7 class="text-primary text-center" id="caption">Tim Ferriss among his books</h7> </div>
<center><div class="bio"><center><h2>About his life</h2><center><p>Timothy "Tim" Ferriss (born July 20, 1977) is an American author, entrepreneur, angel investor, and public speaker. He has written a number of self-help books which have appeared on the New York Times, Wall Street Journal, and USA Today bestseller lists, starting with The 4-Hour Workweek.</p>
<p>Ferriss is also an angel investor or an advisor to Facebook, Twitter, StumbleUpon, Evernote, and Uber, among other companies.</p>
<h3>Early life</h3>
<p>Ferriss grew up in East Hampton, New York and graduated from St. Paul's School in Concord, New Hampshir
@TiagoFuelber
TiagoFuelber / index.html
Last active November 14, 2016 17:44
Tiago Fuelber's portfolio.
<div class="container-fluid">
<!-- Toggle menu -->
<nav class="navbar navbar-default navbar-fixed-top navbar-inverse" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
@TiagoFuelber
TiagoFuelber / ordenacao-propriedades.css
Created March 8, 2017 14:32
Ordenação das propriedades CSS
.seletor {
[fonte e propriedades de texto]
[plano de fundo]
[tamanho]
[bordas]
[espacamentos]
[posicionamento]
}
@TiagoFuelber
TiagoFuelber / scroll.js
Created April 25, 2017 14:20
jQuery snippet to smoothly scroll the page to a certain div on a click.
// FAZ BOTÃO SCROLLAR ATÉ A DIV
function scroll() {
$('html, body').animate({
scrollTop: $("#div").offset().top
}, 1000);
}
@TiagoFuelber
TiagoFuelber / script. js
Created May 16, 2017 16:06
Script for masking telephone numbers in Brazil detecting if it's mobile phone or not.
<input type="text" name="telefone" onkeypress="formatar(this)" maxlength="13" value="Telefone" />
function formatar(src){
if (src.value.length <= 11 ) {
mask = "## ####-####";
var i = src.value.length; // 12
var saida = mask.substring(0,1); //#
var texto = mask.substring(i); //## #####-####
if (texto.substring(0,1) != saida) //true
{
@TiagoFuelber
TiagoFuelber / gulpfile exemple
Created May 24, 2017 13:24
gulpfile exemple
exemplo de gulpfile com algumas tasks
@TiagoFuelber
TiagoFuelber / dropdown.js
Created June 19, 2017 13:16
Dropdown with jquery slidetoggle() without queue triggering
$('.dropdown-parent').mouseover(function(){
$(this).find('.dropdown-child').stop().slideToggle();
}).mouseout(function(){
$(this).find('.dropdown-child').stop().slideToggle();
});
@TiagoFuelber
TiagoFuelber / date.php
Created July 20, 2017 13:00
Formata uma data em uma string.
<?php
// FORMATA A STRING DA DATA PRA MOSTRAR JUNTO COM O POST
$month = '';
foreach ($artigos as $d) {
switch (substr($d->dtArtigo, 5, 2)) {
case '01': $month = "Janeiro" ; break;
case '02': $month = "Fevereiro" ; break;
case '03': $month = "Março" ; break;
case '04': $month = "Abril" ; break;
case '05': $month = "Maio" ; break;
@TiagoFuelber
TiagoFuelber / cssDebugger.js
Created September 27, 2017 02:15
CSS debugger, helps to see the dimensions of all elements of the page changing their background color.
(function () {
var debug = ' * {background-color: rgba(0,0,0,.1);}';
var style = document.querySelector('style');
if (style === null) {
var head = document.querySelector('head');
var style = document.createElement('style');
style.textContent = debug;
head.appendChild(style);
@TiagoFuelber
TiagoFuelber / mascara-cpf-cnpj.js
Last active November 9, 2017 13:29
Máscara para CNPJ e CPF no mesmo input
var input = document.querySelector('#inputCpfCnpj');
input.addEventListener('input', function(){
mascaraMutuario(this, cpfCnpj);
});
input.addEventListener('blur', function(){
clearTimeout();
});