Uncommon Logical stuff of Elixir modules,definitions and some coding snippets that makes our life easy and fast. We go with very basic to the different approach.
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 PasswordLogger do | |
use GenServer | |
# -------------# | |
# Client - API # | |
# -------------# | |
@moduledoc """ | |
Documentation for Password_logger. | |
loggs the password |
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 PasswordLock do | |
use GenServer | |
# -------------# | |
# Client - API # | |
# -------------# | |
@moduledoc """ | |
Documentation for PasswordLock. | |
locks the password |
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 TerminalWidthHeight do | |
def term_dimensionns do | |
{:ok,width} = :io.columns | |
{:ok,height} = :io.rows | |
IO.inspect {width,height} | |
end | |
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 ExecutionTime do | |
def time_of(function, args) do | |
{time, result} = :timer.tc(function, args) | |
IO.puts "Time: #{time}ms" | |
IO.puts "Result: #{result}" | |
end | |
end |
NewerOlder