Instantly share code, notes, and snippets.

View serverless-deploy-user.yaml
AWSTemplateFormatVersion: 2010-09-09
Description: >
Constructs a managed IAM policy to deploy a serverless project.
This template assumes the stack is being deployed in the current region and account.
You can then attach this policy to other IAM objects, such as users or roles.
Based on the work done in: https://github.com/serverless/serverless/issues/1439
View many_uniform_plots.py
import numpy as np
%matplotlib inline
from seaborn import tsplot
stars_planets = np.sort(0.05 + np.random.rand(100, 8), axis=1)
tsplot(np.log(stars_planets), err_style='unit_traces')
View proposal.py
import attr
class AutoValidator:
_expr = None
_counter = 0
def _newvar(self):
num = AutoValidator._counter
AutoValidator._counter += 1
return f'_v{num}'
View test_log_name_bug.py
template = '''
Resources:
LambdaLogGroup1234:
Type: "AWS::Logs::LogGroup"
Properties:
LogGroupName: !Join [ "", [ "/aws/lambda/", !Ref "AWS::StackName", "1234" ] ]
LambdaLogGroup:
Type: "AWS::Logs::LogGroup"
Properties: