Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
narimiran committed Nov 26, 2024
0 parents commit cc0eeb9
Show file tree
Hide file tree
Showing 15 changed files with 3,638 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on: [push, pull_request]

jobs:
test-solutions:
strategy:
matrix:
os: [ubuntu-latest]
kind: [tests, benchmark]
fail-fast: false

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'

- name: Install Clojure
uses: DeLaGuardo/[email protected]
with:
cli: 'latest'

- name: Cache clojure dependencies
uses: actions/cache@v4
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
# List all files containing dependencies:
key: cljdeps-${{ hashFiles('deps.edn') }}
restore-keys: cljdeps-

- name: Test helpers
if : ${{ matrix.kind == 'tests' }}
run: clojure -M clojure/tests/aoc_tests.clj

- name: Test solutions
if : ${{ matrix.kind == 'tests' }}
run: clojure -M clojure/tests/solutions_tests.clj

# - name: Benchmark solutions
# if : ${{ matrix.kind == 'benchmark' }}
# run: clojure -M clojure/tests/solutions_benchmark.clj
63 changes: 63 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Pages

on: push

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'

- name: Install clojure
uses: DeLaGuardo/[email protected]
with:
cli: 'latest'

- name: Cache clojure dependencies
uses: actions/cache@v4
with:
path: |
~/.m2
~/.gitlibs
~/.deps.clj
# List all files containing dependencies:
key: cljdeps-${{ hashFiles('deps.edn') }}
restore-keys: cljdeps-

- name: Clerk Cache
uses: actions/cache@v4
with:
path: .cache
key: ${{ runner.os }}-clerk

- name: Clerk Build
run: clojure -X:nextjournal/clerk :path-prefix '"public/build/${{ github.sha }}/"' :git/sha '"${{ github.sha }}"'

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'public/build'

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 narimiran

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Advent of Code 2024


All my Advent of Code repos:

* [AoC 2015 in Nim, Python](https://github.com/narimiran/advent_of_code_2015)
* [AoC 2016 in Python, Clojure](https://github.com/narimiran/advent_of_code_2016)
* [AoC 2017 in Nim, OCaml, Python](https://github.com/narimiran/AdventOfCode2017)
* [AoC 2018 in Nim, Python, Racket](https://github.com/narimiran/AdventOfCode2018)
* [AoC 2019 in OCaml, Python](https://github.com/narimiran/AdventOfCode2019)
* [AoC 2020 in Nim, one liner-y Python, Racket](https://github.com/narimiran/AdventOfCode2020)
* [AoC 2021 in Python, Racket](https://github.com/narimiran/AdventOfCode2021)
* [AoC 2022 in Python, Clojure](https://github.com/narimiran/AdventOfCode2022)
* [AoC 2023 in Clojure](https://github.com/narimiran/AdventOfCode2023)
* [AoC 2024 in Clojure (Clerk notebooks)](https://github.com/narimiran/aoc2024) (this repo)


 

After using Clojure (along side Python) for the first time in [2022](https://github.com/narimiran/AdventOfCode2022), I've used it exclusively in [2023](https://github.com/narimiran/AdventOfCode2023), and it'll be my main language this year.
I like it _that_ much.

To make things interesting (or at least different than the last year), this year I'll be using [Clerk notebooks](https://clerk.vision).
To make this notebook format "work", I'll have to write the code in a different way than I usually do: I'll not just present the final solution, but the whole process from reading the input and then slowly building the required blocks until we come with the solution.

The notebooks are available at: https://narimiran.github.io/aoc2024

Loading

0 comments on commit cc0eeb9

Please sign in to comment.