From d60694f013fb7fa5c32ec37e66eb43a67f651a5c Mon Sep 17 00:00:00 2001 From: nora <48135649+Noratrieb@users.noreply.github.com> Date: Sat, 10 Jan 2026 20:08:33 +0100 Subject: [PATCH 1/7] Create deploy.yml --- .github/workflows/deploy.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..c119c8c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,26 @@ +name: test + +on: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-22.04 + environment: garage + steps: + - uses: actions/checkout@v4 + - name: Copy website + run: | + mkdir dist + cp *.html *.css *.js ./dist + - name: Deploy website + run: | + aws configure set default.s3.addressing_style path + aws s3 sync ./dist s3://noratrieb.dev + env: + AWS_ACCESS_KEY_ID: "${{ secrets.AWS_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_KEY }}" + AWS_REGION: garage + AWS_ENDPOINT_URL: https://garage.noratrieb.dev From 11301447d4577c1f908a26f7b96bf12878793c04 Mon Sep 17 00:00:00 2001 From: nora <48135649+Noratrieb@users.noreply.github.com> Date: Sat, 10 Jan 2026 20:14:48 +0100 Subject: [PATCH 2/7] Update deploy.yml --- .github/workflows/deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c119c8c..3adf7ec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,8 @@ jobs: - name: Copy website run: | mkdir dist - cp *.html *.css *.js ./dist + files=$(git ls-files | grep -E '\.(html|css|js)$') + cp --parents $files ./dist - name: Deploy website run: | aws configure set default.s3.addressing_style path From 775e00cb3c02c9171e61f4c7b942e4d75f07a294 Mon Sep 17 00:00:00 2001 From: nora <48135649+Noratrieb@users.noreply.github.com> Date: Sat, 10 Jan 2026 20:14:56 +0100 Subject: [PATCH 3/7] Update deploy.yml --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3adf7ec..3f1e70b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: test +name: deploy on: push: From c8539a7990a5f6a8b2bedf6a3fc2d39c925c4122 Mon Sep 17 00:00:00 2001 From: nora <48135649+Noratrieb@users.noreply.github.com> Date: Sat, 10 Jan 2026 20:15:29 +0100 Subject: [PATCH 4/7] Update deploy.yml --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3f1e70b..4a93b91 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,7 +19,7 @@ jobs: - name: Deploy website run: | aws configure set default.s3.addressing_style path - aws s3 sync ./dist s3://noratrieb.dev + aws s3 sync ./dist s3://noratrieb.dev-womangling env: AWS_ACCESS_KEY_ID: "${{ secrets.AWS_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_KEY }}" From 416f658e26eefeabcf81631f806995d46ff8a501 Mon Sep 17 00:00:00 2001 From: nora <48135649+Noratrieb@users.noreply.github.com> Date: Sat, 10 Jan 2026 20:25:49 +0100 Subject: [PATCH 5/7] Update deploy.yml --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4a93b91..3c0e816 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,7 +19,7 @@ jobs: - name: Deploy website run: | aws configure set default.s3.addressing_style path - aws s3 sync ./dist s3://noratrieb.dev-womangling + aws s3 sync ./dist s3://womangling.noratrieb.dev env: AWS_ACCESS_KEY_ID: "${{ secrets.AWS_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_KEY }}" From 4c02c9f13716480e3be2fb8845dbc064c347f0b2 Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Sat, 10 Jan 2026 20:45:40 +0100 Subject: [PATCH 6/7] Fix duplicate practice answers Fixe #3 --- flashcard.js | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/flashcard.js b/flashcard.js index 8761135..e6888ee 100644 --- a/flashcard.js +++ b/flashcard.js @@ -1,19 +1,18 @@ -const randomItem = (not) => { - let item; - - do { - const idx = Math.floor(Math.random() * window.ITEMS.length); - item = window.ITEMS[idx]; - } while (not && item === not); - - return item; -}; - const infoText = document.querySelector("#info-text"); function next() { infoText.textContent = ""; - const item = randomItem(); + + const candiates = [...window.ITEMS]; + + const nextRandomItem = () => { + const idx = Math.floor(Math.random() * candiates.length); + const result = candiates[idx]; + candiates.splice(idx, 1); + return result; + }; + + const item = nextRandomItem(); const mangle = Math.random() > 0.5; @@ -24,10 +23,10 @@ function next() { children[1].textContent = mangle ? item.means : item.mangle; const options = [ - randomItem(item), - randomItem(item), - randomItem(item), - randomItem(item), + nextRandomItem(item), + nextRandomItem(item), + nextRandomItem(item), + nextRandomItem(item), ]; const correctIdx = Math.floor(Math.random() * options.length); options[correctIdx] = item; From a853814581960e2fbacfc7614f513dd525c43400 Mon Sep 17 00:00:00 2001 From: nora <48135649+Noratrieb@users.noreply.github.com> Date: Sat, 10 Jan 2026 21:57:45 +0100 Subject: [PATCH 7/7] Fix typo in lesson 1 fixes #4 --- lesson-1.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lesson-1.html b/lesson-1.html index bc73a47..61b1dd1 100644 --- a/lesson-1.html +++ b/lesson-1.html @@ -31,7 +31,7 @@ Every C++ mangled symbol is prefixed with the string _Z. This signifies that this is a mangled C++ symbol. _Z starts with an underscore followed by an uppercase - letter. All symbols of that structures are reserved by the C + letter. All symbols of that structure are reserved by the C standard and cannot be used by programs. This ensures that there are no name collisions with normal C functions and mangled C++ functions.