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
def health(game_persona): | |
return game_persona[1] | |
def set_health(game_persona, health): | |
game_persona[1] = health | |
def attack(game_persona): | |
return game_persona[2] | |
def set_attack(game_persona, attack): |
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 MixTest.Mixfile do | |
use Mix.Project | |
def project do | |
[app: :mix_test, | |
version: "0.1.0", | |
elixir: "~> 1.3", | |
build_embedded: Mix.env == :prod, | |
start_permanent: Mix.env == :prod, | |
deps: deps()] |
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 bash | |
set +m | |
shopt -s lastpipe | |
app_name="unknown" | |
declare -A app_tests | |
declare -A app_fails | |
declare -A app_warnings | |
declare -A app_errors |
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
# EventBus is just event_handler which retranslates event_store events and allow to send new events which not stored in es | |
# dispatch - is a wrapper above commanded dispatch which allows to handle both types of commands: commanded and non commanded commands. | |
defmodule VOK.User.CommandHandlers.CreateUserSyncHandler do | |
import VOK.User.WaitHelpers | |
alias VOK.Events.{ | |
UserCreated, | |
RoleGranted, | |
RoleGrantFailed, |
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 Access do | |
def indifferent_key(key) do | |
fn | |
:get, data, next -> | |
get_atom_or_string_key!(data, key) | |
|> case do | |
nil -> next.(nil) | |
key -> next.(Map.get(data, key)) | |
end |
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 do | |
use Application | |
def start(_type, _args) do | |
import Supervisor.Spec, warn: false | |
children = [ | |
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [ | |
dispatch: dispatch | |
]) |
OlderNewer