Map [1]
Operation | Time Complexity |
---|---|
Access | O(log n) |
Search | O(log n) |
Insertion | O(n) for <= 32 elements, O(log n) for > 32 elements [2] |
Deletion | O(n) for <= 32 elements, O(log n) for > 32 elements |
config :wps, WPSWeb.Endpoint, | |
live_reload: [ | |
notify: [ | |
live_view: [ | |
~r"lib/wps_web/core_components.ex$", | |
~r"lib/wps_web/(live|components)/.*(ex|heex)$" | |
] | |
], | |
patterns: [ | |
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$", |
<.flash_group flash={@flash} /> | |
<main> | |
<%= @inner_content %> | |
</main> | |
<%!-- We're doing teleport because navigation is rendered in root layout which is not updated --%> | |
<%!-- Notice "hidden" class, it's important because we're not really teleporting content, but duplicating it --%> | |
<div :if={@current_user} id="onboarding-render" phx-hook="teleport" data-teleport-target="onboarding" class="hidden"> | |
<MyApp.Onboarding.onboarding current_user={@current_user} /> |
# lib/party_web/components/example_component.ex | |
defmodule PartyWeb.ExampleComponent do | |
@moduledoc """ | |
An example LiveComponent under test. | |
""" | |
use Phoenix.LiveComponent | |
def render(assigns) do | |
~H""" | |
<div> |
defmodule MyApp.Books.Book do | |
use Ecto.Schema | |
import Ecto.Query, warn: false | |
import Ecto.Changeset | |
import MyApp.ChangesetHelpers | |
schema "books" do | |
field :name, :string | |
field :genres, {:array, :string}, default: [] |
# example from the ecto guides https://hexdocs.pm/ecto/test-factories.html | |
defmodule MyApp.Factory do | |
alias MyApp.Repo | |
# Factories | |
def build(:post) do | |
%MyApp.Post{title: "hello world"} | |
end |
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "Build", | |
"type": "shell", | |
"command": "mix compile", | |
"problemMatcher": ["$mixCompileError", "$mixCompileWarning"], | |
"group": { | |
"kind": "build", |
# TODO: Extract into it's own library | |
defmodule AbsintheSocket do | |
require Logger | |
alias Phoenix.Channels.GenSocketClient | |
@behaviour GenSocketClient | |
@control_topic "__absinthe__:control" | |
defdelegate fetch(term, key), to: Map | |
defdelegate get(term, key, default), to: Map |
Whenever the topic of Bitcoin's energy usage comes up, there's always a flood of hastily-constructed comments by people claiming that their favourite cryptocurrency isn't like Bitcoin, that their favourite cryptocurrency is energy-efficient and scalable and whatnot.
They're wrong, and are quite possibly trying to scam you. Let's look at why.
There are plenty of intricate and complex articles trying to convince you that cryptocurrencies are the future. They usually heavily use jargon and vague terms, make vague promises, and generally give you a sense that there must be something there, but you always come away from them more confused than you were before.
iex(1)> Foo.Correspondence.validate_number("234-555-6789") | |
{:ok, "Verizon Wireless", "mobile"} |