Skip to content

Instantly share code, notes, and snippets.

@maxrice
Created May 23, 2012 18:32
Show Gist options
  • Save maxrice/2776900 to your computer and use it in GitHub Desktop.
Save maxrice/2776900 to your computer and use it in GitHub Desktop.
US State Names & Abbreviations as PHP Arrays
<?php
/* From https://www.usps.com/send/official-abbreviations.htm */
$us_state_abbrevs_names = array(
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',
'CA'=>'CALIFORNIA',
'CO'=>'COLORADO',
'CT'=>'CONNECTICUT',
'DE'=>'DELAWARE',
'DC'=>'DISTRICT OF COLUMBIA',
'FM'=>'FEDERATED STATES OF MICRONESIA',
'FL'=>'FLORIDA',
'GA'=>'GEORGIA',
'GU'=>'GUAM GU',
'HI'=>'HAWAII',
'ID'=>'IDAHO',
'IL'=>'ILLINOIS',
'IN'=>'INDIANA',
'IA'=>'IOWA',
'KS'=>'KANSAS',
'KY'=>'KENTUCKY',
'LA'=>'LOUISIANA',
'ME'=>'MAINE',
'MH'=>'MARSHALL ISLANDS',
'MD'=>'MARYLAND',
'MA'=>'MASSACHUSETTS',
'MI'=>'MICHIGAN',
'MN'=>'MINNESOTA',
'MS'=>'MISSISSIPPI',
'MO'=>'MISSOURI',
'MT'=>'MONTANA',
'NE'=>'NEBRASKA',
'NV'=>'NEVADA',
'NH'=>'NEW HAMPSHIRE',
'NJ'=>'NEW JERSEY',
'NM'=>'NEW MEXICO',
'NY'=>'NEW YORK',
'NC'=>'NORTH CAROLINA',
'ND'=>'NORTH DAKOTA',
'MP'=>'NORTHERN MARIANA ISLANDS',
'OH'=>'OHIO',
'OK'=>'OKLAHOMA',
'OR'=>'OREGON',
'PW'=>'PALAU',
'PA'=>'PENNSYLVANIA',
'PR'=>'PUERTO RICO',
'RI'=>'RHODE ISLAND',
'SC'=>'SOUTH CAROLINA',
'SD'=>'SOUTH DAKOTA',
'TN'=>'TENNESSEE',
'TX'=>'TEXAS',
'UT'=>'UTAH',
'VT'=>'VERMONT',
'VI'=>'VIRGIN ISLANDS',
'VA'=>'VIRGINIA',
'WA'=>'WASHINGTON',
'WV'=>'WEST VIRGINIA',
'WI'=>'WISCONSIN',
'WY'=>'WYOMING',
'AE'=>'ARMED FORCES AFRICA \ CANADA \ EUROPE \ MIDDLE EAST',
'AA'=>'ARMED FORCES AMERICA (EXCEPT CANADA)',
'AP'=>'ARMED FORCES PACIFIC'
);
?>
@ianrodrigues
Copy link

This is a code launch an EC2 instance in AWS for each state on the list. Might be very useful.

locals {
  states = {
    "Alabama" = "AL"
    "Alaska" = "AK"
    "Arizona" = "AZ"
    "Arkansas" = "AR"
    "California" = "CA"
    "Colorado" = "CO"
    "Connecticut" = "CT"
    "Delaware" = "DE"
    "Florida" = "FL"
    "Georgia" = "GA"
    "Hawaii" = "HI"
    "Idaho" = "ID"
    "Illinois" = "IL"
    "Indiana" = "IN"
    "Iowa" = "IA"
    "Kansas" = "KS"
    "Kentucky" = "KY"
    "Louisiana" = "LA"
    "Maine" = "ME"
    "Maryland" = "MD"
    "Massachusetts" = "MA"
    "Michigan" = "MI"
    "Minnesota" = "MN"
    "Mississippi" = "MS"
    "Missouri" = "MO"
    "Montana" = "MT"
    "Nebraska" = "NE"
    "Nevada" = "NV"
    "New Hampshire" = "NH"
    "New Jersey" = "NJ"
    "New Mexico" = "NM"
    "New York" = "NY"
    "North Carolina" = "NC"
    "North Dakota" = "ND"
    "Ohio" = "OH"
    "Oklahoma" = "OK"
    "Oregon" = "OR"
    "Pennsylvania" = "PA"
    "Rhode Island" = "RI"
    "South Carolina" = "SC"
    "South Dakota" = "SD"
    "Tennessee" = "TN"
    "Texas" = "TX"
    "Utah" = "UT"
    "Vermont" = "VT"
    "Virginia" = "VA"
    "Washington" = "WA"
    "West Virginia" = "WV"
    "Wisconsin" = "WI"
    "Wyoming" = "WY"
  }
}

resource "aws_instance" "states_instance" {
  count = length(local.states)

  instance_type = "t2.micro"
  ami           = "ami-0c55b159cbfafe1f0"

  tags = {
    Name = keys(local.states)[count.index]
    Abbr = values(local.states)[count.index]
  }
}

@whoami15
Copy link

whoami15 commented Feb 5, 2023

  1. Whisk 2 large eggs, 2 tablespoons milk and a pinch of kosher salt in a medium bowl until very well combined.

  2. Meanwhile, preheat a small nonstick skillet over medium-high heat. Once the skillet warm, add 1 tablespoon of butter, then swirl the pan to distribute the butter as it melts. Once the butter stops sizzling and the foam subsides, add the eggs. Pause to the let the eggs heat slightly. Stir vigorously with a heat-proof rubber spatula, making sure to include the sides of the egg mixture so it cooks evenly.

  3. Once the omelet is almost set but still custardy, hold the skillet at a 45-degree angle to the stove and carefully fold the omelet like a business letter. The underside should not have any browning on it. Transfer to a warm plate serve with a pinch of salt and freshly chopped fine herbs, such as parsley, chives, chervil and/or tarragon.

@bluffdigital
Copy link

$states = ['Alaska', 'Alabama', 'Arkansas', 'Arizona', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming']

@benjdotxyz
Copy link

A PHP Array of all the state birds if every state's bird were the American kestrel.


$state_birds_kestrel = array(
    'Alabama' => 'American kestrel',
    'Alaska' => 'American kestrel',
    'Arizona' => 'American kestrel',
    'Arkansas' => 'American kestrel',
    'California' => 'American kestrel',
    'Colorado' => 'American kestrel',
    'Connecticut' => 'American kestrel',
    'Delaware' => 'American kestrel',
    'Florida' => 'American kestrel',
    'Georgia' => 'American kestrel',
    'Hawaii' => 'American kestrel',
    'Idaho' => 'American kestrel',
    'Illinois' => 'American kestrel',
    'Indiana' => 'American kestrel',
    'Iowa' => 'American kestrel',
    'Kansas' => 'American kestrel',
    'Kentucky' => 'American kestrel',
    'Louisiana' => 'American kestrel',
    'Maine' => 'American kestrel',
    'Maryland' => 'American kestrel',
    'Massachusetts' => 'American kestrel',
    'Michigan' => 'American kestrel',
    'Minnesota' => 'American kestrel',
    'Mississippi' => 'American kestrel',
    'Missouri' => 'American kestrel',
    'Montana' => 'American kestrel',
    'Nebraska' => 'American kestrel',
    'Nevada' => 'American kestrel',
    'New Hampshire' => 'American kestrel',
    'New Jersey' => 'American kestrel',
    'New Mexico' => 'American kestrel',
    'New York' => 'American kestrel',
    'North Carolina' => 'American kestrel',
    'North Dakota' => 'American kestrel',
    'Ohio' => 'American kestrel',
    'Oklahoma' => 'American kestrel',
    'Oregon' => 'American kestrel',
    'Pennsylvania' => 'American kestrel',
    'Rhode Island' => 'American kestrel',
    'South Carolina' => 'American kestrel',
    'South Dakota' => 'American kestrel',
    'Tennessee' => 'American kestrel',
    'Texas' => 'American kestrel',
    'Utah' => 'American kestrel',
    'Vermont' => 'American kestrel',
    'Virginia' => 'American kestrel',
    'Washington' => 'American kestrel',
    'West Virginia' => 'American kestrel',
    'Wisconsin' => 'American kestrel',
    'Wyoming' => 'American kestrel',
  );

This could be useful in the future if every state changed its official bird to be the American Kestrel (Falco sparverius), aka the sparrow hawk.

@bryan-rigsby
Copy link

const stateAbbreviationsArray = [
{ label: 'AL', value: 'AL' },
{ label: 'AK', value: 'AK' },
{ label: 'AZ', value: 'AZ' },
{ label: 'AR', value: 'AR' },
{ label: 'CA', value: 'CA' },
{ label: 'CO', value: 'CO' },
{ label: 'CT', value: 'CT' },
{ label: 'DE', value: 'DE' },
{ label: 'FL', value: 'FL' },
{ label: 'GA', value: 'GA' },
{ label: 'HI', value: 'HI' },
{ label: 'ID', value: 'ID' },
{ label: 'IL', value: 'IL' },
{ label: 'IN', value: 'IN' },
{ label: 'IA', value: 'IA' },
{ label: 'KS', value: 'KS' },
{ label: 'KY', value: 'KY' },
{ label: 'LA', value: 'LA' },
{ label: 'ME', value: 'ME' },
{ label: 'MD', value: 'MD' },
{ label: 'MA', value: 'MA' },
{ label: 'MI', value: 'MI' },
{ label: 'MN', value: 'MN' },
{ label: 'MS', value: 'MS' },
{ label: 'MO', value: 'MO' },
{ label: 'MT', value: 'MT' },
{ label: 'NE', value: 'NE' },
{ label: 'NV', value: 'NV' },
{ label: 'NH', value: 'NH' },
{ label: 'NJ', value: 'NJ' },
{ label: 'NM', value: 'NM' },
{ label: 'NY', value: 'NY' },
{ label: 'NC', value: 'NC' },
{ label: 'ND', value: 'ND' },
{ label: 'OH', value: 'OH' },
{ label: 'OK', value: 'OK' },
{ label: 'OR', value: 'OR' },
{ label: 'PA', value: 'PA' },
{ label: 'RI', value: 'RI' },
{ label: 'SC', value: 'SC' },
{ label: 'SD', value: 'SD' },
{ label: 'TN', value: 'TN' },
{ label: 'TX', value: 'TX' },
{ label: 'UT', value: 'UT' },
{ label: 'VT', value: 'VT' },
{ label: 'VA', value: 'VA' },
{ label: 'WA', value: 'WA' },
{ label: 'WV', value: 'WV' },
{ label: 'WI', value: 'WI' },
{ label: 'WY', value: 'WY' }
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment