Skip to content

Instantly share code, notes, and snippets.

Nacho natxet

Block or report user

Report or block natxet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View regex.txt
#Spanish ID documents
#Cfr. https://es.wikipedia.org/wiki/N%C3%BAmero_de_identificaci%C3%B3n_fiscal
#DNI/NIE/NIF... (personal)
^[0-9]{8}[A-Z]|[MXYZ][0-9]{7}[A-Z]$
#CIF (corporations)
^[A-HJUV][0-9]{8}|[NPQRSW][0-9]{7}[A-J]$
View distance.sql
DELIMITER //
CREATE FUNCTION `lat_lng_distance` (lat1 FLOAT, lng1 FLOAT, lat2 FLOAT, lng2 FLOAT)
RETURNS FLOAT
DETERMINISTIC
BEGIN
RETURN 6371 * 2 * ASIN(SQRT(
POWER(SIN((lat1 - abs(lat2)) * pi()/180 / 2),
2) + COS(lat1 * pi()/180 ) * COS(abs(lat2) *
pi()/180) * POWER(SIN((lng1 - lng2) *
You can’t perform that action at this time.