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
{ | |
"editor.autoIndent": "advanced", | |
"editor.codeActionsOnSave": { | |
"source.fixAll.eslint": true | |
}, | |
"files.associations": { | |
"*.html.eex": "html-eex", | |
"*.html.leex": "html-eex" | |
}, | |
"[elixir]": { |
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 ActiveLinkWeb.Components.ActiveLinkView do | |
use Phoenix.Component | |
import Phoenix.Controller, only: [current_path: 1] | |
def active_link(assigns) do | |
%{conn: conn, href: href} = assigns | |
link_name = | |
case href |> String.split("/") do | |
["", ""] -> "home" |
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 Advent do | |
@moduledoc """ | |
How to use it: | |
1. Uncomment which `@proof` you want to run against - part I or part II | |
2. Uncomment correct `@last_coord` for target coordinate | |
3. Decide if you want to expand it or not (check docstring in `run/1), and pipe that result into `Advent.run/1`, | |
instead of just calling `Advent.run/1` | |
Metrics: |
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
import 'phoenix_html' | |
// assets/js/app.js | |
import { Socket } from 'phoenix' | |
import { LiveSocket } from 'phoenix_live_view' | |
let liveSocket = new LiveSocket('/live', Socket, { | |
params: { _csrf_token: csrfToken }, | |
... |