Skip to content

Instantly share code, notes, and snippets.

View alexandraj777's full-sized avatar

Alexandra Johnson alexandraj777

View GitHub Profile
import logging
import boto3
from botocore.exceptions import ClientError, BotoCoreError
import requests
from requests import RequestException
def get_instance_name():
try:
@alexandraj777
alexandraj777 / role_policy.json
Last active October 26, 2017 05:05
AWS Lambda basic role policy document. Source: https://alestic.com/2014/11/aws-lambda-cli/
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
@alexandraj777
alexandraj777 / gist:0d1f0629acce0f7303b553b2c4173af6
Created October 27, 2016 22:03
Track tumblr blog post views with Segment's analytics.js
// This snippet goes in your tumblr html theme right after you've loaded the analytics.js library.
// Use this to replace analytics.page() in the generic analytics.js library setup code.
// Homepage blog views will be tracked as analytics.page("Blog", "Home"),
// whereas individual post views will be tracked as analytics.page("Blog", "Post") with metadata.
{block:PermalinkPage}
{block:Posts}
{block:Text}
{block:Title}
analytics.page("Blog", "Post", {
postTitle: "{PlaintextTitle}",