From ddb88643e05de4dd94ff47e18c0eba47dda9145b Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Tue, 14 Apr 2015 21:19:05 -0700 Subject: [PATCH] Nathan's updates to the userMigration script' --- seed_data/coursewares.json | 2 +- seed_data/userMigration.js | 17 ++++++++++++++++- views/partials/meta.jade | 4 ++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/seed_data/coursewares.json b/seed_data/coursewares.json index 2c989b173d2..123f31d6be8 100644 --- a/seed_data/coursewares.json +++ b/seed_data/coursewares.json @@ -599,7 +599,7 @@ "Pair program as much as possible with different campers until you've completed all the Bonfire, Zipline and Basejump challenges. This is a big time investment, but the JavaScript practice you get will be well worth it!", "Mark this challenge as complete and move on to the Bonfires.", "Keep in mind, the Bonfires are a significant challenge in and of themselves. You are not expected to complete them in one sitting, or to complete them before moving on to our next challenges. Mix them in as you keep learning and have fun!", - "In order to participate in our non-profit projects you will need to have successfully completed all \"3 flame\" bonfires and below. Lasly, completing bonfires is not meant to be a sisyphean task. You won't be required to complete new bonfires that are of lower difficuly than you've already completed!" + "In order to participate in our non-profit projects you will need to have successfully completed all \"3 flame\" bonfires and below. Lastly, completing bonfires is not meant to be a sisyphean task. You won't be required to complete new bonfires that are of lower difficuly than you've already completed!" ], "challengeType": 2, "tests": [] diff --git a/seed_data/userMigration.js b/seed_data/userMigration.js index 696ddb1deb0..c02a18385b8 100644 --- a/seed_data/userMigration.js +++ b/seed_data/userMigration.js @@ -9,7 +9,22 @@ var mongodb = require('mongodb'), mongoose.connect(secrets.db); var i = 1; -var stream = User.find({}).skip(0).limit(0).batchSize(1000).stream(); +var stream = User.find({}).skip(0).limit(0).stream(); + +stream.on('data', function(user) { + console.log(i++); + user.save() +}) +.on('error', function (err) { + console.log(err); +}).on('close', function () { + console.log('done with set'); + stream.destroy(); +}); + +i = 1; + +var stream = User.find({'user.needsMigration': true}).skip(0).limit(0).stream(); stream.on('data', function (user) { if (user.challengesHash) { diff --git a/views/partials/meta.jade b/views/partials/meta.jade index ebaba6a9b2a..6a061404fb9 100644 --- a/views/partials/meta.jade +++ b/views/partials/meta.jade @@ -21,7 +21,7 @@ meta(name="twitter:creator", content="@freecodecamp") meta(name="twitter:url", content="http://www.freecodecamp.com") meta(name="twitter:site", content="@freecodecamp") meta(name="twitter:card", content="summary_large_image") -meta(name="twitter:image:src", content="https://s3.amazonaws.com/freecodecamp/challenges.png") +meta(name="twitter:image:src", content="https://s3.amazonaws.com/freecodecamp/1000-hours-of-coding.jpg") meta(name="twitter:title", content="Free Code Camp: a community of busy people learning to code") meta(name="twitter:description", content="We're a community of busy people learning to code by collaborating on projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our online coding bootcamp.") meta(content="a40ee5d5dba3bb091ad783ebd2b1383f", name="p:domain_verify") @@ -54,4 +54,4 @@ link(rel="mstile", sizes="310x310", href="https://s3.amazonaws.com/freecodecamp/ link(rel="mstile", sizes="310x150", href="https://s3.amazonaws.com/freecodecamp/favicons/mstile-310x150.png") link(rel="mstile", sizes="70x70", href="https://s3.amazonaws.com/freecodecamp/favicons/mstile-70x70.png") link(rel="favicon", href="https://s3.amazonaws.com/freecodecamp/favicons/favicon.ico") -link(rel='shortcut icon', href='//s3.amazonaws.com/freecodecamp/favicons/favicon.ico') \ No newline at end of file +link(rel='shortcut icon', href='//s3.amazonaws.com/freecodecamp/favicons/favicon.ico')