Skip to content

Instantly share code, notes, and snippets.

View DavidAntaramian's full-sized avatar

David Antaramian DavidAntaramian

View GitHub Profile
@DavidAntaramian
DavidAntaramian / exunit_assert_order.exs
Last active February 10, 2017 00:35
ExUnit Test for whether one element appears before another in a list
defmodule ExUnitAssertOrder do
def assert_order(list, first, second) do
assert_order(list, first, second, nil)
end
def assert_order([], first, second, first) do
raise ExUnit.AssertionError, message: "Encountered #{first}, but never encountered #{second}"
end
def assert_order([], first, second, second) do
defmodule Stripe.PaymentMethod do
@spec list(Account.id, Keyword.t) :: {:ok, boolean, [t] | []} | {:error, Exception.t}
def list(account_id, opts \\ []) do
query =
%{
object: "card",
ending_before: Keyword.get(opts, :ending_before),
limit: Keyword.get(opts, :limit),
starting_after: Keyword.get(opts, :starting_after)
}

Solving the Maze

Your instructions here are simple, but the implementation not so much. The goal is to build a maze solver that takes a string as input and returns the (x,y) coordinates of the goal location. The maze is as follows:

00000000000000E00000000000
00011110101010101000000100
00000011111111111111111100
00000000000000E00000000000
00011110101010101000000100
00000011111111111111111100
00000010101010101010100000
00011111111110001010100000
000X0000000000000000000000
@DavidAntaramian
DavidAntaramian / keybase.md
Last active January 16, 2017 17:17
Keybase proof file

Keybase proof

I hereby claim:

  • I am davidantaramian on github.
  • I am davidantaramian (https://keybase.io/davidantaramian) on keybase.
  • I have a public key ASBIaujkzwm8AMk1HS0hrqFDt0NfehMqteY3e649gekg-wo

To claim this, I am signing this object:

defmodule Johnann do
def john(day) when day >= 1 do
get(day, :john)
end
def ann(day) when day >= 1 do
get(day, :ann)
end
def sum_john(day) when day >= 1 do
test:
override:
- mix test
machine:
environment:
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH"
MIX_ENV: test
dependencies:
pre:
- if ! asdf | grep version; then git clone https://github.com/asdf-vm/asdf.git ~/.asdf; fi
- asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git || true
- asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git || true
- asdf install
- mix local.hex --force
- mix local.rebar --force
override:
- mix deps.get
machine:
environment:
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH"
MIX_ENV: test
dependencies:
pre:
- if ! asdf | grep version; then git clone https://github.com/asdf-vm/asdf.git ~/.asdf; fi
- asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git || true
- asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git || true