Skip to content

Instantly share code, notes, and snippets.

View philss's full-sized avatar
💭
I may be slow to respond.

Philip Sampaio philss

💭
I may be slow to respond.
  • Brazil
  • 00:11 (UTC -03:00)
View GitHub Profile
@philss
philss / Dockerfile
Created February 20, 2018 03:25
Example of Dockerfile for a Phoenix App
FROM elixir:1.6.0-alpine
RUN mix local.hex --force \
&& mix local.rebar --force \
&& apk --no-cache --update add postgresql-client bash \
&& rm -rf /var/cache/apk/* \
&& mkdir /app
COPY . /app
WORKDIR /app
@philss
philss / oban-output.txt
Created June 7, 2019 14:04
Oban output after crashing without finding the table
22:27:17.495 [error] GenServer Oban.Pruner terminating
** (Postgrex.Error) ERROR 42P01 (undefined_table) relation "oban_jobs" does not exist
query: DELETE FROM "oban_jobs" AS o0 USING (SELECT o0."id" AS "id", o0."state" AS "state", o0."queue" AS "queue", o0."worker" AS "worker", o0."args" AS "args", o0."errors" AS "errors", o0."attempt" AS "attempt", o0."max_attempts" AS "max_attempts", o0."attempted_at" AS "attempted_at", o0."completed_at" AS "completed_at", o0."inserted_at" AS "inserted_at", o0."scheduled_at" AS "scheduled_at" FROM "oban_jobs" AS o0 WHERE (o0."state" IN ('completed','discarded')) ORDER BY o0."id" DESC OFFSET $1) AS s1 WHERE (o0."id" = s1."id")
(ecto_sql) lib/ecto/adapters/sql.ex:618: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto_sql) lib/ecto/adapters/sql.ex:551: Ecto.Adapters.SQL.execute/5
(oban) lib/oban/pruner.ex:44: Oban.Pruner.handle_info/2
(stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:388: :gen_server.loop/7
(stdlib) proc_lib.erl:249: :proc_lib.init

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@philss
philss / docker-compose.yml
Created December 24, 2019 20:22
Docker compose config with Elixir artifacts not being shared with host
version: "3.3"
services:
db:
image: postgres:11.1-alpine
ports:
- "5432:5432"
app:
env_file: .env
build:
context: .
@philss
philss / mix.exs
Created December 24, 2019 20:25
Mix project with a flexible config for the Elixir artifacts
defmodule MyApp.MixProject do
use Mix.Project
def project do
[
app: :my_app,
version: "0.1.0",
elixir: "~> 1.5",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
@philss
philss / bench-from-list.md.livemd
Created March 17, 2022 17:40
Compare from_list/1 and from_map/1

Benchmark Explorer.DataFrame.from_list/1

Deps

Mix.install([
  {:benchee, "~> 1.0.0"},
  {:explorer, github: "kimjoaoun/explorer", branch: "joao/from_list"}
])