/.../
: Start and end regex delimiters|
: Alternation()
: Grouping
This file contains 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
user = Repo.get(User, id) | |
%User{name: "jane", age: 24, email: "[email protected]"} | |
EctoAnon.run(user, Repo) | |
{:ok, %User{name: "redacted", age: 24, email: "redacted"}} |
This file contains 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 Manx.Lowering do | |
alias Beaver.MLIR | |
import MLIR.Sigils | |
import MLIR.{Transforms, Conversion} | |
alias Beaver.MLIR.Dialect.GPU | |
def tosa_vulkan(op) do | |
op | |
|> MLIR.Operation.verify!(dump_if_fail: true) | |
|> canonicalize |
This file contains 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
|
This file contains 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
defprotocol TypeProtocol do | |
@doc """ | |
TypeProtocol checks a term type. | |
""" | |
@spec type(t) :: String.t() | |
def type(value) | |
end | |
defimpl TypeProtocol, for: Float do | |
@spec type(float) :: String.t() |
How to install mongoDB on Manjaro 21 Ornara
- Enable AUR
- Make sure system is up to date
sudo pacman -Syu
- To install, use the following command:
pamac build mongodb-bin
pamac build mongodb-tools-bin
pamac build mongodb-compass
This file contains 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 Math do | |
def sum(a, b) do | |
a + b | |
end | |
end |
This file contains 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 DeafAunty do | |
def run do | |
read_input(0) | |
end | |
# main loop | |
defp read_input(consecutive_byes) when consecutive_byes < 3 do | |
IO.read(:stdio, :line) | |
|> String.trim | |
|> talk_to_aunty(consecutive_byes) |
This file contains 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
regex_str = "[a-z]+\\s+\\d+" | |
small_hit_str = "abc 123 def 456" | |
big_hit_str = Enum.reduce(1..1000, "", fn _val, acc -> | |
"#{acc}#{small_hit_str}" | |
end) | |
small_miss_str = "abc abc abc abc" | |
big_miss_str = Enum.reduce(1..1000, "", fn _val, acc -> | |
"#{acc}#{small_miss_str}" | |
end) |
This file contains 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 TodoList do | |
use GenServer | |
@moduledoc """ | |
A TodoList add, list, find, update & remove. | |
""" | |
def start do | |
{:ok, state} = GenServer.start_link(__MODULE__, []) | |
state | |
end |
NewerOlder