Skip to content

Instantly share code, notes, and snippets.

📝

Rory Hart hartror

📝
View GitHub Profile
@hartror
hartror / awsume.fish
Created Mar 4, 2018
A minimal translation of the awsume bash file for the fish shell.
View awsume.fish
#!/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 Sep 23, 2017
AWS API Gateway Custom Authorizer PEP8'd
View authorizer.py
"""
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
View keybase.md

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 Dec 11, 2018
Rory's Reading List
View reading-list.md
View gist:21b26533dea3e5c89c23
(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 Dec 23, 2014
Finding safe ways to limit a forked proccess's memory in Python.
View limit.py
#!/usr/bin/env python
import os
import psutil
import resource
import subprocess
import sys
import time
View gist:5beea8e46c7b5283a37d
import pytest
import pypact
# 1. Start with your model
class Something(object):
def __init__(self, name):
self.name = name
You can’t perform that action at this time.