Skip to content

Instantly share code, notes, and snippets.

Eric Dykstra EricDykstra

Block or report user

Report or block EricDykstra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View advent_of_code_2016_d1_p1.rb
def change_state(xstate, d)
directions = "NESW"
i = "NESW".index(xstate)
if d == "R"
directions[i+1] ? directions[i+1] : "N"
directions[i-1] ? directions[i-1] : "W"
View advent_of_code_2016_d1_p1.ex
defmodule Day1 do
def main(file_path) do
file_path |>! |> process |> IO.puts
def process(input) do
|> String.split(", ")
|> Enum.reduce(%{x: 0, y: 0, dir: "N"}, &reducer/2)
|> extract_answer

Keybase proof

I hereby claim:

  • I am ericdykstra on github.
  • I am ericd ( on keybase.
  • I have a public key ASAv966Qu1nq0p8ibkcTXgdP5DYqGCMXbNA-FMJWrNKEQQo

To claim this, I am signing this object:

View hr.erl
% ...
read_array(0,D) -> [];
read_array(N,D) ->
{ok, [X]} = io:fread("", D),
[X | read_array(N-1,D)].
read_2darray(0,M,D) -> [];
read_2darray(N,M,D) ->
[Q | read_2darray(N-1,M,D)].
EricDykstra / gist:3f97d9e052e3a8b99650
Created Feb 17, 2016
Compile and run elixir script
View gist:3f97d9e052e3a8b99650
function exrun() {
mix && ./${PWD##*/}
View advent_of_code_day_24.rb
# uncomment for part 1 num_groups = 3
# uncomment for part 2 num_groups = 4
start = 1
until answer = array.combination(start).select{|c| c.inject(:+) == (array.inject(:+) / num_groups)}.sort_by{|c| c.inject(:*)}.first
start += 1
p answer.inject(:*)
View advent_of_code_day_22.rb
class Battle
"Magic Missile" => {cost: 53, damage: 4},
"Drain" => {cost: 73, damage: 2, heal: 2},
"Shield" => {cost: 113, timer: 6, effect: "armor", amount: 7},
"Poison" => {cost: 173, timer: 6, effect: "poison", amount: 3},
"Recharge" => {cost: 229, timer: 5, effect: "recharge", amount: 101},
EricDykstra /
Last active Aug 29, 2015
Hiring Efficiency Problem

You've just been hired by a SF tech company that is looking to expand operations into new cities. Your first task: launch Salt Lake City. To launch into a new city of this size, you need to hire a general manager, 3 salespeople, 2 customer support agents, an office manager, and a marketing manager. You have pulled together a list of all the potential employees for these 8 positions, as well as their salary requirement and a quantified amount of "impact" that they can bring your team.

Your goal is to fill all 8 positions for $350,000 or less with the employees that will maximize "impact".

Not challenging enough? 5500 candidates applied to the same 8 positions for the New York City office, and our budget here is $450,000. Maximize impact while staying under budget again with this group.


Keybase proof

I hereby claim:

  • I am ericdykstra on github.
  • I am ericd ( on keybase.
  • I have a public key whose fingerprint is 0F12 55A0 3A2A C56E F189 219D E653 1EE6 9498 4DB9

To claim this, I am signing this object:

EricDykstra / index.html
Created Jul 8, 2013 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
View index.html
<!doctype html>
<link rel="stylesheet" href="">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href=",400,600,700,800">
<link rel="stylesheet" href=",900">
<link rel="stylesheet" href="">
You can’t perform that action at this time.