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 MedianSortedTuple do | |
# NOTE Alogorithm 4 | |
def attempt2(tup1, tup2) do | |
size1 = tuple_size(tup1) | |
size2 = tuple_size(tup2) | |
half_size = (size1 + size2 + 1) |> div(2) | |
if size1 > size2 do |
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
// an example to create a new mapping `ctrl-y` | |
mapkey('<Ctrl-y>', 'Show me the money', function() { | |
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).'); | |
}); | |
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works. | |
map("K", "R"); | |
map("J", "E"); | |
map("H", "S"); | |
map("L", "D"); |
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 EctoQueryMaker do | |
@moduledoc """ | |
Query builder to abstract away boilerplate queries. | |
""" | |
import Ecto.Query | |
alias Ecto.{Query, Queryable} | |
@callback apply_filter(filter :: atom | {atom, any}, query :: Query.t()) :: Query.t() |
OlderNewer