Skip to content

Instantly share code, notes, and snippets.

package br.com.clairton.validator;
import java.util.InputMismatchException;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import br.com.clairton.annotation.CpfCnpj;
/**
# Programas
.c - C and C++ source code file
.cgi and .pl - Perl script file.
.class - Java class file
.cpp - C++ source code file
.cs - Visual C# source code file
.h - C, C++, and Objective-C header file
.java - Java Source code file
.php - PHP script file.
.py - Python script file.
# ADICIONANDO MODULOS
# MySQL
./jboss-cli.sh -c --command='module add --name=com.mysql --resources=mysql-connector-java.jar --dependencies=javax.api\,javax.transaction.api';
# ORACLE
./jboss-cli.sh -c --command='module add --name=com.oracle.ojdbc --resources=ojdbc-7.jar --dependencies=javax.api\,javax.transaction.api'
# ADICIONANDO DRIVERS
# MySQL
# set JAVA_HOME on every change directory while using asdf-vm
function asdf_update_java_home {
asdf current java 2>&1 > /dev/null
if [[ "$?" -eq 0 ]]
then
export JAVA_HOME=$(asdf where java)
fi
}
precmd() { asdf_update_java_home; }
@clairtonluz
clairtonluz / gist:e4355a0fd0ae501754fdb5561e483dfc
Created September 3, 2020 14:02
whitelist-file-extension.txt
# Imagens
.ai - Adobe Illustrator file
.bmp - Bitmap image
.gif - GIF image
.ico - Icon file
.jpg - JPEG image
.jpeg - JPEG image
.png - PNG image
.ps - PostScript file
.psd - PSD image
@clairtonluz
clairtonluz / index.html
Last active June 19, 2020 13:58
Imagem de fallback
<!-- example 1 -->
<img src="/imagem_principal.png" onerror="this.src='/imagem_de_fallback.png';this.onerror='';"/>
<!-- example 2 -->
<object data="/imagem_principal.png" type="image/png">
<img src="/imagem_de_fallback.png"/>
</object>
// veja como funciona a sintaxy https://ss64.com/bash/syntax-prompt.html
// veja os valores das colors https://ss64.com/bash/tput.html
// retorna o nome do branch entre [] cochetes
git_branch() {
branchName=$(git branch 2>/dev/null | grep '^*' | colrm 1 2)
if [ ! -z "$branchName" ]; then
echo "[$branchName]"
fi
function printById(elementId) {
var popup = window.open();
popup.document.write(document.getElementById(elementId).outerHTML);
popup.focus(); //required for IE
popup.print();
popup.close();
return true;
}
systemProp.http.proxyUser=clairton
systemProp.https.proxyUser=clairton
systemProp.http.proxyPassword=yourPassword
systemProp.https.proxyPassword=yourPassword
systemProp.https.proxyHost=proxy.clairtonluz.com.br
systemProp.http.proxyHost=proxy.clairtonluz.com.br
systemProp.http.proxyPort=8080
systemProp.https.proxyPort=8080
systemProp.http.nonProxyHosts=localhost, 127.0.0.1, *.local
systemProp.https.nonProxyHosts=localhost, 127.0.0.1, *.local