This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with useful tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2263406/osx.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule KeyValueStore do | |
use GenServer | |
@me __MODULE__ | |
@moduledoc """ | |
Implement a simple key-value store as a server. This | |
version creates a named server, so there is no need | |
to pass the server pid to the API calls. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule OA do | |
####### | |
# API # | |
####### | |
def new do | |
{ :ok, agent } = Agent.start_link(fn -> %{ location_of: %{} } end) | |
agent | |
end |