Here's an example of a TCP Echo Server using Livebook.
Mix.install([{:ranch, "2.0.0"}])
I recently made a cross-platform GitHub action out of this (using outputs instead of environment variables) Check it out at https://github.com/paulo-ferraz-oliveira/parse-tool-versions/.
In e.g. .github/parse-tool-versions.sh
, do:
#!/bin/bash
Here's an example of how to do it.
def with_performance_log(options, body, context) do
quote bind_quoted: [
context: Macro.escape(context),
options: Macro.escape(options),
body: body
] do
module = "#{context.module}"
Something like
def trace(ms, where) do
Task.start(fn ->
# making sure file is writable (otherwise it'll only crash later, after a WHILE)
:ok = File.write(where, "")
:ok = :fprof.stop()
{:ok, _} = :fprof.start()
Here's an example on how to do it.
defmodule OneUseAlone do
use Credo.Check,
base_priority: :high,
category: :warning,
explanations: [
check: """
Checks if `use` happens more than once in a given module
(from: jelly-beam/rebar3_ex_doc#67)
This little Gist shows how to achieve simple AST walk + update to change a module attribute, that defines a version (in the example), in mix.exs
.
# up_version.exs
defmodule UpVersion do
@mix_exs "mix.exs"