Skip to content

Instantly share code, notes, and snippets.

View phsacramento's full-sized avatar

Paulo Henrique Sacramento phsacramento

View GitHub Profile
@phsacramento
phsacramento / cnpj.js
Last active March 4, 2023 00:23
Extensão para Jquery.Validation Brasil pt-BR Observação: Adicione no final do arquivo jquery.validation.js
jQuery.validator.addMethod("cnpj", function (cnpj, element) {
cnpj = jQuery.trim(cnpj);
// DEIXA APENAS OS NÚMEROS
cnpj = cnpj.replace('/', '');
cnpj = cnpj.replace('.', '');
cnpj = cnpj.replace('.', '');
cnpj = cnpj.replace('-', '');
var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais;
##
# Ubuntu Server 12.04 64bits
# Automatiza o acesso SSH
# Oh my ZSH
# Shorewall
# PostFix (Enviar e-mails)
# Memcached
# Redis
# Varnish
##
SET @antigaURL = 'http://siteantigo.com';
SET @novaURl = 'http://sitenovo.com';
# Atualiza URL do site nas opções
UPDATE wp_options SET option_value = replace(option_value, @antigaURL, @novaURL);
# Atualiza URL dos posts (e dentro deles)
UPDATE wp_posts SET guid = REPLACE (guid, @antigaURL, @novaURL);
UPDATE wp_posts SET post_content = REPLACE (post_content, @antigaURL, @novaURL);
UPDATE wp_posts SET post_excerpt = REPLACE (post_excerpt, @antigaURL, @novaURL);
##
# Ubuntu Server 12.04 64bits
# Automatiza o acesso SSH
# Oh my ZSH
# Shorewall
# PostFix (Enviar e-mails)
# Memcached
# Redis
# Varnish
##
# ###############
# SETUP LOCAL
# ###############
cd $LOCAL/$SITE
git init
git config color.branch auto
git config color.diff auto
git config color.interactive auto
git config color.status auto