Thanks to the original blog post: https://equimper.com/blog/how-to-setup-tailwindcss-in-phoenix-1.4
cd assets
npm i --save-dev tailwindcss postcss-loader postcss-import
def index(conn, _params) do | |
conn = conn | |
|> put_resp_content_type("text/csv") | |
|> put_resp_header("content-disposition", "attachment; filename=export.csv") | |
|> send_cunked(200) | |
Repo.transaction fn -> | |
Ecto.Adapters.SQL.stream(Repo, "COPY expensive_report TO STDOUT CSV HEADER") | |
|> Stream.map(&(chunk(conn, &1.rows))) | |
|> Stream.run |
Thanks to the original blog post: https://equimper.com/blog/how-to-setup-tailwindcss-in-phoenix-1.4
cd assets
npm i --save-dev tailwindcss postcss-loader postcss-import
defmodule DateTimeParser do | |
@mapping %{ | |
"H" => "(?<hour>\\d{2})", | |
"I" => "(?<hour12>\\d{2})", | |
"M" => "(?<minute>\\d{2})", | |
"S" => "(?<second>\\d{2})", | |
"d" => "(?<day>\\d{2})", | |
"m" => "(?<month>\\d{2})", | |
"y" => "(?<year2>\\d{2})", | |
"Y" => "(?<year>-?\\d{4})", |