Skip to content

Instantly share code, notes, and snippets.

View hartror's full-sized avatar
📝

Rory Hart hartror

📝
View GitHub Profile
@hartror
hartror / awsume.fish
Created March 4, 2018 09:51
A minimal translation of the awsume bash file for the fish shell.
#!/usr/bin/env fish
function awsume
set AWS_VARS "AWS_SECRET_ACCESS_KEY" "AWS_SESSION_TOKEN" "AWS_SECURITY_TOKEN" "AWS_ACCESS_KEY_ID" "AWS_REGION" "AWS_DEFAULT_REGION" "AWS_PROFILE" "AWS_DEFAULT_PROFILE" "AWSUME_PROFILE"
set AWSUME (string split " " (awsumepy))
set AWSUME_FLAG "$AWSUME[1]"
if test $AWSUME_FLAG = "usage:"
awsumepy -h
@hartror
hartror / authorizer.py
Created September 23, 2017 02:58
AWS API Gateway Custom Authorizer PEP8'd
"""
Copyright 2015-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use
this file except in compliance with the License. A copy of the License is
located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is distributed on an
@hartror
hartror / keybase.md
Created September 22, 2017 23:24
Keybase Proof

Keybase proof

I hereby claim:

  • I am hartror on github.
  • I am hartror (https://keybase.io/hartror) on keybase.
  • I have a public key ASC6o-FCmwOCM1oXR6qpEkLt-OQQ82-4LTyXn9h-L0mojwo

To claim this, I am signing this object:

@hartror
hartror / reading-list.md
Last active December 11, 2018 01:59
Rory's Reading List
@hartror
hartror / gist:21b26533dea3e5c89c23
Last active August 29, 2015 14:20
Pact API Options
(mock_service
.given("something exists")
.upon_receiving("a request for something")
.with_request(method="get", path="/something")
.will_respond_with(
status=200,
headers={'Content=Type': 'application/json'},
body={'name': 'A small something'}))
@hartror
hartror / limit.py
Created December 23, 2014 03:21
Finding safe ways to limit a forked proccess's memory in Python.
#!/usr/bin/env python
import os
import psutil
import resource
import subprocess
import sys
import time
import pytest
import pypact
# 1. Start with your model
class Something(object):
def __init__(self, name):
self.name = name