Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am mmzyk on github.
* I am mmzyk (https://keybase.io/mmzyk) on keybase.
* I have a public key ASCtjDrbDu9hzhUQGes56eR_w8zlNmNl3r3nkB4aEkMhWAo
To claim this, I am signing this object:
@mmzyk
mmzyk / system-engineer-work-sample.md
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
@mmzyk
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)
begin
yield
rescue Exception => e
if elapsed_time >= time
raise e
else
sleep increment
wait(time, increment, elapsed_time + increment, &block)
@mmzyk
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
mmzyk / readlink.rb
Created November 18, 2011 17:32
Win API File abstraction calls
@mmzyk
mmzyk / win_symlink_detect.rb
Created November 17, 2011 16:38
FFI symlink detection
%% 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);
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?