Skip to content

Instantly share code, notes, and snippets.

View danilowm's full-sized avatar
🍻
Cheers

Danilo Iannone danilowm

🍻
Cheers
View GitHub Profile
@danilowm
danilowm / gist:1997871
Created March 8, 2012 01:33
Criar ícone para seu site no iPhone, iPad, iPod e outros iGadgets
<link rel="apple-touch-icon" href="images/icon-iphone.png" />
@danilowm
danilowm / gist:1997855
Created March 8, 2012 01:28
CSS Hack Internet Explorer
#divID {
color: green;
}
#divID {
_color: red; /* IE6 */
}
#divID {
*color: yellow; /* IE7 */
}
#divID {
@danilowm
danilowm / gist:1997850
Created March 8, 2012 01:27
Shadowbox Vimeo
<a title="Video Vimeo" href="http://www.vimeo.com/moogaloop.swf?clip_id=31143592&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;autoplay=1" rel="shadowbox;width=900;height=506;">Ver o Vídeo</a>
@danilowm
danilowm / enviar_email.php
Created March 8, 2012 01:23
Enviar email com Anexo em PHP
<?php
$nome = $_POST['nome'];
$arquivo = $_FILES["arquivo"];
// Para quem vai ser enviado o email
$para = "seu[@]email.com.br";
$boundary = "XYZ-".date("dmYis")."-ZYX";
$fp = fopen($arquivo["tmp_name"], "rb"); // abre o arquivo enviado
$anexo = fread($fp, filesize($arquivo["tmp_name"])); // calcula o tamanho
@danilowm
danilowm / gist:1997800
Created March 8, 2012 01:20
Retirar www da url com htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.danilowm.com$ [NC]
RewriteRule ^(.*)$ http://www.danilowm.com/$1 [L,R=301]
@danilowm
danilowm / gist:1997795
Created March 8, 2012 01:19
Retirar www da url com htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^danilowm.com$ [NC]
RewriteRule ^(.*)$ http://danilowm.com/$1 [L,R=301]
@danilowm
danilowm / gist:1869144
Created February 20, 2012 13:16
Remover admin bar do Wordpress
add_filter( 'show_admin_bar', '__return_false' );
@danilowm
danilowm / gist:1808158
Created February 12, 2012 11:51
Header Charset no PHP
<?php header ('Content-type: text/html; charset=ISO-8859-1'); ?>
@danilowm
danilowm / gist:1808154
Created February 12, 2012 11:50
Header Charset no PHP
<?php header ('Content-type: text/html; charset=UTF-8'); ?>
@danilowm
danilowm / gist:1719041
Created February 1, 2012 20:10
If de uma linha PHP
<?php
// Se existir $_GET['nome'] retorna o valor, senão, retorna vazio
$nome = isset($_GET['nome']) ? $_GET['nome'] : '';
$email = isset($_GET['email']) ? $_GET['email'] : '';
$mensagem = isset($_GET['mensagem']) ? $_GET['mensagem'] : '';
echo $nome.'<br/>'.$email.'<br/>'.$mensagem;
?>