aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/pull.yml24
-rw-r--r--bin/checkPeople.js36
-rw-r--r--entries/nritschel/assets/scratch.pngbin0 -> 752302 bytes
-rw-r--r--entries/nritschel/scratch/README.md1
-rw-r--r--entries/nritschel/scratch/fib.sb3bin0 -> 43364 bytes
-rw-r--r--entries/nritschel/xlsx/fib.xlsxbin0 -> 11704 bytes
-rw-r--r--entries/zgrannan/Fib.hs18
-rw-r--r--people.json19
8 files changed, 98 insertions, 0 deletions
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..3c564a4
--- /dev/null
+++ b/bin/checkPeople.js
@@ -0,0 +1,36 @@
+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!`;
+}
+
+for (const entry of person.entries) {
+ const {link} = entry;
+ if (!(link.startsWith("http") || fs.existsSync(link))) {
+ throw `${link} not found!`;
+ }
+}
+
+console.log("Checked!");
diff --git a/entries/nritschel/assets/scratch.png b/entries/nritschel/assets/scratch.png
new file mode 100644
index 0000000..5883245
--- /dev/null
+++ b/entries/nritschel/assets/scratch.png
Binary files 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 @@
+<img src="../assets/scratch.png" alt="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
--- /dev/null
+++ b/entries/nritschel/scratch/fib.sb3
Binary files differ
diff --git a/entries/nritschel/xlsx/fib.xlsx b/entries/nritschel/xlsx/fib.xlsx
new file mode 100644
index 0000000..e1b662d
--- /dev/null
+++ b/entries/nritschel/xlsx/fib.xlsx
Binary files differ
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 e63fc4d..67fb11d 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"
}
]
},
@@ -224,5 +232,16 @@
"link": "./entries/nxjfxu/fib.hs"
}
]
+ },
+ {
+ "github": "zgrannan",
+ "name": "Zack Grannan",
+ "title": "MSc Computer Science Student, UBC",
+ "entries": [
+ {
+ "name": "haskell",
+ "link": "./entries/zgrannan/Fib.hs"
+ }
+ ]
}
]