From 99304b3a04eeb200ac0f058730844a7f5d5a0329 Mon Sep 17 00:00:00 2001 From: SaintPeter Date: Fri, 31 Jul 2015 17:58:14 -0700 Subject: [PATCH 1/5] Added additional tests to Sorted Union Bonfire --- seed/challenges/basic-bonfires.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index b2a49c8ce3..36b9c4b1c0 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -1074,9 +1074,12 @@ ], "tests": [ "assert.deepEqual(unite([1, 3, 2], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4], 'should return the union of the given arrays');", - "assert.deepEqual(unite([1, 3, 2], [1, [5]], [2, [4]]), [1, 3, 2, [5], [4]], 'should not flatten nested arrays');" + "assert.deepEqual(unite([1, 3, 2], [1, [5]], [2, [4]]), [1, 3, 2, [5], [4]], 'should not flatten nested arrays');", + "assert.deepEqual(unite([1, 2, 3], [5, 2, 1]), [1, 2, 3, 5], 'should correctly handle exactly two arguments');", + "assert.deepEqual(unite([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [ 1, 2, 3, 5, 4, 6, 7, 8 ], 'should correctly handle higher numbers of arguments');" ], "MDNlinks": [ + "Arguments object", "Array.reduce()" ], "challengeType": 5, From 8270cb4103b478c692be95dbb039ae6d3f41b708 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Sat, 1 Aug 2015 08:38:42 -0700 Subject: [PATCH 2/5] add github auth --- package.json | 1 + server/passport-providers.js | 14 ++++++++++++++ server/views/account/signin.jade | 21 ++++++++++++--------- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 1a994358a5..4e96eda08e 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "nodemailer": "~1.3.0", "object.assign": "^3.0.0", "passport-facebook": "^2.0.0", + "passport-github": "^0.1.5", "passport-google-oauth2": "^0.1.6", "passport-linkedin-oauth2": "^1.2.1", "passport-local": "^1.0.0", diff --git a/server/passport-providers.js b/server/passport-providers.js index b60ad8f51e..ddd29f64db 100644 --- a/server/passport-providers.js +++ b/server/passport-providers.js @@ -127,5 +127,19 @@ module.exports = { state: process.env.LINKEDIN_STATE }, failureFlash: true + }, + 'github-login': { + provider: 'github', + authScheme: 'oauth2', + module: 'passport-github', + authPath: '/auth/github', + callbackURL: '/auth/github/callback', + callbackPath: '/auth/github/callback', + successRedirect: successRedirect, + failureRedirect: failureRedirect, + clientID: process.env.GITHUB_ID, + clientSecret: process.env.GITHUB_SECRET, + scope: ['email'], + failureFlash: true } }; diff --git a/server/views/account/signin.jade b/server/views/account/signin.jade index c19384964b..878b278ba4 100644 --- a/server/views/account/signin.jade +++ b/server/views/account/signin.jade @@ -2,18 +2,21 @@ extends ../layout block content .jumbotron.text-center h2 Sign in with one of these options: - a.btn.btn-lg.btn-block.btn-google-plus.btn-social(href='/auth/google') - i.fa.fa-google-plus - | Sign in with Google - a.btn.btn-lg.btn-block.btn-facebook.btn-social(href='/auth/facebook') - i.fa.fa-facebook - | Sign in with Facebook - a.btn.btn-lg.btn-block.btn-linkedin.btn-social(href='/auth/linkedin') - i.fa.fa-linkedin - | Sign in with LinkedIn + a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/github') + i.fa.fa-github + | Sign in with Github a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/twitter') i.fa.fa-twitter | Sign in with Twitter + a.btn.btn-lg.btn-block.btn-facebook.btn-social(href='/auth/facebook') + i.fa.fa-facebook + | Sign in with Facebook + a.btn.btn-lg.btn-block.btn-google-plus.btn-social(href='/auth/google') + i.fa.fa-google-plus + | Sign in with Google + a.btn.btn-lg.btn-block.btn-linkedin.btn-social(href='/auth/linkedin') + i.fa.fa-linkedin + | Sign in with LinkedIn br p a(href="/email-signup") Or sign up using your email address here. From 744323691269b77b1dd20305df4d2e1201c23df0 Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Sat, 1 Aug 2015 19:12:44 +0100 Subject: [PATCH 3/5] Added extra regex moving on to fix scroller without those new images --- seed/challenges/basic-javascript.json | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index ab02c594ae..cd682bd51f 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -1069,6 +1069,35 @@ ], "challengeType": 1 }, + { + "id":"cf1111c1c13feddfaeb3bdef", + "name":"Inverting a Match", + "dashedName":"waypoint-inverting-a-match", + "difficulty":"9.987", + "description":[ + "", + "Use /\\S+/gi; to match everything that ins't a space in the string", + "You can invert any match by using the uppercase version of the selector \\s versus \\S for example" + ], + "tests":[ + "assert(test === 36, 'Your RegEx should have found seven spaces in the testString');", + "assert(editorValue.match(/\\/\\\\S\\/gi/gi), 'You should be using the following expression /\\S+/gi to find the spaces in the testString');" + ], + "challengeSeed":[ + "var test = (function(){", + " var testString = \"How many spaces are there in this sentance.\";", + "", + "//Do Not Modify Above", + "", + " var expression = /.+/gi;", + "", + "//Do Not Modify Below", + "", + " return(testString.match(expression).length);", + "})();(function(){return(test);})();" + ], + "challengeType":1 + }, { "id":"cf1111c1c12feddfaeb9bdef", "name":"Creating a slots machine", From fd0307ffcf8d71b5bfd87564d8b0f074b5ce78d8 Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Sat, 1 Aug 2015 19:13:37 +0100 Subject: [PATCH 4/5] Added extra regex moving on to fix scroller without those new images --- seed/challenges/basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index cd682bd51f..5a2a5a28eb 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -1109,7 +1109,7 @@ "For this we will need to generate three random numbers between 1 and 5 to represent the possible values of each individual slot", "Store the three random numbers in slotOne, slotTwo and slotThree", "Generate the random numbers by using the system we used earlier in /challenges/random-whole-numbers-in-a-range", - " Math.floor(Math.random() * (5 - 1 + 1)) + 1; ." + " Math.floor(Math.random() * (5 - 1 + 1)) + 1; " ], "tests":[ "assert(typeof(runSlots($('.slot'))[0]) == 'number', 'SlotOne should be a random number');", From 13bb5df68d3c5d6a0742e676a3522c61ecbf70ec Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Sat, 1 Aug 2015 19:14:30 +0100 Subject: [PATCH 5/5] Added extra regex moving on to fix scroller without those new images --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index c55daf01da..af48fb9746 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -126,7 +126,7 @@ gulp.task('serve', function(cb) { script: paths.server, ext: '.js .json', ignore: paths.serverIgnore, - exec: path.join(__dirname, 'node_modules/.bin/babel-node'), + exec: '%cd%/node_modules/.bin/babel-node', env: { 'NODE_ENV': 'development', 'DEBUG': process.env.DEBUG || 'freecc:*'