Skip to content

Instantly share code, notes, and snippets.

View esaramago's full-sized avatar
💻
Working as a freelancer

Emanuel Saramago esaramago

💻
Working as a freelancer
View GitHub Profile
@esaramago
esaramago / validateNIF.ts
Last active September 6, 2024 10:27
Validação NIF português (typescript)
function validateNIF(value: string) {
// has 9 digits?
if (/^[0-9]{9}$/.test(value) === false) return false
// starts with 5 (Pessoa coletiva)
if(!['1', '2', '3', '5', '6', '8'].includes(value.substring(0,1)) &&
!['45', '70', '71', '72', '77', '79', '90', '91', '98', '99'].includes(value.substring(0,2)))
return false
@esaramago
esaramago / block.json
Last active February 14, 2024 13:47
Wordpress Block
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "THEME_NAME/BLOCK_NAME",
"title": "BLOCK EXAMPLE",
"category": "THEME_NAME",
"icon": "star-full",
"description": "EXAMPLE DESCRIPTION",
"keywords": ["EXAMPLE"],
"version": "0.1",
@esaramago
esaramago / Flexbox-test.markdown
Created September 1, 2014 15:40
A Pen by Emanuel Saramago.
@esaramago
esaramago / reset.css
Created May 2, 2012 09:24
Eric Meyer CSS Reset
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@esaramago
esaramago / HTML head
Created May 2, 2012 08:39
HTML head with meta, icons, fonts, style links, jQuery link, html5shiv, Selectivizr and LESS
<!DOCTYPE html>
<html lang="pt-PT">
<head>
<title>Title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="robots.txt">
<meta name="author" content="humans.txt">
<meta name="keywords" content="">