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
import scala.io.Source.fromFile | |
enum Dir: | |
def toVec: Vec = this match { | |
case North => Vec(0, -1) | |
case East => Vec(1, 0) | |
case South => Vec(0, 1) | |
case West => Vec(-1, 0) | |
} | |
case North, East, South, West |
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
""" | |
Query recorded `Configuration Items` for a given resource and related resources. | |
Usage: | |
* Install requirements. Todo: provide requirements.txt | |
* Set AWS_PROFILE to desired account. | |
* Pick a resource in account and get its type and id | |
(ie AWS::EC2::VPC, vpc-006fd4ebe2axxxxxx or AWS::EC2::Instance, i-0c93934d13axxxxxx) | |
See https://docs.aws.amazon.com/cli/latest/reference/configservice/get-resource-config-history.html | |
for a list of resource types. |
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
-- drop table edges; | |
create table edges ( | |
node_top varchar(15), | |
node_bottom varchar(15) | |
); | |
insert into edges values ('A', 'B'), ('A', 'C'), ('B', 'D'), ('B', 'E'), ('E', 'F'); | |
select * from edges; | |
/* Category tree |