Solutions to adventofcode.com/2020
Solutions (Link)
$ stack test --file-watch --fast
$ day 1 commit
./bin/day 1 commit
Creates a workspace to solve a new day's problem.
Steps
- copies the Template directories and string replaces placeholder values
- fetches input the problem input and saves it to
./test/Day01/input.txt
- fetches the problem statement, converts it to markdown, and saves it as
./src/Day01/README.md
- updates the
.cabal
file - if
commit
is included- creates a branch
- adds and commits the new files
- pushes the branch to origin
- opens a pull-request
$ readme 1
./bin/readme 1
After solving part 1, get a new README with the full problem
statement including part 2.
direnv
- used to add project specific env variablesyarn global add @bionikspoon/html-to-md
yarn global add prettier
go get github.com/ericchiang/pup
- https://hub.docker.com/ API key for Circle CI
- https://codecov.io/ project token for circle CI
-
Create an
.envrc
$ cp .envrc.sample .envrc
-
Add a
SESSION_ID
to the.envrc
- go to
https://adventofcode.com/
- login
- Right click -> "Inspect" -> Click the "Application" tab -> Look for "Storage -> Cookies -> https://adventofcode.com/" -> Copy the "session" value
- Save the "session" value as
SESSION_ID
in.envrc
- go to
-
Enable the
.envrc
file$ direnv allow
-
Add environment variables to CircleCI
CODECOV_TOKEN
DOCKERHUB_PASSWORD
DOCKERHUB_USERNAME
-
Setup
.hspec
$ cp .hspec.sample .hspec