Skip to content

Instantly share code, notes, and snippets.

@jimm
jimm / my_gen_server.ex
Created January 31, 2019 14:57
Sample Elixir GenServer
defmodule MyGenServer do
use GenServer
use Blister.MIDI.IO, type: :input
require Logger
defmodule State do
defstruct [:io, :connections, :listener]
end
# ================ Public API ================
@jimm
jimm / pingpong_with_count.exs
Created January 31, 2019 14:49
Elixir process receive loop / state / response example
#!/usr/bin/env elixir
defmodule Sync do
def pingpong do
# Create process and save pid.
child = spawn(Sync, :loop, [0]) # module, sym, args
# Send some messages to the child
send(child, {self(), :count})
@jimm
jimm / keybase.md
Created May 15, 2015 02:25
Keybase identity verification

Keybase proof

I hereby claim:

  • I am jimm on github.
  • I am jimm (https://keybase.io/jimm) on keybase.
  • I have a public key whose fingerprint is 2BFF 5920 1EDF 9AF3 E6B5 CF39 8B63 03CC BABB 828B

To claim this, I am signing this object: