This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Show the current time in your time zone. | |
-- | |
-- Read how it works: | |
-- https://guide.elm-lang.org/effects/time.html | |
-- | |
-- For an analog clock, check out this SVG example: | |
-- https://elm-lang.org/examples/clock | |
-- | |
import Browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Press a button to generate a random number between 1 and 6. | |
-- | |
-- Read how it works: | |
-- https://guide.elm-lang.org/effects/random.html | |
-- | |
import Browser | |
import Html exposing (..) | |
import Html.Attributes exposing (class, classList, href, style) | |
import Html.Events exposing (..) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func CreateLambdaContextLocally(next http.Handler) http.Handler { | |
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
type MyCustomClaims struct { | |
Username string `json:"cognito:username"` | |
Email string `json:"email"` | |
// custom claims etc | |
jwt.StandardClaims | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handler/handlerX/**.go { | |
prep: go build -o dist/handlerX ./handler/handlerX/ | |
} | |
handler/handlerY/**.go { | |
prep: go build -o dist/handlerY ./handler/handlerY/ | |
} | |
helper/**.go util/**.go { | |
prep: for dir in `ls handler`; do \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clean: | |
@rm -rf dist | |
@mkdir -p dist | |
gomon: | |
reflex -r '\.go' -s -- sh -c 'make build' | |
build: clean | |
@for dir in `ls handler`; do \ | |
GOOS=linux go build -o dist/handler/$$dir PATH/handler/$$dir; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-------------+------------+--------------+-------------+ | |
| Service | Speed | Environment | Extra hacks | | |
+-------------+------------+--------------+-------------+ | |
| Serverless | 💩 | 🔥 | 🔥 | | |
| AWS SAM | 👍 | 👍 | 💩 | | |
| Local | 🔥 | 💩 | 💩 | | |
+-------------+------------+--------------+-------------+ | |
Shit hot (very good) - 🔥 | |
Okay - 👍 | |
Shit - 💩 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebAppRole: | |
Type: "AWS::IAM::Role" | |
Properties: | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Effect: "Allow" | |
Action: | |
- "sts:AssumeRole" | |
Principal: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parameters: | |
Env: | |
Description: An environment name that will be prefixed to resource names | |
Type: String | |
AllowedValues: ["development", "production"] | |
resources: | |
NetworkRole: | |
Type: "AWS::IAM::Role" | |
Properties: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Version: 2012-10-17 | |
Statement: | |
- Effect: Allow | |
Action: | |
- 'cloudformation:CreateChangeSet' | |
- 'cloudformation:DescribeChangeSet' | |
- 'cloudformation:ExecuteChangeSet' | |
- 'cloudformation:DescribeStacks' | |
Resource: | |
- 'arn:aws:cloudformation:<region>:<account_no>:stack/<roles_permission_stack_name>/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This template is a Cloud Formation template, that has AWS Sam seamlessly mixed in | |
# It is extremely powerful as you will see! | |
# This is a template of Lambda & RDS, publically available (so no private VPC) | |
AWSTemplateFormatVersion: 2010-09-09 | |
Transform: AWS::Serverless-2016-10-31 # This is to tell cloudformation we need to transform this template, as it has SAM! | |
Description: Severless set up with an RDS | |
######## ### ######## ### ## ## | |
## ## ## ## ## ## ## ## ### ### |
NewerOlder