{"id":22609537,"url":"https://github.com/heman/aoc2024","last_synced_at":"2025-03-28T22:45:07.702Z","repository":{"id":266032359,"uuid":"884375222","full_name":"HeMan/aoc2024","owner":"HeMan","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-02T08:18:18.000Z","size":1990,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T09:20:01.288Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HeMan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-06T16:29:25.000Z","updated_at":"2024-12-02T08:18:22.000Z","dependencies_parsed_at":"2024-12-02T07:45:17.018Z","dependency_job_id":null,"html_url":"https://github.com/HeMan/aoc2024","commit_stats":null,"previous_names":["heman/aoc2024"],"tags_count":0,"template":false,"template_full_name":"HeMan/aoc_example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeMan%2Faoc2024","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeMan%2Faoc2024/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeMan%2Faoc2024/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeMan%2Faoc2024/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HeMan","download_url":"https://codeload.github.com/HeMan/aoc2024/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246112641,"owners_count":20725300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-08T15:12:58.879Z","updated_at":"2025-03-28T22:45:07.682Z","avatar_url":"https://github.com/HeMan.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example repo for the Cygnified Advent of Code\nThis repo is an example showing how to structure your own repo in a way that your solutions on [Advent of Code](https://adventofcode.com/) can be analyzed correctly on the [Cygnified version](https://aoc-2022.cygni.se).\n\n## Folder structure\nYour solutions must be placed in a folder corresponding to the day that the solutions belong to; `day01`, `day02` etc. There's a script called `create_directories.sh` which you can use to generate all 25 days. Or, if you want you can just execute this in the root of your repo:\n\n```for i in $(seq -w 1 25); do mkdir \"day$i\"; done```\n\n## Dockerfile to measure execution time\nIn order to measure execution time, every solultion needs to be place in a `Dockerfile`. This needs to contain a command (`CMD`) that triggers a run of your solution. `Dockerfile` must also copy a file named `./input.txt` so that your solution has access to the input data. We will then build the image and execute the following: \n\n```\n$ docker build -t \"${dockerImage}\" .\n$ docker run -e part=part1 \"${dockerImage}\"\n```\n\nAs an alternative to docker during development, you can use [podman](https://podman.io/), which has the same commands.\n\n### Environment variable for the two parts\nAs you can see in the example above, the execution time is measured using the environment variable `part`. Every day, there will be a part 1 and part 2 on Advent of Code. Please have a look at the examples (`day01` etc) to see how you can solve this. It's important that the environment variable is setup correctly in order to measure time. We measure time by running \n\n```\n$ docker run -e part=part1 \"${dockerImage}\"\n```\n\nAnd then inspecting the Docker container something like this:\n```\n  START=$(docker inspect --format='{{.State.StartedAt}}' $CONTAINER_ID)\n  STOP=$(docker inspect --format='{{.State.FinishedAt}}' $CONTAINER_ID)\n\n  START_TIMESTAMP=$(date --date=$START +%s%N)\n  STOP_TIMESTAMP=$(date --date=$STOP +%s%N)\n\n  echo $((($STOP_TIMESTAMP-$START_TIMESTAMP)/1000000)) \n```\n\n## Examples of correct structure\nAll folders in this repo (`day01` etc) contains a simple but correct setup. Please have a look at it.\n\n\n## Puzzle example and solutions in many different languages\nYou'll find [here](./examples)\n\n## Any questions?\nDon't fret. Let us know in [#adventofcode](https://cygni.slack.com/archives/C87HA2UNL). We're all here to help each other and have fun!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheman%2Faoc2024","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheman%2Faoc2024","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheman%2Faoc2024/lists"}