{"id":17524087,"url":"https://github.com/rlopzc/protohackers_zig","last_synced_at":"2025-04-15T19:51:27.294Z","repository":{"id":257860897,"uuid":"872725828","full_name":"rlopzc/protohackers_zig","owner":"rlopzc","description":"Solving protohackers.com problems with Zig","archived":false,"fork":false,"pushed_at":"2025-03-24T01:10:08.000Z","size":242,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T10:48:31.041Z","etag":null,"topics":["networking","protohackers","zig","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/rlopzc.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-10-15T00:53:41.000Z","updated_at":"2025-03-24T01:10:12.000Z","dependencies_parsed_at":"2024-12-31T15:30:41.681Z","dependency_job_id":null,"html_url":"https://github.com/rlopzc/protohackers_zig","commit_stats":{"total_commits":44,"total_committers":1,"mean_commits":44.0,"dds":0.0,"last_synced_commit":"2b8cb219814aaceb02fcc7ba0cb96389bae3d70d"},"previous_names":["rlopzc/protohackers_zig"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlopzc%2Fprotohackers_zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlopzc%2Fprotohackers_zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlopzc%2Fprotohackers_zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlopzc%2Fprotohackers_zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rlopzc","download_url":"https://codeload.github.com/rlopzc/protohackers_zig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249144895,"owners_count":21219966,"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":["networking","protohackers","zig","ziglang"],"created_at":"2024-10-20T14:06:23.483Z","updated_at":"2025-04-15T19:51:27.252Z","avatar_url":"https://github.com/rlopzc.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Protohackers in Zig\n\nI'm solving the [protohackers](https://protohackers.com/) in Zig to learn more about networking and continue learning\nZig.\n\nEach problem has it's corresponding file in `src`, e.g. `src/01_smoke_test.zig`. The common logic is extracted in\ndifferent files, e.g. `src/tcp_server.zig`.\n\nI used CLI arguments to run a specific problem. To run the smoke test, run:\n\n```sh\n# Smoke test\nzig build run -- 00\n\n# Prime time\nzig build run -- 01\n```\n\n## Docker\n\nI dockerized this project to be run in any server. The images are exposed in Github Container Registry\n[here](https://github.com/rlopzc/protohackers_zig/pkgs/container/protohackers_zig).\n\nBuilding the images:\n\n```sh\ndocker buildx build --platform linux/arm64,linux/amd64 -t ghcr.io/rlopzc/protohackers_zig:latest --push .\n```\n\n## Running the image in any cloud provider\n\n1. Create a server in a cloud provider (I used Hetzner)\n1. Pull the image. You can either pull the latest, which should contain most solutions, or a specific tag with a\n   solution.\n   ```sh\n   docker pull ghcr.io/rlopzc/protohackers_zig:0_smoke\n   # or\n   docker pull ghcr.io/rlopzc/protohackers_zig:latest\n   ```\n\n1. Run the image. Remember to pass the problem number as an argument.\n   ```sh\n   docker run --rm --name protohackers_zig -p 3000:3000 --init ghcr.io/rlopzc/protohackers_zig:latest 00\n   ```\n1. Run the protohacker test using their website!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlopzc%2Fprotohackers_zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frlopzc%2Fprotohackers_zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlopzc%2Fprotohackers_zig/lists"}