Skip to content

Instantly share code, notes, and snippets.

Clairton Luz clairtonluz

Block or report user

Report or block clairtonluz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CpfCnpjValidator.java
package br.com.clairton.validator;
import java.util.InputMismatchException;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import br.com.clairton.annotation.CpfCnpj;
/**
View terminal-custom-branch.sh
// 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
View print-element-by-id.js
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;
}
View gradle.properties
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
View runner.sh
# cria o runner no docker
docker run -d \
--name gitlab-runner \
--restart always \
-v gitlab-runner:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
# Entra no runner criado anteriormente
View docker-compose.yml
version: "3.7"
services:
db:
image: postgres
environment:
POSTGRES_USER: example
POSTGRES_DB: example
POSTGRES_PASSWORD: example
app:
View wait-for-migration.sh
#!/bin/sh
# wait-for-migration.sh
set -e
cmd="$@"
echo "cmd: $cmd"
until npx sequelize db:migrate; do
View wildfly-datasource-and-xa-datasource.sh
# 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
View settings.json
{
"files.autoSave": "onFocusChange",
"workbench.startupEditor": "newUntitledFile",
"window.zoomLevel": 0,
"editor.fontFamily": "Fira Code",
"editor.fontSize": 18,
"editor.fontLigatures": true,
"editor.renderLineHighlight": "gutter",
"editor.tabSize": 2,
"editor.rulers": [
View create-flutter-project.sh
# flutter create --org <Seu Domínio invertido> <Nome do App>
# Exemplo
flutter create \
--org br.com.clairtonluz \ # domain
--androidx \ # create android project using androidx
-a kotlin \ # use kotlin language to android project (default: java)
-i swift \ # use swift language to iOS project (default: Objetive C)
firstapp # app name
You can’t perform that action at this time.