From 7972ad88012a56f6afd54ada46cd45206418682a Mon Sep 17 00:00:00 2001 From: braxtonhall Date: Mon, 24 Oct 2022 12:03:21 -0700 Subject: Add Nico's new fibs --- entries/nritschel/assets/scratch.png | Bin 0 -> 752302 bytes entries/nritschel/scratch/README.md | 1 + entries/nritschel/scratch/fib.sb3 | Bin 0 -> 43364 bytes entries/nritschel/xlsx/fib.xlsx | Bin 0 -> 11704 bytes people.json | 8 ++++++++ 5 files changed, 9 insertions(+) create mode 100644 entries/nritschel/assets/scratch.png create mode 100644 entries/nritschel/scratch/README.md create mode 100644 entries/nritschel/scratch/fib.sb3 create mode 100644 entries/nritschel/xlsx/fib.xlsx diff --git a/entries/nritschel/assets/scratch.png b/entries/nritschel/assets/scratch.png new file mode 100644 index 0000000..5883245 Binary files /dev/null and b/entries/nritschel/assets/scratch.png differ diff --git a/entries/nritschel/scratch/README.md b/entries/nritschel/scratch/README.md new file mode 100644 index 0000000..e059267 --- /dev/null +++ b/entries/nritschel/scratch/README.md @@ -0,0 +1 @@ +scratch preview \ No newline at end of file diff --git a/entries/nritschel/scratch/fib.sb3 b/entries/nritschel/scratch/fib.sb3 new file mode 100644 index 0000000..a3cf2cc Binary files /dev/null and b/entries/nritschel/scratch/fib.sb3 differ diff --git a/entries/nritschel/xlsx/fib.xlsx b/entries/nritschel/xlsx/fib.xlsx new file mode 100644 index 0000000..e1b662d Binary files /dev/null and b/entries/nritschel/xlsx/fib.xlsx differ diff --git a/people.json b/people.json index 26dc1db..fa3f624 100644 --- a/people.json +++ b/people.json @@ -130,6 +130,14 @@ { "name": "fib-java", "link": "./entries/nritschel/fib-java/src" + }, + { + "name": "xlsx", + "link": "./entries/nritschel/xlsx/fib.xlsx" + }, + { + "name": "scratch", + "link": "./entries/nritschel/scratch" } ] }, -- cgit v1.2.3-70-g09d2 From 06ad8853e86b5c270f31f6d7b99081323f2f677a Mon Sep 17 00:00:00 2001 From: Zack Grannan Date: Mon, 24 Oct 2022 12:02:15 -0700 Subject: Add submission for zgrannan --- entries/zgrannan/Fib.hs | 18 ++++++++++++++++++ people.json | 11 +++++++++++ 2 files changed, 29 insertions(+) create mode 100644 entries/zgrannan/Fib.hs diff --git a/entries/zgrannan/Fib.hs b/entries/zgrannan/Fib.hs new file mode 100644 index 0000000..1918fc8 --- /dev/null +++ b/entries/zgrannan/Fib.hs @@ -0,0 +1,18 @@ +-- Point-less fibonacci +fib :: Int -> Int +fib = fix fib' + where + fib' = + ap (when 0 . (0 ==)) . + ap (when 1 . (1 ==)) . + ap (ap . ((+) .) . (. subtract 1)) (. subtract 2) + + when t c e = if c then t else e + + ap mf m = mf >>= (\f -> m >>= return . f) + + fix f = f (fix f) + + +main :: IO () +main = mapM_ (print . fib) [0 .. 10] diff --git a/people.json b/people.json index 26dc1db..a9d5fa0 100644 --- a/people.json +++ b/people.json @@ -213,5 +213,16 @@ "link": "./entries/laelath/fib.bf" } ] + }, + { + "github": "zgrannan", + "name": "Zack Grannan", + "title": "MS Student, UBC", + "entries": [ + { + "name": "haskell", + "link": "./entries/zgrannan/Fib.hs" + } + ] } ] -- cgit v1.2.3-70-g09d2 From a9e39fa02410b61288208509e038b9e096486702 Mon Sep 17 00:00:00 2001 From: Zack Grannan Date: Mon, 24 Oct 2022 12:13:14 -0700 Subject: Update designation --- people.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/people.json b/people.json index a9d5fa0..cd0cb50 100644 --- a/people.json +++ b/people.json @@ -217,7 +217,7 @@ { "github": "zgrannan", "name": "Zack Grannan", - "title": "MS Student, UBC", + "title": "MSc Computer Science Student, UBC", "entries": [ { "name": "haskell", -- cgit v1.2.3-70-g09d2 From 7cdf8b8dfca8e8513fdbc1ed67a701420d8527cb Mon Sep 17 00:00:00 2001 From: braxtonhall Date: Mon, 24 Oct 2022 12:18:35 -0700 Subject: Add a PR workflow --- .github/workflows/pull.yml | 24 ++++++++++++++++++++++++ bin/checkPeople.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/pull.yml create mode 100644 bin/checkPeople.js diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml new file mode 100644 index 0000000..266b8f8 --- /dev/null +++ b/.github/workflows/pull.yml @@ -0,0 +1,24 @@ +name: Check people + +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node: [ 16.x ] + + steps: + - uses: actions/checkout@v2 + - name: Install modules with Node ${{ matrix.node }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - name: Check people + run: node bin/checkPeople.js ${{ github.actor }} diff --git a/bin/checkPeople.js b/bin/checkPeople.js new file mode 100644 index 0000000..60527b9 --- /dev/null +++ b/bin/checkPeople.js @@ -0,0 +1,29 @@ +const fs = require("fs"); + +const PEOPLE_PATH = "./people.json"; + +const [actor] = process.argv.slice(2); + +console.log(`Triggered by ${actor}`); + +if (!fs.existsSync(PEOPLE_PATH)) { + throw "No people file found"; +} + +let people; +try { + people = JSON.parse(fs.readFileSync(PEOPLE_PATH)); +} catch (err) { + throw "Could not read people.json as JSON"; +} + +const person = people.find(person => person.github === actor); +if (!person) { + throw `${actor} isn't in people.json!`; +} + +if (!(person.entries && person.entries.length > 0)) { + throw `${actor} is missing entries!`; +} + +console.log("Checked!"); -- cgit v1.2.3-70-g09d2 From 8af5f6d9351554b22e75650487d1afe5745df39b Mon Sep 17 00:00:00 2001 From: braxtonhall Date: Mon, 24 Oct 2022 12:23:51 -0700 Subject: Make PR workflow a little stricter --- bin/checkPeople.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/checkPeople.js b/bin/checkPeople.js index 60527b9..3c564a4 100644 --- a/bin/checkPeople.js +++ b/bin/checkPeople.js @@ -26,4 +26,11 @@ if (!(person.entries && person.entries.length > 0)) { throw `${actor} is missing entries!`; } +for (const entry of person.entries) { + const {link} = entry; + if (!(link.startsWith("http") || fs.existsSync(link))) { + throw `${link} not found!`; + } +} + console.log("Checked!"); -- cgit v1.2.3-70-g09d2