A Pen by Gabriel Rodrigues Garcia on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Leitor emails Imap com download de anexo | |
* extension=php_imap.dll | |
*/ | |
/* realiza a conexão com as suas credenciais */ | |
$mailbox = '{meuhost.com.br:993/imap/ssl}INBOX'; | |
$username = 'emailt@meuhost.com.br'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Basta atribuir a classe respectiva no input | |
$('.telefone').on('keyup', function() { | |
mascara(this, mascara_tel); | |
$(this).attr('maxlength','15'); | |
}); | |
$('.cpf').on('keyup', function() { | |
mascara(this, mascara_cpf); | |
$(this).attr('maxlength','14'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="frm_select_estados"> | |
<option value="AC">Acre</option> | |
<option value="AL">Alagoas</option> | |
<option value="AP">Amapá</option> | |
<option value="AM">Amazonas</option> | |
<option value="BA">Bahia</option> | |
<option value="CE">Ceará</option> | |
<option value="DF">Distrito Federal</option> | |
<option value="ES">Espírito Santo</option> | |
<option value="GO">Goiás</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove state field from woocommerce checkout form. | |
* | |
* @see https://github.com/woocommerce/woocommerce/blob/3.1.2/includes/class-wc-countries.php#L629 | |
* | |
* @param array $fields Array of default address fields. | |
*/ | |
function jeherve_remove_state_field( $fields ) { | |
unset( $fields['state'] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################## | |
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024 | |
# ---------------------------------------------------------------------- | |
# @Author: Andreas Hecht | |
# @Author URI: https://seoagentur-hamburg.com | |
# License: GNU General Public License v2 or later | |
# License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
######################################################################## | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function validaCPF($cpf) { | |
// Extrai somente os números | |
$cpf = preg_replace( '/[^0-9]/is', '', $cpf ); | |
// Verifica se foi informado todos os digitos corretamente | |
if (strlen($cpf) != 11) { | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// WooCommerce Rename Checkout Fields | |
add_filter( 'woocommerce_checkout_fields' , 'custom_rename_wc_checkout_fields' ); | |
// Change placeholder and label text | |
function custom_rename_wc_checkout_fields( $fields ) { | |
$fields['billing']['billing_first_name']['placeholder'] = 'Wonka'; | |
$fields['billing']['billing_first_name']['label'] = 'Your Awesome First Name'; | |
return $fields; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'https://ws.pagseguro.uol.com.br/v2/pre-approvals/request'; | |
$data['email'] = 'email_vendedor@gmail.com'; | |
$data['token'] = 'TOKEN'; | |
$data['currency'] = 'BRL'; | |
$data['reference'] = $id_cliente; | |
$data['senderName'] = $cliente['nome']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function telefone_validation(telefone) { | |
//retira todos os caracteres menos os numeros | |
telefone = telefone.replace(/\D/g, ''); | |
//verifica se tem a qtde de numero correto | |
if (!(telefone.length >= 10 && telefone.length <= 11)) return false; | |
//Se tiver 11 caracteres, verificar se começa com 9 o celular | |
if (telefone.length == 11 && parseInt(telefone.substring(2, 3)) != 9) return false; |
NewerOlder