Skip to content

Instantly share code, notes, and snippets.

View jarridlima's full-sized avatar
🎯
Focusing

Jarrid Lima jarridlima

🎯
Focusing
View GitHub Profile
@fernandovaller
fernandovaller / validar_cpf_cnpj.php
Last active September 4, 2021 20:49
PHP – Validar CPF e CNPJ em PHP
<?php
// Validar numero de cpf
function validar_cpf($cpf) {
// Verificar se foi informado
if(empty($cpf))
return false;
// Remover caracteres especias
$cpf = preg_replace('/[^0-9]/', '', $cpf);
@rafael-neri
rafael-neri / validar_cpf.php
Last active April 27, 2024 21:49
Validar CPF em PHP (Completo)
<?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;

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.