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
-- Read the docs: https://www.lunarvim.org/docs/configuration | |
-- Example configs: https://github.com/LunarVim/starter.lvim | |
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6 | |
-- Forum: https://www.reddit.com/r/lunarvim/ | |
-- Discord: https://discord.com/invite/Xb9B4Ny | |
lvim.lsp.installer.setup.automatic_installation = false | |
lvim.format_on_save.enabled = true | |
lvim.colorscheme = "nord" |
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 MapSetEx do | |
@moduledoc """ | |
The helper functions to work with mapsets. | |
Mapsets in matches are matched the same way as maps, that said the following would be matched | |
```elixir | |
fn mapset() -> :ok end.(MapSet.new()) | |
fn mapset() -> :ok end.(MapSet.new([1, 2])) | |
fn mapset([1]) -> :ok end.(MapSet.new([1, 2])) | |
``` | |
and the following would not |
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
function multiselect { | |
# credits: https://unix.stackexchange.com/a/673436/55106 (altered with single-choice by me) | |
# little helpers for terminal print control and key input | |
ESC=$( printf "\033") | |
cursor_blink_on() { printf "$ESC[?25h"; } | |
cursor_blink_off() { printf "$ESC[?25l"; } | |
cursor_to() { printf "$ESC[$1;${2:-1}H"; } | |
print_inactive() { printf "$2 $1 "; } | |
print_active() { printf "$2 $ESC[7m $1 $ESC[27m"; } | |
get_cursor_row() { IFS=';' read -sdR -p $'\E[6n' ROW COL; echo ${ROW#*[}; } |
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 Tracker do | |
@moduledoc """ | |
The `Tracker` behaviour declaring the interface for tracker backend. | |
""" | |
@doc """ | |
The function to be called from tracked entity. | |
""" | |
@callback track(binary(), any()) :: :ok |
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 RuSorter do | |
def compare(<<"ё", _::binary>>, <<"ё", _::binary>>), do: :eq | |
def compare(<<"Ё", _::binary>>, <<"Ё", _::binary>>), do: :eq | |
def compare(<<"ё", _::binary>>, <<c::utf8, _::binary>>) when c in 1072..1077, do: :gt | |
def compare(<<c::utf8, _::binary>>, <<"ё", _::binary>>) when c in 1072..1077, do: :lt | |
def compare(<<"ё", _::binary>>, <<c::utf8, _::binary>>) when c in 1078..1103, do: :lt | |
def compare(<<c::utf8, _::binary>>, <<"ё", _::binary>>) when c in 1078..1103, do: :gt | |
def compare(<<"Ё", _::binary>>, <<c::utf8, _::binary>>) when c in 1040..1045, do: :gt | |
def compare(<<c::utf8, _::binary>>, <<"Ё", _::binary>>) when c in 1040..1045, do: :lt | |
def compare(<<"Ё", _::binary>>, <<c::utf8, _::binary>>) when c in 1046..1071, do: :lt |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 WolfGoatCabbage.State do | |
defstruct banks: %{true => [], false => []}, ltr: true, history: [] | |
end | |
defmodule WolfGoatCabbage.Subj do | |
defstruct me: nil, incompatible: [] | |
end | |
defmodule WolfGoatCabbage do | |
alias WolfGoatCabbage.{State, Subj} |
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 RomanNumerals do | |
require Integer | |
@romans 'IVXLCDM' | |
@spec numeral(pos_integer()) :: String.t() | |
def numeral(number, romans \\ @romans) do | |
fours = fn | |
<<c, c, c, c>>, [last], _f -> <<c, last>> | |
<<c, c, c, c>>, [c, next | _], _f -> <<c, next>> | |
<<next, c, c, c, c>>, [c, next, result | _], _f -> <<c, result>> |
NewerOlder