Merge branch 'staging' of https://github.com/FreeCodeCamp/freecodecamp into greasan-translateDE

This commit is contained in:
greasan
2015-06-15 18:54:20 +02:00
37 changed files with 1474 additions and 300 deletions

View File

@ -8,6 +8,9 @@
"type": "string",
"unique": true
},
"dashedName": {
"type": "string"
},
"difficulty": {
"type": "string"
},

View File

@ -10,6 +10,16 @@ module.exports = function(User) {
delete User.validations.email;
// set salt factor for passwords
User.settings.saltWorkFactor = 5;
// username should not be in blacklist
User.validatesExclusionOf('username', {
'in': blacklistedUsernames,
message: 'is taken'
});
// username should be unique
User.validatesUniquenessOf('username');
debug('setting up user hooks');
// send verification email to new camper
User.afterRemote('create', function(ctx, user, next) {

View File

@ -45,7 +45,7 @@
"type": "string",
"lowercase": true,
"trim": true,
"id": true
"require": true
},
"bio": {
"type": "string",

View File

@ -1,16 +1,18 @@
var gulp = require('gulp'),
debug = require('debug')('freecc:gulp'),
bower = require('bower-main-files'),
nodemon = require('gulp-nodemon'),
sync = require('browser-sync'),
reload = sync.reload,
inject = require('gulp-inject'),
reloadDelay = 1000,
eslint = require('gulp-eslint');
debug = require('debug')('freecc:gulp'),
bower = require('bower-main-files'),
nodemon = require('gulp-nodemon'),
sync = require('browser-sync'),
reload = sync.reload,
inject = require('gulp-inject'),
reloadDelay = 1000,
less = require('gulp-less'),
path = require('path'),
eslint = require('gulp-eslint');
var paths = {
server: './server/server.js',
serverIgnore: []
server: './server/server.js',
serverIgnore: []
};
gulp.task('inject', function() {
@ -22,50 +24,58 @@ gulp.task('inject', function() {
});
gulp.task('serve', function(cb) {
var called = false;
nodemon({
script: paths.server,
ext: '.js',
ignore: paths.serverIgnore,
env: {
'NODE_ENV': 'development',
'DEBUG': process.env.DEBUG || 'freecc:*'
}
var called = false;
nodemon({
script: paths.server,
ext: '.js',
ignore: paths.serverIgnore,
env: {
'NODE_ENV': 'development',
'DEBUG': process.env.DEBUG || 'freecc:*'
}
})
.on('start', function() {
if (!called) {
called = true;
setTimeout(function() {
cb();
}, reloadDelay);
}
})
.on('start', function() {
if (!called) {
called = true;
setTimeout(function() {
cb();
}, reloadDelay);
}
})
.on('restart', function(files) {
if (files) {
debug('Files that changes: ', files);
}
setTimeout(function() {
debug('Restarting browsers');
reload();
}, reloadDelay);
});
.on('restart', function(files) {
if (files) {
debug('Files that changes: ', files);
}
setTimeout(function() {
debug('Restarting browsers');
reload();
}, reloadDelay);
});
});
gulp.task('sync', ['serve'], function() {
sync.init(null, {
proxy: 'http://localhost:3000',
logLeval: 'debug',
files: ['public/js/lib/*/*.{js, jsx}'],
port: 3001,
open: false,
reloadDelay: reloadDelay
});
sync.init(null, {
proxy: 'http://localhost:3000',
logLeval: 'debug',
files: ['public/js/lib/*/*.{js, jsx}'],
port: 3001,
open: false,
reloadDelay: reloadDelay
});
});
gulp.task('lint', function() {
return gulp.src(['public/js/lib/**/*'])
.pipe(eslint())
.pipe(eslint.format());
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task('default', ['serve', 'sync']);
gulp.task('build', function() {
return gulp.src('./public/css/*.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(gulp.dest('./public/css/'));
});
gulp.task('default', ['build', 'serve', 'sync']);

View File

@ -12,7 +12,8 @@
"scripts": {
"start": "node server/server.js",
"lint": "eslint --ext=.js,.jsx .",
"test": "mocha"
"test": "mocha",
"postinstall": "bower cache clean && bower install"
},
"license": "BSD-3-Clause",
"contributors": [
@ -50,6 +51,7 @@
"forever": "~0.14.1",
"frameguard": "^0.2.2",
"github-api": "~0.7.0",
"gulp-less": "^3.0.3",
"gulp-minify-css": "~0.5.1",
"helmet": "~0.9.0",
"helmet-csp": "^0.2.3",
@ -67,6 +69,7 @@
"mongodb": "^2.0.33",
"morgan": "~1.5.0",
"node-slack": "0.0.7",
"node-uuid": "^1.4.3",
"nodemailer": "~1.3.0",
"passport-facebook": "^2.0.0",
"passport-google-oauth": "^0.2.0",

View File

@ -176,8 +176,8 @@ ul {
font-size: 26px;
}
.ten-pixel-break {
height: 10px;
.five-pixel-break {
height: 5px;
}
.fifteen-pixel-break {
@ -201,12 +201,12 @@ ul {
.responsive-container { position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden; }
.responsive-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.positive-5 {
margin-top: 5px;
.positive-10 {
margin-top: 10px;
}
.positive-10 {
padding-top: 10px;
.positive-15-bottom {
margin-bottom: 15px;
}
.positive-15 {
@ -251,6 +251,10 @@ ul {
margin-top: -20px;
}
.negative-bottom-margin-30 {
margin-bottom: -30px;
}
.large-p {
font-size: 18px;
}

View File

@ -90,7 +90,7 @@ var testResults = [];
var postSuccess = function(data) {
var testDoc = document.createElement("div");
$(testDoc)
.html("<div class='row'><div class='col-xs-2 text-center'><i class='ion-checkmark-circled big-success-icon'></i></div><div class='col-xs-10 test-output test-vertical-center wrappable'>" + JSON.parse(data) + "</div></div><div class='ten-pixel-break'/>");
.html("<div class='row'><div class='col-xs-2 text-center'><i class='ion-checkmark-circled big-success-icon'></i></div><div class='col-xs-10 test-output test-vertical-center wrappable'>" + JSON.parse(data) + "</div>");
$('#testSuite').append(testDoc);
testSuccess();
};
@ -98,7 +98,7 @@ var postSuccess = function(data) {
var postError = function(data) {
var testDoc = document.createElement("div");
$(testDoc)
.html("<div class='row'><div class='col-xs-2 text-center'><i class='ion-close-circled big-error-icon'></i></div><div class='col-xs-10 test-vertical-center test-output wrappable'>" + JSON.parse(data) + "</div></div><div class='ten-pixel-break'/>");
.html("<div class='row'><div class='col-xs-2 text-center'><i class='ion-close-circled big-error-icon'></i></div><div class='col-xs-10 test-vertical-center test-output wrappable'>" + JSON.parse(data) + "</div>");
$('#testSuite').append(testDoc);
};
var goodTests = 0;

View File

@ -3,18 +3,21 @@
var tests = parent.tests;
var editor = parent.editorValueForIFrame;
for (var i = 0; i < tests.length; i++) {
var thisTest = true;
try {
eval(parent.tests[i]);
} catch (err) {
allTestsGood = false;
thisTest = false;
parent.postError(JSON.stringify(err.message.split(':').shift()));
} finally {
if (thisTest) {
parent.postSuccess(JSON.stringify(tests[i].split(',').pop().replace(/\'/g, '').replace(/\)/, '')));
setTimeout(function() {
for (var i = 0; i < tests.length; i++) {
var thisTest = true;
try {
eval(parent.tests[i]);
} catch (err) {
allTestsGood = false;
thisTest = false;
parent.postError(JSON.stringify(err.message.split(':').shift()));
} finally {
if (thisTest) {
parent.postSuccess(JSON.stringify(tests[i].split(',').pop().replace(
/\'/g, '').replace(/\)/, '')));
}
}
}
}
}, 10);
})();

View File

@ -5,6 +5,7 @@
{
"id": "aff0395860f5d3034dc0bfc9",
"name": "Bonfire: Validate US Telephone Numbers",
"dashedName": "bonfire-validate-us-telephone-numbers",
"difficulty": "4.01",
"description": [
"Return true if the passed string is a valid US phone number",
@ -65,6 +66,7 @@
{
"id": "a3f503de51cf954ede28891d",
"name": "Bonfire: Symmetric Difference",
"dashedName": "bonfire-symmetric-difference",
"difficulty": "4.02",
"description": [
"Create a function that takes two or more arrays and returns an array of the symmetric difference of the provided arrays.",
@ -102,6 +104,7 @@
{
"id": "aa2e6f85cab2ab736c9a9b24",
"name": "Bonfire: Exact Change",
"dashedName": "bonfire-exact-change",
"difficulty": "4.03",
"description": [
"Design a cash register drawer function that accepts purchase price as the first argument, payment as the second argument, and cash-in-drawer (cid) as the third argument.",
@ -157,6 +160,7 @@
{
"id": "a56138aff60341a09ed6c480",
"name": "Bonfire: Inventory Update",
"dashedName": "bonfire-inventory-update",
"difficulty": "4.04",
"description": [
"Compare and update inventory stored in a 2d array against a second 2d array of a fresh delivery. Update current inventory item quantity, and if an item cannot be found, add the new item and quantity into the inventory array in alphabetical order.",
@ -211,6 +215,7 @@
{
"id": "a7bf700cd123b9a54eef01d5",
"name": "Bonfire: No repeats please",
"dashedName": "bonfire-no-repeats-please",
"difficulty": "4.05",
"description": [
"Return the number of total permutations of the provided string that don't have repeated consecutive letters.",
@ -252,6 +257,7 @@
{
"id": "a19f0fbe1872186acd434d5a",
"name": "Bonfire: Friendly Date Ranges",
"dashedName": "bonfire-friendly-date-ranges",
"difficulty": "4.06",
"description": [
"Implement a way of converting two dates into a more friendly date range that could be presented to a user.",

View File

@ -5,6 +5,7 @@
{
"id": "bd7158d8c443eddfaeb5bcef",
"name": "Waypoint: Get Set for Basejumps",
"dashedName": "waypoint-get-set-for-basejumps",
"difficulty": 2.00,
"challengeSeed": ["128451852"],
"description": [
@ -66,6 +67,7 @@
{
"id": "bd7158d8c443eddfaeb5bdef",
"name": "Basejump: Build a Voting App",
"dashedName": "basejump-build-a-voting-app",
"difficulty": 2.01,
"challengeSeed": ["128451852"],
"description": [
@ -101,6 +103,7 @@
{
"id": "bd7158d8c443eddfaeb5bdff",
"name": "Basejump: Build a Nightlife Coordination App",
"dashedName": "basejump-build-a-nightlife-coordination-app",
"difficulty": 2.02,
"challengeSeed": ["128451852"],
"description": [
@ -132,6 +135,7 @@
{
"id": "bd7158d8c443eddfaeb5bd0e",
"name": "Basejump: Chart the Stock Market",
"dashedName": "basejump-chart-the-stock-market",
"difficulty": 2.03,
"challengeSeed": ["128451852"],
"description": [
@ -163,6 +167,7 @@
{
"id": "bd7158d8c443eddfaeb5bd0f",
"name": "Basejump: Manage a Book Trading Club",
"dashedName": "basejump-manage-a-book-trading-club",
"difficulty": 2.04,
"challengeSeed": ["128451852"],
"description": [
@ -194,6 +199,7 @@
{
"id": "bd7158d8c443eddfaeb5bdee",
"name": "Basejump: Build a Pinterest Clone",
"dashedName": "basejump-build-a-pinterest-clone",
"difficulty": 2.05,
"challengeSeed": ["128451852"],
"description": [

View File

@ -5,6 +5,7 @@
{
"id": "bd7139d8c441eddfaeb5bdef",
"name": "Waypoint: Pair Program on Bonfires",
"dashedName": "waypoint-pair-program-on-bonfires",
"difficulty": 0.44,
"challengeSeed": ["119657641"],
"description": [
@ -42,11 +43,11 @@
{
"id": "ad7123c8c441eddfaeb5bdef",
"name": "Bonfire: Meet Bonfire",
"dashedName": "bonfire-meet-bonfire",
"difficulty": "0",
"description": [
"Click the button below for further instructions.",
"Your goal is to fix the failing test.",
"First, run all the tests by clicking \"Run code\" or by pressing Control + Enter",
"First, run all the tests by clicking \"Run code\" or by pressing Control + Enter.",
"The failing test is in red. Fix the code so that all tests pass. Then you can move on to the next Bonfire.",
"Make this function return true no matter what."
],
@ -81,6 +82,7 @@
{
"id": "a202eed8fc186c8434cb6d61",
"name": "Bonfire: Reverse a String",
"dashedName": "bonfire-reverse-a-string",
"difficulty": "1.01",
"tests": [
"expect(reverseString('hello')).to.be.a('String');",
@ -122,6 +124,7 @@
{
"id": "a302f7aae1aa3152a5b413bc",
"name": "Bonfire: Factorialize a Number",
"dashedName": "bonfire-factorialize-a-number",
"tests": [
"expect(factorialize(5)).to.be.a(\"Number\");",
"expect(factorialize(5)).to.equal(120);",
@ -161,6 +164,7 @@
{
"id": "aaa48de84e1ecc7c742e1124",
"name": "Bonfire: Check for Palindromes",
"dashedName": "bonfire-check-for-palindromes",
"difficulty": "1.03",
"description": [
"Return true if the given string is a palindrome. Otherwise, return false.",
@ -207,6 +211,7 @@
{
"id": "a26cbbe9ad8655a977e1ceb5",
"name": "Bonfire: Find the Longest Word in a String",
"dashedName": "bonfire-find-the-longest-word-in-a-string",
"difficulty": "1.04",
"description": [
"Return the length of the longest word in the provided sentence.",
@ -246,6 +251,7 @@
{
"id": "ab6137d4e35944e21037b769",
"name": "Bonfire: Title Case a Sentence",
"dashedName": "bonfire-title-case-a-sentence",
"difficulty": "1.05",
"description": [
"Return the provided string with the first letter of each word capitalized.",
@ -283,6 +289,7 @@
{
"id": "a789b3483989747d63b0e427",
"name": "Bonfire: Return Largest Numbers in Arrays",
"dashedName": "bonfire-return-largest-numbers-in-arrays",
"difficulty": "1.06",
"description": [
"Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.",
@ -321,6 +328,7 @@
{
"id": "acda2fb1324d9b0fa741e6b5",
"name": "Bonfire: Confirm the Ending",
"dashedName": "bonfire-confirm-the-ending",
"difficulty": "1.07",
"description": [
"Check if a string (first argument) ends with the given target string (second argument).",
@ -360,6 +368,7 @@
{
"id": "afcc8d540bea9ea2669306b6",
"name": "Bonfire: Repeat a string repeat a string",
"dashedName": "bonfire-repeat-a-string-repeat-a-string",
"difficulty": "1.08",
"description": [
"Repeat a given string (first argument) n times (second argument). Return an empty string if n is a negative number.",
@ -396,6 +405,7 @@
{
"id": "ac6993d51946422351508a41",
"name": "Bonfire: Truncate a string",
"dashedName": "bonfire-truncate-a-string",
"difficulty": "1.09",
"description": [
"Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending.",
@ -433,6 +443,7 @@
{
"id": "a9bd25c716030ec90084d8a1",
"name": "Bonfire: Chunky Monkey",
"dashedName": "bonfire-chunky-monkey",
"difficulty": "1.10",
"description": [
"Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.",
@ -470,6 +481,7 @@
{
"id": "ab31c21b530c0dafa9e241ee",
"name": "Bonfire: Slasher Flick",
"dashedName": "bonfire-slasher-flick",
"difficulty": "1.11",
"description": [
"Return the remaining elements of an array after chopping off n elements from the head.",
@ -507,6 +519,7 @@
{
"id": "af2170cad53daa0770fabdea",
"name": "Bonfire: Mutations",
"dashedName": "bonfire-mutations",
"difficulty": "1.12",
"description": [
"Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.",
@ -549,6 +562,7 @@
{
"id": "adf08ec01beb4f99fc7a68f2",
"name": "Bonfire: Falsey Bouncer",
"dashedName": "bonfire-falsey-bouncer",
"difficulty": "1.50",
"description": [
"Remove all falsey values from an array.",
@ -587,6 +601,7 @@
{
"id": "a8e512fbe388ac2f9198f0fa",
"name": "Bonfire: Where art thou",
"dashedName": "bonfire-where-art-thou",
"difficulty": "1.55",
"description": [
"Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).",
@ -625,6 +640,7 @@
{
"id": "a39963a4c10bc8b4d4f06d7e",
"name": "Bonfire: Seek and Destroy",
"dashedName": "bonfire-seek-and-destroy",
"difficulty": "1.60",
"description": [
"You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.",
@ -661,6 +677,7 @@
{
"id": "a24c1a4622e3c05097f71d67",
"name": "Bonfire: Where do I belong",
"dashedName": "bonfire-where-do-i-belong",
"difficulty": "1.61",
"description": [
"Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).",
@ -697,6 +714,7 @@
{
"id": "a3566b1109230028080c9345",
"name": "Bonfire: Sum All Numbers in a Range",
"dashedName": "bonfire-sum-all-numbers-in-a-range",
"difficulty": "2.00",
"description": [
"We'll pass you an array of two numbers. Return the sum of those two numbers and all numbers between them.",
@ -736,7 +754,8 @@
},
{
"id": "a5de63ebea8dbee56860f4f2",
"name": "Bonfire: Diff Two Arrays",
"name": "bonfire-diff-two-arrays",
"dashedName": "Bonfire: Diff Two Arrays",
"difficulty": "2.01",
"description": [
"Compare two arrays and return a new array with any items not found in both of the original arrays.",
@ -782,6 +801,7 @@
{
"id": "a7f4d8f2483413a6ce226cac",
"name": "Bonfire: Roman Numeral Converter",
"dashedName": "bonfire-roman-numeral-converter",
"tests": [
"expect(convert(12)).to.equal(\"XII\");",
"expect(convert(5)).to.equal(\"V\");",
@ -822,6 +842,7 @@
{
"id": "a0b5010f579e69b815e7c5d6",
"name": "Bonfire: Search and Replace",
"dashedName": "bonfire-search-and-replace",
"tests": [
"expect(replace(\"Let us go to the store\", \"store\", \"mall\")).to.equal(\"Let us go to the mall\");",
"expect(replace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\")).to.equal(\"He is Sitting on the couch\");",
@ -865,6 +886,7 @@
{
"id": "aa7697ea2477d1316795783b",
"name": "Bonfire: Pig Latin",
"dashedName": "bonfire-pig-latin",
"tests": [
"expect(translate(\"california\")).to.equal(\"aliforniacay\");",
"expect(translate(\"paragraphs\")).to.equal(\"aragraphspay\");",
@ -908,6 +930,7 @@
{
"id": "afd15382cdfb22c9efe8b7de",
"name": "Bonfire: DNA Pairing",
"dashedName": "bonfire-dna-pairing",
"tests": [
"assert.deepEqual(pair(\"ATCGA\"),[['A','T'],['T','A'],['C','G'],['G','C'],['A','T']], 'should return the dna pair');",
"assert.deepEqual(pair(\"TTGAG\"),[['T','A'],['T','A'],['G','C'],['A','T'],['G','C']], 'should return the dna pair');",
@ -946,6 +969,7 @@
{
"id": "af7588ade1100bde429baf20",
"name": "Bonfire: Missing letters",
"dashedName": "bonfire-missing-letters",
"difficulty": "2.05",
"description": [
"Find the missing letter in the passed letter range and return it.",
@ -983,6 +1007,7 @@
{
"id": "a77dbc43c33f39daa4429b4f",
"name": "Bonfire: Boo who",
"dashedName": "bonfire-boo-who",
"difficulty": "2.06",
"description": [
"Check if a value is classified as a boolean primitive. Return true or false.",
@ -1025,6 +1050,7 @@
{
"id": "a105e963526e7de52b219be9",
"name": "Bonfire: Sorted Union",
"dashedName": "bonfire-sorted-union",
"difficulty": "2.07",
"description": [
"Write a function that takes two or more arrays and returns a new array of unique values in the order of the original provided arrays.",
@ -1062,6 +1088,7 @@
{
"id": "a6b0bb188d873cb2c8729495",
"name": "Bonfire: Convert HTML Entities",
"dashedName": "bonfire-convert-html-entities",
"difficulty": "2.07",
"description": [
"Convert the characters \"&\", \"<\", \">\", '\"', and \"'\", in a string to their corresponding HTML entities.",
@ -1097,6 +1124,7 @@
{
"id": "a103376db3ba46b2d50db289",
"name": "Bonfire: Spinal Tap Case",
"dashedName": "bonfire-spinal-tap-case",
"difficulty": "2.08",
"description": [
"Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes.",
@ -1136,6 +1164,7 @@
{
"id": "a5229172f011153519423690",
"name": "Bonfire: Sum All Odd Fibonacci Numbers",
"dashedName": "bonfire-sum-all-odd-fibonacci-numbers",
"difficulty": "2.09",
"description": [
"Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number.",
@ -1176,6 +1205,7 @@
{
"id": "a3bfc1673c0526e06d3ac698",
"name": "Bonfire: Sum All Primes",
"dashedName": "bonfire-sum-all-primes",
"difficulty": "2.10",
"description": [
"Sum all the prime numbers up to and including the provided number.",
@ -1214,6 +1244,7 @@
{
"id": "ae9defd7acaf69703ab432ea",
"name": "Bonfire: Smallest Common Multiple",
"dashedName": "bonfire-smallest-common-multiple",
"difficulty": "2.11",
"description": [
"Find the smallest number that is evenly divisible by all numbers in the provided range.",
@ -1252,6 +1283,7 @@
{
"id": "a6e40f1041b06c996f7b2406",
"name": "Bonfire: Finders Keepers",
"dashedName": "bonfire-finders-keepers",
"difficulty": "2.12",
"description": [
"Create a function that looks through an array (first argument) and returns the first element in the array that passes a truth test (second argument).",
@ -1287,6 +1319,7 @@
{
"id": "a5deed1811a43193f9f1c841",
"name": "Bonfire: Drop it",
"dashedName": "bonfire-drop-it",
"difficulty": "2.13",
"description": [
"Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.",
@ -1324,6 +1357,7 @@
{
"id": "ab306dbdcc907c7ddfc30830",
"name": "Bonfire: Steamroller",
"dashedName": "bonfire-steamroller",
"difficulty": "2.14",
"description": [
"Flatten a nested array. You must account for varying levels of nesting.",
@ -1360,6 +1394,7 @@
{
"id": "a8d97bd4c764e91f9d2bda01",
"name": "Bonfire: Binary Agents",
"dashedName": "bonfire-binary-agents",
"difficulty": "2.15",
"description": [
"Return an English translated sentence of the passed binary string.",
@ -1396,6 +1431,7 @@
{
"id": "a10d2431ad0c6a099a4b8b52",
"name": "Bonfire: Everything Be True",
"dashedName": "bonfire-everything-be-true",
"difficulty": "2.21",
"description": [
"Check if the predicate (second argument) returns truthy (defined) for all elements of a collection (first argument).",
@ -1434,6 +1470,7 @@
{
"id": "a97fd23d9b809dac9921074f",
"name": "Bonfire: Arguments Optional",
"dashedName": "bonfire-arguments-optional",
"difficulty": "2.22",
"description": [
"Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.",

View File

@ -5,6 +5,7 @@
{
"id": "bd7123c8c441eddfaeb5bdef",
"name": "Waypoint: Say Hello to HTML Elements",
"dashedName": "waypoint-say-hello-to-html-elements",
"difficulty": 0.0085,
"description": [
"Welcome to Free Code Camp's first coding challenge! Click on the button below for further instructions.",
@ -44,6 +45,7 @@
{
"id": "bad87fee1348bd9aedf0887a",
"name": "Waypoint: Headline with the h2 Element",
"dashedName": "waypoint-headline-with-the-h2-element",
"difficulty": 0.010,
"description": [
"Add an <code>h2</code> tag that says \"CatPhotoApp\" to create a second HTML <code>element</code> below your \"Hello World\" <code>h1</code> element.",
@ -80,6 +82,7 @@
{
"id": "bad87fee1348bd9aedf08801",
"name": "Waypoint: Inform with the Paragraph Element",
"dashedName": "waypoint-inform-with-the-paragraph-element",
"difficulty": 0.011,
"description": [
"Create a <code>p</code> element below your <code>h2</code> element, and give it the text \"Hello Paragraph\".",
@ -114,6 +117,7 @@
{
"id": "bad87fee1348bd9aeaf08801",
"name": "Waypoint: Visually Separate Elements with Line Breaks",
"dashedName": "waypoint-visually-separate-elements-with-line-breaks",
"difficulty": 0.012,
"description": [
"Add a <code>br</code> element to your page, preferably between two of your elements.",
@ -149,6 +153,7 @@
{
"id": "bad87fee1348bd9aedf08802",
"name": "Waypoint: Uncomment HTML",
"dashedName": "waypoint-uncomment-html",
"difficulty": 0.013,
"description": [
"Uncomment your <code>h1</code>, <code>h2</code> and <code>p</code> elements.",
@ -193,6 +198,7 @@
{
"id": "bad87fee1348bd9aedf08804",
"name": "Waypoint: Comment out HTML",
"dashedName": "waypoint-comment-out-html",
"difficulty": 0.014,
"description": [
"Comment out your <code>h1</code> element and your <code>p</code> element, but leave your <code>h2</code> element uncommented.",
@ -235,6 +241,7 @@
{
"id": "bad87fee1348bd9aedf08833",
"name": "Waypoint: Fill in the Blank with Placeholder Text",
"dashedName": "waypoint-fill-in-the-blank-with-placeholder-text",
"difficulty": 0.015,
"description": [
"Replace the text inside your <code>p</code> element with the first few words of the provided \"Kitty Ipsum\" text.",
@ -276,6 +283,7 @@
{
"id": "bad87fed1348bd9aedf08833",
"name": "Waypoint: Delete HTML Elements",
"dashedName": "waypoint-delete-html-elements",
"difficulty": 0.016,
"description": [
"Delete your <code>h1</code> and <code>br</code> elements so we can simplify our view.",
@ -316,6 +324,7 @@
{
"id": "bad87fee1348bd9aedf08803",
"name": "Waypoint: Change the Color of Text",
"dashedName": "waypoint-change-the-color-of-text",
"difficulty": 0.017,
"description": [
"Change your <code>h2</code> element's style so that its text color is red.",
@ -351,6 +360,7 @@
{
"id": "bad87fee1348bd9aedf08805",
"name": "Waypoint: Use CSS Selectors to Style Elements",
"dashedName": "waypoint-use-css-selectors-to-style-elements",
"difficulty": 0.018,
"description": [
"Delete your <code>h2</code> element's style attribute and instead create a CSS <code>style</code> element. Add the necessary CSS to turn all <code>h2</code> elements blue.",
@ -395,6 +405,7 @@
{
"id": "bad87fee1348bd9aecf08806",
"name": "Waypoint: Use a CSS Class to Style an Element",
"dashedName": "waypoint-use-a-css-class-to-style-an-element",
"difficulty": 0.019,
"description": [
"Create a CSS class called \"red-text\" and apply it to your <code>h2</code> element.",
@ -436,6 +447,7 @@
{
"id": "bad87fee1348bd9aefe08806",
"name": "Waypoint: Style Multiple Elements with a CSS Class",
"dashedName": "waypointstylemultiple-elements-with-a-css-class",
"difficulty": 0.020,
"description": [
"Apply the \"red-text\" class to your <code>h2</code> and <code>p</code> elements.",
@ -474,6 +486,7 @@
{
"id": "bad87fee1348bd9aedf08806",
"name": "Waypoint: Change the Font Size of an Element",
"dashedName": "waypoint-change-the-font-size-of-an-element",
"difficulty": 0.021,
"description": [
"Create a second <code>p</code> element. Then, inside your <code>&#60;style&#62;</code> element, set the \"font-size\" of all <code>p</code> elements to 16 pixels.",
@ -513,6 +526,7 @@
{
"id": "bad87fee1348bd9aede08807",
"name": "Waypoint: Set the Font Family of an Element",
"dashedName": "waypoint-set-the-font-family-of-an-element",
"difficulty": 0.022,
"description": [
"Make all of your <code>p</code> elements use the \"Monospace\" font.",
@ -553,6 +567,7 @@
{
"id": "bad87fee1348bd9aedf08807",
"name": "Waypoint: Import a Google Font",
"dashedName": "waypoint-import-a-google-font",
"difficulty": 0.023,
"description": [
"Apply the <code>font-family</code> of \"Lobster\" to your <code>h2</code> element.",
@ -598,6 +613,7 @@
{
"id": "bad87fee1348bd9aedf08808",
"name": "Waypoint: Specify How Fonts Should Degrade",
"dashedName": "waypoint-specify-how-fonts-should-degrade",
"difficulty": 0.024,
"description": [
"Make all your <code>h2</code> elements use \"Lobster\" as their font family, but degrade to the \"Monospace\" font when the \"Lobster\" font isn't available.",
@ -647,6 +663,7 @@
{
"id": "bad87fee1348bd9aedf08809",
"name": "Waypoint: Override Styles with Important",
"dashedName": "waypoint-override-styles-with-important",
"difficulty": 0.025,
"description": [
"Create an \"urgently-red\" class that gives an element the font-color of red, but add <code>!important</code> to the class to ensure the element is rendered as being red. Immediately below your \"urgently-red\" class declaration, create a \"blue-text\" class that gives an element the font-color of blue. Apply both classes to your <code>h2</code> element.",
@ -703,6 +720,7 @@
{
"id": "bad87fee1348bd9aedf08812",
"name": "Waypoint: Add Images to your Website",
"dashedName": "waypoint-add-images-to-your-website",
"difficulty": 0.026,
"description": [
"Use an <code>img</code> element to add the image <code>http://bit.ly/fcc-kittens</code> to your website.",
@ -751,6 +769,7 @@
{
"id": "bad87fee1348bd9acdf08812",
"name": "Waypoint: Size your Images",
"dashedName": "waypoint-size-your-images",
"difficulty": 0.027,
"description": [
"Create a class called <code>smaller-image</code> and use it to resize the image so that it's only 100 pixels wide.",
@ -800,6 +819,7 @@
{
"id": "bad87fee1348bd9bedf08813",
"name": "Waypoint: Add Borders Around your Elements",
"dashedName": "waypoint-add-borders-around-your-elements",
"difficulty": 0.028,
"description": [
"Create a class called \"thick-green-border\" that puts a 10-pixel-wide green border with a style of \"solid\" around an HTML element, and apply that class to your cat photo.",
@ -856,6 +876,7 @@
{
"id": "bad87fee1348bd9aedf08814",
"name": "Waypoint: Add Rounded Corners with a Border Radius",
"dashedName": "waypoint-add-rounded-corners-with-a-border-radius",
"difficulty": 0.029,
"description": [
"Give your cat photo a <code>border-radius</code> of 10 pixels.",
@ -915,6 +936,7 @@
{
"id": "bad87fee1348bd9aedf08815",
"name": "Waypoint: Make Circular Images with a Border Radius",
"dashedName": "waypoint-make-circular-images-with-a-border-radius",
"difficulty": 0.030,
"description": [
"Give your cat photo a <code>border-radius</code> of 50%.",
@ -973,6 +995,7 @@
{
"id": "bad87fee1348bd9aedf08816",
"name": "Waypoint: Link to External Pages with Anchor Elements",
"dashedName": "waypoint-link-to-external-pages-with-anchor-elements",
"difficulty": 0.031,
"description": [
"Create an <code>a</code> element, or \"anchor element\", that links to http://catphotoapp.com and has \"cat photos\" as its link text, or \"anchor text\".",
@ -1035,6 +1058,7 @@
{
"id": "bad87fee1348bd9aede08817",
"name": "Waypoint: Wrap an Anchor Element within a Paragraph",
"dashedName": "waypoint-wrap-an-anchor-element-within-a-paragraph",
"difficulty": 0.032,
"description": [
"Now wrap your <code>a</code> element within a new <code>p</code> element so that the surrounding paragraph says \"click here for cat photos\", but where only \"cat photos\" is a link - the rest is plain text.",
@ -1103,6 +1127,7 @@
{
"id": "bad87fee1348bd9aedf08817",
"name": "Waypoint: Make Dead Links using the Hash Symbol",
"dashedName": "waypoint-make-dead-links-using-the-hash-symbol",
"difficulty": 0.033,
"description": [
"Use the hash symbol (#) to turn your <code>a</code> element's link into a dead link.",
@ -1165,6 +1190,7 @@
{
"id": "bad87fee1348bd9aedf08820",
"name": "Waypoint: Turn an Image into a Link",
"dashedName": "waypoint-turn-an-image-into-a-link",
"difficulty": 0.034,
"description": [
"Wrap your <code>img</code> element inside an <code>a</code> element with a dead link.",
@ -1230,6 +1256,7 @@
{
"id": "bad87fee1348bd9aedf08818",
"name": "Waypoint: Add Alt Text to an Image for Accessibility",
"dashedName": "waypoint-add-alt-text-to-an-image-for-accessibility",
"difficulty": 0.035,
"description": [
"Add an <code>alt</code> attribute with the text \"A cute orange cat lying on its back\" to our cat photo.",
@ -1293,6 +1320,7 @@
{
"id": "bad87fee1348bd9aedf08827",
"name": "Waypoint: Create a Bulleted Unordered List",
"dashedName": "waypoint-create-a-bulleted-unordered-list",
"difficulty": 0.036,
"description": [
"Replace your <code>p</code> elements with an unordered list of three things that cats love.",
@ -1358,6 +1386,7 @@
{
"id": "bad87fee1348bd9aedf08828",
"name": "Waypoint: Create an Ordered List",
"dashedName": "waypoint-create-an-ordered-list",
"difficulty": 0.037,
"description": [
"Create an ordered list of the top 3 things cats hate the most.",
@ -1430,6 +1459,7 @@
{
"id": "bad87fee1348bd9aedf08829",
"name": "Waypoint: Create a Text Field",
"dashedName": "waypoint-create-a-text-field",
"difficulty": 0.038,
"description": [
"Now we'll create a web form. Create a text input under your lists.",
@ -1501,6 +1531,7 @@
{
"id": "bad87fee1348bd9aedf08830",
"name": "Waypoint: Add Placeholder Text to a Text Field",
"dashedName": "waypoint-add-placeholder-text-to-a-text-field",
"difficulty": 0.039,
"description": [
"Set the <code>placeholder</code> value of your text <code>input</code> to \"cat photo URL\".",
@ -1574,6 +1605,7 @@
{
"id": "bad87fee1348bd9aede08830",
"name": "Waypoint: Create a Form Element",
"dashedName": "waypoint-create-a-form-element",
"difficulty": 0.040,
"description": [
"Wrap your text field in a <code>form</code> element. Add the <code>action=\"/submit-cat-photo\"</code> attribute to this form element.",
@ -1649,6 +1681,7 @@
{
"id": "bad87fee1348bd9aedd08830",
"name": "Waypoint: Add a Submit Button to a Form",
"dashedName": "waypoint-add-a-submit-button-to-a-form",
"difficulty": 0.041,
"description": [
"Add a submit button to your <code>form</code> element with type \"submit\" and \"Submit\" as its text.",
@ -1725,7 +1758,8 @@
},
{
"id": "bad87fee1348bd9aedc08830",
"name": "Waypoint: Use HTML5 to Require a Field",
"name": "waypoint-use-html5-to-require-a-field",
"dashedName": "Waypoint: Use HTML5 to Require a Field",
"difficulty": 0.042,
"description": [
"Make your text <code>input</code> a \"required\" field, so that your user can't submit the form without completing this field.",
@ -1801,6 +1835,7 @@
{
"id": "bad87fee1348bd9aedf08834",
"name": "Waypoint: Create a Set of Radio Buttons",
"dashedName": "waypoint-create-a-set-of-radio-buttons",
"difficulty": 0.043,
"description": [
"Add to your form a pair of radio buttons. Each radio button should be wrapped within its own <code>label</code> element. They should share a common <code>name</code> attribute. One should have the option of \"indoor\" and the other should have the option of \"outdoor\".",
@ -1884,6 +1919,7 @@
{
"id": "bad87fee1348bd9aedf08835",
"name": "Waypoint: Create a Set of Checkboxes",
"dashedName": "waypoint-create-a-set-of-checkboxes",
"difficulty": 0.044,
"description": [
"Add to your form a set of three checkbox elements. Each checkbox should be wrapped within its own <code>label</code> element. All three should share the <code>name</code> attribute of \"personality\".",
@ -1964,6 +2000,7 @@
{
"id": "bad87fee1348bd9aede18835",
"name": "Waypoint: Clean up your form using Linebreaks",
"dashedName": "waypoint-clean-up-your-form-using-linebreaks",
"difficulty": 0.045,
"description": [
"Clean up your form by adding linebreaks between form elements.",
@ -2043,6 +2080,7 @@
{
"id": "bad87fee1348bd9aedd08835",
"name": "Waypoint: Check Radio Buttons and Checkboxes by Default",
"dashedName": "waypoint-check-radio-buttons-and-checkboxes-by-default",
"difficulty": 0.046,
"description": [
"Set the first of your radio buttons and the first of your checkboxes to both be checked by default.",
@ -2126,6 +2164,7 @@
{
"id": "bad87fee1348bd9aede08835",
"name": "Waypoint: Wrap Many Elements within a Single Div Element",
"dashedName": "waypoint-wrap-many-elements-within-a-single-div-element",
"difficulty": 0.047,
"description": [
"Wrap your \"Things cats love\" and \"Things cats hate\" lists all within a single <code>div</code> element.",
@ -2214,6 +2253,7 @@
{
"id": "bad87fee1348bd9aede07836",
"name": "Waypoint: Give a Background Color to a Div Element",
"dashedName": "waypoint-give-a-background-color-to-a-div-element",
"difficulty": 0.048,
"description": [
"Create a class called \"gray-background\" with the background color of gray. Assign this class to your <code>div</code> element.",
@ -2300,6 +2340,7 @@
{
"id": "bad88fee1348bd9aedf08825",
"name": "Waypoint: Adjusting the Padding of an Element",
"dashedName": "waypoint-adjusting-the-padding-of-an-element",
"difficulty": 0.064,
"description": [
"These next few Waypoints will give you a brief tour of three important aspects of the space surrounding HTML elements: <code>padding</code>, <code>margin</code>, and <code>border</code>. Change the <code>padding</code> of your green box to match that of your red box.",
@ -2361,6 +2402,7 @@
{
"id": "bad87fee1348bd9aedf08822",
"name": "Waypoint: Adjust the Margin of an Element",
"dashedName": "waypoint-adjust-the-margin-of-an-element",
"difficulty": 0.065,
"description": [
"Change the <code>margin</code> of the green box to match that of the red box.",
@ -2424,6 +2466,7 @@
{
"id": "bad87fee1348bd9aedf08823",
"name": "Waypoint: Add a Negative Margin to an Element",
"dashedName": "waypoint-add-a-negative-margin-to-an-element",
"difficulty": 0.066,
"description": [
"Change the <code>margin</code> of the green box to a negative value, so it fills the entire horizontal width of the yellow box around it.",
@ -2486,6 +2529,7 @@
{
"id": "bad87fee1348bd9aedf08824",
"name": "Waypoint: Add Different Padding to Each Side of an Element",
"dashedName": "waypoint-add-different-padding-to-each-side-of-an-element",
"difficulty": 0.067,
"description": [
"Give the green box a <code>padding</code> of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
@ -2551,6 +2595,7 @@
{
"id": "bad87fee1248bd9aedf08824",
"name": "Waypoint: Add Different Margins to Each Side of an Element",
"dashedName": "waypoint-add-different-margins-to-each-side-of-an-element",
"difficulty": 0.068,
"description": [
"Give the green box a <code>margin</code> of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
@ -2616,6 +2661,7 @@
{
"id": "bad87fee1348bd9aedf08826",
"name": "Waypoint: Use Clockwise Notation to Specify the Padding of an Element",
"dashedName": "waypoint-use-clockwise-notation-to-specify-the-padding-of-an-element",
"difficulty": 0.069,
"description": [
"Use Clockwise Notation to give the \".green-box\" class a <code>padding</code> of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
@ -2678,6 +2724,7 @@
{
"id": "bad87fee1348bd9aedf08726",
"name": "Waypoint: Use Clockwise Notation to Specify the Margin of an Element",
"dashedName": "waypoint-use-clockwise-notation-to-specify-the-margin-of-an-element",
"difficulty": 0.070,
"description": [
"Let's try this again, but with <code>margin</code> this time. Use <code>Clockwise Notation</code> to give an element a margin of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",

View File

@ -5,6 +5,7 @@
{
"id": "bd7129d8c441eddfaeb5bdef",
"name": "Waypoint: Build an Adventure Game",
"dashedName": "waypoint-build-an-adventure-game",
"difficulty": 0.24,
"challengeSeed": ["114604814"],
"description": [
@ -30,6 +31,7 @@
{
"id": "bd7130d8c441eddfaeb5bdef",
"name": "Waypoint: Build Rock Paper Scissors",
"dashedName": "waypoint-build-rock-paper-scissors",
"difficulty": 0.25,
"challengeSeed": ["114604815"],
"description": [
@ -53,6 +55,7 @@
{
"id": "bd7131d8c441eddfaeb5bdef",
"name": "Waypoint: Learn JavaScript For Loops",
"dashedName": "waypoint-learn-javascript-for-loops",
"difficulty": 0.26,
"challengeSeed": ["114614220"],
"description": [
@ -76,6 +79,7 @@
{
"id": "bd7132d8c441eddfaeb5bdef",
"name": "Waypoint: Learn JavaScript While Loops",
"dashedName": "waypoint-learn-javascript-while-loops",
"difficulty": 0.27,
"challengeSeed": ["114612889"],
"description": [
@ -98,6 +102,7 @@
{
"id": "bd7133d8c441eddfaeb5bdef",
"name": "Waypoint: Learn Control Flow",
"dashedName": "waypoint-learn-control-flow",
"difficulty": 0.28,
"challengeSeed": ["114612888"],
"description": [
@ -122,6 +127,7 @@
{
"id": "bd7134d8c441eddfaeb5bdef",
"name": "Waypoint: Build a Contact List",
"dashedName": "waypoint-build-a-contact-list",
"difficulty": 0.29,
"challengeSeed": ["114612887"],
"description": [
@ -145,6 +151,7 @@
{
"id": "bd7135d8c441eddfaeb5bdef",
"name": "Waypoint: Build an Address Book",
"dashedName": "waypoint-build-an-address-book",
"difficulty": 0.30,
"challengeSeed": ["114612885"],
"description": [
@ -168,6 +175,7 @@
{
"id": "bd7136d8c441eddfaeb5bdef",
"name": "Waypoint: Build a Cash Register",
"dashedName": "waypoint-build-a-cash-register",
"difficulty": 0.31,
"challengeSeed": ["114612882"],
"description": [
@ -191,6 +199,7 @@
{
"id": "bd7118d8c441eddfaeb5bdef",
"name": "Waypoint: Discover Chrome DevTools",
"dashedName": "waypoint-discover-chrome-devTools",
"difficulty": 0.32,
"challengeSeed": ["110752743"],
"description": [
@ -222,6 +231,7 @@
{
"id": "bd7138d8c441eddfaeb5bdef",
"name": "Waypoint: Learn Regular Expressions",
"dashedName": "waypoint-learn-regular-expressions",
"difficulty": 0.33,
"challengeSeed": ["112547802"],
"description": [

View File

@ -5,6 +5,7 @@
{
"id": "bad87fee1348bd9acde08812",
"name": "Waypoint: Mobile Responsive Images",
"dashedName": "waypoint-mobile-responsive-images",
"difficulty": 0.047,
"description": [
"Now let's go back to our Cat Photo App. This time, we'll style it using the popular Twitter Bootstrap responsive CSS framework. First, add a new image with the <code>src</code> attribute of \"http://bit.ly/fcc-kittens2\", and add the \"img-responsive\" Bootstrap class to that image.",
@ -91,6 +92,7 @@
{
"id": "bad87fee1348bd8acde08812",
"name": "Waypoint: Center Text with Bootstrap",
"dashedName": "waypoint-center-text-with-bootstrap",
"difficulty": 0.048,
"description": [
"Add Bootstrap's \"text-center\" class to your <code>h2</code> element.",
@ -174,6 +176,7 @@
{
"id": "bad87fee1348cd8acdf08812",
"name": "Waypoint: Create a Bootstrap Button",
"dashedName": "waypoint-create-a-bootstrap-button",
"difficulty": 0.049,
"description": [
"Create a new <code>button</code> element below your large kitten photo. Give it the class \"btn\" and the text of \"like this photo\".",
@ -258,6 +261,7 @@
{
"id": "bad87fee1348cd8acef08812",
"name": "Waypoint: Create a Block Element Bootstrap Button",
"dashedName": "waypoint-create-a-block-element-bootstrap-button",
"difficulty": 0.050,
"description": [
"Add Bootstrap's \"btn-block\" class to your Bootstrap button.",
@ -346,6 +350,7 @@
{
"id": "bad87fee1348cd8acef08811",
"name": "Waypoint: Taste the Bootstrap Button Color Rainbow",
"dashedName": "waypoint-taste-the-bootstrap-button-color-rainbow",
"difficulty": 0.051,
"description": [
"Add Bootstrap's \"btn-primary\" class to your button.",
@ -432,6 +437,7 @@
{
"id": "bad87fee1348cd8acef08813",
"name": "Waypoint: Call out Optional Actions with Button Info",
"dashedName": "waypoint-call-out-optional-actions-with-button-info",
"difficulty": 0.052,
"description": [
"Create a new block-level Bootstrap button below your \"Like\" button with the text \"Info\", and add Bootstrap's \"btn-info\" and \"btn-block\" classes to it.",
@ -519,6 +525,7 @@
{
"id": "bad87fee1348ce8acef08814",
"name": "Waypoint: Warn your Users of a Dangerous Action",
"dashedName": "waypoint-warn-your-users-of-a-dangerous-action",
"difficulty": 0.053,
"description": [
"Create a button with the text \"Delete\" and give it the class \"btn-danger\".",
@ -607,6 +614,7 @@
{
"id": "bad88fee1348ce8acef08815",
"name": "Waypoint: Use the Bootstrap Grid to Put Elements Side By Side",
"dashedName": "waypoint-use-the-bootstrap-grid-to-put-elements-side-by-side",
"difficulty": 0.054,
"description": [
"Put the \"Like\", \"Info\" and \"Delete\" buttons side-by-side by wrapping all three of them within one <code>&#60;div class=\"row\"&#62;</code> element, then each of them within a <code>&#60;div class=\"col-xs-4\"&#62;</code> element.",
@ -700,6 +708,7 @@
{
"id": "bad87fee1348bd9aedf08845",
"name": "Waypoint: Ditch Custom CSS for Bootstrap",
"dashedName": "waypoint-ditch-custom-css-for-bootstrap",
"difficulty": 0.055,
"description": [
"Delete the \".red-text\", \"p\", and \".smaller-image\" CSS declarations from your <code>style</code> element so that the only declarations left in your <code>style</code> element are \"h2\" and \"thick-green-border\". Then Delete the <code>p</code> element that contains a dead link. Then remove the \"red-text\" class from your <code>h2</code> element and replace it with the \"text-primary\" Bootstrap class. Finally, remove the \"smaller-image\" class from your first <code>img</code> element and replace it with the <code>img-responsive</code> class.",
@ -799,6 +808,7 @@
{
"id": "bad87fee1348bd9aede08845",
"name": "Waypoint: Create a Custom Heading",
"dashedName": "waypoint-create-a-custom-heading",
"difficulty": 0.056,
"description": [
"Wrap your first image and your <code>h2</code> element within a single <code>&#60;div class='row'&#62;</code> element. Wrap your <code>h2</code> text within a <code>&#60;div class='col-xs-8'&#62;</code> and your image in a <code>&#60;div class='col-xs-4'&#62;</code> so that they are on the same line.",
@ -888,6 +898,7 @@
{
"id": "bad87fee1348bd9aedd08845",
"name": "Waypoint: Add Font Awesome Icons to our Buttons",
"dashedName": "waypoint-add-font-awesome-icons-to-our-buttons",
"difficulty": 0.057,
"description": [
"Use Font Awesome to add a \"thumbs-up\" icon to your like button by giving it a <code>i</code> element with the classes \"fa\" and \"fa-thumbs-up\".",
@ -974,7 +985,8 @@
},
{
"id": "bad87fee1348bd9aedc08845",
"name": "Waypoint: Add Font Awesome Icons all of our Buttons",
"name": "Waypoint: Add Font Awesome Icons to all of our Buttons",
"dashedName": "waypoint-add-font-awesome-icons-to-all-of-our-Buttons",
"difficulty": 0.058,
"description": [
"Use Font Awesome to add a \"info-circle\" icon to your info button and a \"trash\" icon to your delete button.",
@ -1062,6 +1074,7 @@
{
"id": "bad87fee1348bd9aedb08845",
"name": "Waypoint: Responsively Style Radio Buttons",
"dashedName": "waypoint-responsively-style-radio-buttons",
"difficulty": 0.059,
"description": [
"Wrap all of your radio buttons within a <code>&#60;div class='row'&#62;</code> element. Then wrap each of them within a <code>&#60;div class='col-xs-6'&#62;</code> element.",
@ -1148,6 +1161,7 @@
{
"id": "bad87fee1348bd9aeda08845",
"name": "Waypoint: Responsively Style Checkboxes",
"dashedName": "waypoint-responsively-style-checkboxes",
"difficulty": 0.060,
"description": [
"Wrap all your checkboxes in a <code>&#60;div class='row'&#62;</code> element. Then wrap each of them in a <code>&#60;div class='col-xs-4'&#62;</code> element.",
@ -1241,6 +1255,7 @@
{
"id": "bad87fee1348bd9aed908845",
"name": "Waypoint: Style Text Inputs as Form Controls",
"dashedName": "waypoint-style-text-inputs-as-form-controls",
"difficulty": 0.061,
"description": [
"Give your form's text input field a class of \"form-control\". Give your form's submit button the classes \"btn btn-primary\". Also give this button the Font Awesome icon of \"fa-paper-plane\".",
@ -1344,6 +1359,7 @@
{
"id": "bad87fee1348bd9aec908845",
"name": "Waypoint: Line up Form Elements Responsively with Bootstrap",
"dashedName": "waypoint-line-up-form-elements-responsively-with-bootstrap",
"difficulty": 0.062,
"description": [
"Now let's get your form <code>input</code> and your submission <code>button</code> on the same line. We'll do this the same way we have previously: by using a <code>div</code> element with the class \"row\", and other <code>div</code> elements within it using the \"col-xs-*\" class.",

View File

@ -5,6 +5,7 @@
{
"id": "bd7123d8c441eddfaeb5bdef",
"name": "Waypoint: Learn Basic Computer Science",
"dashedName": "waypoint-learn-basic-computer-science",
"difficulty": 0.90,
"challengeSeed": ["114628241"],
"description": [
@ -34,6 +35,7 @@
{
"id": "bd8124d8c441eddfaeb5bdef",
"name": "Waypoint: Learn Loops",
"dashedName": "waypoint-learn-loops",
"difficulty": 0.19,
"challengeSeed": ["114597348"],
"description": [
@ -61,6 +63,7 @@
{
"id": "bd8125d8c441eddfaeb5bdef",
"name": "Waypoint: Learn Computer Hardware",
"dashedName": "waypoint-learn-computer-hardware",
"difficulty": 0.20,
"challengeSeed": ["114597347"],
"description": [
@ -88,6 +91,7 @@
{
"id": "bd8126d8c441eddfaeb5bdef",
"name": "Waypoint: Learn Computer Networking",
"dashedName": "waypoint-learn-computer-networking",
"difficulty": 0.21,
"challengeSeed": ["114604811"],
"description": [
@ -115,6 +119,7 @@
{
"id": "bd8127d8c441eddfaeb5bdef",
"name": "Waypoint: Learn Boolean Logic",
"dashedName": "waypoint-learn-boolean-logic",
"difficulty": 0.22,
"challengeSeed": ["114604812"],
"description": [
@ -142,6 +147,7 @@
{
"id": "bd8128d8c441eddfaeb5bdef",
"name": "Waypoint: Learn Computer Security",
"dashedName": "waypoint-learn-computer-security",
"difficulty": 0.23,
"challengeSeed": ["114604813"],
"description": [

View File

@ -5,6 +5,7 @@
{
"id": "bd7154d8c441eddfaeb5bdef",
"name": "Waypoint: Get Started with Angular.js",
"dashedName": "waypoint-get-started-with-angularjs",
"difficulty": 0.34,
"challengeSeed": ["114684726"],
"description": [
@ -28,6 +29,7 @@
{
"id": "bd7155d8c441eddfaeb5bdef",
"name": "Waypoint: Apply Angular.js Directives",
"dashedName": "waypoint-apply-angularjs-directives",
"difficulty": 0.35,
"challengeSeed": ["114684727"],
"description": [
@ -51,6 +53,7 @@
{
"id": "bd7156d8c441eddfaeb5bdef",
"name": "Waypoint: Power Forms with Angular.js",
"dashedName": "waypoint-power-forms-with-angularjs",
"difficulty": 0.36,
"challengeSeed": ["114684729"],
"description": [
@ -74,6 +77,7 @@
{
"id": "bd7157d8c441eddfaeb5bdef",
"name": "Waypoint: Customize Angular.js Directives",
"dashedName": "waypoint-customize-angularjs-directives",
"difficulty": 0.37,
"challengeSeed": ["114685062"],
"description": [
@ -96,6 +100,7 @@
{
"id": "bd7158d8c441eddfaeb5bdef",
"name": "Waypoint: Create Angular.js Services",
"dashedName": "waypoint-create-angularjs-services",
"difficulty": 0.38,
"challengeSeed": ["114685060"],
"description": [
@ -119,6 +124,7 @@
{
"id": "bd7153d8c441eddfaeb5bd0f",
"name": "Waypoint: Manage Packages with NPM",
"dashedName": "waypoint-manage-packages-with-npm",
"difficulty": 0.39,
"challengeSeed": ["126433450"],
"description": [
@ -172,6 +178,7 @@
{
"id": "bd7153d8c441eddfaeb5bdff",
"name": "Waypoint: Start a Node.js Server",
"dashedName": "waypoint-start-a-nodejs-server",
"difficulty": 0.40,
"challengeSeed": ["126411561"],
"description": [
@ -214,6 +221,7 @@
{
"id": "bd7153d8c441eddfaeb5bdfe",
"name": "Waypoint: Continue working with Node.js Servers",
"dashedName": "waypoint-continue-working-with-nodejs-servers",
"difficulty": 0.41,
"challengeSeed": ["128836506"],
"description": [
@ -241,6 +249,7 @@
{
"id": "bd7153d8c441eddfaeb5bdfd",
"name": "Waypoint: Finish working with Node.js Servers",
"dashedName": "waypoint-finish-working-with-nodejs-servers",
"difficulty": 0.42,
"challengeSeed": ["128836507"],
"description": [
@ -268,6 +277,7 @@
{
"id": "bd7153d8c441eddfaeb5bd1f",
"name": "Waypoint: Build Web Apps with Express.js",
"dashedName": "waypoint-build-web-apps-with-expressjs",
"difficulty": 0.43,
"challengeSeed": ["126411559"],
"description": [
@ -309,6 +319,7 @@
{
"id": "bd7140d8c441eddfaeb5bdef",
"name": "Waypoint: Manage Source Code with Git",
"dashedName": "waypoint-manage-source-code-with-git",
"difficulty": 0.44,
"challengeSeed": ["114635309"],
"description": [

View File

@ -5,6 +5,7 @@
{
"id": "bd7129d8c441eddfbeb5bddf",
"name": "Waypoint: Practice Functional Programming",
"dashedName": "waypoint-practice-functional-programming",
"difficulty": 0.01,
"challengeSeed": ["129169463"],
"description": [

View File

@ -5,6 +5,7 @@
{
"id": "bd7124d8c441eddfaeb5bdef",
"name": "Waypoint: Learn how Free Code Camp Works",
"dashedName": "waypoint-learn-how-free-code-camp-works",
"difficulty": 0.001,
"challengeSeed": ["125407438"],
"description": [
@ -53,6 +54,7 @@
{
"id": "bd7125d8c441eddfaeb5bd0f",
"name": "Waypoint: Join Our Chat Room",
"dashedName": "waypoint-join-our-chat-room",
"difficulty": 0.002,
"challengeSeed": ["124555254"],
"description": [
@ -107,6 +109,7 @@
{
"id": "bd7125d8c441eddfaeb5bdff",
"name": "Waypoint: Preview our Challenge Map",
"dashedName": "waypoint-preview-our-challenge-map",
"difficulty": 0.003,
"challengeSeed": ["125407437"],
"description": [
@ -149,6 +152,7 @@
{
"id": "bd7125d8c441eddfaeb5bd1f",
"name": "Waypoint: Browse our Field Guide",
"dashedName": "waypoint-browse-our-field-guide",
"difficulty": 0.004,
"challengeSeed": ["125407435"],
"description": [
@ -188,6 +192,7 @@
{
"id": "bd7125d8c441eddfaeb5bd2f",
"name": "Waypoint: Customize your Portfolio Page",
"dashedName": "waypoint-customize-your-portfolio-page",
"difficulty": 0.005,
"challengeSeed": ["125407433"],
"description": [
@ -233,6 +238,7 @@
{
"id": "bd7126d8c441eddfaeb5bd3f",
"name": "Waypoint: Try Camper News",
"dashedName": "waypoint-try-camper-news",
"difficulty": 0.006,
"challengeSeed": ["124553410"],
"description": [
@ -284,6 +290,7 @@
{
"id": "bd7126d8c441eddfaeb5bd3e",
"name": "Waypoint: Meet Other Campers in your City",
"dashedName": "waypoint-meet-other-campers-in-your-city",
"difficulty": 0.007,
"challengeSeed": ["127358841"],
"description": [
@ -332,6 +339,7 @@
{
"id": "bd7137d8c441eddfaeb5bdef",
"name": "Waypoint: Get Help the Hacker Way with RSAP",
"dashedName": "waypoint-get-help-the-hacker-way-with-rsap",
"difficulty": 0.008,
"challengeSeed": ["125407432"],
"description": [

View File

@ -5,6 +5,7 @@
{
"id": "a2f1d72d9b908d0bd72bb9f6",
"name": "Bonfire: Make a Person",
"dashedName": "bonfire-make-a-person",
"difficulty": "3.01",
"description": [
"Fill in the object constructor with the methods specified in the tests.",
@ -56,6 +57,7 @@
{
"id": "af4afb223120f7348cdfc9fd",
"name": "Bonfire: Map the Debris",
"dashedName": "bonfire-map-the-debris",
"difficulty": "3.02",
"description": [
"Return a new array that transforms the element's average altitude into their orbital periods.",
@ -96,6 +98,7 @@
{
"id": "a3f503de51cfab748ff001aa",
"name": "Bonfire: Pairwise",
"dashedName": "bonfire-pairwise",
"difficulty": "3.03",
"description": [
"Return the sum of all indices of elements of 'arr' that can be paired with one other element to form a sum that equals the value in the second argument 'arg'. If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.",

View File

@ -5,6 +5,7 @@
{
"id": "bd7112d8c441eddfaeb5bded",
"name": "Waypoint: Get Started with jQuery",
"dashedName": "waypoint-get-started-with-jquery",
"difficulty": 0.13,
"challengeSeed": ["125671865"],
"description": [
@ -30,6 +31,7 @@
{
"id": "bd7113d8c441eddfaeb5bdef",
"name": "Waypoint: Write Functions with jQuery",
"dashedName": "waypoint-write-functions-with-jquery",
"difficulty": 0.14,
"challengeSeed": ["125658029"],
"description": [
@ -54,6 +56,7 @@
{
"id": "bd7114d8c441eddfaeb5bdef",
"name": "Waypoint: Harness Dynamic HTML",
"dashedName": "waypoint-harness-dynamic-html",
"difficulty": 0.15,
"challengeSeed": ["125658028"],
"description": [
@ -77,6 +80,7 @@
{
"id": "bd7115d8c441eddfaeb5bdef",
"name": "Waypoint: Listen for jQuery Events",
"dashedName": "waypoint-listen-for-jquery-events",
"difficulty": 0.16,
"challengeSeed": ["125658027"],
"description": [
@ -100,6 +104,7 @@
{
"id": "bd7116d8c441eddfaeb5bdef",
"name": "Waypoint: Trigger jQuery Effects",
"dashedName": "waypoint-trigger-jquery-effects",
"difficulty": 0.17,
"challengeSeed": ["125658025"],
"description": [

View File

@ -5,6 +5,7 @@
{
"id": "bd7129d8c441eddfaeb5bddf",
"name": "Waypoint: Scope Your Variables",
"dashedName": "waypoint-scope-your-variables",
"difficulty": 0.01,
"challengeSeed": ["128836683"],
"description": [
@ -31,6 +32,7 @@
{
"id": "bd7131d8c441eddfaeb5bdbf",
"name": "Waypoint: Reference your Current Object with This",
"dashedName": "waypoint-reference-your-current-object-with-this",
"difficulty": 0.03,
"challengeSeed": ["128836508"],
"description": [
@ -57,6 +59,7 @@
{
"id": "bd7132d8c441eddfaeb5bdaf",
"name": "Waypoint: Traverse the Prototype Chain",
"dashedName": "waypoint-traverse-the-prototype-chain",
"difficulty": 0.04,
"challengeSeed": ["128836684"],
"description": [
@ -82,6 +85,7 @@
{
"id": "bd7133d8c441eddfaeb5bd0f",
"name": "Waypoint: Reuse Code with Decorators",
"dashedName": "waypoint-reuse-code-with-decorators",
"difficulty": 0.05,
"challengeSeed": ["128836681"],
"description": [
@ -108,6 +112,7 @@
{
"id": "bd7134d8c441eddfaeb5bd1f",
"name": "Waypoint: Build Objects with Functional Classes",
"dashedName": "waypoint-build-objects-with-functional-classes",
"difficulty": 0.06,
"challengeSeed": ["128836503"],
"description": [
@ -134,6 +139,7 @@
{
"id": "bd7135d8c441eddfaeb5bd2f",
"name": "Waypoint: Build Objects with Prototypal Classes",
"dashedName": "waypoint-build-objects-with-prototypal-classes",
"difficulty": 0.07,
"challengeSeed": ["128836505"],
"description": [
@ -160,6 +166,7 @@
{
"id": "bd7136d8c441eddfaeb5bd3f",
"name": "Waypoint: Understand Pseudoclassical Patterns",
"dashedName": "waypoint-understand-pseudoclassical-patterns",
"difficulty": 0.08,
"challengeSeed": ["128836689"],
"description": [
@ -186,6 +193,7 @@
{
"id": "bd7136d8c441eddfaeb5bd4f",
"name": "Waypoint: Subclass one Object to Another",
"dashedName": "waypoint-subclass-one-object-to-another",
"difficulty": 0.09,
"challengeSeed": ["128836686"],
"description": [
@ -211,6 +219,7 @@
{
"id": "bd7136d8c441eddfaeb5bd5f",
"name": "Waypoint: Use Pseudoclassical Subclasses",
"dashedName": "waypoint-use-pseudoclassical-subclasses",
"difficulty": 0.10,
"challengeSeed": ["128836937"],
"description": [

View File

@ -5,6 +5,7 @@
{
"id": "bd7158d8c442eddfbeb5bd1f",
"name": "Waypoint: Get Set for Ziplines",
"dashedName": "waypoint-get-set-for-ziplines",
"difficulty": 1.00,
"challengeSeed": ["125658022"],
"description": [
@ -39,6 +40,7 @@
{
"id": "bd7158d8c442eddfaeb5bd1f",
"name": "Zipline: Use the Twitch.tv JSON API",
"dashedName": "zipline-use-the-twitchtv-json-api",
"difficulty": 1.01,
"challengeSeed": ["126411564"],
"description": [
@ -74,6 +76,7 @@
{
"id": "bd7158d8c442eddfaeb5bd13",
"name": "Zipline: Build a Random Quote Machine",
"dashedName": "zipline-build-a-random-quote-machine",
"difficulty": 1.02,
"challengeSeed": ["126415122"],
"description": [
@ -104,6 +107,7 @@
{
"id": "bd7158d8c442eddfaeb5bd10",
"name": "Zipline: Show the Local Weather",
"dashedName": "zipline-show-the-local-weather",
"difficulty": 1.03,
"challengeSeed": ["126415127"],
"description": [
@ -136,6 +140,7 @@
{
"id": "bd7158d8c442eddfaeb5bd18",
"name": "Zipline: Stylize Stories on Camper News",
"dashedName": "zipline-stylize-stories-on-camper-news",
"difficulty": 1.04,
"challengeSeed": ["126415129"],
"description": [
@ -168,7 +173,8 @@
},
{
"id": "bd7158d8c442eddfaeb5bd19",
"name": "Zipline: Wikipedia Viewer",
"name": "zipline-wikipedia-viewer",
"dashedName": "Zipline: Wikipedia Viewer",
"difficulty": 1.05,
"challengeSeed": ["126415131"],
"description": [
@ -201,6 +207,7 @@
{
"id": "bd7158d8c442eddfaeb5bd0f",
"name": "Zipline: Build a Pomodoro Clock",
"dashedName": "zipline-build-a-pomodoro-clock",
"difficulty": 1.06,
"challengeSeed": ["126411567"],
"description": [
@ -232,6 +239,7 @@
{
"id": "bd7158d8c442eddfaeb5bd17",
"name": "Zipline: Build a JavaScript Calculator",
"dashedName": "zipline-build-a-javascript-calculator",
"difficulty": 1.07,
"challengeSeed": ["126411565"],
"description": [
@ -263,6 +271,7 @@
{
"id": "bd7158d8c442eddfaeb5bd1c",
"name": "Zipline: Build a Tic Tac Toe Game",
"dashedName": "zipline-build-a-tic-tac-toe-game",
"difficulty": 1.08,
"challengeSeed": ["126415123"],
"description": [

View File

@ -1,12 +1,21 @@
/* eslint-disable no-process-exit */
require('dotenv').load();
var assign = require('lodash/object/assign'),
Rx = require('rx'),
var Rx = require('rx'),
uuid = require('node-uuid'),
assign = require('lodash/object/assign'),
mongodb = require('mongodb'),
secrets = require('../config/secrets');
var MongoClient = mongodb.MongoClient;
var providers = [
'facebook',
'twitter',
'google',
'github',
'linkedin'
];
function createConnection(URI) {
return Rx.Observable.create(function(observer) {
MongoClient.connect(URI, function(err, database) {
@ -27,11 +36,14 @@ function createQuery(db, collection, options, batchSize) {
// or schedule getting next batch on nextTick
cursor.each(function (err, doc) {
if (err) {
console.log(err);
return observer.onError(err);
}
if (!doc) {
console.log('hit complete');
return observer.onCompleted();
}
console.log('calling onnext');
observer.onNext(doc);
});
@ -48,6 +60,7 @@ function insertMany(db, collection, users, options) {
if (err) {
return observer.onError(err);
}
observer.onNext();
observer.onCompleted();
});
});
@ -56,7 +69,8 @@ function insertMany(db, collection, users, options) {
var count = 0;
// will supply our db object
var dbObservable = createConnection(secrets.db).shareReplay();
dbObservable
var users = dbObservable
.flatMap(function(db) {
// returns user document, n users per loop where n is the batchsize.
return createQuery(db, 'users', {});
@ -66,7 +80,17 @@ dbObservable
assign(user, user.portfolio, user.profile);
return user;
})
// batch them into arrays of twenty documents
.map(function(user) {
if (user.username) {
return user;
}
user.username = 'fcc' + uuid.v4().slice(0, 8);
return user;
})
.shareReplay();
// batch them into arrays of twenty documents
var userSavesCount = users
.bufferWithCount(20)
// get bd object ready for insert
.withLatestFrom(dbObservable, function(users, db) {
@ -77,16 +101,53 @@ dbObservable
})
.flatMap(function(dats) {
// bulk insert into new collection for loopback
console.log(dats);
return insertMany(dats.db, 'user', dats.users, { w: 1 });
})
// count how many times insert completes
.count()
.count();
// create User Identities
var userIdentityCount = users
.flatMap(function(user) {
var ids = providers
.map(function(provider) {
return {
provider: provider,
externalId: user[provider],
userId: user.id
};
})
.filter(function(ident) {
return !!ident.externalId;
});
return Rx.Observable.from(ids);
})
.bufferWithCount(20)
.withLatestFrom(dbObservable, function(identities, db) {
return {
identities: identities,
db: db
};
})
.flatMap(function(dats) {
// bulk insert into new collection for loopback
return insertMany(dats.db, 'userIdentity', dats.identities, { w: 1 });
})
// count how many times insert completes
.count();
Rx.Observable.merge(
userIdentityCount,
userSavesCount
)
.subscribe(
function(_count) {
count = _count * 20;
count += _count * 20;
},
function(err) {
console.log('an error occured', err);
console.log('an error occured', err, err.stack);
},
function() {
console.log('finished with %s documents processed', count);

View File

@ -1,73 +1,231 @@
{
"name": "jQuery, Ajax and JSON",
"order" : 0.004,
"challenges": [
{
"order": 0.004,
"challenges": [{
"id": "bad87fee1348bd9acdd08826",
"name": "Waypoint: Learn how Script Tags and Document Ready Work",
"difficulty": 0.072,
"description": [
"Test"
"We've simplified our Cat Photo App and removed our <code>style</code> element. Add a <code>script</code> element to your page and create a <code>$(document).ready</code> function within it.",
"Add <code>$(document).ready(function() {</code> to your <code>script</code> element, and then close it on the following line with <code>});</code>."
],
"tests": [
"assert(typeof $('#target').attr('disabled') === 'undefined', 'Change the disabled attribute of the \"target\" button to false');",
"expect($('#target')).to.exist()"
"assert(editor.match(/<script>/g), 'Create a <code>script</code> element.')",
"assert(editor.match(/<\\/script>/g) && editor.match(/<script/g) && editor.match(/<\\/script>/g).length === editor.match(/<script/g).length, 'Make sure your <code>script</code> element has a closing tag.')",
"assert(editor.match(/\\$\\(document\\)\\.ready\\(function\\(\\)\\s?\\{/g), 'Add <code>$(document).ready(function() {</code> to the beginning of your <code>script</code> element.')",
"assert(editor.match(/\\n\\s+?\\}\\);/g), 'Close your <code>$(document).ready(function() {</code> function with <code>\\}\\);</code>.')"
],
"challengeSeed": [
"<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>",
"<div class='row'>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-primary'><i class='fa fa-thumbs-up'></i> Like</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-info'><i class='fa fa-info-circle'></i> Info</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-danger'><i class='fa fa-trash'></i> Delete</button>",
" </div>",
"</div>",
"<br>",
"<form action='submit-cat-photo'>",
" <div class='row'>",
" <div class='col-xs-7'>",
" <input type='text' class='form-control' placeholder='cat photo URL' required>",
" </div>",
" <div class='col-xs-5'>",
" <button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'></i> Submit</button>",
" </div>",
" </div>",
"</form>"
],
"challengeType": 0
},
{
"id": "bad87fee1348bd9bedc08826",
"name": "Waypoint: Target Elements by Selectors Using jQuery",
"difficulty": 0.073,
"description": [
"Make all <code>img</code> elements bounce $('img').addClass('animated bounce')"
],
"tests": [
"assert($('img').hasClass('animated') && $('img').hasClass('bounce'), 'Use the jQuery <code>addClass()</code> function to give the classes \"animated\" and \"bounce\" to your <code>img</code> element.')",
"assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')"
],
"challengeSeed": [
"fccss",
" $(document).ready(function() {",
" $('#target').attr('disabled', true)",
"",
" });",
"fcces",
"<button id='target' class='btn btn-primary btn-block'>Enable this button with jQuery</button>"
"<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>",
"<div class='row'>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-primary'><i class='fa fa-thumbs-up'></i> Like</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-info'><i class='fa fa-info-circle'></i> Info</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-danger'><i class='fa fa-trash'></i> Delete</button>",
" </div>",
"</div>",
"<br>",
"<form action='submit-cat-photo'>",
" <div class='row'>",
" <div class='col-xs-7'>",
" <input type='text' class='form-control' placeholder='cat photo URL' required>",
" </div>",
" <div class='col-xs-5'>",
" <button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'></i> Submit</button>",
" </div>",
" </div>",
"</form>"
],
"challengeType": 0
},
{
"id": "bad87fee1348bd9aedc08826",
"name": "Waypoint: Target Elements by Selectors Using jQuery",
"difficulty": 0.073,
"description": [
],
"tests": [
],
"challengeSeed": [
],
"challengeType": 0
},
{
"id": "bad87fee1348bd9aedb08826",
"name": "Waypoint: Target Elements by Class Using jQuery",
"difficulty": 0.074,
"description": [
],
"tests": [
"assert($('.btn').hasClass('animated') && $('.btn').hasClass('shake'), 'Use the jQuery <code>addClass()</code> function to give the classes \"animated\" and \"shake\" to all your elements with the class \"btn\".')",
"assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')"
],
"challengeSeed": [
"fccss",
" $(document).ready(function() {",
" $('img').addClass('animated bounce');",
" });",
"fcces",
"<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>",
"<div class='row'>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-primary'><i class='fa fa-thumbs-up'></i> Like</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-info'><i class='fa fa-info-circle'></i> Info</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-danger'><i class='fa fa-trash'></i> Delete</button>",
" </div>",
"</div>",
"<br>",
"<form action='submit-cat-photo'>",
" <div class='row'>",
" <div class='col-xs-7'>",
" <input type='text' class='form-control' placeholder='cat photo URL' required>",
" </div>",
" <div class='col-xs-5'>",
" <button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'></i> Submit</button>",
" </div>",
" </div>",
"</form>"
],
"challengeType": 0
},
{
"id": "bad87fee1348bd9aedb08826",
"name": "Waypoint: Add an ID to an Element",
"difficulty": 0.075,
"description": [
],
"tests": [
"assert($('form').attr('id') === 'cat-photo-form', 'Add the ID of \"cat-photo-form\" to your <code>form</code> element.')"
],
"challengeSeed": [
"fccss",
" $(document).ready(function() {",
" $('img').addClass('animated bounce');",
" $('.btn').addClass('animated shake');",
" });",
"fcces",
"<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>",
"<div class='row'>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-primary'><i class='fa fa-thumbs-up'></i> Like</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-info'><i class='fa fa-info-circle'></i> Info</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-danger'><i class='fa fa-trash'></i> Delete</button>",
" </div>",
"</div>",
"<br>",
"<form action='submit-cat-photo'>",
" <div class='row'>",
" <div class='col-xs-7'>",
" <input type='text' class='form-control' placeholder='cat photo URL' required>",
" </div>",
" <div class='col-xs-5'>",
" <button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'></i> Submit</button>",
" </div>",
" </div>",
"</form>"
],
"challengeType": 0
},
{
"id": "bad87fee1348bd9aeda08826",
"name": "Waypoint: Target an element by ID Using jQuery",
"name": "Waypoint: Target Elements by ID Using jQuery",
"difficulty": 0.075,
"description": [
],
"tests": [
"assert($('#cat-photo-form') && $('#cat-photo-form').hasClass('animated') && $('#cat-photo-form').hasClass('pulse'), 'Select the element with the <code>id</code> of \"cat-photo-form\" and use the jQuery <code>addClass()</code> function to give it the classes of \"animated\" and \"pulse\".')",
"assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')"
],
"challengeSeed": [
"fccss",
" $(document).ready(function() {",
" $('img').addClass('animated bounce');",
" $('.btn').addClass('animated shake');",
" });",
"fcces",
"<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>",
"<div class='row'>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-primary'><i class='fa fa-thumbs-up'></i> Like</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-info'><i class='fa fa-info-circle'></i> Info</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-danger'><i class='fa fa-trash'></i> Delete</button>",
" </div>",
"</div>",
"<br>",
"<form action='submit-cat-photo' id='cat-photo-form'>",
" <div class='row'>",
" <div class='col-xs-7'>",
" <input type='text' class='form-control' placeholder='cat photo URL' required>",
" </div>",
" <div class='col-xs-5'>",
" <button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'></i> Submit</button>",
" </div>",
" </div>",
"</form>"
],
"challengeType": 0
},
@ -80,10 +238,42 @@
],
"tests": [
"assert(!editor.match(/nce\\'\\)\\;/g) && !editor.match(/ke\\'\\)\\;/g), 'Delete your <code>img</code> element selector statement and your \".btn\" selector statement.')",
"assert(editor.match(/css.*,.*background-color.*gray.\\);/g), 'Select the element with the <code>id</code> of \"cat-photo-form\" give it the background color of gray.')"
],
"challengeSeed": [
"fccss",
" $(document).ready(function() {",
" $('img').addClass('animated bounce');",
" $('.btn').addClass('animated shake');",
" $('#cat-photo-form').addClass('animated pulse');",
" });",
"fcces",
"<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>",
"<div class='row'>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-primary'><i class='fa fa-thumbs-up'></i> Like</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-info'><i class='fa fa-info-circle'></i> Info</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-danger'><i class='fa fa-trash'></i> Delete</button>",
" </div>",
"</div>",
"<br>",
"<form action='submit-cat-photo' id='cat-photo-form'>",
" <div class='row'>",
" <div class='col-xs-7'>",
" <input type='text' class='form-control' placeholder='cat photo URL' required>",
" </div>",
" <div class='col-xs-5'>",
" <button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'></i> Submit</button>",
" </div>",
" </div>",
"</form>"
],
"challengeType": 0
},
@ -96,10 +286,40 @@
],
"tests": [
"assert($('form button').attr('id') === 'submit-button', 'Add the ID of \"submit-button\" to your the <code>button</code> on your <code>form</code> element.')",
"assert($('#submit-button') && $('#submit-button').prop('disabled'), 'Disable your element with the id of \"submit-button\".')"
],
"challengeSeed": [
"fccss",
" $(document).ready(function() {",
" $('#cat-photo-form').css('background-color', 'gray');",
" });",
"fcces",
"<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>",
"<div class='row'>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-primary'><i class='fa fa-thumbs-up'></i> Like</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-info'><i class='fa fa-info-circle'></i> Info</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-danger'><i class='fa fa-trash'></i> Delete</button>",
" </div>",
"</div>",
"<br>",
"<form action='submit-cat-photo' id='cat-photo-form'>",
" <div class='row'>",
" <div class='col-xs-7'>",
" <input type='text' class='form-control' placeholder='cat photo URL' required>",
" </div>",
" <div class='col-xs-5'>",
" <button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'></i> Submit</button>",
" </div>",
" </div>",
"</form>"
],
"challengeType": 0
},
@ -112,10 +332,41 @@
],
"tests": [
"assert($('img').length === 0, 'Use jQuery to remove your <code>img</code> element from your page.')",
"assert(editor.match(/<img/g), 'You should still have an <code>img</code> element in your HTML but jQuery should remove it.')"
],
"challengeSeed": [
"fccss",
" $(document).ready(function() {",
" $('#cat-photo-form').css('background-color', 'gray');",
" $('#submit-button').prop('disabled', 'true');",
" });",
"fcces",
"<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>",
"<div class='row'>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-primary'><i class='fa fa-thumbs-up'></i> Like</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-info'><i class='fa fa-info-circle'></i> Info</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-danger'><i class='fa fa-trash'></i> Delete</button>",
" </div>",
"</div>",
"<br>",
"<form action='submit-cat-photo' id='cat-photo-form'>",
" <div class='row'>",
" <div class='col-xs-7'>",
" <input type='text' class='form-control' placeholder='cat photo URL' required>",
" </div>",
" <div class='col-xs-5'>",
" <button type='submit' id='submit-button' class='btn btn-primary'><i class='fa fa-paper-plane'></i> Submit</button>",
" </div>",
" </div>",
"</form>"
],
"challengeType": 0
},
@ -125,7 +376,38 @@
"name": "Waypoint: Move an Element Using jQuery",
"difficulty": 0.079,
"description": [
"fccss",
" $(document).ready(function() {",
" $('#cat-photo-form').css('background-color', 'gray');",
" $('#submit-button').prop('disabled', 'true');",
" $('img').remove();",
" });",
"fcces",
"<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>",
"<div class='row'>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-primary'><i class='fa fa-thumbs-up'></i> Like</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-info'><i class='fa fa-info-circle'></i> Info</button>",
" </div>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-danger'><i class='fa fa-trash'></i> Delete</button>",
" </div>",
"</div>",
"<br>",
"<form action='submit-cat-photo' id='cat-photo-form'>",
" <div class='row'>",
" <div class='col-xs-7'>",
" <input type='text' class='form-control' placeholder='cat photo URL' required>",
" </div>",
" <div class='col-xs-5'>",
" <button type='submit' id='submit-button' class='btn btn-primary'><i class='fa fa-paper-plane'></i> Submit</button>",
" </div>",
" </div>",
"</form>"
],
"tests": [
@ -152,22 +434,6 @@
"challengeType": 0
},
{
"id": "bad87fee1348bd9aed408826",
"name": "Waypoint: Animate an Element Using jQuery",
"difficulty": 0.081,
"description": [
],
"tests": [
],
"challengeSeed": [
],
"challengeType": 0
},
{
"id": "bad87fee1348bd9aed308826",
"name": "Waypoint: Target the Parent of an Element Using jQuery",
@ -295,8 +561,7 @@
],
"challengeType": 0
},
{
}, {
"id": "bad87fee1348bd9aede08826",
"name": "Waypoint: Use Hex Codes for Precise Colors",
"difficulty": 0.071,
@ -310,8 +575,7 @@
],
"challengeType": 0
},
{
}, {
"id": "bad87fee1348bd9aedd08826",
"name": "Waypoint: Use Shortened Hex Codes for Colors",
"difficulty": 0.071,

View File

@ -26,6 +26,7 @@ module.exports = function(app) {
router.post('/get-help', getHelp);
router.post('/get-pair', getPair);
router.get('/chat', chat);
router.get('/bootcamp-calculator', bootcampCalculator);
router.get('/twitch', twitch);
router.get('/pmi-acp-agile-project-managers', agileProjectManagers);
router.get('/pmi-acp-agile-project-managers-form', agileProjectManagersForm);
@ -325,6 +326,12 @@ module.exports = function(app) {
}
}
function bootcampCalculator(req, res) {
res.render('resources/calculator', {
title: 'Coding Bootcamp Cost Calculator'
});
}
function jobsForm(req, res) {
res.render('resources/jobs-form', {
title: 'Employer Partnership Form for Job Postings,' +

View File

@ -119,13 +119,15 @@ module.exports = function(app) {
*/
function returnUser (req, res, next) {
debug(req.params.username);
User.findOne(
{ where: { username: req.params.username.toLowerCase() } },
{ where: { 'username': req.params.username.toLowerCase() } },
function(err, user) {
if (err) {
debug('Username err: ', err);
return next(err);
}
debug(user);
if (user) {
user.progressTimestamps =
user.progressTimestamps.sort(function(a, b) {
@ -184,11 +186,6 @@ module.exports = function(app) {
user.currentStreak = 1;
}
user.save(function(err) {
if (err) {
return next(err);
}
var data = {};
var progressTimestamps = user.progressTimestamps;
progressTimestamps.forEach(function(timeStamp) {
@ -234,7 +231,6 @@ module.exports = function(app) {
currentStreak: user.currentStreak +
(user.currentStreak === 1 ? ' day' : ' days')
});
});
} else {
req.flash('errors', {
msg: "404: We couldn't find a page with that url. " +

View File

@ -49,11 +49,11 @@ app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
if (process.env.NODE_ENV === 'production') {
app.use(forceDomain({
hostname: 'www.freecodecamp.com'
}));
}
//if (process.env.NODE_ENV === 'production') {
// app.use(forceDomain({
// hostname: 'www.freecodecamp.com'
// }));
//}
app.use(compress());
app.use(lessMiddleware(path.join(__dirname, '/public')));

View File

@ -88,7 +88,7 @@ block content
.hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center.large-p.negative-10
.col-xs-12.col-sm-9.col-md-10
li.faded.large-p.negative-10
a(href="/challenges/#{challenge.name}")= challenge.name
a(href="/challenges/#{challenge.dashedName}")= challenge.name
else
.row
@ -96,24 +96,23 @@ block content
span.negative-10
.col-xs-12.col-sm-9.col-md-10
li.large-p.negative-10
a(href="/challenges/#{challenge.name}")= challenge.name
a(href="/challenges/#{challenge.dashedName}")= challenge.name
//#announcementModal.modal(tabindex='-1')
// .modal-dialog.animated.fadeInUp.fast-animation
// .modal-content
// .modal-header.challenge-list-header Join our Saturday Summit!
// a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
// .modal-body
// h3.text-left Saturday at Noon EDT: We'll live-stream our Saturday Summit on Twitch.tv.
// h3.text-left We'll announce our new Front End Development Certificate Program (it's free, of course) and our new "Free Code Camp On The Go" app. &thinsp;
// a(href='http://www.freecodecamp.com/twitch', target='_blank') Add us to your calendar here
// | .
// a.btn.btn-lg.btn-info.btn-block(name='_csrf', value=_csrf, aria-hidden='true', href='http://twitch.tv/freecodecamp', target='_blank') Follow us on Twitch.tv
// a.btn.btn-lg.btn-primary.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Thanks for the heads-up!
//script.
// $(document).ready(function () {
// if (!localStorage || !localStorage.day234) {
// $('#announcementModal').modal('show');
// localStorage.day234 = "true";
// }
// });
#announcementModal.modal(tabindex='-1')
.modal-dialog.animated.fadeInUp.fast-animation
.modal-content
.modal-header.challenge-list-header Add us to your LinkedIn profile
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body
h3.text-left LinkedIn now recognizes Free Code Camp as a university.
img.img-responsive.img-center(src='https://www.evernote.com/l/AHTzkHwtg-BHj57bqqDL7WFF8WgrI5V8cxwB/image.png')
h3.text-left It takes less than a minute to add Free Code Camp to your LinkedIn profile.
a.btn.btn-lg.btn-info.btn-block(name='_csrf', value=_csrf, aria-hidden='true', href='/linkedin', target='_blank') Show me how to do this
a.btn.btn-lg.btn-primary.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Thanks for the heads-up
script.
$(document).ready(function () {
if (!localStorage || !localStorage.linkedIn) {
$('#announcementModal').modal('show');
localStorage.linkedIn = "true";
}
});

View File

@ -17,11 +17,11 @@ block content
script(type='text/javascript', src='/js/lib/coursewares/sandbox.js')
.row(ng-controller="pairedWithController")
.col-xs-12.col-sm-12.col-md-4.bonfire-top
#testCreatePanel
h1#bonfire-name.text-center= name
h2.text-center
.bonfire-flames Difficulty:&thinsp;
.col-xs-12.col-sm-12.col-md-4.col-lg-3
#testCreatePanel.well
h3.text-center.negative-10= name
.positive-15.positive-15-bottom
h4.text-center.bonfire-flames Difficulty:&thinsp;
if (difficulty == "0")
i.ion-ios-flame-outline
i.ion-ios-flame-outline
@ -58,67 +58,61 @@ block content
i.ion-ios-flame
i.ion-ios-flame
i.ion-ios-flame
.well
.row
.col-xs-12
.bonfire-instructions
p.wrappable= brief
#brief-instructions
#more-info.btn.btn-primary.btn-block.btn-primary-ghost
span.ion-arrow-down-b
| More information
#long-instructions.row.hide
.col-xs-12
for sentence in details
p.wrappable!= sentence
#MDN-links
p Here are some helpful links:
for link, index in MDNlinks
ul: li: a(href=""+link, target="_blank") !{MDNkeys[index]}
#less-info.btn.btn-primary.btn-block.btn-primary-ghost
span.ion-arrow-up-b
| Less information
.row
.col-xs-12
.bonfire-instructions
for sentence in details
p.wrappable.negative-10!= sentence
.negative-bottom-margin-30
#MDN-links
p.negative-10 Here are some helpful links:
for link, index in MDNlinks
.negative-10
ul: li: a(href=""+link, target="_blank") !{MDNkeys[index]}
if (user)
form.form-horizontal(novalidate='novalidate', name='completedWithForm')
.form-group.text-center
.col-xs-12
// extra field to distract password tools like lastpass from injecting css into our username field
input.form-control(ng-show="false")
input.form-control#completed-with(name="existingUser", placeholder="Your pair's username if pairing", existing-username='', ng-model="existingUser")
.col-xs-12(ng-cloak, ng-show="completedWithForm.$error.exists && !completedWithForm.existingUser.$pristine && existingUser.length > 0")
alert(type='danger')
span.ion-close-circled
| Username not found
#submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter)
if (user && user.sentSlackInvite)
.button-spacer
.btn-group.input-group.btn-group-justified
label.btn.btn-success#trigger-help-modal
i.fa.fa-medkit
| &nbsp; Help
label.btn.btn-success#trigger-pair-modal
i.fa.fa-user-plus
| &nbsp; Pair
label.btn.btn-success#trigger-issue-modal
i.fa.fa-bug
| &nbsp; Bug
if (user)
form.form-horizontal(novalidate='novalidate', name='completedWithForm')
.form-group.text-center.negative-10
.col-xs-12
// extra field to distract password tools like lastpass from injecting css into our username field
input.form-control(ng-show="false")
input.form-control#completed-with(name="existingUser", placeholder="Your pair's username if pairing", existing-username='', ng-model="existingUser")
.col-xs-12(ng-cloak, ng-show="completedWithForm.$error.exists && !completedWithForm.existingUser.$pristine && existingUser.length > 0")
alert(type='danger')
span.ion-close-circled
| Username not found
label.negative-10.btn.btn-primary.btn-block#submitButton
i.fa.fa-play
| &nbsp; Run code (ctrl + enter)
if (user && user.sentSlackInvite)
.button-spacer
form.code
.form-group.codeMirrorView
textarea#codeOutput(style='display: none;')
br
#testSuite
br
script(type="text/javascript").
var tests = !{JSON.stringify(tests)};
var challengeSeed = !{JSON.stringify(challengeSeed)};
var challenge_Id = !{JSON.stringify(challengeId)};
var challenge_Name = !{JSON.stringify(name)};
var started = Math.floor(Date.now());
var challengeType = !{JSON.stringify(challengeType)};
var _ = R;
var dashed = !{JSON.stringify(dashedName)};
.btn-group.input-group.btn-group-justified
label.btn.btn-success#trigger-help-modal
i.fa.fa-medkit
| &nbsp; Help
label.btn.btn-success#trigger-pair-modal
i.fa.fa-user-plus
| &nbsp; Pair
label.btn.btn-success#trigger-issue-modal
i.fa.fa-bug
| &nbsp; Bug
.button-spacer
form.code
.form-group.codeMirrorView
textarea#codeOutput(style='display: none;')
br
#testSuite.negative-10
br
script(type="text/javascript").
var tests = !{JSON.stringify(tests)};
var challengeSeed = !{JSON.stringify(challengeSeed)};
var challenge_Id = !{JSON.stringify(challengeId)};
var challenge_Name = !{JSON.stringify(name)};
var started = Math.floor(Date.now());
var challengeType = !{JSON.stringify(challengeType)};
var _ = R;
var dashed = !{JSON.stringify(dashedName)};
.col-xs-12.col-sm-12.col-md-8
#mainEditorPanel
@ -140,7 +134,6 @@ block content
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf) Go to my next challenge (ctrl + enter)
if (user.progressTimestamps.length > 2)
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
i.fa.fa-twitter &thinsp;

View File

@ -20,59 +20,48 @@ block content
script(src='/js/lib/codemirror/mode/htmlmixed/htmlmixed.js')
script(src='/js/lib/codemirror/addon/emmet/emmet.js')
.row.courseware-height
.vertical-scroll
.col-xs-12.col-sm-12.col-md-3.col-lg-3
.well
.row
.col-xs-12
h2.text-center= name
.bonfire-instructions
p.wrappable!= brief
#brief-instructions
#more-info.btn.btn-primary.btn-block.btn-primary-ghost
span.ion-arrow-down-b
| More information
#long-instructions.row.hide
.col-xs-12
for sentence in details
p.wrappable!= sentence
#less-info.btn.btn-primary.btn-block.btn-primary-ghost
span.ion-arrow-up-b
| Less information
br
if (user)
a.btn.btn-primary.btn-big.btn-block#next-courseware-button
| Go to my next challenge
br
| (ctrl + enter)
if (user.sentSlackInvite)
.button-spacer
.btn-group.input-group.btn-group-justified
label.btn.btn-success#trigger-help-modal
i.fa.fa-medkit
| &nbsp; Help
label.btn.btn-success#trigger-issue-modal
i.fa.fa-bug
| &nbsp; Bug
.button-spacer
.col-xs-12.col-sm-12.col-md-3.col-lg-3
.well
.row
.col-xs-12
h3.text-center.negative-10= name
.bonfire-instructions
for sentence in details
p.wrappable.negative-10!= sentence
.negative-bottom-margin-30
if (user)
label.btn.btn-primary.btn-block.negative-10#next-courseware-button
.ion-checkmark-circled
| &nbsp; Go to my next challenge (ctrl + enter)
if (user.sentSlackInvite)
.button-spacer
.btn-group.input-group.btn-group-justified
label.btn.btn-success#trigger-help-modal
i.fa.fa-medkit
| &nbsp; Help
label.btn.btn-success#trigger-issue-modal
i.fa.fa-bug
| &nbsp; Bug
.button-spacer
script.
var userLoggedIn = true;
else
a.btn.signup-btn.btn-block.btn-block.negative-15(href='/login') Sign in so you can save your progress
script.
var userLoggedIn = true;
else
a.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
script.
var userLoggedIn = false;
.button-spacer
ul#testSuite.list-group
br
script(type="text/javascript").
$('#next-courseware-button').attr('disabled', 'disabled');
var tests = !{JSON.stringify(tests)};
var challengeSeed = !{JSON.stringify(challengeSeed)};
var challenge_Id = !{JSON.stringify(challengeId)};
var challenge_Name = !{JSON.stringify(name)};
var prodOrDev = !{JSON.stringify(environment)};
var challengeType = !{JSON.stringify(challengeType)};
var started = Math.floor(Date.now());
var userLoggedIn = false;
.button-spacer
ul#testSuite.list-group
br
script(type="text/javascript").
$('#next-courseware-button').attr('disabled', 'disabled');
var tests = !{JSON.stringify(tests)};
var challengeSeed = !{JSON.stringify(challengeSeed)};
var challenge_Id = !{JSON.stringify(challengeId)};
var challenge_Name = !{JSON.stringify(name)};
var prodOrDev = !{JSON.stringify(environment)};
var challengeType = !{JSON.stringify(challengeType)};
var started = Math.floor(Date.now());
.col-xs-12.col-sm-12.col-md-5.col-lg-6
#mainEditorPanel
form.code

View File

@ -3,7 +3,6 @@ html(ng-app='profileValidation', lang='en')
head
include partials/universal-head
body.top-and-bottom-margins
include partials/css-cdns
include partials/navbar
.container
include partials/flash

View File

@ -3,6 +3,7 @@
a.ion-speakerphone(href='http://blog.freecodecamp.com', target='_blank') &nbsp;Blog&nbsp;&nbsp;
a.ion-social-github(href="http://github.com/freecodecamp", target='_blank') &nbsp;GitHub&nbsp;&nbsp;
a.ion-social-twitch-outline(href="/twitch") &thinsp;Twitch&nbsp;
a.ion-social-linkedin(href="/linkedin") &thinsp;LinkedIn&nbsp;
a.ion-social-facebook(href="/field-guide/how-can-i-find-other-free-code-camp-campers-in-my-city") &nbsp;Facebook&nbsp;&nbsp;
a.ion-social-twitter(href="http://twitter.com/freecodecamp", target='_blank') &nbsp;Twitter&nbsp;&nbsp;
a.ion-locked(href="/privacy") &nbsp;Privacy&nbsp;&nbsp;
@ -14,6 +15,8 @@
span.sr-only Free Code Camp on GitHub
a.ion-social-twitch-outline(href="/twitch")
span.sr-only Free Code Camp Live Pair Programming on Twitch.tv
a.ion-social-linkedin(href="/linkedin")
span.sr-only Free Code Camp LinkedIn Alumni Network
a.ion-social-facebook(href="/field-guide/how-can-i-find-other-free-code-camp-campers-in-my-city")
span.sr-only Free Code Camp local groups on Facebook
a.ion-social-twitter(href="http://twitter.com/freecodecamp", target='_blank')

View File

@ -9,14 +9,14 @@ meta(property="og:site_name", content="Free Code Camp")
meta(name='twitter:widgets:csp', content='on')
meta(name='p:domain_verify', content='d0bc047a482c03c24f1168004c2a216a')
meta(property="og:url", content="http://www.freecodecamp.com")
meta(property="og:description", content="We're a community where you learn to code by helping nonprofits. Build your full stack JavaScript Portfolio today.")
meta(property="og:description", content="Learn to code by helping nonprofits. Build your full stack web development portfolio today.")
meta(property="og:image", content="https://s3.amazonaws.com/freecodecamp/curriculum-diagram-full.jpg")
meta(property="og:type", content="article")
meta(property="article:publisher", content="https://www.facebook.com/freecodecamp")
meta(property="article:section", content="Responsive")
link(rel="publisher", href="https://plus.google.com/+Freecodecamp")
link(rel="author", href="https://plus.google.com/+Freecodecamp")
meta(name="description", content="A community where you learn to code by helping nonprofits. Build your full stack JavaScript Portfolio today.")
meta(name="description", content="Learn to code by helping nonprofits. Build your full stack web development portfolio today.")
meta(name="twitter:creator", content="@freecodecamp")
meta(name="twitter:url", content="http://www.freecodecamp.com")
meta(name="twitter:site", content="@freecodecamp")

View File

@ -34,32 +34,32 @@ block content
.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: &thinsp;
p.wrappable.negative-30 link: &thinsp;
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: &thinsp;
p.wrappable.negative-30 link: &thinsp;
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: &thinsp;
p.wrappable.negative-30 link: &thinsp;
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')
p.wrappable.negative-45 link: &thinsp;
p.wrappable.negative-30 link: &thinsp;
a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/dolG-yRMcPs
.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/YMz_vrK_KlQ')
p.wrappable.negative-45 link: &thinsp;
p.wrappable.negative-30 link: &thinsp;
a(href="http://www.youtube.com/watch/_BErpDdmBOw") http://www.youtube.com/watch/YMz_vrK_KlQ
.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/bbFVxaza8Ik')
p.wrappable.negative-45 link: &thinsp;
p.wrappable.negative-30 link: &thinsp;
a(href="http://www.youtube.com/watch/S7iRBZJwOAs") http://www.youtube.com/watch/bbFVxaza8Ik
br
br

View File

@ -15,10 +15,10 @@
.spacer
.row
.col-xs-12.col-sm-8.col-sm-offset-2.well
h4.text-center Which Coders are Worth Following on Twitter?
img.img-responsive(src='https://www.evernote.com/l/AHQLuyBNcVpKj5TRhNzWssVuCvbRIEylm3oB/image.png')
p Share a link to the Twitter profile of your choice, and tell us in 140 characters or less why this person is a "Coder Worth Following".
p Use the headline: "Coder Worth Following: (their Twitter handle)". We'll publish a list of the 25 most-upvoted submissions (and the campers who submitted them) in Wednesday's blog post. Also - as always - you'll get 1 point every time someone upvotes your post.
h4.text-center Which other free resources do you use?
img.img-responsive(src='https://www.evernote.com/l/AHRNhlwViM1Kh5qCm6iy7MSWrbdyxYbRkWkB/image.png')
p Link us to your favorite free coding resources.
p Use the headline: "Awesome Free Resource: (the name of the book, podcast, or video series)". We'll publish a list of the 25 most-upvoted resources (and the campers who submitted them) in Wednesday's blog post, and in an upcoming Field Guide article. Also - as always - you'll get 1 point every time someone upvotes your post.
.spacer
#search-results

View File

@ -0,0 +1,656 @@
extends ../layout
block content
.panel.panel-info
.panel-heading.text-center Coding Bootcamp Cost Calculator
.panel-body
.row
.col-xs-12.col-sm-10.col-sm-offset-1
style.
#lastYearIncome{
clear:both;
margin: 2% 0;
width: 110px;
}
#income, #calculate {
visibility:hidden;
}
.step {
font-size: 2em;
padding: 1%;
clear: both;
}
.city-buttons {
display: block;
clear: right;
}
#four p{
font-size: .6em;
color: black;
}
.chart rect {
fill: steelblue;
}
.chart text {
fill: #121401;
font: 10px sans-serif;
text-anchor: end;
}
.axis path,
.axis line {
fill: none;
stroke: #121401;
stroke-width: 2px;
shape-rendering: crispEdges;
}
html.
<!--Live Logging for Testing-->
<div id="target" class="step"></div>
<div class="header">
<!--Step 1-->
<div id="one" class="step">Step 1: Choose your City</div>
<div id="city-buttons">
<ul>
<li><span id="New York City">New York City</span></li>
<li><span id="San Fransisco">San Fransisco</span></li>
<li><span id="Austin">Austin</span></li>
<li><span id="Los Angeles">Los Angeles</span></li>
<li><span id="Chicago">Chicago</span></li>
<li><span id="Other">Other</span></li>
</ul>
</div>
&nbsp;
<!--Step 2-->
<div id="two" class="step">Step 2: Enter last Year's Income</div>
<div id="income">
<label>Last Years Income in $$:</label>
<input type="number" placeholder="52000" class="form-control" id="lastYearIncome">
</div>
<!--Step 3-->
<div id="three" class="step">Step 3: Calculate</div>
<button id="calculate" type="submit" class="btn btn-default">Calculate</button>
<!--Check Outputs Temp-->
<!--Step 4-->
<!--<div id="four" class="step">Clear the Chart and Start Over?</div>-->
<svg class="chart"></svg>
</div>
<!--container-->
<div class="footer">
Sources: <a href="#">Link to Data Sources Here</a>
<form>
<label>
<input type="radio" name="mode"
value="grouped">Grouped
</label>
<label>
<input type="radio" name="mode"
value="stacked" checked>
Stacked
</label>
</form>
script.
$(document).ready(function () {
var n = 4, // number of layers
m = 58, // number of samples per layer
stack = d3.layout.stack(),
layers = stack(d3.range(n).map(function () {
return bumpLayer(m, .1);
})),
yGroupMax = d3.max(layers, function (layer) {
return d3.max(layer, function (d) {
return d.y;
});
}),
yStackMax = d3.max(layers, function (layer) {
return d3.max(layer, function (d) {
return d.y0 + d.y;
});
});
var margin = {
top: 40,
right: 10,
bottom: 20,
left: 10
},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var x = d3.scale.ordinal()
.domain(d3.range(m))
.rangeRoundBands([0, width], .08);
var y = d3.scale.linear()
.domain([0, yStackMax])
.range([height, 0]);
var color = d3.scale.linear()
.domain([0, n - 1])
.range(["#aad", "#556"]);
var xAxis = d3.svg.axis()
.scale(x)
.tickSize(0)
.tickPadding(6)
.orient("bottom");
var svg = d3.select("body").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var layer = svg.selectAll(".layer")
.data(layers)
.enter().append("g")
.attr("class", "layer")
.style("fill", function (d, i) {
return color(i);
});
var rect = layer.selectAll("rect")
.data(function (d) {
return d;
})
.enter().append("rect")
.attr("x", function (d) {
return x(d.x);
})
.attr("y", height)
.attr("width", x.rangeBand())
.attr("height", 0);
rect.transition()
.delay(function (d, i) {
return i * 10;
})
.attr("y", function (d) {
return y(d.y0 + d.y);
})
.attr("height", function (d) {
return y(d.y0) - y(d.y0 + d.y);
});
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis);
d3.selectAll("input").on("change", change);
var timeout = setTimeout(function () {
d3.select("input[value=\"grouped\"]").property("checked", true).each(change);
}, 2000);
function change() {
clearTimeout(timeout);
if (this.value === "grouped") transitionGrouped();
else transitionStacked();
}
function transitionGrouped() {
y.domain([0, yGroupMax]);
rect.transition()
.duration(500)
.delay(function (d, i) {
return i * 10;
})
.attr("x", function (d, i, j) {
return x(d.x) + x.rangeBand() / n * j;
})
.attr("width", x.rangeBand() / n)
.transition()
.attr("y", function (d) {
return y(d.y);
})
.attr("height", function (d) {
return height - y(d.y);
});
}
function transitionStacked() {
y.domain([0, yStackMax]);
rect.transition()
.duration(500)
.delay(function (d, i) {
return i * 10;
})
.attr("y", function (d) {
return y(d.y0 + d.y);
})
.attr("height", function (d) {
return y(d.y0) - y(d.y0 + d.y);
})
.transition()
.attr("x", function (d) {
return x(d.x);
})
.attr("width", x.rangeBand());
}
// Inspired by Lee Byron's test data generator.
function bumpLayer(n, o) {
function bump(a) {
var x = 1 / (.1 + Math.random()),
y = 2 * Math.random() - .5,
z = 10 / (.1 + Math.random());
for (var i = 0; i < n; i++) {
var w = (i / n - y) * z;
a[i] += x * Math.exp(-w * w);
}
}
var a = [], i;
for (i = 0; i < n; ++i) a[i] = o + o * Math.random();
for (i = 0; i < 5; ++i) bump(a);
return a.map(function (d, i) {
return {x: i, y: Math.max(0, d)};
});
}
var city = "";
var lastYearincome = 52000;
//major cities array to check against users location for housing costs
var cityArray = ["San Fransisco", "Los Angeles", "Chicago", "Austin", "New York City"];
//this is the raw bootcamps file allowing easy addition of new code camps
var bootcamps = [{
"name": "App Academy",
"cost": "18000",
"weeks": "12",
"finance": false,
"cities": [
"New York",
"San Francisco"
]
}, {
"name": "Viking Code School",
"cost": "18000",
"weeks": "14",
"finance": false,
"cities": [
"online"
]
}, {
"name": "Hack Reactor",
"cost": "17780",
"weeks": "12",
"finance": true,
"cities": [
"New York",
"San Francisco"
]
}, {
"name": "Hackbright Academy",
"cost": "15000",
"weeks": "10",
"finance": true,
"cities": [
"San Francisco"
]
}, {
"name": "Dev Bootcamp",
"cost": "13950",
"finance": true,
"weeks": "19",
"cities": [
"New York",
"San Francisco",
"Chicago"
]
}, {
"name": "General Asssembly",
"cost": "11500",
"finance": true,
"weeks": "12",
"cities": [
"Washington, DC",
"Austin",
"Boston",
"Chicago",
"Hong Kong",
"London",
"Los Angeles",
"Melbourne",
"New York cities",
"San Francisco",
"Seattle",
"Singapore"
]
}, {
"name": "Angel Hack",
"cost": "14250",
"finance": true,
"weeks": "12",
"cities": [
"San Francisco"
]
}, {
"name": "Bitmaker Labs",
"cost": "12000",
"finance": true,
"weeks": "12",
"cities": [
"Toronto"
]
}, {
"name": "CoderVox",
"cost": "9980",
"finance": true,
"weeks": "12",
"cities": [
"Austin"
]
}, {
"name": "Coding Dojo",
"cost": "12500",
"finance": true,
"weeks": "12",
"cities": [
"New York",
"San Francisco",
"Chicago"
]
}, {
"name": "Epicodus",
"cost": "4500",
"finance": false,
"weeks": "15",
"cities": [
"Portland"
]
}, {
"name": "Flat Iron School",
"cost": "15000",
"finance": true,
"weeks": "12",
"cities": [
"New York"
]
}, {
"name": "Galvanize",
"cost": "21000",
"finance": true,
"weeks": "24",
"cities": [
"Boulder",
"Denver",
"Seattle",
"San Francisco",
"Fort Collins"
]
}, {
"name": "The Iron Yard",
"cost": "12000",
"finance": true,
"weeks": "19",
"cities": [
"Atlanta",
"Austin",
"Colombia, SC",
"Charleston, SC",
"Houston",
"Greenville, SC",
"Las Vegas",
"Little Rock",
"Nashville",
"Orlando",
"Raleigh - Durham",
"Tampa - St. Petersburg",
"Washington DC"
]
}, {
"name": "Launch Academy",
"cost": "12500",
"finance": true,
"weeks": "10",
"cities": [
"Boston"
]
}, {
"name": "Maker Square",
"cost": "16920",
"finance": true,
"weeks": "12",
"cities": [
"Los Angeles",
"San Francisco",
"Austin"
]
}, {
"name": "Refactor U",
"cost": "13500",
"finance": true,
"weeks": "10",
"cities": [
"Boulder"
]
}, {
"name": "Rocket U",
"cost": "12500",
"finance": true,
"weeks": "12",
"cities": [
"New York",
"San Francisco",
"Chicago"
]
}, {
"name": "Sabio",
"cost": "13450",
"finance": true,
"weeks": "12",
"cities": [
"Los Angeles"
]
}, {
"name": "Shillington School",
"cost": "12950",
"finance": true,
"weeks": "12",
"cities": [
"New York",
"Sydney",
"Brisbane",
"London",
"Manchester",
"Melbourne"
]
}, {
"name": "The Tech Academy",
"cost": "9000",
"finance": true,
"weeks": "20",
"cities": [
"Portland"
]
}, {
"name": "Turing School",
"cost": "17500",
"finance": true,
"weeks": "27",
"cities": [
"Denver"
]
}, {
"name": "Free Code Camp",
"cost": "0",
"finance": true,
"weeks": "0",
"cities": [
"Online"
]
}];
//reduce opacity for steps 2 through 4
//the actual elements start out hidden via CSS
$('#two').css({opacity: '0.25'});
$('#three').css({opacity: '0.25'});
$('#four').css({opacity: '0.25'});
//step one event listener
$('#city-buttons').on("click", "span", function () {
$(this).addClass('animated tada');
city = $(this).attr("id");
//make next step visible
$('#two').css({opacity: '1'});
$('#income').css({visibility: 'visible'});
//console.log(city);
});
//step two event listener
$('#income').on("change", function () {
console.log("Income Updated");
lastYearincome = parseInt($('#lastYearIncome').val());
//make next step visible
$('#three').css({opacity: '1'});
$('#calculate').css({visibility: 'visible'});
});
<!--Graph it-->
$('#calculate').on("click", function () {
//Make data logger visible
$('#four').css({opacity: '1'});
<!--Prep the data for D3 -->
var categoryNames = ['Tuition', 'Finance', 'Housing', 'Working Cost'];
bootcamps.forEach(function (camp) {
var x0 = 0;
//this just checks against main city array.
//when we refactor, this should check against this camp's cities array
//should not be a difficult change
if (cityArray.indexOf(city) >= 0) {
weeklyHousing = 0;
} else {
weeklyHousing = 500;
}
camp.mapping = [{
name: camp.name,
label: 'Tuition',
x0: x0,
x1: x0 += +camp.cost
}, {
name: camp.name,
label: 'Finance',
x0: +camp.cost,
x1: x0 += +Math.floor(camp.cost * .09519)
}, {
name: camp.name,
label: 'Housing',
x0: +Math.floor(camp.cost * 1.09519),
x1: x0 += weeklyHousing * camp.weeks
}, {
name: camp.name,
label: 'Working Cost',
x0: +(Math.floor(camp.cost * 1.09519) + weeklyHousing * camp.weeks),
x1: x0 += +(Math.floor(camp.weeks * lastYearincome / 50))
}];
camp.total = camp.mapping[camp.mapping.length - 1].x1;
});
console.log(bootcamps[0]);
var margin = {
top: 30,
right: 60,
bottom: 50,
left: 140
},
width = 800 - margin.left - margin.right,
height = 600 - margin.top - margin.bottom;
var barHeight = 20;
var xScale = d3.scale.linear()
.domain([0, d3.max(bootcamps, function (d) {
return d.total;
})])
.rangeRound([0, width]);
var yScale = d3.scale.ordinal()
.domain(bootcamps.map(function (d) {
return d.name;
}))
.rangeRoundBands([0, height], .1);
console.log("yrangeroundband", yScale.rangeBand());
var color = d3.scale.ordinal()
.range(["#f0ad4e", "#4A2B0F", "#215f1e", "#457E86"])
.domain(['Tuition', 'Finance', 'Housing', 'Working Cost']);
var svg = d3.select("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var selection = svg.selectAll(".series")
.data(bootcamps)
.enter().append("g")
.attr("class", "series")
.attr("transform", function (d) {
return "translate(0," + yScale(d.name) + ")";
});
;
selection.selectAll("rect")
.data(function (d) {
return d.mapping;
})
.enter().append("rect")
.attr("width", function (d) {
return xScale((d.x1) - (d.x0));
})
.attr("x", function (d) {
return xScale(d.x0);
})
.attr("height", yScale.rangeBand())
.style("fill", function (d) {
return color(d.label);
})
.style("stroke", "white")
.on("mouseover", function (d) {
showPopover.call(this, d);
})
.on("mouseout", function (d) {
removePopovers();
});
//axes
//axes
var xAxis = d3.svg.axis()
.scale(xScale)
.orient("bottom");
var yAxis = d3.svg.axis()
.scale(yScale)
.orient("left");
svg.append("g")
.attr("class", "y axis")
.call(yAxis);
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis)
.append("text")
.attr("x", 300)
.attr("y", 35)
.attr("dy", ".35em")
.style("text-anchor", "middle")
.text("Cost in $USD");
//tooltips
function removePopovers() {
$('.popover').each(function () {
$(this).remove();
});
}
function showPopover(d) {
$(this).popover({
title: d.name,
placement: 'auto top',
container: 'body',
trigger: 'manual',
html: true,
content: function () {
return d.label +
"<br/>$" +
d3.format(",")(d.value ? d.value : d.x1 - d.x0);
}
});
$(this).popover('show')
}
//legends
var legend = svg.selectAll(".legend")
.data(categoryNames.slice().reverse())
.enter().append("g")
.attr("class", "legend")
.attr("transform", function (d, i) {
return "translate(30," + i * yScale.rangeBand() * 1.1 + ")";
});
legend.append("rect")
.attr("x", width - yScale.rangeBand())
.attr("width", yScale.rangeBand())
.attr("height", yScale.rangeBand())
.style("fill", color)
.style("stroke", "white");
legend.append("text")
.attr("x", width - yScale.rangeBand() * 1.2)
.attr("y", 12)
.attr("dy", ".35em")
.style("text-anchor", "end")
.text(function (d) {
return d;
});
});
});