Today I Learned
I’ve got a problem where
Phoenix.Channel.Server receives an unexpected message to be pushed to my client via a channel. However that message is very long, and some of the important information is only printed at the very bottom of the log message that has been truncated.
On this blog the dates were formatted incorrectly, i.e.
2022-08-30 would be printed as
30-88-022. The solution was that
the format strings look like they are just some random date, i.e.
.Date.Format "Monday, 01.11.2006", but actually the values
for date, month and year are hardcoded like
dd.mm.yyyy in nearly every other language. Correct would be
.Date.Format "Monday, 02.01.2006".
In Phoenix 1.6.x you now need to start the server explicitly by setting the
PHX_SERVER=true environment variable.
If you’ve got a heex template where you want to insert some data attribute like
true, make sure that you convert it to a string first.
Otherwise a blank string
"" is inserted.
If you’ve got a dependency that one of your apps in your umbrella project depends on, do not put it in the main
at the base of the umbrella project. It will not be included in relases in that case.
When using responsive images using
<picture> and the
sizes attribute is not enough to force the browser to use a small
image on mobile. Instead you need to provide multiple
<source> tags with the
media="(max-width: 200px)" attribute set.
After migrating to Ecto 3, the following code did not work:
Ecto.assoc_loaded?() does not accept any objects, check manually before you call
Searching for a domain for your new project? Try
Nice trick to deal with disk full issues on a server:
After setting up the server, create an empty 8GB file in
Why? In case the server goes out of space, simpley delete the file.
That gives you more to fix the actual issue.
Running custom background watchers with e.g.
will lead to zombie processes if not wrapped in custom shell script that kills the process once elixir quits.
Do not try to nest
<a> tags in Firefox, that will cause Firefox to mangle up the layout.
Eine Studie hat gezeigt, dass eine Stellenanzeige mit der Formulierung “Geschäftsführerin oder Geschäftsführer (m/w/d)" mehr Bewerbungen von Frauen und insgesamt mehr Bewerbungen bringt als die Formulierung “Geschäftsführer (m/w/d)".
When migrating to a new phone, you can copy most app data using the
apt backup and restore function.
You can perform a reduce using
for by using the
reduce:  opt.
On Safari in iOS the event
beforeunload does not exist, but it does on Safari for MacOS. Add a
global event listener on all clicks on anchor tags as a workaround.
If you are using
mix release with a different
erts version, the path must point to the
erts-x.x.x directory inside the erlang installation.
simulator.app from XCode to test your websites on iOS devices.
If you’ve got a migration that has
ex as its extension instead of
exs its silently skipped.