Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
defmodule I do
def cls, do: IO.puts("\ec")
def qt(m, f \\ :_) do
:recon_trace.calls(
{m, f, :return_trace},
{100, 10000},
pid: :all,
scope: :local,
stack: :return
@dch
dch / .iex.exs
Created February 20, 2024 11:27
dch custom iex prompt, put in ~/.iexs
defmodule I do
def cls, do: IO.puts("\ec")
def qt(m, f) do
:recon_trace.calls(
{m, f, :return_trace},
{100, 10000},
pid: :all,
scope: :local,
stack: :return
@dch
dch / recover.sh
Last active February 9, 2024 06:23
tarsnap hacky parallel restore script
#!/bin/sh
# recover all files in parallel from the most recent archive
# MIT license
# https://git.io/vdrbG
# "works on my machine"
# lots of assumptions notably path length (strip-component)
# get the latest archive as our names can be sorted by time
ARCHIVE=`tarsnap --keyfile /tmp/tarsnap.key --list-archives | sort | tail -1`
@dch
dch / beetroot_risotto.md
Created February 1, 2024 15:01
beetrtoot risotto
  • fry a few onions
  • add salt and grated beetroot
  • add risotto rice and thyme
  • cook a few minutes
  • add red wine, stock, water slowly
  • stir in parmesan cheese or feta
  • serve with chopped walnuts or similar
  • rock a sprinkle of green chives or rucola
@dch
dch / pot-stickers.md
Last active January 7, 2024 22:12
Asian Dumplings or Piryogi
@dch
dch / chilli.md
Created January 7, 2024 21:47
chilli beans

ingredients

  • 2 red peppers, diced
  • 4 onions, sliced
  • 4 cloves garlic, chopped
  • 3 carrots, grated
  • 2 tins red beans, washed & drained
  • 1 tin white beans, washed & drained
  • 1 tin corn kernels, washed & drained
  • 2 tins peeled or diced tomatoes
@dch
dch / lentils.md
Last active January 7, 2024 21:37
Syrian shorbit adas lentil soup
@dch
dch / websockets-with-gun.ex
Created September 15, 2015 21:52 — forked from ashneyderman/gist:5eca8b1bed16a7b6f4be
Use of gun from elixir
defmodule Transport do
def connect(params) do
hostname = params.hostname
port = params.port
path = params.path
timeout = params.connection_timeout
{:ok, conn} = :gun.open(hostname, port)
{:ok, :http} = :gun.await_up(conn)
:gun.ws_upgrade(conn, path)
@dch
dch / 20150131_grandpas_sourdough_recipe.md
Last active December 30, 2023 20:19
Grandpa's sourdough recipe

Grandpa's Sourdough Bread Recipe

January 2015

  • adapted for use with an ambient room temperature of about 20 degrees

  • uses existing starter

  • see instructions below for making starter if none is available

Awaken the starter