Skip to content

Instantly share code, notes, and snippets.

View claudiosanches's full-sized avatar
👨‍💻

Claudio Sanches claudiosanches

👨‍💻
View GitHub Profile
@claudiosanches
claudiosanches / imagem-seguindo-mouse.php
Created October 31, 2012 21:19
Imagem Seguindo o Mouse
<?php
/**
* Plugin Name: Imagem seguindo o mouse
* Plugin URI: http://www.claudiosmweb.com/
* Description: Uma imagem seguindo o mouse com jQuery
* Author: claudiosanches
* Author URI: http://www.claudiosmweb.com/
* Version: 1.0
* License: GPLv2 or later
*/
@claudiosanches
claudiosanches / functions.php
Created November 6, 2012 05:49
Wordpress - Retore roles, permissions and capabilities
<?php
/**
* Returar papéis, permissões e capacidades:
*
* Cole isso no seu functions.php.
* Atualize o seu site pelo navegador (F5) e depois delete isso!
*
*/
include( ABSPATH . 'wp-admin/includes/schema.php' );
echo populate_roles();
@claudiosanches
claudiosanches / teste.php
Created November 10, 2012 06:15
PagSeguro Wordpress WooCommerce
<?php
$email = '';
$token = '';
$postdata = 'email=' . $email . '&token=' . $token . '&currency=BRL&itemId1=0001&itemDescription1=Notebook Prata&itemAmount1=243.00&itemQuantity1=1&itemWeight1=1000&itemId2=0002&itemDescription2=Notebook Rosa&itemAmount2=256.00&itemQuantity2=2&itemWeight2=750&reference=REF1234&senderName=Jose Comprador&senderAreaCode=11&senderPhone=56273440&[email protected]&shippingType=1&shippingAddressStreet=Av. Brig. Faria Lima&shippingAddressNumber=1384&shippingAddressComplement=5o andar&shippingAddressDistrict=Jardim Paulistano&shippingAddressPostalCode=01452002&shippingAddressCity=Sao Paulo&shippingAddressState=SP&shippingAddressCountry=BRA';
// Send back post vars.
$params = array(
'body' => $postdata,
@claudiosanches
claudiosanches / teste.php
Created November 13, 2012 03:41
Testando Gist
<?php
echo 'Testando exemplo de Gist'
?>
@claudiosanches
claudiosanches / functions.php
Created November 13, 2012 23:15
Add ARS in Jigoshop
<?php
function new_jigoshop_add_my_currency( $currencies ) {
$currencies['ARS'] = ' Argentine peso (&#36;)';
asort( $currencies );
return $currencies;
}
add_filter( 'jigoshop_currencies', 'new_jigoshop_add_my_currency', 1, 1 );
@claudiosanches
claudiosanches / exemplo.html
Created November 21, 2012 15:14
Exemplo da imagem com base64
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARwAAACxCAIAAACZY5UzAAAgAElEQVR4nGza9VvUef82/jfMMN0dzDADDN09xMAk3d0gDdISUtLd3UioWCgGCkiLKOaqu6tuuW6vu9baou/7B69rP/f3e3+O4/wXHsd5Hs/XC8BqZOIFWXzLErZJLowVenhpx96rHcOJQ7FTSII9VO1inCAPr5VPNCzA6WeqqCdjtfdg1PMgjDQL597h4/+0jny1fPXVSxB8A4LvwPc74EsQfA1+BJ/8+urRnWfPf3oPvnm18+rxp0/gszfgt09BbWmOwL2BoeigOg/jFeM4+QTBeYrmfljV+wjX8wDH7YCqdFpVeoQln2I4jzOcx2guI0znEVXFYHDRVVn0lI1LsdhlV/m+4l9+WPrmVv9PXzb+fLf0t3ulj24X3dnKvr6edfNSwbXNgq3l3PnjsWuz8VfPJN6ZS7w/t+uHczG/zO96thAGbgSB25lfXuyfnLug7l2PlAwTpaeQNsdI4uNU8QRV0iMQVUitU5KM/To1HZp1Xbwssg2FNRomZUy9IpJOKUGvAm9UjzdrxZt34Cy7cVY9RGE/2b6f5jjEcBykSMcIvicwPrNMn3O6fscsXWsNnPI4sgaO+36K06Sazwmi96ChtKRWlFHrnK/n1wL49XKCDtEch4x95g0Vx7XsO82d29nGGbZeXUayQZ6wy8h9SF1WZRNe1XT8lq5LAcD0U6IEAUqeAD6ByM/HEUOQcAWF7M2mBpIhHjRcOIIdA6cGMSAyurItgDEDkGZKSBcuP1kF4Q1AFFicrwpMgUK5weFyNEqBgEtRSDkKKUdCFUqASCqq2LoK1g7dDc47GlZ4LDjv8O7mpeZj3y1/D95+Dmo4ZgMYJwAQKmHcIAg3CMQVhfBHw33hgAsS4o5B+KFRQUh0iAo6FIaOgGHD0ZRYKC5IBecLxbhhSB4EmhuJJu8e3GZpRKGp/nReLJoSSFOLx9LCEYRQDCUSS47EUi
@claudiosanches
claudiosanches / index.html
Created November 22, 2012 01:50
jQuery print page
<!DOCTYPE html>
<html dir="ltr" lang="pt-BR">
<head>
<meta charset="UTF-8" />
<title>Print</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('.print-this').on('click', function(e) {
@claudiosanches
claudiosanches / functions.php
Created November 23, 2012 15:01
WooCommerce - Customizar o summary do content-single-product.php
<?php
// Colar no functions.php
// Para remover os hooks
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title' );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price' );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt' );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart' );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta' );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing' );
@claudiosanches
claudiosanches / .gitignore
Created November 24, 2012 02:46
GIT: Include empty directories
# Ignore everything in this directory
*
# Except this file
!.gitignore
@claudiosanches
claudiosanches / functions.php
Created November 26, 2012 15:02
Wordpress - Script Shortcode
<?php
/**
* Embed Scripts in Wordpress editor.
*
* Usage:
* [js]http://youtsite.com/script.js[/js]
*
* @param array $atts
* @param string $content