TwistingTwists

TwistingTwists

Best Practices from LiveBeats App

This is a thread to note down things/best practices encountered in LiveBeats App as I explore the source code.

https://github.com/fly-apps/live_beats/blob/master/lib/live_beats_web/controllers/user_auth.ex#L29

Found this usage of rescue/1

I’ve been meaning to handle Ecto errors myself. So this comes in handy for next time.

First Post!

cvkmohan

cvkmohan

Nice exercise @TwistingTwists

Most Liked

dorgan

dorgan

Protip: if you press Y while seeing a github file it replaces the url at the address bar with a permalink so you can copy that instead of scrolling and clicking copy permalink

13
Post #6
RudManusachi

RudManusachi

First of all, thank you for this initiative!

https://github.com/fly-apps/live_beats/blob/master/lib/live_beats_web/live/live_helpers.ex#L494

Never seen a for loop like this before.

I’d recommend to post a “permalink” to the line in the commit. That file was changed 7 hours ago. And looks like the link doesn’t point to the place you meant to.

10
Post #5
mcrumm

mcrumm

Phoenix Core Team

Check out the Phoenix.HTML docs for Link.link/2– You can override the default (:get) link method. You can also provide a data-confirm attribute to prompt the user before following the link. This is all ancient UX stuff that you get when you include phoenix_html.js. :slight_smile:

Almost certainly, but take a look at router.ex to be sure. You don’t want to put destructive actions behind a GET method (especially a public one) otherwise any request to the path will trigger the destructive action. Imagine a search engine spidering your delete links– it’s not ideal.

Last Post!

03juan

03juan

I also think this is a great topic and encourage everyone to start threads on investigating other systems of interest. Well done :+1:

I assume this is so you can capture telemetry data at the same time as certain events happen, but if you’re only interested in having parts of the system react to events without capturing the telemetry, you use pubsub.

Another use case could be that when you’re handling the telemetry event you then want to broadcast some other data, or additional data, than what was received from the telemetry event. So you can broadcast a different payload as needed.

Where Next?

Popular in Guides/Tuts Top

bitli
In case this is handy for other people, here is how you can run Elixir on Android: Install https://termux.com/ apt update; apt upgrade ...
New
AstonJ
This blog post hit my timeline earlier, and I’ve also been learning about some fantastic Elixir related tips via @pragdave’s new online c...
New
dgamidov
Hi folks, Just a short instruction. Maybe it will help somebody. Install boostrap with deps and Sass: cd assets npm install jquery ...
New
lukertty
Install web-mode and mmm-mode first and put this in your config file: (require 'mmm-mode) (require 'web-mode) (setq mmm-global-mode 'may...
New
tomciopp
TLS 1.3 has been out for a little over a year now, but it has been unavailable in Phoenix due to erlang’s handling of ssl. With the most ...
New
magnetic
Hey :waving_hand:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and ...
New
kevinlang
Hey all, With Phoenix 1.6 just around the corner, I figured I’d make a tutorial on how to add Bulma to a new Phoenix 1.6 project. By lev...
New

Other popular topics Top

vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

We're in Beta

About us Mission Statement