Advent of Code template repository.
This is not made to be hosted. This is made to boostrap your yearly Advent of Code solving routine as a Laravel dev, by removing the hassle of preparing a php environment with appropriate helpers.
Released under the MIT License. See LICENSE.
Copyright ©️ 2023 {{ $your_name }}
This repository does follow the automation guidelines on the /r/adventofcode community wiki. Specifically:
- No automation is provided
- Outbound calls to the /events endpoint are cached for 24h (see
app/Console/UpdateBadgesCommand.php
) - Once inputs are downloaded, they are cached locally indefinitly (see
app/Console/PrepareCommand
) - If you suspect your input is corrupted, you can run the command again to regenerate from cache. Manual deletion of cache files is required to enable a fresh download.
The User-Agent header is set to information you need to provide in your .env
.
It must be set to the owner of the end-repository (not the template repository owner).
This template repository is provided as-is, as detailed in the LICENSE file.
By using this template repository, you become the one and only maintainer of your new repository.
By using this template repository, you take responsability over your usage of the provided scripts. The original author designed them to be executed 25 times a year, no more.
Although a Laravel application, this code is not fit to be hosted. Specifically, the code as-is is not fit for any kind of automation or production environments.
First, click on "use this template" and generate a new repo based on this one.
git clone [email protected]:{{ $your_name }}/{{ $your_repo_name }}.git
cd advent-of-code
cp .env.example .env
Specify in the .env the values for:
- your GitHub username
- your GitHub email
- the name of your repository
These are required by the AoC maintainers to track abusive use of the website. Without those values, the scripts will get banned.
docker run --rm --interactive --tty --volume $PWD:/app composer install
vendor/bin/sail up -d
echo Enjoy!
composer install
echo Enjoy!
Use sail
or php
depending on wether you want to use docker or not.
# generate code file and download input
sail artisan aoc:prepare {year} {day}
# hopefully first try !
sail artisan aoc:run {year} {day} {--example}
# once you're done for the day
sail artisan aoc:update-badges