- Add migration command in rel/config.exs [1]
- Create rel/commands/migrate.sh script [2]
- Create lib/release/tasks.ex with contents of [3]
- Add priv/repo/migrations to your docker context [4]
- Now you can run the
migrate
command as a custom command from your Distillery output, this is just like runningconsole
orforeground
. It will appear inhelp
of your release
import { Pushex } from 'pushex' | |
import { getToken } from './tokenService' | |
const pushexOptions = { | |
getParams: () => getToken().then(({ token }) => Promise.resolve({ token })), | |
onConnectionError: pushex => { | |
pushex.resetParams() | |
}, | |
} |
# We use this ClusterLoadBalancer to prevent hot nodes in our load balanced setup. | |
# The WebSockets are provided by Phoenix through the PushEx application https://github.com/pushex-project/pushex/ | |
# The load balancer's `Worker` module is where the bulk of the cluster orchestration happens, using pg2 for cross node communication | |
defmodule ClusterLoadBalancer.Behavior do | |
@moduledoc """ | |
Behavior for implementing a ClusterLoadBalancer compatible tool. | |
""" | |
@callback count() :: number |
defmodule MyApp.AccountLookup.Cache do | |
@moduledoc """ | |
Provides a cache that can be used for account lookups. This cache is backed by | |
Cachex for local storage and pg2 for remote distribution. Keys are set to expire | |
after 7-10 days (randomly distributed) in order to prevent stale data in our cache | |
over a long time period. | |
""" | |
use Cachex.DistributedCache |
defmodule FeedItemProducer do | |
use GenStage | |
def start_link(:nameless) do | |
GenStage.start_link(__MODULE__, :ok) | |
end | |
def start_link() do | |
GenStage.start_link(__MODULE__, :ok, name: __MODULE__) | |
end |
# mix.exs deps | |
# start exometer; force "correct" modules due to elixometer not compiling properly | |
{:elixometer, "~> 1.2"}, | |
{:lager, ">= 3.2.1", override: true}, | |
{:exometer, github: "Feuerlabs/exometer"}, | |
{:exometer_core, "~>1.4.0", override: true}, | |
{:amqp_client, git: "https://github.com/dsrosario/amqp_client.git", branch: "erlang_otp_19", override: true}, | |
# end exometer |
# First sort the input using an nlogn method | |
# Then iterate over the array, finding the index of each value in the sorted array | |
# The index of the value in the sorted array is the inversion count, because all items to the left are less | |
# Sum those up | |
# Be sure to use the most efficient searching and not build in. (nlogn sort and logn search) | |
def solution(a) | |
return 0 if a.empty? | |
sorted = a.sort | |
inversions = a.each_with_index.map do |val, index| |
def solution(t) | |
traverse_height(t, 0) | |
end | |
def traverse_height(t, current_height) | |
return current_height - 1 if t.nil? | |
left_height = traverse_height(t.l, current_height+1) | |
right_height = traverse_height(t.r, current_height+1) | |
[left_height, right_height].max |
This privacy policy governs your use of the software application Noisy Dog Log (“Application”) for mobile devices that was created by Stephen Bussey. The Application is a way to monitor loud noises around your device, namely dog barking.
The Application obtains the information you provide when you download and register the Application. Registration with us is optional. However, please keep in mind that you may not be able to use some of the features offered by the Application unless you register with us.
When you register with us and use the Application, you generally provide (a) your name, email address, user name, password and other registration information; (b) transaction-related information, such as when you make purchases, respond to any offers, or download or use applications from us; (c) information you provide us when you contact us for help, and; (d) information you enter into our system when using th
module AgentDispatch | |
class Loader | |
def self.run! | |
new.run! | |
end | |
def run! | |
future = master.future.run # It's a celluloid example here | |
while read_trap_io |