Skip to content

Instantly share code, notes, and snippets.

View AaronJamesKing's full-sized avatar

Aaron King AaronJamesKing

  • Grand Rapids, MI
View GitHub Profile
@raorao
raorao / ets_cache.ex
Last active October 21, 2024 19:20
Simple ETS based cache with TTL
defmodule RequestCache do
@moduledoc """
Simple ETS-based cache.
"""
use GenServer
@type t :: %{ttl: integer, invalidators: %{}}
@type cache_key :: any
@type cache_value :: any
@rdetert
rdetert / states.rb
Last active March 30, 2023 17:53 — forked from dblandin/states.rb
Hash of the United States in Ruby
::States = { AK: "Alaska",
AL: "Alabama",
AR: "Arkansas",
AS: "American Samoa",
AZ: "Arizona",
CA: "California",
CO: "Colorado",
CT: "Connecticut",
DC: "District of Columbia",
DE: "Delaware",