Skip to content

Instantly share code, notes, and snippets.

@kkirsche
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkirsche/02811d2eed65422483c6 to your computer and use it in GitHub Desktop.
Save kkirsche/02811d2eed65422483c6 to your computer and use it in GitHub Desktop.
International Country Codes / State Abbreviations
# Use strings for un_num to avoid octal number interpretation
@countries = {
afghanistan: {
name: 'Afghanistan',
iso: 'AF',
un_a3: 'AFG',
un_num: '004',
dial: 93
},
albania: {
name: 'Albania',
iso: 'AL',
un_a3: 'ALB',
un_num: '008',
dial: 355
},
algeria: {
name: 'Algeria',
iso: 'DZ',
un_a3: 'DZA',
un_num: '012',
dial: 213 },
american_samoa: {
name: 'American Samoa',
iso: 'AS',
un_a3: 'ASM',
un_num: '016',
dial: 1684
},
andorra: {
name: 'Andorra',
iso: 'AD',
un_a3: 'AND',
un_num: '020',
dial: 376
},
angola: {
name: 'Angola',
iso: 'AO',
un_a3: 'AGO',
un_num: '024',
dial: 244
},
anguilla: {
name: 'Anguilla',
iso: 'AI',
un_a3: 'AIA',
un_num: '660',
dial: 1_264
},
antartica: {
name: 'Antartica',
iso: 'AQ',
un_a3: 'ATA',
un_num: '010',
dial: 672
},
antigua_and_barbuda: {
name: 'Antigua and Barbuda',
iso: 'AG',
un_a3: 'ATG',
un_num: '028',
dial: 1_268
},
argentina: {
name: 'Argentina',
iso: 'AR',
un_a3: 'ARG',
un_num: '032',
dial: 54
},
armenia: {
name: 'Armenia',
iso: 'AM',
un_a3: 'ARM',
un_num: '051',
dial: 374
},
aruba: {
name: 'Aruba',
iso: 'AW',
un_a3: 'ABW',
un_num: '533',
dial: 297
},
australia: {
name: 'Australia',
iso: 'AU',
un_a3: 'AUS',
un_num: '036',
dial: 61
},
austria: {
name: 'Austria',
iso: 'AT',
un_a3: 'AUT',
un_num: '040',
dial: 43
},
azerbaijan: {
name: 'Azerbaijan',
iso: 'AZ',
un_a3: 'AZE',
un_num: '031',
dial: 994
},
bahamas: {
name: 'Bahamas',
iso: 'BS',
un_a3: 'BHS',
un_num: '044',
dial: 1_242
},
bahrain: {
name: 'Bahrain',
iso: 'BH',
un_a3: 'BHR',
un_num: '048',
dial: 973
},
bangladesh: {
name: 'Bangladesh',
iso: 'BD',
un_a3: 'BGD',
un_num: '050',
dial: 880
},
barbados: {
name: 'Barbados',
iso: 'BB',
un_a3: 'BRB',
un_num: '052',
dial: 1_246
},
belarus: {
name: 'Belarus',
iso: 'BY',
un_a3: 'BLR',
un_num: '112',
dial: 375
},
belgium: {
name: 'Belgium',
iso: 'BE',
un_a3: 'BEL',
un_num: '056',
dial: 32
},
belize: {
name: 'Belize',
iso: 'BZ',
un_a3: 'BLZ',
un_num: '084',
dial: 501
},
benin: {
name: 'Benin',
iso: 'BJ',
un_a3: 'BEN',
un_num: '204',
dial: 229
},
bermuda: {
name: 'Bermuda',
iso: 'BM',
un_a3: 'BMU',
un_num: '060',
dial: 1_441
},
bhutan: {
name: 'Bhutan',
iso: 'BT',
un_a3: 'BTN',
un_num: '064',
dial: 975
},
bolivia: {
name: 'Bolivia',
iso: 'BO',
un_a3: 'BOL',
un_num: '068',
dial: 591
},
bosnia_and_herzegowina: {
name: 'Bosnia and Herzegowina',
iso: 'BA',
un_a3: 'BIH',
un_num: '070',
dial: 387
},
botswana: {
name: 'Botswana',
iso: 'BW',
un_a3: 'BWA',
un_num: '072',
dial: 267
},
bouvet_island_aka_norway: {
name: 'Bouvet Island (Norway)',
iso: 'BV',
un_a3: 'BVT',
un_num: '074',
dial: 61
},
brazil: {
name: 'Brazil',
iso: 'BR',
un_a3: 'BRA',
un_num: '076',
dial: 55
},
british_indian_ocean_territory: {
name: 'British Indian Ocean Territory',
iso: 'IO',
un_a3: 'IOT',
un_num: '086',
dial: 246
},
brunei_darussalam: {
name: 'Brunei Darussalam',
iso: 'BN',
un_a3: 'BRN',
un_num: '096',
dial: 672
},
bulgaria: {
name: 'Bulgaria',
iso: 'BG',
un_a3: 'BGR',
un_num: '100',
dial: 359
},
burkina_faso: {
name: 'Burkina Faso',
iso: 'BF',
un_a3: 'BFA',
un_num: '854',
dial: 226
},
burundi: {
name: 'Burundi',
iso: 'BI',
un_a3: 'BDI',
un_num: '108',
dial: 257
},
cambodia: {
name: 'Cambodia',
iso: 'KH',
un_a3: 'KHM',
un_num: '116',
dial: 855
},
cameroon: {
name: 'Cameroon',
iso: 'CM',
un_a3: 'CMR',
un_num: '120',
dial: 237
},
canada: {
name: 'Canada',
iso: 'CA',
un_a3: 'CAN',
un_num: '124',
dial: 1
},
cape_verde: {
name: 'Cape Verde',
iso: 'CV',
un_a3: 'CPV',
un_num: '132',
dial: 238
},
cayman_islands: {
name: 'Cayman Islands',
iso: 'KY',
un_a3: 'CYM',
un_num: '136',
dial: 1_345
},
central_african_republic: {
name: 'Central African Republic',
iso: 'CF',
un_a3: 'CAF',
un_num: '140',
dial: 236
},
chad: {
name: 'Chad',
iso: 'TD',
un_a3: 'TCD',
un_num: '148',
dial: 235
},
chile: {
name: 'Chile',
iso: 'CL',
un_a3: 'CHL',
un_num: '152',
dial: 56
},
china: {
name: 'China',
iso: 'CN',
un_a3: 'CHN',
un_num: '156',
dial: 86
},
christmas_island: {
name: 'Christmas Island',
iso: 'CX',
un_a3: 'CXR',
un_num: '162',
dial: 61
},
cocos_island_austrailia: {
name: 'Cocos Island (Australia)',
iso: 'CC',
un_a3: 'CCK',
un_num: '166',
dial: 891
},
colombia: {
name: 'Colombia',
iso: 'CO',
un_a3: 'COL',
un_num: '170',
dial: 57
},
comoros: {
name: 'Comoros',
iso: 'KM',
un_a3: 'COM',
un_num: '174',
dial: 269
},
congo: {
name: 'Congo',
iso: 'CG',
un_a3: 'COG',
un_num: '178',
dial: 242
},
the_drc_congo: {
name: 'The DRC Congo',
iso: 'CD',
un_a3: 'COD',
un_num: '180',
dial: 243
},
cook_islands: {
name: 'Cook Islands',
iso: 'CK',
un_a3: 'COK',
un_num: '184',
dial: 682
},
costa_rica: {
name: 'Costa Rica',
iso: 'CR',
un_a3: 'CRI',
un_num: '188',
dial: 506
},
cote_d_ivoire: {
name: 'Cote D\'Ivoire',
iso: 'CI',
un_a3: 'CIV',
un_num: '384',
dial: 225
},
hrvatska_aka_croatia: {
name: 'Hrvatska (Croatia)',
iso: 'HR',
un_a3: 'HRV',
un_num: '191',
dial: 385
},
cuba: {
name: 'Cuba',
iso: 'CU',
un_a3: 'CUB',
un_num: '192',
dial: 53
},
cyprus: {
name: 'Cyprus',
iso: 'CY',
un_a3: 'CYP',
un_num: '196',
dial: 357
},
czech_republic: {
name: 'Czech Republic',
iso: 'CZ',
un_a3: 'CZE',
un_num: '203',
dial: 420
},
denmark: {
name: 'Denmark',
iso: 'DK',
un_a3: 'DNK',
un_num: '208',
dial: 45
},
djibouti: {
name: 'Djibouti',
iso: 'DJ',
un_a3: 'DJI',
un_num: '262',
dial: 253
},
dominica: {
name: 'Dominica',
iso: 'DM',
un_a3: 'DMA',
un_num: '212',
dial: 1767
},
dominican_republic: {
name: 'Dominican Republic',
iso: 'DO',
un_a3: 'DOM',
un_num: '214',
dial: 1809
},
east_timor: {
name: 'East Timor',
iso: 'TP',
un_a3: 'TMP',
un_num: '626',
dial: 670
},
ecuador: {
name: 'Ecuador',
iso: 'EC',
un_a3: 'ECU',
un_num: '218',
dial: 593
},
egypt: {
name: 'Egypt',
iso: 'EG',
un_a3: 'EGY',
un_num: '818',
dial: 20
},
el_salvador: {
name: 'El Salvador',
iso: 'SV',
un_a3: 'SLV',
un_num: '222',
dial: 503
},
equatorial_guinea: {
name: 'Equatorial Guinea',
iso: 'GQ',
un_a3: 'GNQ',
un_num: '226',
dial: 240
},
eritrea: {
name: 'Eritrea',
iso: 'ER',
un_a3: 'ERI',
un_num: '232',
dial: 291
},
estonia: {
name: 'Estonia',
iso: 'EE',
un_a3: 'EST',
un_num: '233',
dial: 372
},
ethiopia: {
name: 'Ethiopia',
iso: 'ET',
un_a3: 'ETH',
un_num: '231',
dial: 251
},
falkland_islands: {
name: 'Falkland Islands',
iso: 'FK',
un_a3: 'FLK',
un_num: '238',
dial: 500
},
faroe_islands: {
name: 'Faroe Islands',
iso: 'FO',
un_a3: 'FRO',
un_num: '234',
dial: 298
},
fiji: {
name: 'Fiji',
iso: 'FJ',
un_a3: 'FJI',
un_num: '242',
dial: 679
},
finland: {
name: 'Finland',
iso: 'FI',
un_a3: 'FIN',
un_num: '246',
dial: 358
},
france: {
name: 'France',
iso: 'FR',
un_a3: 'FRA',
un_num: '250',
dial: 33
},
metropolitan_france: {
name: 'Metropolitan France',
iso: 'FX',
un_a3: 'FXX',
un_num: '249',
dial: 33
},
french_guiana: {
name: 'French Guiana',
iso: 'GF',
un_a3: 'GUF',
un_num: '254',
dial: 594
},
french_polynesia: {
name: 'French Polynesia',
iso: 'PF',
un_a3: 'PYF',
un_num: '258',
dial: 689
},
french_southern_territories: {
name: 'French Southern Territories',
iso: 'TF',
un_a3: 'ATF',
un_num: '260',
dial: 262
},
gabon: {
name: 'Gabon',
iso: 'GA',
un_a3: 'GAB',
un_num: '266',
dial: 241
},
gambia: {
name: 'Gambia',
iso: 'GM',
un_a3: 'GMB',
un_num: '270',
dial: 220
},
georgia: {
name: 'Georgia',
iso: 'GE',
un_a3: 'GEO',
un_num: '268',
dial: 995
},
germany: {
name: 'Germany',
iso: 'DE',
un_a3: 'DEU',
un_num: '276',
dial: 49
},
ghana: {
name: 'Ghana',
iso: 'GH',
un_a3: 'GHA',
un_num: '288',
dial: 233
},
gibraltar: {
name: 'Gibraltar',
iso: 'GI',
un_a3: 'GIB',
un_num: '292',
dial: 350
},
greece: {
name: 'Greece',
iso: 'GR',
un_a3: 'GRC',
un_num: '300',
dial: 30
},
greenland: {
name: 'Greenland',
iso: 'GL',
un_a3: 'GRL',
un_num: '304',
dial: 299
},
grenada: {
name: 'Grenada',
iso: 'GD',
un_a3: 'GRD',
un_num: '308',
dial: 1_473
},
guadeloupe: {
name: 'Guadeloupe',
iso: 'GP',
un_a3: 'GLP',
un_num: '312',
dial: 590
},
guam: {
name: 'Guam',
iso: 'GU',
un_a3: 'GUM',
un_num: '316',
dial: 1_671
},
guatemala: {
name: 'Guatemala',
iso: 'GT',
un_a3: 'GTM',
un_num: '320',
dial: 502
},
guinea: {
name: 'Guinea',
iso: 'GN',
un_a3: 'GIN',
un_num: '324',
dial: 224
},
guinea_bissau: {
name: 'Guinea Bissau',
iso: 'GW',
un_a3: 'GNB',
un_num: '624',
dial: 245
},
guyana: {
name: 'Guyana',
iso: 'GY',
un_a3: 'GUY',
un_num: '328',
dial: 592
},
haiti: {
name: 'Haiti',
iso: 'HT',
un_a3: 'HTI',
un_num: '332',
dial: 509
},
heard_and_mcdonald_islands: {
name: 'heard and McDonald Islands',
iso: 'HM',
un_a3: 'HMD',
un_num: '334',
dial: 672
},
holy_see_vatican_city_state: {
name: 'Holy See (Vatican City State)',
iso: 'VA',
un_a3: 'VAT',
un_num: '336',
dial: 379
},
honduras: {
name: 'Honduras',
iso: 'HN',
un_a3: 'HND',
un_num: '340',
dial: 504
},
hong_kong: {
name: 'Hong Kong',
iso: 'HK',
un_a3: 'HKG',
un_num: '344',
dial: 852
},
hungary: {
name: 'Hungary',
iso: 'HU',
un_a3: 'HUN',
un_num: '348',
dial: 36
},
iceland: {
name: 'Iceland',
iso: 'IS',
un_a3: 'ISL',
un_num: '352',
dial: 354
},
india: {
name: 'India',
iso: 'IN',
un_a3: 'IND',
un_num: '356',
dial: 91
},
indonesia: {
name: 'Indonesia',
iso: 'ID',
un_a3: 'IDN',
un_num: '360',
dial: 62
},
iran: {
name: 'Iran',
iso: 'IR',
un_a3: 'IRN',
un_num: '364',
dial: 98
},
iraq: {
name: 'Iraq',
iso: 'IQ',
un_a3: 'IRQ',
un_num: '368',
dial: 964
},
ireland: {
name: 'Ireland',
iso: 'IE',
un_a3: 'IRL',
un_num: '372',
dial: 353
},
israel: {
name: 'Israel',
iso: 'IL',
un_a3: 'ISR',
un_num: '376',
dial: 972
},
italy: {
name: 'Italy',
iso: 'IT',
un_a3: 'ITA',
un_num: '380',
dial: 39
},
jamaica: {
name: 'Jamaica',
iso: 'JM',
un_a3: 'JAM',
un_num: '388',
dial: 1_876
},
japan: {
name: 'Japan',
iso: 'JP',
un_a3: 'JPN',
un_num: '392',
dial: 81
},
jordan: {
name: 'Jordan',
iso: 'JO',
un_a3: 'JOR',
un_num: '400',
dial: 962
},
kazakhstan: {
name: 'Kazakhstan',
iso: 'KZ',
un_a3: 'KAZ',
un_num: '398',
dial: 7
},
kenya: {
name: 'Kenya',
iso: 'KE',
un_a3: 'KEN',
un_num: '404',
dial: 254
},
kiribati: {
name: 'Kiribati',
iso: 'KI',
un_a3: 'KIR',
un_num: '296',
dial: 686
},
dpro_korea: {
name: 'Democratic People\'s Republic of Korea',
iso: 'KP',
un_a3: 'PRK',
un_num: '408',
dial: 850
},
republic_of_korea: {
name: 'Republic of Korea',
iso: 'KR',
un_a3: 'KOR',
un_num: '410',
dial: 82
},
kuwait: {
name: 'Kuwait',
iso: 'KW',
un_a3: 'KWT',
un_num: '414',
dial: 965
},
kyrgyzstan: {
name: 'Kyrgyzstan',
iso: 'KG',
un_a3: 'KGZ',
un_num: '417',
dial: 996
},
laos: {
name: 'Laos',
iso: 'LA',
un_a3: 'LAO',
un_num: '418',
dial: 856
},
latvia: {
name: 'Latvia',
iso: 'LV',
un_a3: 'LVA',
un_num: '428',
dial: 371
},
lebanon: {
name: 'Lebanon',
iso: 'LB',
un_a3: 'LBN',
un_num: '422',
dial: 961
},
lesotho: {
name: 'Lesotho',
iso: 'LS',
un_a3: 'LSO',
un_num: '426',
dial: 266
},
liberia: {
name: 'Liberia',
iso: 'LR',
un_a3: 'LBR',
un_num: '430',
dial: 231
},
libyan_arab_jamahiriya: {
name: 'Libyan Arab Jamahiriya',
iso: 'LY',
un_a3: 'LBY',
un_num: '434',
dial: 218
},
liechtenstein: {
name: 'Liechtenstein',
iso: 'LI',
un_a3: 'LIE',
un_num: '438',
dial: 423
},
lithuania: {
name: 'Lithuania',
iso: 'LT',
un_a3: 'LTU',
un_num: '440',
dial: 370
},
luxembourg: {
name: 'Luxembourg',
iso: 'LU',
un_a3: 'LUX',
un_num: '442',
dial: 352
},
macau: {
name: 'Macau',
iso: 'MO',
un_a3: 'MAC',
un_num: '446',
dial: 853
},
macedeonia: {
name: 'Macedeonia',
iso: 'MK',
un_a3: 'MKD',
un_num: '807',
dial: 389
},
madagascar: {
name: 'Madagascar',
iso: 'MG',
un_a3: 'MDG',
un_num: '450',
dial: 261
},
malawi: {
name: 'Malawi',
iso: 'MW',
un_a3: 'MWI',
un_num: '454',
dial: 265
},
malaysia: {
name: 'Malaysia',
iso: 'MY',
un_a3: 'MYS',
un_num: '458',
dial: 60
},
maldives: {
name: 'Maldives',
iso: 'MV',
un_a3: 'MDV',
un_num: '462',
dial: 960
},
mali: {
name: 'Mali',
iso: 'ML',
un_a3: 'MLI',
un_num: '466',
dial: 223
},
malta: {
name: 'Malta',
iso: 'MT',
un_a3: 'MLT',
un_num: '470',
dial: 356
},
marshall_islands: {
name: 'Marshall Islands',
iso: 'MH',
un_a3: 'MHL',
un_num: '584',
dial: 692
},
martinique: {
name: 'Martinique',
iso: 'MQ',
un_a3: 'MTQ',
un_num: '474',
dial: 596
},
mauritania: {
name: 'Mauritania',
iso: 'MR',
un_a3: 'MRT',
un_num: '478',
dial: 222
},
mauritius: {
name: 'Mauritius',
iso: 'MU',
un_a3: 'MUS',
un_num: '480',
dial: 230
},
mayotte: {
name: 'Mayotte',
iso: 'YT',
un_a3: 'MYT',
un_num: '175',
dial: 262
},
mexico: {
name: 'Mexico',
iso: 'MX',
un_a3: 'MEX',
un_num: '484',
dial: 52
},
federated_states_of_micronesia: {
name: 'Federated States of Micronesia',
iso: 'FM',
un_a3: 'FSM',
un_num: '583',
dial: 691
},
republic_of_moldova: {
name: 'republic of Moldova',
iso: 'MD',
un_a3: 'MDA',
un_num: '498',
dial: 373
},
monaco: {
name: 'Monaco',
iso: 'MC',
un_a3: 'MCO',
un_num: '492',
dial: 377
},
mongolia: {
name: 'Mongolia',
iso: 'MN',
un_a3: 'MNG',
un_num: '496',
dial: 976
},
montenegro: {
name: 'Montenegro',
iso: 'ME',
un_a3: 'MNE',
un_num: '499',
dial: 382
},
montserrat: {
name: 'Montserrat',
iso: 'MS',
un_a3: 'MSR',
un_num: '500',
dial: 1_664
},
morocco: {
name: 'Morocco',
iso: 'MA',
un_a3: 'MAR',
un_num: '504',
dial: 212
},
mozambique: {
name: 'Mozambique',
iso: 'MZ',
un_a3: 'MOZ',
un_num: '508',
dial: 258
},
burma: {
name: 'Burma',
iso: 'MM',
un_a3: 'MMR',
un_num: '104',
dial: 95
},
namibia: {
name: 'Namibia',
iso: 'NA',
un_a3: 'NAM',
un_num: '516',
dial: 264
},
nauru: {
name: 'Nauru',
iso: 'NR',
un_a3: 'NRU',
un_num: '520',
dial: 674
},
nepal: {
name: 'Nepal',
iso: 'NP',
un_a3: 'NPL',
un_num: '524',
dial: 977
},
netherlands: {
name: 'Netherlands',
iso: 'NL',
un_a3: 'NLD',
un_num: '528',
dial: 31
},
netherlands_antilles: {
name: 'Netherlands Antilles',
iso: 'AN',
un_a3: 'ANT',
un_num: '530',
dial: 599
},
new_caledonia: {
name: 'New Caledonia',
iso: 'NC',
un_a3: 'NCL',
un_num: '540',
dial: 687
},
new_zealand: {
name: 'New Zealand',
iso: 'NZ',
un_a3: 'NZL',
un_num: '554',
dial: 64
},
nicaragua: {
name: 'Nicaragua',
iso: 'NI',
un_a3: 'NIC',
un_num: '558',
dial: 505
},
niger: {
name: 'Niger',
iso: 'NE',
un_a3: 'NER',
un_num: '562',
dial: 227
},
nigeria: {
name: 'Nigeria',
iso: 'NG',
un_a3: 'NGA',
un_num: '566',
dial: 234
},
niue: {
name: 'Niue',
iso: 'NU',
un_a3: 'NIU',
un_num: '570',
dial: 683
},
norfolk_islands: {
name: 'Norfolk Islands',
iso: 'NF',
un_a3: 'NFK',
un_num: '574',
dial: 672
},
northern_mariana_islands: {
name: 'Northern Mariana Islands',
iso: 'MP',
un_a3: 'MNP',
un_num: '580',
dial: 1_670
},
norway: {
name: 'Norway',
iso: 'NO',
un_a3: 'NOR',
un_num: '578',
dial: 47
},
oman: {
name: 'Oman',
iso: 'OM',
un_a3: 'OMN',
un_num: '512',
dial: 968
},
pakistan: {
name: 'Pakistan',
iso: 'PK',
un_a3: 'PAK',
un_num: '586',
dial: 92
},
palau: {
name: 'Palau',
iso: 'PW',
un_a3: 'PLW',
un_num: '585',
dial: 680
},
panama: {
name: 'Panama',
iso: 'PA',
un_a3: 'PAN',
un_num: '591',
dial: 507
},
papua_new_guinea: {
name: 'Papua New Guinea',
iso: 'PG',
un_a3: 'PNG',
un_num: '598',
dial: 675
},
paraguay: {
name: 'Paraguay',
iso: 'PY',
un_a3: 'PRY',
un_num: '600',
dial: 595
},
peru: {
name: 'Peru',
iso: 'PE',
un_a3: 'PER',
un_num: '604',
dial: 51
},
philippines: {
name: 'Philippines',
iso: 'PH',
un_a3: 'PHL',
un_num: '608',
dial: 63
},
pitcairn: {
name: 'Pitcairn',
iso: 'PN',
un_a3: 'PCN',
un_num: '612',
dial: 870
},
poland: {
name: 'Poland',
iso: 'PL',
un_a3: 'POL',
un_num: '616',
dial: 48
},
portugal: {
name: 'Portugal',
iso: 'PT',
un_a3: 'PRT',
un_num: '620',
dial: 351
},
puerto_rico: {
name: 'Puerto Rico',
iso: 'PR',
un_a3: 'PRI',
un_num: '630',
dial: 1
},
qatar: {
name: 'Qatar',
iso: 'QA',
un_a3: 'QAT',
un_num: '634',
dial: 974
},
reunion: {
name: 'Reunion',
iso: 'RE',
un_a3: 'REU',
un_num: '638',
dial: 262
},
romania: {
name: 'Romania',
iso: 'RO',
un_a3: 'ROM',
un_num: '642',
dial: 40
},
russian_federation: {
name: 'Russian Federation',
iso: 'RU',
un_a3: 'RUS',
un_num: '643',
dial: 7
},
rwanda: {
name: 'Rwanda',
iso: 'RW',
un_a3: 'RWA',
un_num: '646',
dial: 250
},
saint_kitts_and_nevis: {
name: 'Saint Kitts and Nevis',
iso: 'KN',
un_a3: 'KNA',
un_num: '659',
dial: 1_869
},
saint_lucia: {
name: 'Saint Lucia',
iso: 'LC',
un_a3: 'LCA',
un_num: '662',
dial: 1_758
},
saint_vincent_and_the_grenadines: {
name: 'Saint Vincent and the Grenadines',
iso: 'VC',
un_a3: 'VCT',
un_num: '670',
dial: 1_784
},
samoa: {
name: 'Samoa',
iso: 'WS',
un_a3: 'WSM',
un_num: '882',
dial: 685
},
san_marino: {
name: 'San Marino',
iso: 'SM',
un_a3: 'SMR',
un_num: '674',
dial: 378
},
sao_tome_and_principe: {
name: 'Sao Tome and Principe',
iso: 'ST',
un_a3: 'STP',
un_num: '678',
dial: 239
},
saudi_arabia: {
name: 'Saudi Arabia',
iso: 'SA',
un_a3: 'SAU',
un_num: '682',
dial: 966
},
senegal: {
name: 'Senegal',
iso: 'SN',
un_a3: 'SEN',
un_num: '686',
dial: 221
},
serbia: {
name: 'Serbia',
iso: 'RS',
un_a3: 'SRB',
un_num: '688',
dial: 381
},
seychelles: {
name: 'Seychelles',
iso: 'SC',
un_a3: 'SYC',
un_num: '690',
dial: 248
},
sierra_leone: {
name: 'Sierra Leone',
iso: 'SL',
un_a3: 'SLE',
un_num: '694',
dial: 232
},
singapore: {
name: 'Singapore',
iso: 'SG',
un_a3: 'SGP',
un_num: '702',
dial: 65
},
slovakia: {
name: 'Slovakia',
iso: 'SK',
un_a3: 'SVK',
un_num: '703',
dial: 421
},
slovenia: {
name: 'Slovenia',
iso: 'SI',
un_a3: 'SVN',
un_num: '705',
dial: 386
},
solomon_islands: {
name: 'Solomon Islands',
iso: 'SB',
un_a3: 'SLB',
un_num: '090',
dial: 677
},
somalia: {
name: 'Somalia',
iso: 'SO',
un_a3: 'SOM',
un_num: '706',
dial: 252
},
south_africa: {
name: 'South Africa',
iso: 'ZA',
un_a3: 'ZAF',
un_num: '729',
dial: 27
},
south_sudan: {
name: 'South Sudan',
iso: 'SS',
un_a3: 'SSD',
un_num: '710',
dial: 211
},
south_georgia_and_south_ss: {
name: 'South Georgia and South SS',
iso: 'GS',
un_a3: 'SGS',
un_num: '239',
dial: 500
},
spain: {
name: 'Spain',
iso: 'ES',
un_a3: 'ESP',
un_num: '724',
dial: 34
},
sri_lanka: {
name: 'Sri Lanka',
iso: 'LK',
un_a3: 'LKA',
un_num: '144',
dial: 94
},
st_helena: {
name: 'St. Helena',
iso: 'SH',
un_a3: 'SHN',
un_num: '654',
dial: 290
},
st_pierre_and_miquelon: {
name: 'St. Pierre and Miquelon',
iso: 'PM',
un_a3: 'SPM',
un_num: '666',
dial: 508
},
sudan: {
name: 'Sudan',
iso: 'SD',
un_a3: 'SDN',
un_num: '736',
dial: 249
},
suriname: {
name: 'Suriname',
iso: 'SR',
un_a3: 'SUR',
un_num: '740',
dial: 597
},
svalbard_and_jan_mayen_islands: {
name: 'Svalbard and Jan Mayen Islands',
iso: 'SJ',
un_a3: 'SJM',
un_num: '744',
dial: 47
},
swaziland: {
name: 'Swaziland',
iso: 'SZ',
un_a3: 'SWZ',
un_num: '748',
dial: 268
},
sweden: {
name: 'Sweden',
iso: 'SE',
un_a3: 'SWE',
un_num: '752',
dial: 46
},
switzerland: {
name: 'Switzerland',
iso: 'CH',
un_a3: 'CHE',
un_num: '756',
dial: 41
},
syrian_arab_republic: {
name: 'Syrian Arab Republic',
iso: 'SY',
un_a3: 'SYR',
un_num: '760',
dial: 963
},
taiwan: {
name: 'Taiwan',
iso: 'TW',
un_a3: 'TWN',
un_num: '158',
dial: 886
},
tajikistan: {
name: 'Tajikistan',
iso: 'TJ',
un_a3: 'TJK',
un_num: '762',
dial: 992
},
united_republic_of_tanzania: {
name: 'United Republic of Tanzania',
iso: 'TZ',
un_a3: 'TZA',
un_num: '834',
dial: 255
},
thailand: {
name: 'Thailand',
iso: 'TH',
un_a3: 'THA',
un_num: '764',
dial: 66
},
togo: {
name: 'Togo',
iso: 'TG',
un_a3: 'TGO',
un_num: '768',
dial: 228
},
tokelau: {
name: 'Tokelau',
iso: 'TK',
un_a3: 'TKL',
un_num: '772',
dial: 690
},
tonga: {
name: 'Tonga',
iso: 'TO',
un_a3: 'TON',
un_num: '776',
dial: 676
},
trinidad_and_tobago: {
name: 'Trinidad and Tobago',
iso: 'TT',
un_a3: 'TTO',
un_num: '780',
dial: 1_868
},
tunisia: {
name: 'Tunisia',
iso: 'TN',
un_a3: 'TUN',
un_num: '788',
dial: 216
},
turkey: {
name: 'Turkey',
iso: 'TR',
un_a3: 'TUR',
un_num: '792',
dial: 90
},
turkmenistan: {
name: 'Turkmenistan',
iso: 'TM',
un_a3: 'TKM',
un_num: '795',
dial: 993
},
turks_and_caicos_islands: {
name: 'Turks and Caicos Islands',
iso: 'TC',
un_a3: 'TCA',
un_num: '796',
dial: 1_649
},
tuvalu: {
name: 'Tuvalu',
iso: 'TV',
un_a3: 'TUV',
un_num: '798',
dial: 688
},
uganda: {
name: 'Uganda',
iso: 'UG',
un_a3: 'UGA',
un_num: '800',
dial: 256
},
ukraine: {
name: 'Ukraine',
iso: 'UA',
un_a3: 'UKR',
un_num: '804',
dial: 380
},
united_arab_emirates: {
name: 'United Arab Emirates',
iso: 'AE',
un_a3: 'ARE',
un_num: '784',
dial: 971
},
united_kingdom: {
name: 'United Kingdom (Great Britain)',
iso: 'GB',
un_a3: 'GBR',
un_num: '826',
dial: 44
},
united_states: {
name: 'United States of America',
iso: 'US',
un_a3: 'USA',
un_num: '840',
dial: 1
},
us_minor_islands: {
name: 'U.S. Minor Islands',
iso: 'UM',
un_a3: 'UMI',
un_num: '581',
dial: 1
},
uruguay: {
name: 'Uruguay',
iso: 'UY',
un_a3: 'URY',
un_num: '858',
dial: 598
},
uzebekistan: {
name: 'Uzebekistan',
iso: 'UZ',
un_a3: 'UZB',
un_num: '860',
dial: 998
},
vanuatu: {
name: 'Vanuatu',
iso: 'VU',
un_a3: 'VUT',
un_num: '548',
dial: 678
},
venezuela: {
name: 'Venezuela',
iso: 'VE',
un_a3: 'VEN',
un_num: '862',
dial: 58
},
vietnam: {
name: 'Vietnam',
iso: 'VN',
un_a3: 'VNM',
un_num: '704',
dial: 84
},
virgin_islands_british: {
name: 'Virgin Islands (British)',
iso: 'VG',
un_a3: 'VGB',
un_num: '092',
dial: 1_284
},
virgin_islands_us: {
name: 'Virgin Islands (U.S.)',
iso: 'VI',
un_a3: 'VIR',
un_num: '850',
dial: 1_430
},
wallis_and_futuna_islands: {
name: 'Wallis and Futuna Islands',
iso: 'WF',
un_a3: 'WLF',
un_num: '876',
dial: 681
},
western_sahara: {
iso: 'EH',
un_a3: 'ESH',
un_num: '732',
dial: 212
},
yemen: {
name: 'Yemen',
iso: 'YE',
un_a3: 'YEM',
un_num: '887',
dial: 967
},
zambia: {
name: 'Zambia',
iso: 'ZM',
un_a3: 'ZMB',
un_num: '894',
dial: 260
},
zimbabwe: {
name: 'Zimbabwe',
iso: 'ZW',
un_a3: 'ZWE',
un_num: '716',
dial: 263
}
}
def create_long_lat_point
@latitude = rand(-90.0000000000..90.0000000000)
@longitude = rand(-180.0000000000..180.0000000000)
{
coordinates: [@latitude, @longitude],
latitude: @latitude,
longitude: @longitude
}
end
# Provide an array with every state in it.
@states = {
alabama: {
abbr: 'AL',
state: 'Alabama'
},
alaska: {
abbr: 'AK',
state: 'Alaska'
},
american_samoa: {
abbr: 'AS',
state: 'American Samoa'
},
armed_forces_americas: {
abbr: 'AA',
state: 'Armed Forces Americas'
},
armed_forces_europe: {
abbr: 'AE',
state: 'Armed Fources Europe'
},
armed_forces_pacific: {
abbr: 'AP',
state: 'Armed Forces Pacific'
},
arizona: {
abbr: 'AZ',
state: 'Arizona'
},
arkansas: {
abbr: 'AR',
state: 'Arkansas'
},
california: {
abbr: 'CA',
state: 'California'
},
colorado: {
abbr: 'CO',
state: 'Colorado'
},
connecticut: {
abbr: 'CT',
state: 'Connecticut'
},
delaware: {
abbr: 'DE',
state: 'Delaware'
},
district_of_columbia: {
abbr: 'DC',
state: 'District of Columbia'
},
federated_states_of_micronesia: {
abbr: 'FM',
state: 'Federated States of Micronesia'
},
florida: {
abbr: 'FL',
state: 'Florida'
},
georgia: {
abbr: 'GA',
state: 'Georgia'
},
guam: {
abbr: 'GU',
state: 'Guam'
},
hawaii: {
abbr: 'HI',
state: 'Hawaii'
},
idaho: {
abbr: 'ID',
state: 'Idaho'
},
illinois: {
abbr: 'IL',
state: 'Illinois'
},
indiana: {
abbr: 'IN',
state: 'Indiana'
},
iowa: {
abbr: 'IA',
state: 'Iowa'
},
kansas: {
abbr: 'KS',
state: 'Kansas'
},
kentucky: {
abbr: 'KY',
state: 'Kentucky'
},
louisiana: {
abbr: 'LA',
state: 'Louisiana'
},
maine: {
abbr: 'ME',
state: 'Maine'
},
marshall_islands: {
abbr: 'MH',
state: 'Marshall Islands'
},
maryland: {
abbr: 'MD',
state: 'Maryland'
},
massachusetts: {
abbr: 'MA',
state: 'Massachusetts'
},
michigan: {
abbr: 'MI',
state: 'Michigan'
},
minnesota: {
abbr: 'MN',
state: 'Minnesota'
},
mississippi: {
abbr: 'MS',
state: 'Mississippi'
},
missouri: {
abbr: 'MO',
state: 'Missouri'
},
montana: {
abbr: 'MT',
state: 'Montana'
},
nebraska: {
abbr: 'NE',
state: 'Nebraska'
},
nevada: {
abbr: 'NV',
state: 'Nevada'
},
new_hampshire: {
abbr: 'NH',
state: 'New Hampshire'
},
new_jersey: {
abbr: 'NJ',
state: 'New Jersey'
},
new_mexico: {
abbr: 'NM',
state: 'New Mexico'
},
new_york: {
abbr: 'NY',
state: 'New York'
},
north_carolina: {
abbr: 'NC',
state: 'North Carolina'
},
north_dakota: {
abbr: 'ND',
state: 'North Dakota'
},
northern_marianas: {
abbr: 'MP',
state: 'Northern Marianas'
},
ohio: {
abbr: 'OH',
state: 'Ohio'
},
oklahoma: {
abbr: 'OK',
state: 'Oklahoma'
},
oregon: {
abbr: 'OR',
state: 'Oregon'
},
palau: {
abbr: 'PW',
state: 'Palau'
},
pennsylvania: {
abbr: 'PA',
state: 'Pennsylvania'
},
puerto_rico: {
abbr: 'PR',
state: 'Puerto Rico'
},
rhode_island: {
abbr: 'RI',
state: 'Rhode Island'
},
south_carolina: {
abbr: 'SC',
state: 'South Carolina'
},
south_dakota: {
abbr: 'SD',
state: 'South Dakota'
},
tennessee: {
abbr: 'TN',
state: 'Tennessee'
},
texas: {
abbr: 'TX',
state: 'Texas'
},
utah: {
abbr: 'UT',
state: 'Utah'
},
vermont: {
abbr: 'VT',
state: 'Vermont'
},
virginia: {
abbr: 'VA',
state: 'Virginia'
},
virgin_islands: {
abbr: 'VI',
state: 'Virgin Islands'
},
washington: {
abbr: 'WA',
state: 'Washington'
},
west_virginia: {
abbr: 'WV',
state: 'West Virginia'
},
wisconsin: {
abbr: 'WI',
state: 'Wisconsin'
},
wyoming: {
abbr: 'WY',
state: 'Wyoming'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment