🏋️♂️
This file contains hidden or 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
:crypto.verify( | |
:ecdsa, | |
:sha256, | |
"message", | |
signature, | |
[public_key, :secp256k1] | |
) |
This file contains hidden or 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
signature = | |
:crypto.sign( | |
:ecdsa, | |
:sha256, | |
"message", | |
[private_key, :secp256k1] | |
) |
This file contains hidden or 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
with {public_key, private_key} <- :crypto.generate_key(:ecdh, :secp256k1), | |
do: {Base.encode16(public_key), Base.encode16(private_key)} |
This file contains hidden or 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
# Latest version of Erlang-based Elixir installation: https://hub.docker.com/_/elixir/ | |
FROM elixir:latest | |
# Create and set home directory | |
ENV HOME /opt/your_application | |
WORKDIR $HOME | |
# Configure required environment | |
ENV MIX_ENV prod |
This file contains hidden or 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
machine: | |
services: | |
- docker | |
dependencies: | |
cache_directories: | |
- ~/docker | |
deployment: | |
staging: |
This file contains hidden or 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
erlang 19.3 | |
elixir 1.4.4 |
This file contains hidden or 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
machine: | |
environment: # configure the particular environmental variables | |
MIX_ENV: test | |
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH" | |
dependencies: | |
pre: | |
- ./scripts/ci.sh | |
post: | |
- mix local.hex --force # install elixir package manager |
This file contains hidden or 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 YourApplication do | |
def main(args), | |
do: args # do whatever with your args | |
end |
This file contains hidden or 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 YourApplication.Mixfile do | |
use Mix.Project | |
def project do | |
[ | |
# ... | |
escript: escript(), | |
] | |
end | |
This file contains hidden or 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 | |
mix ecto.migrate # migrate your database if Ecto is used | |
mix escript.build # create application executable binary | |
./your_application_name # run application script |