From 3d449572c0f8ebb7ad592ace990a0e69d2ed8ddf Mon Sep 17 00:00:00 2001 From: David Ashby Date: Wed, 26 Nov 2025 15:47:32 -0500 Subject: [PATCH] scaffold --- .gitignore | 2 ++ readme.md | 3 +++ run.sh | 17 +++++++++++++++++ today.sh | 21 +++++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 .gitignore create mode 100644 readme.md create mode 100755 run.sh create mode 100755 today.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5f6aff7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.cookie +*/inputs diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..827b591 --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# AOC 2025 + + diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..bdb5e58 --- /dev/null +++ b/run.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +__year=2024 + +__day="${1}" +if [ -z "${__day}" ]; then + __day=$(date '+%d') +fi + +padded=$(printf "%02g" ${__day}) +if [ -f "${padded}/index.ts" ]; then + cd $padded + npx tsx "index.ts" 2>/dev/null + cd - >/dev/null +else + echo "day not found" +fi diff --git a/today.sh b/today.sh new file mode 100755 index 0000000..013db30 --- /dev/null +++ b/today.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +__year=2024 + +__day="${1}" +if [ "${__day}" == "" ]; then + __day=$(date '+%d') +fi + +padded=$(printf "%02g" ${__day}) +mkdir -p ${padded}/inputs +touch ${padded}/inputs/testinput +if [ ! -f "${padded}/inputs/input" ]; then + curl -s \ + -A "https://git.yetaga.in/alazyreader/AdventOfCode${__year}/" \ + -H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${__day##0}/input > "${padded}/inputs/input" +fi +if [ ! -f "${padded}/index.ts" ]; then + cp index.ts.tmpl ${padded}/index.ts +fi +open "https://adventofcode.com/${__year}/day/${__day##0}"