Skip to content

Instantly share code, notes, and snippets.

View felipegenuino's full-sized avatar
🇧🇷
Hello from Brazil

Felipe Genuino felipegenuino

🇧🇷
Hello from Brazil
View GitHub Profile
@felipegenuino
felipegenuino / data.php
Created February 24, 2017 14:46
Dias da semana em php
<?php
// author: Thiago Mattos
// original no site: http://www.tiagomatos.com/blog/dia-da-semana-mes-e-ano-em-portugues-utilizando-php
$data = date('D');
$mes = date('M');
$dia = date('d');
$ano = date('Y');
$semana = array(
@felipegenuino
felipegenuino / title com 3 pontos no final :)
Created February 24, 2017 04:46
Colocar ... no final de texto
.panel-heading h3 {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: normal;
width: 75%;
padding-top: 8px;
}
@felipegenuino
felipegenuino / git-tricks
Created February 6, 2017 17:59
Remover todas as alterações que tu fez.
git reset --hard HEAD
git clean -f -d
git pull
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.felipegenuino.myowncard.MainActivity"
>
// Problema: Sobreposição de imagens
// Causa: A altura (height) dos elementos é calculado antes de terminar o carregamento do site
// Solução 1: Inicializar o Isotope após todas as imagens terem sido carregadas. Para isso vai ser preciso usar o ImagesLoaded (Este plugin detecta quando as imagens foram carregadas).
// fonte: https://www.linhadecomando.com/jquery/resolvido-isotope-causando-sobreposicao-de-imagens
<script src="js/isotope.js" type="text/javascript"></script>
<script src="js/imagesloaded.pkgd.min.js" type="text/javascript"></script>
var $container = $('.$container').imagesLoaded( function() {
$container.isotope({
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/darker_gray">
<ImageView
android:src="@drawable/mountains"
android:layout_height="wrap_content"
@felipegenuino
felipegenuino / validation-material-form.js
Created October 20, 2016 14:04
validation material form
$(".mdl-textfield__input").blur(function (){
if( !this.value ){
$(this).prop('required', true);
$(this).parent().addClass('is-invalid');
}
});
$(".mdl-button[type='submit']").click(function (event){
$(this).siblings(".mdl-textfield").addClass('is-invalid');
$(this).siblings(".mdl-textfield").children(".mdl-textfield__input").prop('required', true);
});
@felipegenuino
felipegenuino / videoEmbed.css
Created October 10, 2016 19:42
Embed responsive video without boostrap
.embed-responsive {
position: relative;
display: block;
height: 0;
padding: 0;
overflow: hidden;
}
.embed-responsive .embed-responsive-item,
.embed-responsive iframe,
.embed-responsive embed,
@felipegenuino
felipegenuino / index.html
Created October 10, 2016 19:35
alls iframes responsives with boostrap
$("iframe").wrap("<div class='embed-responsive embed-responsive-16by9'></div>");