Weeknotes 98
14th May, 2023
“Trauma is trauma”
-
You can specify inline routes inside your Rails
config/routes.rb
. Handy for those times when you don’t want a full controller.get "test", to: ->(env) { [200, {}, ['hello world']] end
-
Chris McCord’s gives an nice overview of where LiveView has been and is going in his keynote at ElixirConf EU 2023 – The Road To LiveView 1.0. Solving the nested form inputs issue is music to my ears. I’ve written this from scratch before and it was very not fun.
-
Phoenix LiveView Navigation Regressions.
LiveView excels for complex UI logic, or things like live updates. For back-office applications it is hard to be beat. In other words, proper applications that would’ve otherwise needed an SPA to implement. But for basic blogs or documentation sites, I recommend instead to continue to use normal views.
Yep. I personally think using it for anything that would be an SPA is a valid choice, but for normal web pages? No.
-
The Rubygems website was blocked by Firefox and Chrome this week by being included in the Google Safe Browsing database.
-
ModelProbe for ActiveRecord looks neat.
Colorized table info for columns, types, nullables, indexes… and the actual DDL used by the database to create the table. All this and more with ModelProbe!
Get a clear picture of your model’s underlying schema with beautiful and informative schema introspection. Generate model class definitions with a well organized, logical structure. Create sensible text fixture stubs.
-
Next time I have the need for anything Docker I’m going to check out OrbStack.
Run Docker and Linux on your Mac seamlessly and efficiently. Docker Desktop alternative that helps you work faster.
-
Refresh vs. Long-lived Access Tokens – This is a really good read on why we have moved towards a refresh token world. Refresh tokens are annoying, for sure, but there are reasons.
Why would you want to use long-lived refresh tokens that generate short-lived access tokens as commonly seen in OAuth 2.0, versus long-lived access tokens? Aren’t you simply replacing one long-lived token with another?
-
Singed seems like an easy way to get hold of a flamegraph. I’ve briefly used stackprof and speedscope recently and it was a bit of faff getting going.
Singed makes it easy to get a flamegraph anywhere in your code base. It wraps profiling your code with stackprof or rbspy, and then launching speedscope to view it.
This certainly looks easier.
-
Trauma is Trauma by Kevin Smith hit me hard. Worth watching.