Skip to content

Instantly share code, notes, and snippets.

View gist:386557abf120bc7030bf637cd97e9728
### 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 Apr 8, 2020
Spreedly Systems Engineer Work Sample - Payment Frame
View system-engineer-work-sample.md

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
View gist:0fc61cbf621d62469624
%% 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?
@mmzyk
mmzyk / cookbook_upload_test.rb
Last active Dec 10, 2015
A script to test uploading of cookbooks to Hosted Chef
View cookbook_upload_test.rb
#!/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 / wait.rb
Created Mar 2, 2012
Function to retry rspec test w/ sleep
View wait.rb
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 / readlink.rb
Created Nov 18, 2011
Win API File abstraction calls
View readlink.rb
@mmzyk
mmzyk / win_symlink_detect.rb
Created Nov 17, 2011
FFI symlink detection
View win_symlink_detect.rb