Application.put_env(:sample, Example.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 5001],
server: true,
live_view: [signing_salt: "aaaaaaaa"],
secret_key_base: String.duplicate("a", 64)
)
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
// assets/js/app.js | |
window._lazy_hooks = window._lazy_hooks || {}; | |
let lazyHook = function(hook) { | |
return { | |
mounted() { window._lazy_hooks[hook].mounted(...arguments) }, | |
beforeUpdate() { window._lazy_hooks[hook].beforeUpdate(...arguments) }, | |
updated() { window._lazy_hooks[hook].updated(...arguments) }, | |
destroyed() { window._lazy_hooks[hook].destroyed(...arguments) }, | |
disconnected() { window._lazy_hooks[hook].disconnected(...arguments) }, |
Problem: accidentally pressing 'Esc' when editing a form in a "standard" LiveView modal dialog will discard all edits.
Proposed solution: Make the modal show a confirmation window on close when there have been changes on the form.
LiveView v0.20 was used.
Table of content
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 TravelerWeb.SearchbarLive do | |
use TravelerWeb, :live_view | |
alias Phoenix.LiveView.JS | |
alias Traveler.Places | |
def mount(_params, _session, socket) do | |
socket = assign(socket, places: []) | |
{:ok, socket, layout: false} | |
end |
Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)
- If you want to add a link, comment or send it to me
- Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak
- Royce Williams list sorted by vendors responses Royce List
- Very detailed list NCSC-NL
- The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
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
# Has one external dependency except for Gettext: https://github.com/rrrene/html_sanitize_ex | |
defmodule MyApp.Gettext do | |
@doc """ | |
A helper for translations with links. | |
Pass in the translation string which must include | |
`%{link_start}`/`%{link_end}`. For multiple URLs, use | |
`%{link_start_<0,1,2...>}`. |
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 MyAppWeb.GettextTest do | |
use ExUnit.Case | |
import MyAppWeb.Gettext | |
# A unit test for Gettext translations that checks if the original and the translation | |
# use the same HTML tags. | |
# | |
# Uses Floki to parse HTML. | |
describe "translations" do |
- @idlehands: I don't post new things
- @idlehahands@mastodon.social: if I post new things, it's here
- help@testingelixir.com: I like to help people
- Testing Elixir Book: the sample code is downloadable without buying the book
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
Phoenix esbuild with Tailwind+Fontawesome |
NewerOlder