User contributions for Admin

Jump to: navigation, search
Search for contributionsExpandCollapse
⧼contribs-top⧽
⧼contribs-date⧽
(newest | oldest) View ( | ) (20 | 50 | 100 | 250 | 500)

10 June 2024

  • 15:1215:12, 10 June 2024 diff hist +361 N How to Write an Event Handler in PhoenixCreated page with "==Example== <source> defmodule AppWeb.PageLive do use AppWeb, :live_view def mount(_params, _session, socket) do {:ok, socket} end def handle_event("run", unsigned_params, socket) do IO.inspect "It works!" {:noreply, socket} end def render(assigns) do ~H""" <p phx-click="run">TEST</p> """ end end </source>" current
  • 01:4801:48, 10 June 2024 diff hist +66 N Phoenix Live View RedirectCreated page with "<source> {:noreply, redirect(socket, to: "/download")} </source>" current

9 June 2024

  • 15:1615:16, 9 June 2024 diff hist +625 User:AdminNo edit summary
  • 15:1515:15, 9 June 2024 diff hist +6 Elixir Phoenix SSHNo edit summary
  • 15:1515:15, 9 June 2024 diff hist +548 N Elixir Phoenix SSHCreated page with "These are ways to SSH into a server using Elixir/Phoenix. Using the librarian library you can do this: <source> SSH.connect!("test.laptop.local", username: "username", password: "passs", silently_accept_hosts: true) </source> If server has a private key: <source> SSH.connect( "server.host", user: "server.user", port: "server.port", identity: "identity path eg: ~/.ssh/id_rsa_nop", save_accepted_host: false, silen..."

8 June 2024

6 June 2024

  • 18:2618:26, 6 June 2024 diff hist +23 How to Upload Files to PhoenixNo edit summary
  • 18:1518:15, 6 June 2024 diff hist +2,408 N How to Upload Files to PhoenixCreated page with "==Working Live View Example == <source> # lib/my_app_web/live/upload_live.ex defmodule AppWeb.PageLive do use AppWeb, :live_view @impl Phoenix.LiveView def mount(_params, _session, socket) do {:ok, socket |> assign(:uploaded_files, []) |> allow_upload(:avatar, accept: ~w(.json), max_entries: 1)} end @impl Phoenix.LiveView def handle_event("validate", _params, socket) do {:noreply, socket} end @impl Phoenix.LiveView def handle_ev..."

5 June 2024

  • 15:5115:51, 5 June 2024 diff hist +272 N How to Download a Static File from PhoenixCreated page with "<source> defmodule AppWeb.PageController do use AppWeb, :controller def home(conn, _params) do path = Application.app_dir(:app, "priv/test.json") #static directory send_download(conn, {:file, path}) render(conn, :home, layout: false) end end </source>" current

24 May 2024

2 May 2024

29 April 2024

  • 10:1610:16, 29 April 2024 diff hist +279 N Non-Blocking Error Check ExampleCreated page with "Example of error checking using the ElixirRss module. <source> def fetch_and_parse(rss) do case ElixirRes.fetch_and_parse(rss) do {:ok, _response} = out -> out {:error, _} = err -> err end rescue e -> dbg(e) {:error, :unknown} end </source>" current

25 April 2024

19 April 2024

18 April 2024

5 April 2024

16 March 2024

15 March 2024

14 March 2024

9 March 2024

29 January 2024

(newest | oldest) View ( | ) (20 | 50 | 100 | 250 | 500)