Worked 2015-09-08 for Phoenix 1.0.1 on Dokku 0.3.25.
These instructions assume you've set up Dokku. If not, go find a tutorial for that part. My notes for setting it up on Digital Ocean.
Create a Dokku app:
creating | handling with | where y is | |
----------------------------------------------------- | |
raise x | rescue y | %RuntimeError{message: x} | |
error(x) | rescue y | %ErlangError{original: x} | |
throw x | catch y | x | |
exit(x) | catch :exit, y | x | |
creating | handling with | where y is | and z is |
defmodule MyList | |
def delete_all(list, el) do | |
_delete_all(list, el, []) | |
|> Enum.reverse() | |
end | |
def _delete_all([el | tail], el, new_list) do | |
_delete_all(tail, el, new_list) | |
end |
defmodule ReqWithBackoff do | |
# hakney :connect_timeout - timeout used when establishing a connection, in milliseconds | |
# hakney :recv_timeout - timeout used when receiving from a connection, in milliseconds | |
# poison :timeout - timeout to establish a connection, in milliseconds | |
# :backoff_max - maximum backoff time, in milliseconds | |
# :backoff_factor - a backoff factor to apply between attempts, in milliseconds | |
defp fetch(uri) do | |
options = [ | |
follow_redirect: true, | |
recv_timeout: Application.get_env(:arc, :recv_timeout, 5_000), |
defmodule MergeCommonPlaces do | |
def merge_places([]), do: [] | |
def merge_places([place | rest]) do | |
{similar_places, rest_places} = | |
Enum.reduce(rest, {[], []}, fn plc, {same_places, rest} -> | |
if same_place?(place, plc) do | |
{[plc | same_places], rest} | |
else | |
{same_places, [plc | rest]} | |
end |
defmodule BG.Aggregator.Supervisor do | |
use Supervisor | |
@name BG.Aggregator.Supervisor | |
def start_link() do | |
Supervisor.start_link(__MODULE__, :ok, name: @name) | |
end | |
def init(:ok) do | |
num_aggregator_consumers = Application.get_env(:twd, :num_aggregator_consumers, 5) |
defmodule Cluster.RabbitStrategy do | |
use GenServer | |
use Cluster.Strategy | |
import Cluster.Logger | |
alias Cluster.Strategy.State | |
@routing_key "cluster.heartbeat" | |
def start_link(opts) do |
defmodule RepoStream do | |
defmodule Producer do | |
use GenStage | |
defstruct [:demand, :pid] | |
def start_link() do | |
GenStage.start_link(__MODULE__, self()) | |
end |
Tinkko - http://tinkko.com | |
Selina :unicorn_face: - https://www.selina.com/cowork-medellin/ | |
Nodo-coworking - https://nodo.space/coworking-nodo/ | |
Co-Work Latam - http://www.rutanmedellin.org/es/ciudad/item/en-noviembre-se-abrira-el-espacio-de-co-working-mas-grande-de-la-ciudad | |
Ruta N - https://www.coworklatam.com/sedes/colombia-medellin-ruta-n/ | |
Epicentro - http://www.epicentro.com.co/espacio.html |
require 'benchmark' | |
class Array | |
def my_map | |
self.inject([]) do |arr, elm| | |
arr << (yield elm) | |
end | |
end | |
def filter_map fn |
Worked 2015-09-08 for Phoenix 1.0.1 on Dokku 0.3.25.
These instructions assume you've set up Dokku. If not, go find a tutorial for that part. My notes for setting it up on Digital Ocean.
Create a Dokku app: