Skip to content

Instantly share code, notes, and snippets.

View sirbaconjr's full-sized avatar
👨‍💻
On intense coding

Everton Júnior sirbaconjr

👨‍💻
On intense coding
View GitHub Profile
@sirbaconjr
sirbaconjr / keyCodeCallback.js
Last active February 11, 2019 05:29
This is a JS function to record keyboard input and process callback for specific key combinations. If you see a problem or know how to make it better, please contact me.
function getEventCode(event) {
if (event.key !== undefined) {
return event.key;
}
if (event.keyIdentifier !== undefined) {
return event.keyIdentifier;
}
if (event.keyCode !== undefined) {
return event.keyCode;
}
@sirbaconjr
sirbaconjr / cores.php
Created December 5, 2019 02:26
Conjunto de cores e seus nomes em PHP
<?php
$cores = [
'#F4C430' => 'Açafrão',
'#00FFFF' => 'Água',
'#7FFFD4' => 'Água-marinha',
'#66CDAA' => 'Água-marinha média',
'#E32636' => 'Alizarina',
'#FFFF00' => 'Amarelo',
'#ECDB00' => 'Amarelo brasilis',
@sirbaconjr
sirbaconjr / numeros.md
Created December 5, 2019 02:31
Regex para Números de Telefone Brasileiros 2019

Regex para validar números de telefone brasileiro

Funciona de acordo com o padrão atual da Anatel.

Exemplos de números aceitos:

0800 999 9999
0300 999 9999
0500 999 9999
0900 999 9999