Code and Stuff
Code and Stuff
  • 40
  • 118 887
What's New in Elixir 1.18?
In this video, I walk through some highlights from the Elixir 1.18 release (currently in a release candidate)! This includes parameterized tests, enhancements to the dbg macro, mix format's migrate option, and more.
Take a look at the demo repo for a more thorough walkthrough and code examples you can run yourself!
Links
Screen recording software I use (affiliate): screen.studio/@Yy75o
Elixir Changelog: hexdocs.pm/elixir/1.18.0-rc.0/changelog.html
Demo repo: github.com/ChristianAlexander/elixir_1_18_demos
Table-driven tests in Go: dave.cheney.net/2019/05/07/prefer-table-driven-tests
Timestamps
Intro - 00:00
Enum Methods - 00:17
Benchmarking the Change - 1:27
Parameterized Tests - 2:44
When NOT to use this - 5:21
List.ends_with? - 6:29
A Note on Performance - 7:49
Debug Macro Improvements! - 8:22
Mix Format's Migrate Option - 9:49
Переглядів: 3 233

Відео

A New Type of Component Library: Mishka Chelekom
Переглядів 4,6 тис.2 місяці тому
Mishka Chelekom is a brand new open-source component library for Phoenix applications. It uses a unique code generation approach that prepares your project for future updates. See how Chelekom provides a solid starting point for Phoenix developers, despite being in its early stages (v0.0.1)! Links Screen recording software I use (affiliate): screen.studio/@Yy75o Mishka Chelekom Docs: mishka.too...
LiveView JS: The Comprehensive Guide
Переглядів 5 тис.3 місяці тому
Unlock the full potential of Phoenix LiveView with this comprehensive guide to LiveView JS commands! In this video, I’ll cover: - All 19 LiveView JS commands in detail - Examples and use cases for each command - Tips for combining commands to create powerful interactions - Best practices for using LiveView JS in your projects Whether you're new to LiveView or looking to level up your skills, th...
Automating Advent of Code Setup with Igniter
Переглядів 1,9 тис.3 місяці тому
This year I’m doing Advent of Code differently by incorporating the Igniter library, from the makers of the Ash framework. With 25 days of coding challenges, there can be a ton of boilerplate to wrestle with. What if I could generate each day’s template on the fly? It turns out, Igniter makes it easy to generate Elixir code! Links Screen recording software I use (affiliate): screen.studio/@Yy75...
Phoenix Analytics: open-source view tracking, in your app!
Переглядів 2,2 тис.3 місяці тому
A brand new Elixir package was just posted that brings analytics directly into your Phoenix applications. Check it out! Links Screen recording software I use (affiliate): screen.studio/@Yy75o Analytics demo site: theindiestack.com/analytics PhoenixAnalytics on GitHub: github.com/lalabuy948/PhoenixAnalytics Author of PhoenixAnalytics: x.com/mrpopov_com
Exploring OAuth 2.0: Must-Know Flows Explained
Переглядів 1,7 тис.4 місяці тому
Every developer should know about OAuth. In this video, I break down five key OAuth 2.0 flows: including Authorization Code, PKCE, Device Code, Token Refresh, and Client Credentials. Perfect for developers looking to understand how modern authentication works. Whether you're new to OAuth or looking to refresh your knowledge, this visual explanation will help you grasp the concepts quickly. Idea...
Building a Real-time Collaborative Whiteboard (with live_svelte)
Переглядів 2,4 тис.4 місяці тому
Discover how to create interactive, multiplayer web applications using live_svelte! Combine Svelte's excellent developer experience with Phoenix LiveView's real-time messaging to build collaborative apps-all without relying on third-party services. In this tutorial, you'll learn to: * Set up a live_svelte project * Create a real-time collaborative whiteboard * Implement multi-room functionality...
Read the Room: Measuring Air Quality with Rust and Elixir
Переглядів 2,9 тис.5 місяців тому
Join me as I build a non-trivial air quality measurement app using Rustler, bridging the gap between Rust and Elixir! Along the way, I'll show how GenServers and Phoenix PubSub can help manage state and send the latest measurements to the browser. Links Screen recording software I use (affiliate): screen.studio/@Yy75o Project source repo: github.com/ChristianAlexander/air_sensor Rustler: hexdoc...
A new open source error tracker in Elixir!
Переглядів 1,8 тис.5 місяців тому
A brand new package was just posted that brings Sentry-style error tracking directly into Elixir applications. Check it out! Links Screen recording software I use (affiliate): screen.studio/@Yy75o ErrorTracker on GitHub: github.com/elixir-error-tracker/error-tracker Demo project branch: github.com/ChristianAlexander/open_csp/pull/1/files
Chunked Responses: Scaling File Exports for Production
Переглядів 2,2 тис.5 місяців тому
While it's possible to build file export features that work on your machine, it's important to keep track of memory usage. Using Elixir's Stream module and chunked responses, it's possible to dramatically reduce memory consumption per request-allowing your application to go further without needing massive servers. In this video, I walk through the process of optimizing a demo app's CSV export f...
Simplify React and Phoenix using Inertia JS: A quick look
Переглядів 5 тис.6 місяців тому
Some of the hardest parts of React development are routing and data fetching. The Inertia JS library, originally from the Laravel community, was recently brought to Phoenix by the folks behind SavvyCal. Join me as I walk through a couple of demos that show how Inertia can fit into modern monolithic applications. Links Screen recording software I use (affiliate): screen.studio/@Yy75o Project sou...
Extending Phoenix LiveView with Hooks
Переглядів 2,4 тис.6 місяців тому
Phoenix LiveView is typically enough to build an app, but there are times where it is necessary to boost performance or get access to browser-native behavior only available to JavaScript. Luckily, LiveView has an escape hatch for these scenarios: hooks! Join me as I walk through the process of building a simple countdown timer app with LiveView, and then improve it with a little JS. Links Scree...
How fast is your Elixir code? Find out with Benchee!
Переглядів 1,5 тис.7 місяців тому
Benchee is a common microbenchmarking package used in Elixir and Erlang to measure the performance characteristics of functions. In this video, I show how to use Benchee with real examples-from the new OTP 27 JSON support to sorting algorithms and even Advent of Code solutions. Links Livebook Code: gist.github.com/ChristianAlexander/6c64b2df15f1dec395b341199b416e9a Screen recording software I u...
Native JSON in OTP 27! (Elixir, Erlang, Gleam)
Переглядів 2,4 тис.7 місяців тому
Erlang OTP, which runs all Erlang, Elixir, and Gleam apps, now has built-in support for JSON. Soon, this will eliminate the need for third party libraries to use the web's most common data serialization format! Here's a quick preview of what the new JSON support looks like! Links Demo repo: github.com/ChristianAlexander/json-otp-27 Screen recording software I use (affiliate): screen.studio/@Yy75o
GitHub's Secret Blocks
Переглядів 1,8 тис.7 місяців тому
GitHub's Secret Blocks
How to Track Faces in Live Video with Elixir: Quick Tutorial
Переглядів 1,4 тис.7 місяців тому
How to Track Faces in Live Video with Elixir: Quick Tutorial
Boost Your AI Projects: Cloud GPUs + Elixir (Step-by-Step)
Переглядів 1,3 тис.8 місяців тому
Boost Your AI Projects: Cloud GPUs Elixir (Step-by-Step)
Transcribe Podcasts with Whisper AI & Elixir in Livebook
Переглядів 1,6 тис.8 місяців тому
Transcribe Podcasts with Whisper AI & Elixir in Livebook
Build a React JS Full Text Search - No Backend Needed
Переглядів 2219 місяців тому
Build a React JS Full Text Search - No Backend Needed
Real-Time Techniques: Polling, Long Polling, Server-Sent Events & WebSockets
Переглядів 4509 місяців тому
Real-Time Techniques: Polling, Long Polling, Server-Sent Events & WebSockets
Build a GPT Haiku Generator (Simple AI Tutorial)
Переглядів 210Рік тому
Build a GPT Haiku Generator (Simple AI Tutorial)
Fine-Tuning GPT 3.5: From Generalist to Specialist
Переглядів 2,5 тис.Рік тому
Fine-Tuning GPT 3.5: From Generalist to Specialist
Building a ChatGPT Slackbot with Javascript
Переглядів 494Рік тому
Building a ChatGPT Slackbot with Javascript

КОМЕНТАРІ

  • @dwylhq874
    @dwylhq874 4 дні тому

    Great intro to :json.encode/decode Christian. Subbed. 🔔

  • @NullViewer
    @NullViewer 11 днів тому

    querySelectorAll() is not efficient.

  • @alexeycherkashin6251
    @alexeycherkashin6251 17 днів тому

    Great,thank you for the overview

  • @iosif6073
    @iosif6073 21 день тому

    Very good man, keep it up with the upcoming versions 😁

  • @wpftutorial
    @wpftutorial 22 дні тому

    followed great video dude

  • @tevoj
    @tevoj 25 днів тому

    Such a good content! Thanks!

  • @dhonydev
    @dhonydev 26 днів тому

    As always, outstanding content. Thanks.

  • @jordelver
    @jordelver 26 днів тому

    Great concise video. Thank you!

  • @victorkarlsson5183
    @victorkarlsson5183 26 днів тому

    Great video and presentation. Subscribed! Looking forward to more content.

  • @anishsekhar1702
    @anishsekhar1702 26 днів тому

    Nice, concise video with everything well explained. good stuff!

  • @MathewWarger
    @MathewWarger 26 днів тому

    You mentioned that everyone should be using async: true on tests. If that's true, why is it not the default? Do you think it should be the default?

    • @CodeAndStuff
      @CodeAndStuff 26 днів тому

      It’s a balance between safety and performance, where two tests might contend over a shared resource like a file or a port. Safety is a good default, but in practice most tests won’t fail in this way.

  • @2mbst1
    @2mbst1 27 днів тому

    Nice! I always wrote a simple for loop to create table tests. Great to have first class support for them now!

  • @diogonunescarvalho2439
    @diogonunescarvalho2439 27 днів тому

    Do you have any tips for those who want to start learning Elixir? A book or something like that...

    • @toxtethogrady4610
      @toxtethogrady4610 27 днів тому

      Elixir docs.

    • @CodeAndStuff
      @CodeAndStuff 26 днів тому

      The third edition of Elixir in Action is the most recent entrypoint to Elixir: www.manning.com/books/elixir-in-action-third-edition

    • @diogonunescarvalho2439
      @diogonunescarvalho2439 26 днів тому

      @@toxtethogrady4610 thank you!!

  • @shahryartavakkoli
    @shahryartavakkoli 27 днів тому

    Whoa, this video was turbo speed! Like, seriously, well played! 👏😄

    • @CodeAndStuff
      @CodeAndStuff 27 днів тому

      I wasn’t sure when the RC would come out but I did this research and recorded a few weeks ago. I don’t cover JSON, but I think it’s fine!

  • @elchemista
    @elchemista 27 днів тому

    Good stuff! 🎉

  • @SlimShady-gs8pl
    @SlimShady-gs8pl Місяць тому

    It's time!

  • @jeromeschaeffer2915
    @jeromeschaeffer2915 Місяць тому

    This is a very easy and comprehensive video, well done. the video and examples were so well made I want to watch more.

  • @hunger997
    @hunger997 Місяць тому

    Excellent. Most materials on YT either (try to) explain the general concept of SSO, or already dive into details of particular flows or schemas. This one is spot on as an overview for technical audience. Congratulations.

  • @matheuscruz6195
    @matheuscruz6195 Місяць тому

    Wow, this is a hell of a good video. Thanks for such a detailed and easy-to-follow video. Acquired a new sub!

  • @AndreasDonig
    @AndreasDonig Місяць тому

    Awesome 👍

  • @pixelriegel
    @pixelriegel Місяць тому

    Does a package like Rustler exist but for golang?

    • @CodeAndStuff
      @CodeAndStuff Місяць тому

      I don't know of one with the same level of integration and tooling. I think Go programs tend to use CGo and Rust binaries compiled with FFI bindings (like UniFFI). I've only done CGo with C libraries, so I don't have direct experience with Rust integrations.

    • @pixelriegel
      @pixelriegel Місяць тому

      @@CodeAndStuff No no I mean I want to integrate a golang library that exports C libraries into elixir.

    • @CodeAndStuff
      @CodeAndStuff Місяць тому

      Oh, sorry for the misunderstanding! There isn't a Go equivalent to Rustler that I've seen. There have been some experiments compiling Go to wasm and running that wasm in Elixir (yasoob.me/posts/running-go-web-assembly-from-elixir/). Someone did play around with Go NIFs in 2018, but it doesn't look like it went anywhere (github.com/paulcager/gerlang). The latest thread I could find in Elixir Forum for writing NIFs in Go was from 2017, where the recommendation was to use Ports instead of NIFs (elixirforum.com/t/is-there-a-way-to-write-nifs-in-go/10638/6). These are the docs for Ports: www.erlang.org/doc/system/c_port.html

  • @BorisBarroso
    @BorisBarroso Місяць тому

    Thanks for the great tutorial. How does this compare to phoenix_live_react?

    • @CodeAndStuff
      @CodeAndStuff Місяць тому

      Thanks! I haven't tried phoenix_live_react yet, but if it's anything like live_svelte I imagine that it's quite different from Interita. Inertia primarily solves the problem of establishing APIs to fetch data for a page, without using LiveView / Phoenix Channels. It originally came out of the Laravel PHP community and the backend API was ported over to Elixir. On the other hand, live_svelte (and I assume phoenix_live_react) actually use the LiveView websocket to interact with the backend. This provides capabilities like pushing data updates to the client and participating in Phoenix PubSub. That's not to say you can't do PubSub in an Inertia app-you'd just have to mount the Phoenix Channel yourself. Hopefully that makes sense! If you want to know more about live_svelte, I have a video on it here: ua-cam.com/video/LBYQ_NLVKCw/v-deo.html

    • @BorisBarroso
      @BorisBarroso Місяць тому

      @ thanks for your answer. I use it inertia in a rails project and I really like it. I wonder if it makes sense to use in phoenix if there is livesvelte or live_react. It solves a different problem but anyway liveview is amazing since it basically improves the default controller view working well with SEO

  • @daskog
    @daskog Місяць тому

    Great videos! Love it! Thank you! + 1 sub

  • @zoedsoupe
    @zoedsoupe Місяць тому

    phoenix live view n elixir 💜

  • @geeksy2278
    @geeksy2278 Місяць тому

    Thank you so much. Can’t wait to try it out. BTW what’s the font you use in your Editor? Really like it

    • @CodeAndStuff
      @CodeAndStuff Місяць тому

      I never thought I’d pay for a font, but Berkeley Mono won me over.

    • @geeksy2278
      @geeksy2278 Місяць тому

      @ thank you so much! 🙏

  • @solvm1652
    @solvm1652 2 місяці тому

    First off, everyone should venture into making their own Mix.Tasks. It's cool to to see how these builtin powers of Elixir are being used to do some cool stuff easily.

  • @garyhe5482
    @garyhe5482 2 місяці тому

    Good video, remind me a lot about shadcn

    • @shahryartavakkoli
      @shahryartavakkoli 2 місяці тому

      We try to provide a better experience and much more possibilities over time than JS libraries

  •  2 місяці тому

    Great stuff! Thanks for sharing, I will check it!

  • @norbertocammayo2334
    @norbertocammayo2334 2 місяці тому

    Much better than shadcn-ui in terms of maintainability and control. Thanks!

    • @shahryartavakkoli
      @shahryartavakkoli 2 місяці тому

      We will try to refatctor the ui and add more components to be better in terms of ui too. thank you for your support

    • @norbertocammayo2334
      @norbertocammayo2334 2 місяці тому

      @ thank you for authoring a very useful library that could potentially be widely adopted

    • @shahryartavakkoli
      @shahryartavakkoli 2 місяці тому

      @@norbertocammayo2334 ♥♥

  • @iamyasha
    @iamyasha 2 місяці тому

    Good

  • @bengoosman5201
    @bengoosman5201 2 місяці тому

    If I modify the generated component, update the library, and re-run the generator, how do the new generations merge in with my changes?

    • @QuentinDurot
      @QuentinDurot 2 місяці тому

      I think it wouldn't, however the git diff should be enough to sort this out by yourself

    • @bengoosman5201
      @bengoosman5201 2 місяці тому

      @@QuentinDurot Got it. So the onus is on the library user to merge in upstream changes to generated components.

    • @Mona_Aghili
      @Mona_Aghili 2 місяці тому

      Hello, dear friend. I put a lot of thought into this during development. The generator shows you the diff, and as a developer, you need to manage itوthere's no other way around it. Even if there wasn't a generator and you used an independent plugin, you would always have the latest version.

    • @Mona_Aghili
      @Mona_Aghili 2 місяці тому

      However, we followed a unified approach across the entire component and will continue to improve it in the future. Each component has a property named class, which essentially serves as your custom class, so there’s no need to modify the component itself.

  • @Mona_Aghili
    @Mona_Aghili 2 місяці тому

    I genuinely appreciate the time and effort you put into creating this video. Your feedback are incredibly valuable, and it’s exciting to see others exploring and engaging with the project. We’re working hard to improve it and truly value community input like yours. I hope you make more videos about it in the future. Thanks again!

  • @shahryartavakkoli
    @shahryartavakkoli 2 місяці тому

    This short video was everything I imagined. It even covers some features we forgot to highlight in the documentation. Thank you for all your hard work and feedback. The issues will be resolved on the master branch as soon as possible. This video is the perfect starting point for developers to begin.

  • @awksedgreep
    @awksedgreep 2 місяці тому

    Thank you! Thank you! Been waiting for this video.

  • @mzerone-g6m
    @mzerone-g6m 2 місяці тому

    Awesome

  • @zfarahx
    @zfarahx 2 місяці тому

    You rock!

  • @avaneeshc
    @avaneeshc 2 місяці тому

    I really enjoyed this video!, can you please make a video with phoenix elixir api authentication with svelte. It would be really appreciated.

    • @CodeAndStuff
      @CodeAndStuff 2 місяці тому

      Thanks for the feedback and the suggestion! I'll consider it in the future. In the mean time, I have covered live_svelte which has a very interesting and productive developer experience.

  • @jsonkody
    @jsonkody 2 місяці тому

    well $hit .. this quality is comparable with Fireship :O .. and it's about Elixir / Phoenix where I am switching right now from JS madness :O 🙌 perfection!

    • @CodeAndStuff
      @CodeAndStuff 2 місяці тому

      Thanks for the very kind feedback, and welcome to Elixir and Phoenix!

  • @BorisBarroso
    @BorisBarroso 2 місяці тому

    I'm coming back to Elixir since the end of 2017 and I found your channel and it has great tutorials. Thanks for sharing your experiments. I can't believe how much Elixir has grown there are so many so great projects and Livebook is insane.

    • @CodeAndStuff
      @CodeAndStuff 2 місяці тому

      Thanks, and welcome back to Elixir!

  • @zfold4702
    @zfold4702 2 місяці тому

    Why does this sound like Htmx? Are these both trying to do.same thing or are different? Thank you for this video

    • @CodeAndStuff
      @CodeAndStuff 2 місяці тому

      Htmx and LiveView JS commands are similar, but different. While they both use HTML attributes to provide frontend and backend interactions, Htmx attributes are directly written and perform API calls. On the other hand, LiveView JS commands are written in Elixir and serialized to an HTML attribute by the LiveView renderer. These commands don't perform API calls, instead relying on the websocket connection to the corresponding server process and receiving compact diffs in response.

    • @zfold4702
      @zfold4702 2 місяці тому

      @CodeAndStuff Thank you very much for explaining this. Appreciate your efforts. Then this is closer to SignalR

  • @wo11ucks
    @wo11ucks 2 місяці тому

    I can tell that an Ash walkthrough from you would be excellent!

  • @Sorc47
    @Sorc47 2 місяці тому

    I just found your channel and I can't believe how few subscribers you have. This is some top quality content!

    • @zfarahx
      @zfarahx 2 місяці тому

      Same here. Subscribed !

  • @HerrSiering
    @HerrSiering 2 місяці тому

    Coming from years of frontend development, you using tabular-nums in there *really* made this great :D I love slapping that class onto any numbers in any table. I even stopped telling designers about it, they sometimes notice and really appreciate that nice little touch.

    • @CodeAndStuff
      @CodeAndStuff 2 місяці тому

      I’m glad I’m not the only one! Font designers put so much work into variants all for us to just use the default and move on.

  • @Kryptonis
    @Kryptonis 2 місяці тому

    What if you wanted to extend this example by having some sort of refresh or live reload happen when the timer hit zero? Would you be able to use a Hook to send an event to the server from the JS code?

    • @CodeAndStuff
      @CodeAndStuff 2 місяці тому

      Hooks are able to push to the server through the pushEvent method: hexdocs.pm/phoenix_live_view/js-interop.html#client-server-communication

  • @Kryptonis
    @Kryptonis 2 місяці тому

    Seriously good walkthrough of the JS commands. Thank you! You mentioned that the next version of Phoenix won't come with a modal, why is that? It seems like it's a common and important component to have.

    • @CodeAndStuff
      @CodeAndStuff 2 місяці тому

      Thanks! I found out about the modal removal from core_components while researching this video. It turns out modals won't be used in UIs generated by the phx mix tasks, so this PR removed the modal when changing the generator: github.com/phoenixframework/phoenix/pull/5900

  • @abujessica
    @abujessica 2 місяці тому

    I got in love with elixir through you and another youtuber, and you both mention the amazing stuff about elixir that are not live-view related Where can I learn about the awesome stuff you can do with a genserver and a websocket in pheonix?

  • @PhilKingstonByron
    @PhilKingstonByron 3 місяці тому

    Great work. Thank you.

  • @brunoanken3571
    @brunoanken3571 3 місяці тому

    Amazing video!

  • @parthranawat5748
    @parthranawat5748 3 місяці тому

    I may have watched atleast 20 videos and this is the one I have liked. Keep up the good work!

  • @thisismissem
    @thisismissem 3 місяці тому

    This is really good, but PKCE is now recommended as a best practice for all client types, as is issuer identification

    • @thisismissem
      @thisismissem 3 місяці тому

      I'd highly recommend reading through the IETF draft for OAuth 2 Security Current Best Practices - it explains those more and what threat vectors exist. In decentralised landscapes like say Mastodon* and the Fediverse, there's also an initial flow known as Dynamic Client Registration, and a new internet draft I'm co-authoring called Client ID Metadata Documents, which tackle obtaining a client_id and potential client_secret without having to register with the authorization server ahead of time. *Mastodon doesn't currently implement DCR, but something similar to it.