Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
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 |
defmodule TerminalWidthHeight do | |
def term_dimensionns do | |
{:ok,width} = :io.columns | |
{:ok,height} = :io.rows | |
IO.inspect {width,height} | |
end | |
end |
defmodule PasswordLock do | |
use GenServer | |
# -------------# | |
# Client - API # | |
# -------------# | |
@moduledoc """ | |
Documentation for PasswordLock. | |
locks the password |
defmodule PasswordLogger do | |
use GenServer | |
# -------------# | |
# Client - API # | |
# -------------# | |
@moduledoc """ | |
Documentation for Password_logger. | |
loggs the password |
defmodule PasswordLockTest do | |
use ExUnit.Case | |
doctest PasswordLock | |
setup do | |
{:ok,server_pid} = PasswordLock.start_link("foo") | |
{:ok,server: server_pid} | |
end | |
test "unlock success test", %{server: pid} do |
@doc """ | |
Initiate with the given password . | |
""" | |
def start_link(password) do | |
GenServer.start_link(__MODULE__, password, []) | |
end |
@doc """ | |
Unlocks the given password | |
""" | |
def unlock(server_pid, password) do | |
GenServer.call(server_pid, {:unlock, password}) | |
end | |
@doc """ | |
resets the given password | |
""" |