Skip to content

Instantly share code, notes, and snippets.

View ssbreno's full-sized avatar
😎

Breno Sobral ssbreno

😎
View GitHub Profile
@ssbreno
ssbreno / validate-cnpj.ts
Created January 5, 2024 03:52
validate-cnpj.ts
export const regexCNPJ = /^\d{2}\.\d{3}\.\d{3}\/\d{4}-\d{2}$/;
export const validCNPJ = (value: string | number | number[] = '') => {
if (!value) return false;
const isString = typeof value === 'string';
if (isString && !regexCNPJ.test(value)) return false;
const numbers = matchNumbers(value);
@ssbreno
ssbreno / array.php
Last active September 4, 2020 15:49
ShowLocationState
<?php
$telefones['552141054905'] = ['localidade' => 'Rio de Janeiro', 'hrefTel' => '552141054905', 'telefone' => '(21) 4105-4905', 'uf' => 'RJ'];
$telefones['551920421507'] = ['localidade' => 'Campinas', 'hrefTel' => '551920421507', 'telefone' => '(19) 2042-1507', 'uf' => 'SP'];
$telefones['554135421977'] = ['localidade' => 'Curitiba', 'hrefTel' => '554135421977', 'telefone' => '(41) 3542-1977', 'uf' => 'PR'];
$telefones['556231420088'] = ['localidade' => 'Goiânia', 'hrefTel' => '556231420088', 'telefone' => '(62) 3142-0088', 'uf' => 'GO'];
$telefones['558331420749'] = ['localidade' => 'João Pessoa', 'hrefTel' => '558331420749', 'telefone' => '(83) 3142-0749', 'uf' => 'PB'];
?>
@ssbreno
ssbreno / Google Forms - Form Choice
Last active October 28, 2017 17:02
Google Forms - Condition Choice
// Author : Breno Sobral
// Using Google Forms Docs
function CreateFormChoice() {
// Create a new form and add a multiple-choice item.
var title = 'Pesquisa sobre mobilidade urbana';
var description = ('Pesquisa de Levantamento de dados para Projeto Final de Breno Sobral');
var form = FormApp.create(title)
.setDescription(description)
#Test Level Formula
# Telerik Kendo UI Calculator
txtcalc:"",
calculo:null,
Calcc : function(e){
if (!this.txtcalc) {
navigator.notification.alert("Write your level:");
return;
}