See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
<?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; |
// Regex para validação de string no formato CNPJ | |
export const regexCNPJ = /^\d{2}.\d{3}.\d{3}\/\d{4}-\d{2}$/ | |
// Método de validação | |
// Referência: https://pt.wikipedia.org/wiki/Cadastro_Nacional_da_Pessoa_Jur%C3%ADdica | |
export function validCNPJ(value: string | number | number[] = '') { | |
if (!value) return false | |
// Aceita receber o valor como string, número ou array com todos os dígitos | |
const isString = typeof value === 'string' |
#!/bin/bash | |
# Get the current branch name | |
current_branch=`git rev-parse --abbrev-ref HEAD` | |
# Search Jira ID in a pattern such a "feature/ABCD-123-my-feature" | |
id=$(echo $current_branch | sed -nE 's,[a-z]+/([A-Z]+-[0-9]+)-.+,\1,p') | |
# only prepare commit message if pattern matched and jiraId was found | |
if [[ ! -z $id ]]; then |
Possible values for ext-name: | |
bcmath | |
bz2 | |
calendar | |
ctype | |
curl | |
dba | |
dom | |
enchant |
<?php | |
function validar_cnpj($cnpj) | |
{ | |
$cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj); | |
// Valida tamanho | |
if (strlen($cnpj) != 14) | |
return false; |
# Set the Google Auth parameters. Fill in your RefreshToken, ClientID, and ClientSecret | |
$params = @{ | |
Uri = 'https://accounts.google.com/o/oauth2/token' | |
Body = @( | |
"refresh_token=$RefreshToken", # Replace $RefreshToken with your refresh token | |
"client_id=$ClientID", # Replace $ClientID with your client ID | |
"client_secret=$ClientSecret", # Replace $ClientSecret with your client secret | |
"grant_type=refresh_token" | |
) -join '&' | |
Method = 'Post' |
Shader "PostProcess/HeightFog" | |
{ | |
Properties | |
{ | |
[HideInInspector] _MainTex ("Texture", 2D) = "white" {} | |
_FogColor ("FogColor", Color) = (1,1,1,1) | |
_FogDensity ("FogDensity", Range(0,1)) = 0.2 | |
_FogHeight ("FogHeight", float) = 5.0 | |
} | |
SubShader |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Service-worker demo</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script> | |
if ( "serviceWorker" in navigator ) { |