Skip to content

Instantly share code, notes, and snippets.

View adrianolisboa's full-sized avatar
🔭

Adriano Lisboa adrianolisboa

🔭
View GitHub Profile
@laurenfazah
laurenfazah / express_postgress_knex.md
Last active November 26, 2022 13:19
Cheat Sheet: Setting up Express with Postgres via Knex

Express & Postgres via Knex

Note: <example> is meant to denote text replaced by you (including brackets).

Setup

// global dependencies
npm install -g knex
defmodule NumberToWord do
@spec say(integer) :: String.t
def say(n), do: n |> say_io() |> IO.iodata_to_binary()
@spec say_io(integer) :: iodata
def say_io(1), do: "one"
def say_io(2), do: "two"
def say_io(3), do: "three"
def say_io(4), do: "four"
def say_io(5), do: "five"