Skip to content

Instantly share code, notes, and snippets.

View ac360's full-sized avatar

Austen ac360

View GitHub Profile
# Components
### Component Strategy
* Focus on the use-cases we want to deliver.
* Write Components only for those, do not bother with breaking everything into a child Component.
* Focus on supporting those use-cases best and providing the best possible customer experience.
* Modularity and reusability is not a priority (at this time), only if necessary.
### Component & Dashboard Integration
@ac360
ac360 / v2-info-experience.md
Last active October 12, 2018 14:10
Serverless Framework V.2 - Info Experience

Info Experience

info() is a Component method that returns an javascript object that contains a summary of information about that component that is intended to easily communicate its most important information to humans, while :

const summary = componentInstance.info()

// { name: foo }
@ac360
ac360 / cloudevent-aws-s3-object-created.md
Last active May 14, 2018 17:19
This is a JSON representation of CloudEvent for AWS S3 Object Created
{
  // CloudEvents metadata data goes here
  "eventType": "aws.s3.object.created",
  "eventID": "C1234-1234-1234",
  "eventTime": "2018-05-08T14:48:09.769Z",
  "eventTypeVersion": "1.0",
  "source": "/cloudevents-bucket",
  "extensions": {},
 "contentType": "application/json",
@ac360
ac360 / example.js
Last active December 2, 2018 22:10
AWS Wrapper: Good or Bad?
// In the new ServerlessProviderAws class -----------------------------------
// A class method wraps all aws-sdk requests
request(service, method, params, stage, region) {
let awsService = new AWS[service](_this.getCredentials(stage, region)); // Easily set stage/region-specific credentials
let req = awsService[method](params); // Form an aws-sdk "request" so we can listen to all AWS SDK events throughout the framework
// Listen to any events we want (e.g., VALIDATE_CREDENTIALS)
@ac360
ac360 / gist:374ebd81734f973f663c
Last active January 29, 2016 12:52
Serverless Classes
// Project
let Project = new ServerlessProject(path);
Project._path // Private properties use '_'
Project.data.name // Public properties at root
Project.data.modules.slackbot.functions.functionFolder.functionName = 'newFunction';
Project.get() // Returns clone of unpopulated object
Project.getPopulated() // Returns clone of populated object
Project.save() // Persists
@ac360
ac360 / serverless.json
Last active January 29, 2016 12:52
Serverless Project In JSON
{
"name": "serverless-project",
"version": "0.0.1",
"profile": "serverless-0",
"location": "https://github.com/...",
"author": "",
"description": "",
"cloudFormation": {
"lambdaIamPolicyDocumentStatements": [{}],
"resources": {}