Executing OS processes using Elixir Ports

Ports in Elixir provide us an interface for communicating with external processes by sending and receiving messages. They make it easy to start and ma...
Deankinyua

Deankinyua

4 days ago

Speed up Phoenix with ETS content caching and TTL expiration

Database queries for content-heavy pages become performance bottlenecks fast. Redis adds infrastructure complexity. ETS gives you microsecond lookups ...
almirsarajcic

almirsarajcic

6 days ago

Fine tuning routing for a better UX

Phoenix gives you a very cool and easier way to fine tune your routing and be able to effectively handle cases where, say a user has a typo in the url...
jrowah

jrowah

6 days ago

Verifying Replicate Signatures

Replicate is a platform for running AI models without having to worry about setting up infrastructure. A more simple definition would be "The Cloud bu...
Deankinyua

Deankinyua

12 days ago

Using `@impl Phoenix.LiveView` instead of `@impl true` for clear callback contracts

Stop using @impl true in your Phoenix modules. The Elixir compiler provides much better safety and clarity when you specify the exact behaviour module...
almirsarajcic

almirsarajcic

14 days ago

Sandbox modes in Ecto Testing

A sandbox is an isolated testing environment that enables users to run programs or open files without affecting the application, system or platform on...
Deankinyua

Deankinyua

20 days ago

Pass arguments to Mix aliases with anonymous functions

Need to pass command-line arguments to your Mix aliases? Use anonymous functions instead of strings to capture and forward arguments....
almirsarajcic

almirsarajcic

20 days ago

Extracting repeated type specs to module-level `@type` declarations

Tired of Dialyzer warnings and repetitive type declarations? Clean up your specs by extracting repeated types to the module level. Your code becomes m...
almirsarajcic

almirsarajcic

27 days ago

Debugging GenServer state with `:sys.get_state`

Ever wondered what's actually inside your GenServer's state when things go wrong? Instead of adding debug prints or crashing the process, you can peek...
almirsarajcic

almirsarajcic

1 month ago

Asynchronous operations in Phoenix LiveView

What do you understand by the term "Expensive Computations"? Theoretical computer science defines them as the ones taking the most memory and time to ...
Deankinyua

Deankinyua

1 month ago

Inline CSS in Phoenix email templates

Most email clients don't support linked stylesheets, so you need to inline CSS for proper email rendering. Instead of manually copying styles or using...
almirsarajcic

almirsarajcic

1 month ago

Pattern matching on Bitstrings

Assume that you have a long string of text that you want to display to the user. You want to display a maximum of 60 characters and add an ellipsis if...
Deankinyua

Deankinyua

1 month ago

Fixing Wallaby's "Invalid Session ID" Error

When running Wallaby integration tests in your Phoenix application, you might encounter this cryptic error:...
almirsarajcic

almirsarajcic

1 month ago

Using the "Use" Elixir Macro

Suppose you have the following module directives in your current module:...
Deankinyua

Deankinyua

1 month ago

Offset-based pagination in Elixir

Pagination is a technique used to break a large dataset into manageable “pages” (chunks) of results. It’s essential for: + UI rendering (e.g., showin...
Deankinyua

Deankinyua

1 month ago