Skip to content

Instantly share code, notes, and snippets.

@ricardodantas
ricardodantas / php-email-to.utf8.php
Created January 31, 2014 13:43
Função para codificar email para UTF8 no envio de emails pela função "mail()" do PHP.
function utf8mail($to,$s,$body,$from_name="x",$from_a = "info@x.com", $reply="info@x.com")
{
$s= "=?utf-8?b?".base64_encode($s)."?=";
$headers = "MIME-Version: 1.0\r\n";
$headers.= "From: =?utf-8?b?".base64_encode($from_name)."?= <".$from_a.">\r\n";
$headers.= "Content-Type: text/plain;charset=utf-8\r\n";
$headers.= "Reply-To: $reply\r\n";
$headers.= "X-Mailer: PHP/" . phpversion();
mail($to, $s, $body, $headers);
}
@ricardodantas
ricardodantas / hide-text.css
Created February 17, 2014 14:59
Esconde texto de elementos HTML.
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@ricardodantas
ricardodantas / hide-text.scss
Last active August 29, 2015 13:56 — forked from anonymous/mycode.js
A hide text SCSS mixin.
// How to use: @include hide-text;
@mixin hide-text() {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
# ----------------------------------------------------------------------
# /PUBLIC folder .htaccess
# ----------------------------------------------------------------------
# This .htaccess file is recommended
# to be placed at root/public folder
# of your Laravel powered application
# ----------------------------------------------------------------------
# This file works with Laravel 3 and 4
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and
@ricardodantas
ricardodantas / git-rollback-remote
Created March 28, 2014 02:18
Git rollback on remote.
git push -f origin has_to_rollback:master
@ricardodantas
ricardodantas / SassMeister-input.scss
Created May 26, 2014 15:37
Generated by SassMeister.com.
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
$colors:(Branco: #f0f0f0, Preto: #000, Amarelo: #f6dd34,Azul: #5c6fcf,Bege: #d9cc9e,Cinza: #969696,Laranja: #e36139,Marrom: #7d4f3f,Rosa: #c8418c,Roxo: #543c94,Verde: #007831,Vermelho: #c11300);
@each $name, $color in $colors{
.#{$name}{
background-color: $color;
}
jQuery.fn.brTelMask = function() {
return this.each(function(){
var el = this;
$(el).focus(function(){
$(el).mask("(99) 9999-9999?9");
});
$(el).focusout(function(){
var phone, element;
@ricardodantas
ricardodantas / sample.css
Created September 4, 2014 18:01
Centralizar verticalmente e horizontalmente elementos (css/html) --- From http://css-tricks.com/centering-css-complete-guide/
.parent { position: relative; }
.child { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
$.getJSON('https://gdata.youtube.com/feeds/api/videos?q=googledevelopers&max-re‌​sults=5&v=2&alt=jsonc&orderby=published', function(data) {
console.log(data);
for(var i=0; i<data.data.items.length; i++) {
console.log(data.data.items[i].title); // title
console.log(data.data.items[i].description); // description
}
});
@ricardodantas
ricardodantas / whatsapp.txt
Created October 8, 2014 18:57
Share button from whatsapp
whatsapp://send?text=Acesse%20o%20nosso%20site: http%3A%2F%2Flazzariagenciaweb.com.br%2Fblog