From c1f8fe47f0cdb68e14808807f9c96ac89d931fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= Date: Mon, 6 Jan 2020 09:49:27 +0100 Subject: [PATCH 1/4] Explanation --- src/shared/md/2010-02-15-true-has-a-value.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/md/2010-02-15-true-has-a-value.md b/src/shared/md/2010-02-15-true-has-a-value.md index 3a39f626..96938708 100644 --- a/src/shared/md/2010-02-15-true-has-a-value.md +++ b/src/shared/md/2010-02-15-true-has-a-value.md @@ -1,10 +1,12 @@ [@AtomFusion](http://twitter.com/AtomFusion) shows us that true sometimes has a value. ``` - (true + 1) === 2;​ ​// true + (true + 1) === 2; // true (true + true) === 2; // true true === 2; // false true === 1; // false ``` -Wow wtf. \ No newline at end of file +Wow wtf. + +*Explanation*: `true` is not actually `1`, but when you add `1` to it, `valueOf()` is called in order to cast it to a number so that JavaScript is able sum these two values which are now of the same type (double). From 1c3a086bef0601964bae40f89858390b882fe893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= Date: Mon, 6 Jan 2020 09:49:42 +0100 Subject: [PATCH 2/4] Formatting --- src/shared/md/2010-02-15-true-has-a-value.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/md/2010-02-15-true-has-a-value.md b/src/shared/md/2010-02-15-true-has-a-value.md index 96938708..f1d3c933 100644 --- a/src/shared/md/2010-02-15-true-has-a-value.md +++ b/src/shared/md/2010-02-15-true-has-a-value.md @@ -9,4 +9,4 @@ Wow wtf. -*Explanation*: `true` is not actually `1`, but when you add `1` to it, `valueOf()` is called in order to cast it to a number so that JavaScript is able sum these two values which are now of the same type (double). +**Explanation**: `true` is not actually `1`, but when you add `1` to it, `valueOf()` is called in order to cast it to a number so that JavaScript is able sum these two values which are now of the same type (double). From eb0297b8b60af366add4517fd9eb0600acc6f834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= Date: Mon, 6 Jan 2020 15:12:41 +0100 Subject: [PATCH 3/4] decode wtfID url param --- src/html/get-wtfs-000wtfID/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/html/get-wtfs-000wtfID/index.js b/src/html/get-wtfs-000wtfID/index.js index accb2f4f..288bacda 100644 --- a/src/html/get-wtfs-000wtfID/index.js +++ b/src/html/get-wtfs-000wtfID/index.js @@ -6,7 +6,7 @@ var arc = require('@architect/functions') var layout = require('@architect/shared/layout') function route(req, res) { - var filename = req.params.wtfID + '.md' + var filename = decodeURI(req.params.wtfID) + '.md' var filepath = path.join(__dirname, 'node_modules', '@architect', 'shared', 'md', filename) exists(filepath, function _exists(err, yasqueen) { if (err) { From 0a89a48e32e13a4b77206377dfebfe74029ac846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= Date: Mon, 6 Jan 2020 15:15:44 +0100 Subject: [PATCH 4/4] encode wtfid --- src/html/get-wtfs/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/html/get-wtfs/index.js b/src/html/get-wtfs/index.js index 622c51fc..14c27034 100644 --- a/src/html/get-wtfs/index.js +++ b/src/html/get-wtfs/index.js @@ -8,6 +8,7 @@ var files = fs.readdirSync(__dirname + '/node_modules/@architect/shared/md').fil function link(file) { var val = file.replace('.md', '') var name = val.replace(/-/g, ' ') + var name = encodeURI(name) return `
  • ${name}
  • ` }