{"id":17650175,"url":"https://github.com/busser/adventofcode","last_synced_at":"2025-05-07T04:03:28.168Z","repository":{"id":136060905,"uuid":"557921956","full_name":"busser/adventofcode","owner":"busser","description":"Solutions to the Advent of Code puzzles","archived":false,"fork":false,"pushed_at":"2025-01-07T23:33:41.000Z","size":955,"stargazers_count":16,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-07T04:03:18.644Z","etag":null,"topics":["advent-of-code","golang","puzzles"],"latest_commit_sha":null,"homepage":"","language":"Go","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/busser.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":"2022-10-26T14:56:13.000Z","updated_at":"2025-01-07T23:33:44.000Z","dependencies_parsed_at":"2023-12-24T01:37:37.631Z","dependency_job_id":"b0b0dbdb-dce0-4566-9ef2-2454db43398c","html_url":"https://github.com/busser/adventofcode","commit_stats":{"total_commits":79,"total_committers":2,"mean_commits":39.5,"dds":"0.012658227848101222","last_synced_commit":"a284736ec2e9586705edf821516cd33bce814922"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busser%2Fadventofcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busser%2Fadventofcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busser%2Fadventofcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busser%2Fadventofcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/busser","download_url":"https://codeload.github.com/busser/adventofcode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810271,"owners_count":21807759,"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":["advent-of-code","golang","puzzles"],"created_at":"2024-10-23T11:36:47.009Z","updated_at":"2025-05-07T04:03:28.145Z","avatar_url":"https://github.com/busser.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advent of Code\n\n![tests-passing](https://github.com/busser/adventofcode/actions/workflows/ci.yml/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/busser/adventofcode)](https://goreportcard.com/report/github.com/busser/adventofcode)\n\n[Advent of Code](https://adventofcode.com) is an Advent calendar of small\nprogramming puzzles for a variety of skill sets and skill levels that can be\nsolved in any programming language you like.\n\nIn the Cloud Native ecosystem, [Go](https://golang.org/) has emerged as the\nlanguage of choice. As a Site Reliability Engineer, knowing how to write\nsoftware in Go is a useful skill.\n\nWhether you are new to Go or have already written countless lines of it, this\nrepository aims at giving you everything you need to improve.\n\n## Getting started\n\nFirst and foremost, go to the [Advent of Code website](https://adventofcode.com/)\nand log in.\n\nTo get started on a solution, clone this repository:\n\n```bash\ngit clone git@github.com:busser/adventofcode.git\ncd adventofcode\n```\n\nRemove existing solutions to start from scratch:\n\n```bash\nrm -r y*\n```\n\nBuild the `adventofcode` command-line tool:\n\n```bash\nmake build\n```\n\nGet started on your first puzzle:\n\n```bash\nbin/adventofcode scaffold --day 1 --workdir \"$(pwd)\"\n```\n\nThe command above will create a package where your code will go. Your next steps\nshould be:\n\n1. Implement your solution in the `solution.go` file. Use this command to test\n   it:\n\n   ```bash\n   go test ./y2021/d01 -run ExamplePartOne\n   ```\n\n2. Once you think you have found the answer to the problem, submit it on the\n   adventofcode.com website. If it's the right answer, congrats!\n\n3. Update your tests by adding the answer to `ExamplePartOne` in\n   `solution_test.go`.\n4. Repeat steps 1 to 3 for the second part of the Advent of Code problem.\n5. Now that you have finished, run all tests to make sure everything is ready\n   for your pull request:\n\n   ```bash\n   make test\n   ```\n\nOnce you are done with the first day of the Advent of Code, have a look at the\n[Configuration](#configuration) section below on how you can configure the\n`adventofcode` CLI, or the [Tests and benchmarks](#tests-and-benchmarks) section\nfor tips on how to measure your solution's performance.\n\n## Scaffolding\n\nThe `adventofcode` can help you get started quickly on your solution to the\ndaily Advent of Code problems. The `scaffold` subcommand builds the following\nfor you:\n\n- A new package to write your solution in;\n- A `solution.go` file with a basic code skeleton to get started quickly;\n- A `solution_test.go` file with basic unit tests and benchmarks, for when you\n  have found the answer to the daily problem;\n\nIt can also download your input for the day's problem, granted you have provided\nyour adventofcode.com session cookie (see [Session cookie](#session-cookie) for\ndetails).\n\n### Session cookie\n\nWhen logged in to the adventofcode.com website, your browser has a cookie called\n`session`. Retrieve this cookie's value and provide it to the `adventofcode` CLI\nto automatically download your input for the day.\n\n## Helpers\n\nThis repository includes a `helpers` package with useful functions for\nimplementing solutions to Advent of Code problems. Feel free to use any of them.\n\nFor examples on how to use them, look for functions that start with `Example`.\nThese are actually unit tests, so you can be sure that they work as described.\n\n## Tests and benchmarks\n\nThe scaffolding provided by the `adventofcode` CLI includes unit tests and\nbenchmarks. To run them, make sure they are properly uncommented in the\n`solution_test.go` file, then run these commands:\n\n```bash\n# Run all units tests\ngo test ./y2022/d01\n# Run all benchmarks\ngo test ./y2022/d01 -bench . -benchmem -cpu 1,2,4,8\n```\n\n## Configuration\n\nTo configure the `adventofcode` CLI, you can use flags, environment variables,\nor a configuration file.\n\n### Flags\n\nThe CLI is entirely configurable with flags. For a list of available flags, use\nthese commands:\n\n```bash\nadventofcode --help\nadventofcode scaffold --help\n```\n\n### Environment variables\n\nYou can replace any flag in the `adventofcode` CLI with an environment variable.\nEnvironment variables must simply start with `ADVENTOFCODE_`. For example, you\ncan replace the `--workdir` flag by setting the `ADVENTOFCODE_WORKDIR` variable.\n\nIf you have [direnv](https://direnv.net/) installed, you can add a `.envrc` file\nto the `adventofcode` directory that looks like this:\n\n```bash\nexport ADVENTOFCODE_WORKDIR=\"$(git rev-parse --show-toplevel)\"\nexport ADVENTOFCODE_COOKIE=\"abcdef0123456789...\"\n```\n\n### Configuration file\n\nThe `adventofcode` CLI automatically looks for a configuration file located in\nyour home directory: `$HOME/.adventofcode.yaml`. In this file, you can set\nvalues for any flag. For example, your configuration file could look like this:\n\n```yaml\nworkdir: /Users/arthur/workspace/adventofcode\ncookie: abdefg0123456789...\n```\n\n## Troubleshooting\n\nIf you encounter any problems while using the `adventofcode` CLI, let us know\nwith a GitHub issue.\n\n---\n\nMade with 💜 by @busser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusser%2Fadventofcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbusser%2Fadventofcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusser%2Fadventofcode/lists"}