Skip to content

Instantly share code, notes, and snippets.

View alco's full-sized avatar
🇺🇦

Oleksii Sholik alco

🇺🇦
View GitHub Profile
vars = ...
ignored_vars = ...
quote bind_quoted: [name: name, body: Macro.escape(body)] do
name = String.to_atom(name)
# This unquote is deferred for later, but unquote_splicing needs to be run
def unquote(name)(0, result, unquote_splicing(ignored_vars)) do
result
end
var Hashids = require("../lib/hashids");
var hashids = new Hashids();
var bignums = [
9007199254740992,
"9007199254740992 (2^53)",
9007199254740993,
"9007199254740993 (2^53+1)",
18014398509481984,
"18014398509481984 (2^54)",
Mix.Project.config
|> Keyword.update!(:erlc_options, &[{:d,:TEST}|&1])
|> Keyword.update!(:erlc_paths, &["test"|&1])
|> MixErlangTasks.Util.with_config(fn ->
Mix.Task.run "compile", []
end)
defmodule MixErlangTasks.Util do
[{'miniweb_escript.beam',
<<70, 79, 82, 49, 0, 0, 12, 216, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 117, 131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 95, 118
, 49, 108, 0, 0, 0, 2, 104, 2, 100, ...>>},
{'Elixir.Miniweb.CLI.Definition.beam',
<<70, 79, 82, 49, 0, 0, 11, 188, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 148, 131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 95, 118
, 49, 108, 0, 0, 0, 2, 104, 2, ...>>},
{'Elixir.Miniweb.CLI.Inspect.Router.beam',
<<70, 79, 82, 49, 0, 0, 6, 184, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 221, 131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 95, 118,
49, 108, 0, 0, 0, 2, 104, ...>>},
{'Elixir.Miniweb.CLI.Inspect.beam',
..14:56:32.307 [error] Error in process <0.193.0> with exit value: {#{'__exception__'=>true,'__struct__'=>'Elixir.Protocol.UndefinedError',description=>nil,protocol=>'Elixir.Enumerable',value=><<6 bytes>>},[{'Elixir.Enumerable','impl_for!',1,[{file,"lib/enum.ex"},{line,1}]},{'Elixir.Enumerable',reduce,3,[{file...
λ mix bench
Settings:
duration: 1.0 s
mem stats: false
sys mem stats: false
[11:00:25] 1/4: StringBench.reverse string
[11:00:28] 2/4: BinBench.binary_part
[11:00:29] 3/4: BinBench.matching
[11:00:34] 4/4: ListBench.reverse list
λ vagrant up
Bringing machine 'core-01' up with 'virtualbox' provider...
==> core-01: Checking if box 'coreos-stable' is up to date...
==> core-01: Clearing any previously set forwarded ports...
==> core-01: Clearing any previously set network interfaces...
==> core-01: Preparing network interfaces based on configuration...
core-01: Adapter 1: nat
core-01: Adapter 2: hostonly
==> core-01: Forwarding ports...
core-01: 2375 => 2375 (adapter 1)
λ cat mix.exs
defmodule Fuego.Mixfile do
use Mix.Project
def project do
[app: :fuego,
version: "0.0.1",
elixir: "~> 0.14.2",
deps: deps]
end
==> Merging custom relx configuration from rel/relx.config...
** (CaseClauseError) no case clause matching: [{:lib_dirs, ['/Users/alco/.kiex/elixirs/elixir-0.14.3/lib/elixir/lib', '../_build/prod']}, {:release, {:miniweb, '0.1.0'}, [{:miniweb, '0.1.0'}, :elixir, :iex, :sasl]}, {:include_erts, true}, {:extended_start_script, true}, {:generate_start_script, false}, {:overlay, [{:mkdir, 'releases/0.1.0'}, {:copy, './files/sys.config', 'releases/0.1.0/sys.config'}, {:copy, './files/boot', 'bin/miniweb'}, {:copy, '/Users/alco/home/projects/miniweb/_build/prod/consolidated', 'lib/consolidated'}, {:copy, '/Users/alco/home/projects/miniweb/config/miniweb.schema.exs', 'releases/0.1.0/miniweb.schema.exs'}, {:copy, '/Users/alco/home/projects/miniweb/config/miniweb.conf', 'releases/0.1.0/miniweb.conf'}, {:copy, '/Users/alco/home/projects/miniweb/deps/conform/conform', 'bin/conform'}]}]
lib/mix/tasks/release.ex:133: Mix.Tasks.Release.generate_relx_config/1
lib/mix/tasks/release.ex:64: Mix.Tasks.Release.do_run/1
[...]
===> Provider successfully run: rlx_prv_release
===> Running provider rlx_prv_overlay
===> Provider (rlx_prv_overlay) failed with: {error,
{rlx_prv_overlay,
{overlay_failed,
[{error,
{rlx_prv_overlay,
{copy_failed,