Skip to content

Instantly share code, notes, and snippets.

View rudwolf's full-sized avatar

rudwolf

View GitHub Profile
@rudwolf
rudwolf / phoneValidate_BR.php
Last active May 27, 2019 15:56 — forked from boliveirasilva/phoneValidate_BR.php
Regex para validação de telefones (celular ou fixo) no Brasil. A expressão leva em conta o formato internacional/nacional, com ou sem o DDD, de telefones fixos e celulares.
<?php
// A função abaixo demonstra o uso de uma expressão regular que identifica, de forma simples, telefones válidos no Brasil.
// Nenhum DDD iniciado por 0 é aceito, e nenhum número de telefone pode iniciar com 0 ou 1.
// Exemplos válidos: +55 (11) 98888-8888 / 9999-9999 / 21 98888-8888 / 5511988888888
function phoneValidate($phone)
{
$regex = '/^(?:(?:\+|00)?(55)\s?)?(?:\(?([1-9][0-9])\)?\s?)?(?:((?:9\d|[2-9])\d{3})\-?(\d{4}))$/';
if (preg_match($regex, $phone) == false) {
function myFunction() {
var str = "a Raposa Matou o rato no NatO";
var res = str.toLowerCase().split(" ");
var htmlFinal = "";
for(let i = 0; i < res.length; i++){
palavra = res[i].split("");
for(let i2 = 0; i2 < palavra.length; i2++){
console.log(palavra[i2]);
}
}
@rudwolf
rudwolf / .htaccess
Created September 15, 2022 15:16
Typo3 for Shared Hosts
#####
#
# Example .htaccess file for TYPO3 CMS - for use with Apache Webserver
#
# This file includes settings for the following configuration options:
#
# - Compression
# - Caching
# - MIME types
# - Cross Origin requests
@rudwolf
rudwolf / codetest-rb.php
Created January 25, 2023 20:08
Coding test for rightbalance
<?php
/*
Let’s say we are dealing with sending data over the internet, to make it simple, assume this plain text, in order to save some bandwidth we want to compress it, according to the following function:
compress(aaaaca) -> ax4ca
compress(aaaaaabbbcaaa) -> ax6bx3cax3
compress(mississippi) -> misx2isx2ipx2i
*/