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
@claudiosanches
claudiosanches / style.css
Created Jul 9, 2014
WooCommerce - PagSeguro Checkout transparente
View style.css
.payment_method_pagseguro > input[type="radio"],
.payment_method_pagseguro > label,
.woocommerce #payment div.payment_box.payment_method_pagseguro:after,
.woocommerce-page #payment div.payment_box.payment_method_pagseguro:after,
.payment_box.payment_method_pagseguro > p {
display: none;
}
.woocommerce #payment div.payment_box.payment_method_pagseguro,
.woocommerce-page #payment div.payment_box.payment_method_pagseguro {
@claudiosanches
claudiosanches / some.php
Created Sep 9, 2014
Check if is WooCommerce 2.2
View some.php
<?php
if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.2', '>=' ) ) {
} else {
}
@claudiosanches
claudiosanches / functions.php
Created Dec 11, 2014
WooCommerce PayPal Adaptive Payments - feesPayer
View functions.php
<?php
function custom_woocommerce_paypal_ap_payment_args( $args ) {
$args['feesPayer'] = 'SENDER';
return $args;
}
add_filter( 'woocommerce_paypal_ap_payment_args', 'custom_woocommerce_paypal_ap_payment_args' );
@claudiosanches
claudiosanches / functions.php
Created Apr 8, 2015
WooCommerce - Fix state field in IE
View functions.php
function custom_woocommerce_default_address_fields( $fields ) {
if ( isset( $fields['state']['placeholder'] ) ) {
unset( $fields['state']['placeholder'] );
}
return $fields;
}
add_filter( 'woocommerce_default_address_fields', 'custom_woocommerce_default_address_fields' );
@claudiosanches
claudiosanches / functions.php
Created Apr 29, 2015
WooCommerce MercadoPago - Exclude Ticket from payment options
View functions.php
function wc_mercadopago_exclude_ticket( $args ) {
$args['payment_methods'] = array( array( 'excluded_payment_types' => array( 'id' => 'ticket' ) ) );
return $args;
}
add_filter( 'woocommerce_mercadopago_args', 'wc_mercadopago_exclude_ticket' );
View 000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
@claudiosanches
claudiosanches / gist:fa02e18296e5a1a7ecf6
Last active Aug 29, 2015 — forked from ezimuel/gist:9135151
Tesing SimpleXML and DOMDocument to prevent XXE attacks on XML
View gist:fa02e18296e5a1a7ecf6
<?php
// The libxml entity loader is disabled by default
// even setting the libxml_disable_entity_loader to false doesn't works!
//
// @see http://uk3.php.net/manual/en/function.libxml-disable-entity-loader.php
// @see http://stackoverflow.com/a/10213239
$dir = __DIR__;
$content = 'This is a remote content!';
file_put_contents('content.txt', $content);
@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);
});
You can’t perform that action at this time.