Skip to content

Instantly share code, notes, and snippets.

:shipit:

Claudio Sanches claudiosanches

:shipit:
Block or report user

Report or block claudiosanches

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bomfinder.php
<?php
// Tell me the root folder path.
// You can also try this one
// $home = $_SERVER['DOCUMENT_ROOT'];
// Or this
// dirname( __FILE__ )
$home = dirname( __FILE__ );
// Is this a Windows host ? If it is, change this line to $windows = true;
$windows = false;
@claudiosanches
claudiosanches / rand_banners.html
Created Apr 12, 2012
Função para banners randômicos
View rand_banners.html
<!DOCTYPE html>
<html dir="ltr" lang="pt-BR">
<head>
<title>Banners Randômicos</title>
<meta charset="UTF-8" />
<script type="text/javascript">
// cria a função para banners randômicos
function rand_banners(valor){
// transforma a variável "valor" em um Array, cortando a string pela virgula
banners = valor.split(',');
@claudiosanches
claudiosanches / custom_gravatar.php
Created Apr 12, 2012
Wordpress custom gravatar
View custom_gravatar.php
<?php
// Coloque isso no functions.php
if ( !function_exists('my_new_gravatar') ) {
function cs_new_gravatar( $avatar_defaults ) {
// Suba a imagem para a pasta images do tema
$myavatar = get_bloginfo('template_directory').'/images/SUAIMAGEM.jpg';
// Inseria o nome do gravar que vai aparecer em Configurações > Discussão
$avatar_defaults[$myavatar] = 'NOME DO GRAVATAR';
return $avatar_defaults;}
add_filter( 'avatar_defaults', 'cs_new_gravatar' );
View ieplaceholder.js
$(document).ready(function() {
// Placeholder para browsers antigos
// Importante usar o placeholder="" corretamente para o script rodar
$('input[placeholder]').each(function(){
var ph = $(this).attr('placeholder');
$(this).val(ph).focus(function(){
if($(this).val() == ph) $(this).val('');
}).blur(function(){
if(!$(this).val()) $(this).val(ph);
});
@claudiosanches
claudiosanches / default_text.css
Created Apr 13, 2012
Wordpress Default text CSS
View default_text.css
/* Text elements */
p {margin-bottom:1.625em;}
ul, ol {margin:0 0 1.625em 2.5em;}
ul {list-style:circle;}
ol {list-style-type:decimal;}
ol ol {list-style:upper-alpha;}
ol ol ol {list-style:lower-roman;}
ol ol ol ol {list-style:lower-alpha;}
ul ul, ol ol, ul ol, ol ul {margin-bottom:0;}
dl {margin:0 1.625em;}
@claudiosanches
claudiosanches / functions.php
Created May 1, 2012
Custom category posts per page
View functions.php
<?php
// Custom category posts per page
function cs_category_posts_per_page($query) {
if (is_category()) {
$query->query_vars['posts_per_page'] = 5;
return;
}
}
add_filter('pre_get_posts', 'cs_category_posts_per_page');
?>
@claudiosanches
claudiosanches / style.css
Created May 3, 2012
Facebook comment responsive
View style.css
.fb-comments, .fb-comments iframe, .fb_iframe_widget span {
width: 100% !important;
}
View tooltip.html
<!DOCTYPE html>
<html dir="ltr" lang="pt-BR">
<head>
<title></title>
<meta charset="UTF-8" />
<style>
/* oculta o tooltip na hora que carrega a página, é importante ter isso */
.tooltip {
display: none;
}
View exemplo-media-queries-condicoes.html
<!DOCTYPE html>
<html>
<head>
<title>Exemplo de Media Types</title>
<!-- todos os dispositivos -->
<link href="estilos.css" rel="stylesheet" type="text/css" media="all" />
<!-- monitores e com largura máxima de 600px (por exemplo tablets) -->
<link href="estilo1.css" rel="stylesheet" type="text/css" media="screen and (max-width: 800px)" />
<!-- apenas para monitores coloridos -->
<link href="estilo2.css" rel="stylesheet" type="text/css" media="only screen and (color)" />
@claudiosanches
claudiosanches / layout-fluido-hibrido-ie.html
Created May 26, 2012
Tudo sobre Layout Responsivo #02: Diferenças entre Layout Responsivo e Fluido
View layout-fluido-hibrido-ie.html
<!DOCTYPE html>
<html dir="ltr" lang="pt-BR">
<head>
<title>Layout Fluido Hibrido - IE Hack</title>
<meta charset="UTF-8" />
<!-- CSS -->
<style>
* {margin:0;padding:0}
.clear {clear:both;}
#wrap {max-width:960px;min-width:600px;margin:0 auto;}
You can’t perform that action at this time.