From 8e7a333520e576c849fe23205ec5fc582fbeb525 Mon Sep 17 00:00:00 2001 From: ahmednaguib Date: Tue, 9 Jun 2015 23:42:33 +0200 Subject: [PATCH 1/9] add link for slack channel --- seed_data/challenges/basic-bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/challenges/basic-bonfires.json b/seed_data/challenges/basic-bonfires.json index 01abab5f26..1de1a952e0 100644 --- a/seed_data/challenges/basic-bonfires.json +++ b/seed_data/challenges/basic-bonfires.json @@ -12,7 +12,7 @@ "Pair Programming is where two people code together on the same computer. It is an efficient way to collaborate, and widely practiced at software companies. Pair Programming is one of the core concepts of \"Agile\" Software Development, which you will hear more about later.", "Many people use Skype or Google Hangouts to pair program, but if you talk with professional software engineers, they will tell you that it's not really pair programming unless both people have the ability to use the keyboard and mouse.", "The most popular tool for pair programming is Screen Hero. You can download Screen Hero for Mac or Windows. Create your new user account from within the app.", - "We have a special chat room for people ready to pair program. Go to our Slack chat room, navigate to the #letspair channel and type \"Hello Pair Programmers!\"", + "We have a special chat room for people ready to pair program. Go to our Slack chat room, navigate to the #letspair channel and type \"Hello Pair Programmers!\"", "If someone is available, they will be your \"pair\" - the person you pair programming with.", "If no one gets back to you in the first few minutes, don't worry. There will be lots of opportunities to pair program in the future.", "If someone does get back to you, private message them and ask for the email address they used to register Screen Hero.", From b7e7eb692fbc01868fa823d7e39cc75dacb3fdae Mon Sep 17 00:00:00 2001 From: ahmednaguib Date: Tue, 9 Jun 2015 23:43:58 +0200 Subject: [PATCH 2/9] add alert message for outdated video --- seed_data/challenges/basic-bonfires.json | 1 + 1 file changed, 1 insertion(+) diff --git a/seed_data/challenges/basic-bonfires.json b/seed_data/challenges/basic-bonfires.json index 1de1a952e0..2d42da6452 100644 --- a/seed_data/challenges/basic-bonfires.json +++ b/seed_data/challenges/basic-bonfires.json @@ -8,6 +8,7 @@ "difficulty": 0.44, "challengeSeed": "119657641", "description": [ + "Please note that this video is a little outdated, for now you can read the following steps instead. We are working on a new video in the mean time.", "OK, we're finally ready to start pair programming!", "Pair Programming is where two people code together on the same computer. It is an efficient way to collaborate, and widely practiced at software companies. Pair Programming is one of the core concepts of \"Agile\" Software Development, which you will hear more about later.", "Many people use Skype or Google Hangouts to pair program, but if you talk with professional software engineers, they will tell you that it's not really pair programming unless both people have the ability to use the keyboard and mouse.", From 243f4cd2ec9001a73ac83c097d1860c83f371914 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Wed, 10 Jun 2015 23:04:43 -0700 Subject: [PATCH 3/9] update twitch page and add new cities --- seed_data/field-guides.json | 18 ++---------------- views/resources/twitch.jade | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/seed_data/field-guides.json b/seed_data/field-guides.json index ecdb3b2b53..56ad3be106 100644 --- a/seed_data/field-guides.json +++ b/seed_data/field-guides.json @@ -394,6 +394,8 @@ "
  • Lagos
  • ", "
  • Lahore
  • ", "
  • Leesburg
  • ", + "
  • Lehi
  • ", + "
  • Lima
  • ", "
  • Limassol
  • ", "
  • London
  • ", "
  • Los Angeles
  • ", @@ -509,22 +511,6 @@ "" ] }, - { - "_id": "bd7158d9c442eddfaeb5b2ef", - "name": "Why doesn't Free Code Camp teach technical interviewing skills?", - "dashedName": "why-doesnt-free-code-camp-teach-technical-interviewing-skills", - "description": [ - "
    ", - "

    The skills you'll need to succeed in the job interview are quite different from the skills you'll need to succeed on the job.


    ", - "

    Employers are gradually moving to a pair-programming interview format. You don't need to make special preparations for these types of interviews - just pair program like you would on any Free Code Camp project.

    ", - "

    If you intend to apply for a job at older tech companies like Apple, Microsoft, Google, Facebook or Amazon, you should prepare for your interviews by working through this single authoritative book:

    ", - " ", - "

    You can download the 4th edition of this book in PDF form for free here or buy the 5th edition of the book here.", - "

    Many of the questions you'll be asked during your interviews will come straight out of this book, which is standard-issue in Silicon Valley.

    ", - "

    We may focus more on interview preparation in the future if we determine that it's necessary. In the mean time, Free Code Camp will continue to focus skills that are directly related to becoming a job-ready software engineer.", - "

    " - ] - }, { "_id": "bd7158d9c442eddfaeb5bdef", "name": "How do I best use the Global Control Shortcuts for Mac?", diff --git a/views/resources/twitch.jade b/views/resources/twitch.jade index e47b9e63b7..678d983411 100644 --- a/views/resources/twitch.jade +++ b/views/resources/twitch.jade @@ -31,6 +31,21 @@ block content .col-xs-12 h2 Here are some of our previous shows (you can full-screen them): .row.negative-20 + .col-xs-12.col-sm-12.col-md-6 + .embed-responsive.embed-responsive-16by9.big-break + iframe.embed-responsive-item(src='//www.youtube.com/embed/Z_43xApGB9Y') + p.wrappable.negative-45 link:   + a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/Z_43xApGB9Y + .col-xs-12.col-sm-12.col-md-6 + .embed-responsive.embed-responsive-16by9.big-break + iframe.embed-responsive-item(src='//www.youtube.com/embed/PvWHzcebjjQ') + p.wrappable.negative-45 link:   + a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/PvWHzcebjjQ + .col-xs-12.col-sm-12.col-md-6 + .embed-responsive.embed-responsive-16by9.big-break + iframe.embed-responsive-item(src='//www.youtube.com/embed/yHL6mEr-LGY') + p.wrappable.negative-45 link:   + a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/yHL6mEr-LGY .col-xs-12.col-sm-12.col-md-6 .embed-responsive.embed-responsive-16by9.big-break iframe.embed-responsive-item(src='//www.youtube.com/embed/dolG-yRMcPs') @@ -46,11 +61,6 @@ block content iframe.embed-responsive-item(src='//www.youtube.com/embed/bbFVxaza8Ik') p.wrappable.negative-45 link:   a(href="http://www.youtube.com/watch/S7iRBZJwOAs") http://www.youtube.com/watch/bbFVxaza8Ik - .col-xs-12.col-sm-12.col-md-6 - .embed-responsive.embed-responsive-16by9.big-break - iframe.embed-responsive-item(src='//www.youtube.com/embed/6okiEBZ2y-Y') - p.wrappable.negative-45 link:   - a(href="http://www.youtube.com/watch/BHNRg39ZblE") http://www.youtube.com/watch/6okiEBZ2y-Y br br br From a87757b35cc796d0bf18a5dc8c3acee88bc73409 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Wed, 10 Jun 2015 23:06:44 -0700 Subject: [PATCH 4/9] fix #888 --- seed_data/challenges/basic-html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json index a8f99f266c..ca0f358a27 100644 --- a/seed_data/challenges/basic-html5-and-css.json +++ b/seed_data/challenges/basic-html5-and-css.json @@ -201,7 +201,7 @@ ], "tests": [ "assert(($('h1').length === 0), 'Comment out your h1 element so that it is not visible on your page.')", - "assert(($('h2').length > 0), 'Leave your h2 element uncommented so that is not visible on your page.')", + "assert(($('h2').length > 0), 'Leave your h2 element uncommented so that it is visible on your page.')", "assert(($('p').length === 0), 'Comment out your p element so that it is not visible on your page.')", "assert(editor.match(/-->/g).length > 1, 'Be sure to close each of your comments with -->.')" ], From 52840884e6830b94a80a53b1b5db56d1423338dd Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Wed, 10 Jun 2015 23:13:33 -0700 Subject: [PATCH 5/9] fix 883 --- seed_data/challenges/basic-html5-and-css.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json index ca0f358a27..35941c9578 100644 --- a/seed_data/challenges/basic-html5-and-css.json +++ b/seed_data/challenges/basic-html5-and-css.json @@ -1304,7 +1304,7 @@ "assert($('ul').length > 0, 'Create a ul element.')", "assert($('li').length > 2, 'Add three li elements to your ul element.')", "assert(editor.match(/<\\/ul>/g) && editor.match(/
      /g).length === editor.match(/
        ul element has a closing tag.')", - "assert(editor.match(/<\\/li>/g) && editor.match(/
      • /g).length === editor.match(/
      • li element has a closing tag.')" + "assert(editor.match(/<\\/li>/g) && editor.match(/
      • /g) && editor.match(/<\\/li>/g).length === editor.match(/
      • /g).length, 'Make sure your li element has a closing tag.')" ], "challengeSeed": [ "", @@ -1372,7 +1372,7 @@ "assert($('li').length > 5, 'You should have three li elements within your ol element.')", "assert(editor.match(/<\\/ul>/g) && editor.match(/<\\/ul>/g).length === editor.match(/
          /g).length, 'Make sure your ul element has a closing tag.')", "assert(editor.match(/<\\/ol>/g) && editor.match(/<\\/ol>/g).length === editor.match(/
            /g).length, 'Make sure your ol element has a closing tag.')", - "assert(editor.match(/<\\/li>/g) && editor.match(/<\\/li>/g).length === editor.match(/
          1. /g).length, 'Make sure your li element has a closing tag.')" + "assert(editor.match(/<\\/li>/g) && editor.match(/
          2. /g) && editor.match(/<\\/li>/g).length === editor.match(/
          3. /g).length, 'Make sure your li element has a closing tag.')" ], "challengeSeed": [ "", From e190aacd9b8474f1f84fcd4d1b48efd66a01e87c Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Wed, 10 Jun 2015 23:45:03 -0700 Subject: [PATCH 6/9] update pair programming challenge text --- seed_data/challenges/basic-bonfires.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed_data/challenges/basic-bonfires.json b/seed_data/challenges/basic-bonfires.json index 2d42da6452..3773c4da22 100644 --- a/seed_data/challenges/basic-bonfires.json +++ b/seed_data/challenges/basic-bonfires.json @@ -8,12 +8,12 @@ "difficulty": 0.44, "challengeSeed": "119657641", "description": [ - "Please note that this video is a little outdated, for now you can read the following steps instead. We are working on a new video in the mean time.", + "Please note that the video for this challenge is a little outdated, and doesn't perfectly match these steps. We plan to record a new video soon.", "OK, we're finally ready to start pair programming!", "Pair Programming is where two people code together on the same computer. It is an efficient way to collaborate, and widely practiced at software companies. Pair Programming is one of the core concepts of \"Agile\" Software Development, which you will hear more about later.", "Many people use Skype or Google Hangouts to pair program, but if you talk with professional software engineers, they will tell you that it's not really pair programming unless both people have the ability to use the keyboard and mouse.", "The most popular tool for pair programming is Screen Hero. You can download Screen Hero for Mac or Windows. Create your new user account from within the app.", - "We have a special chat room for people ready to pair program. Go to our Slack chat room, navigate to the #letspair channel and type \"Hello Pair Programmers!\"", + "We have a special chat room for people ready to pair program. Go to our http://freecodecamp.slack.com/messages/letspair and type \"Hello Pair Programmers!\"", "If someone is available, they will be your \"pair\" - the person you pair programming with.", "If no one gets back to you in the first few minutes, don't worry. There will be lots of opportunities to pair program in the future.", "If someone does get back to you, private message them and ask for the email address they used to register Screen Hero.", From 070a80cb796adada7a45c88f4a8b896dcea87e62 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Fri, 12 Jun 2015 11:38:00 -0700 Subject: [PATCH 7/9] set saltfactor for Passwords --- common/models/user.js | 2 ++ common/models/user.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/models/user.js b/common/models/user.js index af104e8e39..0806d97e0b 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -8,6 +8,8 @@ module.exports = function(User) { // see: // https://github.com/strongloop/loopback/issues/1137#issuecomment-109200135 delete User.validations.email; + // set salt factor for passwords + User.settings.saltWorkFactor = 5; debug('setting up user hooks'); // send verification email to new camper User.afterRemote('create', function(ctx, user, next) { diff --git a/common/models/user.json b/common/models/user.json index 7aeca01d1e..8e15a241dc 100644 --- a/common/models/user.json +++ b/common/models/user.json @@ -242,5 +242,5 @@ "property": "doesExist" } ], - "methods": ["login"] + "methods": [] } From 0f5f92b937768adf3bc29a7d4dc39f51a5d8ad43 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Fri, 12 Jun 2015 11:58:31 -0700 Subject: [PATCH 8/9] fix user deletion of credentials should use a where clause with destroyAll --- server/boot/a-extendUser.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/server/boot/a-extendUser.js b/server/boot/a-extendUser.js index 951705c650..ff4b08ed2c 100644 --- a/server/boot/a-extendUser.js +++ b/server/boot/a-extendUser.js @@ -1,32 +1,36 @@ var Rx = require('rx'); var debug = require('debug')('freecc:user:remote'); -function destroyById(id, Model) { - return Rx.Observable.create(function(observer) { - Model.destroyById(id, function(err) { - if (err) { return observer.onError(err); } - observer.onCompleted(); - }); - return Rx.Disposable(Rx.helpers.noop); - }); +function destroyAllRelated(id, Model) { + return Rx.Observable.fromNodeCallback( + Model.destroyAll, + Model + )({ userId: id }); } module.exports = function(app) { var User = app.models.User; var UserIdentity = app.models.UserIdentity; var UserCredential = app.models.UserCredential; - User.observe('after delete', function(ctx, next) { + User.observe('before delete', function(ctx, next) { debug('removing user', ctx.where); var id = ctx.where && ctx.where.id ? ctx.where.id : null; if (!id) { return next(); } Rx.Observable.combineLatest( - destroyById(id, UserIdentity), - destroyById(id, UserCredential), - Rx.helpers.noop + destroyAllRelated(id, UserIdentity), + destroyAllRelated(id, UserCredential), + function(identData, credData) { + return { + identData: identData, + credData: credData + }; + } ).subscribe( - Rx.helpers.noop, + function(data) { + debug('deleted', data); + }, function(err) { debug('error deleting user %s stuff', id, err); next(err); From 63937c3a56775d018fd00e970c63a4268105a3f8 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Fri, 12 Jun 2015 13:14:07 -0700 Subject: [PATCH 9/9] fix make usernames required --- common/models/user.json | 16 ++++++++++++++-- server/config.json | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/common/models/user.json b/common/models/user.json index 8e15a241dc..ff0cab3495 100644 --- a/common/models/user.json +++ b/common/models/user.json @@ -44,7 +44,8 @@ "username": { "type": "string", "lowercase": true, - "trim": true + "trim": true, + "id": true }, "bio": { "type": "string", @@ -226,7 +227,18 @@ } }, "validations": [], - "relations": {}, + "relations": { + "credentials": { + "type": "hasMany", + "model": "userCredential", + "foreignKey": "" + }, + "identities": { + "type": "hasMany", + "model": "userIdentity", + "foreignKey": "" + } + }, "acls": [ { "accessType": "*", diff --git a/server/config.json b/server/config.json index 643481ac45..953b2f37c5 100644 --- a/server/config.json +++ b/server/config.json @@ -2,7 +2,7 @@ "restApiRoot": "/api", "host": "0.0.0.0", "port": 3000, - "legacyExplorer" : false, + "legacyExplorer": false, "remoting": { "context": { "enableHttpContext": false