View portland_meetup_09.ex
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
ClusterPlayground.hello() | |
# => :world | |
# Start peer node | |
{:ok, peer, node_name} = :peer.start(%{connection: :standard_io}) | |
# try call some functions | |
:peer.call(peer, :rand, :uniform, [100]) | |
:peer.call(peer, ClusterPlayground, :hello, []) |
View humanized_weather.ex
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 MyApp.WeatherAPI do | |
@callback temp(MyApp.LatLong.t()) :: {:ok, integer()} | |
@callback humidity(MyApp.LatLong.t()) :: {:ok, integer()} | |
def temp(lat_long), do: impl().temp(lat_long) | |
def humidity(lat_long), do: impl().humidity(lat_long) | |
defp impl, do: Application.get_env(:my_app, :weather, MyApp.ExternalWeatherAPI) | |
end | |
defmodule MyApp.HumanizedWeather do |
View build_elixir.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
#!/bin/sh | |
if [[ -z $1 ]] || [[ -z $2 ]]; then | |
echo """ | |
Usage: ./build_elixir.sh ELIXIR_VERSION OTP_VERSION | |
""" | |
exit 1 | |
fi | |
set -xe |