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.

@claudiosanches
claudiosanches / whois.php
Last active March 27, 2023 06:29
WordPress - Domain Whois
<?php
/**
* Plugin Name: Domain Whois
* Plugin URI: https://claudiosmweb.com
* Description: Domain Whois
* Author: claudiosanches
* Author URI: http://claudiosmweb.com
* Version: 0.0.1
* License: GPLv2 or later
*/
@claudiosanches
claudiosanches / recebe.php
Created September 30, 2012 18:49
Exemplo de como adicionar ou atualizar dados com WPDB
<?php
// Update table
function cs_add_data($competition, $date, $numbers) {
global $wpdb;
$table_name = $wpdb->prefix . 'nome da sua tabela';
$numbers = str_replace('/', '-', $numbers);
// Test variables
if (!is_numeric($competition))
wp_die('O número do concurso é inválido');
@claudiosanches
claudiosanches / changing-php-version.md
Last active January 23, 2023 02:19
Changing PHP version on Ubuntu

Apache

sudo a2dismod php8.0
sudo a2enmod php7.4
sudo service apache2 restart

Command line

@claudiosanches
claudiosanches / exemplo-media-queries-condicoes.html
Created May 19, 2012 20:03
Layout Responsivo #01: Introdução
<!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 / functions.php
Last active October 31, 2022 16:02
WooCommerce Correios - PAC Free
<?php
function custom_woocommerce_correios_shipping_methods( $rate ) {
$rate['cost'] = 0;
return $rate;
}
add_filter( 'woocommerce_correios_correios-pac_rate', 'custom_woocommerce_correios_shipping_methods' );
@claudiosanches
claudiosanches / woocommerce-installments-example.php
Last active October 12, 2022 19:03
WooCommerce - Displays the price in 3 installments without interest.
<?php
/**
* Plugin Name: WooCommerce Installments Example
* Plugin URI: http://claudiosmweb.com/
* Description: Added the price with 3 installments without interest.
* Author: claudiosanches
* Author URI: http://www.claudiosmweb.com/
* Version: 1.0
* License: GPLv2 or later
*/
@claudiosanches
claudiosanches / plugin.php
Created May 2, 2017 22:33
WooCommerce - Send "New User Registration" email to admins when new customer is created.
<?php
/**
* Send "New User Registration" email to admins when new customer is created on WooCommerce.
*
* @param int $id New customer ID.
*/
function my_wc_customer_created_notification( $id ) {
wp_new_user_notification( $id, null, 'admin' );
}
@claudiosanches
claudiosanches / pagina.html
Created December 12, 2012 23:41
Exemplo de blocos do Adsense flutuando lado a lado.
<div style="float: left;">
<!-- Primeiro código do Adsense aqui -->
</div>
<div style="float: left; margin: 0 20px;">
<!-- Segundo código do Adsense aqui -->
</div>
<div style="float: left;">
<!-- Terceiro código do Adsense aqui -->
@claudiosanches
claudiosanches / svn-checkout.sh
Last active July 4, 2022 18:32
SVN - Checkout project and don't fetch content for all tags
svn co --depth=files https://plugins.svn.wordpress.org/woocommerce/ # Checkout project without fetching content
cd woocommerce
svn up assets branches trunk # Fetch content for everything except for the tags
svn up --set-depth=immediates tags # Create tags directory tree, but don't fetch any content
svn up --set-depth=infinity tags/<tag_number> # Fetch content for a tag