Skip to content

Instantly share code, notes, and snippets.

View claudiosanches's full-sized avatar
👨‍💻

Claudio Sanches claudiosanches

👨‍💻
View GitHub Profile
@claudiosanches
claudiosanches / Mailhog_installation.md
Last active May 31, 2023 14:16 — forked from dipenparmar12/Mailhog_installation.md
Mailhog installation guide (Linux)

Mailhog

1. Install GoLang

Install

Mailhog Requires Go 1.4+ to run so we will install GO language in system.

sudo apt install golang-go -y

Cross verify Go language is successfully installed.

<?php
/**
* Wraps a message $content in a responsive e-mail template.
*
* Reference: http://zurb.com/playground/projects/responsive-email-templates/basic.html
*/
function post_mail_content( $content ) {
ob_start(); ?><html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta content="width=device-width" name="viewport">
@claudiosanches
claudiosanches / bin-cc.md
Last active July 18, 2016 03:26 — forked from arlm/bin-cc.md

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc Regex
Visa 4 13,16 3 ^4[0-9]{12}(?:[0-9]{3})
Mastercard 5 16 3 ^5[1-5][0-9]{14}
Diners 301,305,36,38 link 14,16 3 `^3(?:0[0-5]
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
global $woocommerce;
$minimum = 10;
if ( $woocommerce->cart->get_cart_total(); < $minimum ) {
$woocommerce->add_error( sprintf( 'You must have an order with a minimum of %s to place your order.' , $minimum ) );
}
}
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php)
add_filter('add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment');
function woocommerce_header_add_to_cart_fragment( $fragments ) {
global $woocommerce;
ob_start();
?>
<a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a>
<?php
// Activate menu function
add_action( 'init', 'my_custom_menus' );
function my_custom_menus() {
register_nav_menus( array(
'main-menu' => 'Main Menu',
'footer-menu' => 'Footer Menu', 'top_menu' => 'Top Menu', 'resp_menu' => 'Responsive Menu'
) );
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)
"abaixo","aca","acaso","acerca","acima","acola","acula","ademais","adentro","adiante","afinal","afora","agora","agorinha","ah","ainda","alem","algo","alguem","algum","alguma","algumas","alguns","ali","alias","alo","ambos","amiude","ante","antes","ao","aonde","aos","apenas","apesar","apos","apud","aquela","aquelas","aquele","aqueles","aqui","aquilo","as","assim","ate","atras","atraves","basicamente","bastante","bastantes","bem","bis","bom","ca","cada","cade","caso","certa","certamente","certas","certeiramente","certo","certos","chez","chi","comigo","como","comumente","conforme","confronte","conosco","conquanto","consequentemente","consigo","consoante","contanto","contigo","contra","contudo","convosco","cuja","cujas","cujo","cujos","da","dai","dali","dantes","daquela","daquelas","daquele","daqueles","daqui","daquilo","das","de","debaixo","defronte","dela","delas","dele","deles","demais","dentre","dentro","depois","desde","dessa","dessas","desse","desses","desta","destas","deste","destes","detras","deveras","dia
<?php
/*
Template Name: Print Processing Orders :)
*/
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@claudiosanches
claudiosanches / functions.php
Created September 11, 2013 07:06
WooCommerce - Max and Min
/**
* This code should be added to functions.php of your theme
**/
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
function custom_variation_price( $price, $product ) {
$price = '';
if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '<span class="from">' . _x('From', 'min_price', 'woocommerce') . ' </span>';