Skip to content

Instantly share code, notes, and snippets.

@sjava
sjava / repo.ex
Created September 22, 2021 16:14 — forked from c4710n/repo.ex
Ecto: reverse a preload
defmodule Hello.Repo do
use Ecto.Repo,
otp_app: :hello,
adapter: Ecto.Adapters.Postgres
@doc """
Reverse a preload.
## Example
@sjava
sjava / lesson_deref.md
Created August 6, 2024 07:06 — forked from Houtamelo/lesson_deref.md
Lesson - Deref

Introduction

This lesson aims to teach the reader about the inner-workings of Rust's *(deref operator) and trait Deref, as well as how to take advantage of those features.

Requirements

This lesson assumes that:

  • You have amateurish understanding of Rust's type system. Most importantly, understand that references are types, meaning &T, &mut T and T are all different types.

Terminology