Skip to content

Instantly share code, notes, and snippets.

View marcinlerka's full-sized avatar

Marcin Lerka marcinlerka

  • Wrocław, Poland
View GitHub Profile
# http://play.codesthq.com/game#1
# Write a method called format_number which converts given integer number to string like this:
# format_number(49) #=> '49'
# format_number(12345) #=> '12_345'
# format_number(-134567) #=> '-134_567'
# format_number(1234567890) #=> '1_234_567_890'
# The idea is to create groups of 3 digits separated by '_' character.
@marcinlerka
marcinlerka / eu_vat_numbers_regex
Created August 23, 2017 09:40
eu vat numbers regex
'AT': (/^(AT)(U\d{8}$)/i), // Austria
'BE': (/^(BE)(\d{10}$)/i), // Belgium
'BG': (/^(BG)(\d{9,10}$)/i), // Bulgaria
'CY': (/^(CY)([0-5|9]\d{7}[A-Z]$)/i), // Cyprus
'CZ': (/^(CZ)(\d{8,10})?$/i), // Czech Republic
'DE': (/^(DE)([1-9]\d{8}$)/i), // Germany
'DK': (/^(DK)(\d{8}$)/i), // Denmark
'EE': (/^(EE)(10\d{7}$)/i), // Estonia
'EL': (/^(EL)(\d{9}$)/i), // Greece
'ES': (/^(ES)([0-9A-Z][0-9]{7}[0-9A-Z]$)/i), // Spain

Keybase proof

I hereby claim:

  • I am marcinlerka on github.
  • I am marcinlerka (https://keybase.io/marcinlerka) on keybase.
  • I have a public key whose fingerprint is 4781 61D2 E311 6F4C 279D 65B5 7836 8DB8 976E 6E68

To claim this, I am signing this object: