The example Dockerfile given on the Elixir Phoenix Guides appears to be outdated and broken. The example is found here: https://hexdocs.pm/phoenix/releases.html#containers
I created a vanilla application like like so: mix phx.new hello_world
The broken Dockerfile:
# FROM elixir:1.9.0-alpine as build
# install build dependencies
RUN apk add --update git build-base nodejs yarn python
# prepare build dir
RUN mkdir /app
WORKDIR /app
# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
# set build ENV …Run Code Online (Sandbox Code Playgroud) I'm not sure when to use mix and when to use phoenix for creating umbrella applications.
I have read a lot of articles online but they are not clear of the reasoning for using mix over phoenix and vis versa.
mix gives:
- apps/
- config/
Run Code Online (Sandbox Code Playgroud)
phoenix gives:
- build/dev/(consolidated/lib)
- apps/(app_name/app_name_web)
- config/(configs for different envs)
- deps/(stuffffff)
Run Code Online (Sandbox Code Playgroud)
mix new [UMBRELLA NAME] --umbrella VS mix phx.new [UMBRELLA NAME] --umbrella
If I want to generate an umbrella that has an …
要获取 IEx 中模块上所有函数的列表,我可以运行:
Map.__info__(:functions)
# or
Enum.__info__(:functions)
Run Code Online (Sandbox Code Playgroud)
使用{Module}.__info__(:functions)格式。
如何获取所有标准库模块的列表?
我有一个包含多个 Dragula 容器的页面。容器中ul有一堆li。我希望用户能够li在他们的容器中重新排序's,但我不希望lifrom 一个容器可以拖动到另一个容器。现在我可以将 each 拖到liany ul。如何将li's限制为仅使用其原始容器?
html:
<ul id="first">
<li>for first group only</li>
<li>for first group only</li>
<li>for first group only</li>
</ul>
<ul id="second">
<li>for second group only</li>
<li>for second group only</li>
<li>for second group only</li>
</ul>
<ul id="third">
<li>for third group only</li>
<li>for third group only</li>
<li>for third group only</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
js:
var first = '#first';
var second = '#second';
var third = '#third';
var …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用asdf安装Erlang(及更高版本的Elixir),但是jinterface由于安装过程似乎冻结而出现错误:
? ~ asdf install erlang 22.1.1
Downloading OTP-22.1.1.tar.gz to /Users/me/.asdf/plugins/erlang/kerl-home/archives
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 122 0 122 0 0 320 0 --:--:-- --:--:-- --:--:-- 321
100 52.4M 0 52.4M 0 0 7604k 0 --:--:-- 0:00:07 --:--:-- 9203k
Extracting source code
Building Erlang/OTP 22.1.1 (asdf_22.1.1), please wait...
APPLICATIONS DISABLED (See: /Users/me/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log)
* jinterface : Java compiler disabled by user
DOCUMENTATION INFORMATION (See: /Users/me/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.1/otp_build_22.1.1.log) …Run Code Online (Sandbox Code Playgroud) elixir ×4
asdf ×1
docker ×1
dockerfile ×1
dragula ×1
elixir-iex ×1
elixir-mix ×1
erlang ×1
java ×1
javac ×1
javascript ×1
umbrella ×1