Skip to content

Instantly share code, notes, and snippets.

View hl's full-sized avatar
🛼

Henricus Louwhoff hl

🛼
View GitHub Profile
@swalkinshaw
swalkinshaw / tutorial.md
Last active February 26, 2025 21:15
Designing a GraphQL API
@pyrmont
pyrmont / build.yaml
Created May 21, 2020 17:43
A simple GitHub Actions workflow for CI testing with Janet
name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
@mcrumm
mcrumm / phx_sqlite_fly_launch.md
Last active March 19, 2025 21:03
Phoenix + SQLite Deployment tips

Deploying to Fly.io with SQLite

Deploying a Phoenix app to Fly.io is a breeze...is what everyone kept telling me. In fairness, I imagine the process would have been breezier had I just used postgres, but all the sqlite and litestream talk has been far too intriguing to ignore. "Wait", you say. "It is just a flat file. How much harder can it be?"

It is easy to make something harder than it should be. It is hard to take something complex and make it truly simple. flyctl launch does an amazing job at providing a simple interface to the utterly complex task of generating deployment resources, especially now that we are living in a containerd (erm, firecracker) world.

This gist is for anyone who, like me, thinks they know better than to read all of the documentation and therefore necessari

defmodule Module.Extend do
@doc """
Extend a module (i.e. define `defdelegate` and `defoverridable` for all functions from the source module in the current module.
Usage:
import Module.Extend
extend_module Common.Text
"""
defmacro extend_module(module) do
require Logger
@paulo-ferraz-oliveira
paulo-ferraz-oliveira / recon_trace_format.md
Last active July 12, 2023 08:31
Shows an (Elixir) example of tracing HTTPoison's :request and extracting from the call and the return value, using Fred Hebert's recon

Tracing in Elixir with :recon, and formatter

I tend to not remember how this is done, so here goes, for easier copy-paste effect:

:recon_trace.calls(
  {_mod = HTTPoison, _fun = :request, fn ([_, _, _, _, _]) -> :return_trace end},
  _calls = 10,
  [scope: :local,
 formatter: fn (tuple) ->