Skip to content

Instantly share code, notes, and snippets.

View emiliojva's full-sized avatar
💭
Happy

Emílio Vieira emiliojva

💭
Happy
View GitHub Profile
@emiliojva
emiliojva / Github Webhook Tutorial.md
Created October 7, 2022 18:15 — forked from jagrosh/Github Webhook Tutorial.md
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
<?php
// Inclui o arquivo class.phpmailer.php localizado na pasta phpmailer
require_once("phpmailer/class.phpmailer.php");
// Inicia a classe PHPMailer
$mail = new PHPMailer();
// Define os dados do servidor e tipo de conexão
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
$mail->IsSMTP(); // Define que a mensagem será SMTP
<?php
function validar_cpf($cpf)
{
$cpf = preg_replace('/\D/', '', (string) $cpf);
// Valida tamanho
if (strlen($cpf) != 11)
return false;
@emiliojva
emiliojva / regex-validations.js
Created August 9, 2018 01:26 — forked from robertopc/regex-validations.js
Validações em Expressões Regulares no Javascript regex js
// Data e hora dd/mm/yyyy hh:mm
var data = "01/01/2000 12:00:00".match(/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/[0-9]{4} (0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$/);
console.log(data);
// Email
var email = "email@abc.com".match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
console.log(email);