Skip to content

Instantly share code, notes, and snippets.

@jimm
jimm / my_gen_server.ex
Created Jan 31, 2019
Sample Elixir GenServer
View my_gen_server.ex
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 Jan 31, 2019
Elixir process receive loop / state / response example
View pingpong_with_count.exs
#!/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
Keybase identity verification
View keybase.md

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: