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
program factorial_recursive | |
script { | |
def factorial(int n) : int { | |
if (n is 0) { | |
spit 1; | |
} | |
spit n * (factorial(n - 1)) | |
} | |
eval(factorial(10)) |
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: 2 | |
jobs: # (1) | |
test: # (2) | |
docker: # use the docker executor type | |
- image: python:3.7-alpine # the primary container, where the job's commands are run | |
steps: | |
- checkout # check out the code in the project directory | |
- run: python3 -m unittest tests/test_compiled_code.py | |
deploy: # (3) | |
docker: # use the docker executor type |
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
#!/usr/bin/env bash | |
set -e | |
echo "build image" | |
REPOSITORY=CHANGE-ME # Change this to your Docker Hub's name | |
IMAGE=trendlit-tutorial-1 | |
TAG=`make version` | |
HASH=`git log --format="%H" -n 1 | cut -c1-6` |
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
{ | |
"AWSEBDockerrunVersion":"1", | |
"Image":{ | |
"Name":"docker.io/your-username/trendlit-tutorial-1", | |
"Update":"true" | |
}, | |
"Ports":[ | |
{ | |
"ContainerPort":"80" | |
} |
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
INFO[0000] Starting the service... | |
INFO[0000] The service is ready to listen and serve. | |
INFO[0004] Processing URL /contacts | |
INFO[0009] Processing URL /importContacts | |
INFO[0009] Redirecting to URL https://accounts.google.com/o/oauth2/auth?client_id=xxx.apps.googleusercontent.com&redirect_uri | |
http%3A%2F%2Flocalhost%3A8000%2Fcallback&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcontacts.readonly&state=pseudo-random | |
INFO[0009] Client is redirecting user agent to authorization endpoint. | |
INFO[0019] Processing URL /callback | |
INFO[0019] Getting user info... | |
INFO[0019] Client is sending authorization code and its own credentials to token endpoint |
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 init() { | |
err := godotenv.Load() | |
if err != nil { | |
log.Fatal("Error loading .env file") | |
} | |
googleOauthConfig = &oauth2.Config{ | |
RedirectURL: "http://localhost:" + os.Getenv("PORT") + "/callback", |
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
@startuml | |
left to right direction | |
actor "Alice" as a | |
rectangle "Not So crAPI App" as r { | |
rectangle "Application Logic" as logic | |
rectangle "Authenticator" as auth | |
rectangle "Access Controller" as ac |
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
#!/bin/bash | |
STACK_NAME=bastion-poc | |
REGION=us-east-1 | |
CLI_PROFILE=your-aws-profile-with-an-appropiate-role | |
EC2_INSTANCE_TYPE=t2.micro | |
KEY_NAME=your-key-pair-name | |
# Deploy the CloudFormation template | |
echo -e "\n\n=========== Deploying main.yml ===========" |