Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am mmzyk on github.
* I am mmzyk ( on keybase.
* I have a public key ASCtjDrbDu9hzhUQGes56eR_w8zlNmNl3r3nkB4aEkMhWAo
To claim this, I am signing this object:
mmzyk /
Last active April 8, 2020 01:01
Spreedly Systems Engineer Work Sample - Payment Frame

Spreedly Systems Engineer Work Sample

Being a company founded by developers, it's in our DNA to automate as much as we can and deploy as often as possible in order to allow for rapid development, innovation, and reduced human error. Spreedly relies on many internal services for its infrastructure. Your role as a Systems Engineer at Spreedly will involve:

  • understanding how all the pieces that comprise the infrastructure fit together
  • knowing how best to maintain and secure that infrastructure
  • automating provisioning, testing, and maintenance as much as possible
  • measuring and monitoring system fitness
  • delivering services that other engineering teams can utilize in support of their development efforts
  • communicating well with the rest of the team and the wider technical community
%% Tells whether this user is the superuser.
is_superuser(Req) ->
UserName = list_to_binary(wrq:get_req_header("x-ops-userid", Req)),
is_superuser(UserName) ->
Superusers = envy:get(oc_chef_wm, superusers, [], list),
lists:member(UserName, Superusers).
Lines 5 to 7 is the existing function. I want to add lines 2 to 4. How can I make it guard so if it's a webmachine request object, it uses the first fun head and if not otherwise uses the 2nd?
mmzyk / cookbook_upload_test.rb
Last active December 10, 2015 22:58
A script to test uploading of cookbooks to Hosted Chef
#!/usr/bin/env ruby
NoteOnUsage = <<USAGE
This script allows you to upload multiple cookbooks automatically.
Use -d to download the cookbooks
Use -p to purge cookbooks
Using either option will require some user input
mmzyk / wait.rb
Created March 2, 2012 14:53
Function to retry rspec test w/ sleep
def wait(time, increment = 5, elapsed_time = 0, &block)
rescue Exception => e
if elapsed_time >= time
raise e
sleep increment
wait(time, increment, elapsed_time + increment, &block)
mmzyk / readlink.rb
Created November 18, 2011 17:32
Win API File abstraction calls
mmzyk / win_symlink_detect.rb
Created November 17, 2011 16:38
FFI symlink detection