@ -1,6 +1,6 @@
|
||||
window.common = (function({ $, common = { init: [] }}) {
|
||||
|
||||
common.displayTestResults = function displayTestResults(data = []) {
|
||||
common.displayTestResults = function displayTestResults(data = [], down) {
|
||||
$('#testSuite').children().remove();
|
||||
$('#testSuite').fadeIn('slow');
|
||||
data.forEach(({ err = false, text = '' }) => {
|
||||
@ -21,7 +21,11 @@ window.common = (function({ $, common = { init: [] }}) {
|
||||
`)
|
||||
.appendTo($('#testSuite'));
|
||||
});
|
||||
$('#scroll-locker').animate({ scrollTop: $(document).height() }, 'slow');
|
||||
if (down) {
|
||||
$('#scroll-locker').animate(
|
||||
{ scrollTop: $(document).height() }, 'slow'
|
||||
);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
|
@ -110,7 +110,7 @@ $(document).ready(function() {
|
||||
return common.updateOutputDisplay('' + err);
|
||||
}
|
||||
common.updateOutputDisplay(output);
|
||||
common.displayTestResults(tests);
|
||||
common.displayTestResults(tests, true);
|
||||
if (solved) {
|
||||
common.showCompletion();
|
||||
}
|
||||
@ -140,7 +140,7 @@ $(document).ready(function() {
|
||||
}
|
||||
return common.updateOutputDisplay('' + err);
|
||||
}
|
||||
common.displayTestResults(tests);
|
||||
common.displayTestResults(tests, false);
|
||||
return null;
|
||||
},
|
||||
({ err }) => {
|
||||
@ -164,7 +164,7 @@ $(document).ready(function() {
|
||||
return common.updateOutputDisplay('' + err);
|
||||
}
|
||||
common.codeStorage.updateStorage(challengeName, originalCode);
|
||||
common.displayTestResults(tests);
|
||||
common.displayTestResults(tests, false);
|
||||
return null;
|
||||
},
|
||||
(err) => {
|
||||
|
@ -1161,6 +1161,11 @@ code {
|
||||
background-color: @brand-primary;
|
||||
}
|
||||
|
||||
// user bio
|
||||
.bio {
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
@import "chat.less";
|
||||
@import "jobs.less";
|
||||
@import "challenge.less";
|
||||
|
@ -325,6 +325,7 @@
|
||||
"title": "Confirm the Ending",
|
||||
"description": [
|
||||
"Check if a string (first argument, <code>str</code>) ends with the given target string (second argument, <code>target</code>).",
|
||||
"This challenge <em>can</em> be solved with the <code>.endsWith()</code> method, which was introduced in ES2015. But for the purpose of this challenge, we would like you to use one of the JavaScript substring methods instead.",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/FreeCodeCamp-Get-Help\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
@ -343,7 +344,8 @@
|
||||
"assert(confirmEnding(\"He has to give me a new name\", \"name\") === true, 'message: <code>confirmEnding(\"He has to give me a new name\", \"name\")</code> should return true.');",
|
||||
"assert(confirmEnding(\"He has to give me a new name\", \"me\") === true, 'message: <code>confirmEnding(\"He has to give me a new name\", \"me\")</code> should return true.');",
|
||||
"assert(confirmEnding(\"He has to give me a new name\", \"na\") === false, 'message: <code>confirmEnding(\"He has to give me a new name\", \"na\")</code> should return false.');",
|
||||
"assert(confirmEnding(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: <code>confirmEnding(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\")</code> should return false.');"
|
||||
"assert(confirmEnding(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: <code>confirmEnding(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\")</code> should return false.');",
|
||||
"assert(!/\\.endsWith\\(.*?\\)\\s*?;/.test(code), 'message: Do not use the built-in method <code>.endsWith()</code> to solve the challenge.');"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"isRequired": true,
|
||||
@ -351,7 +353,8 @@
|
||||
"function confirmEnding(str, target) {\n return str.substring(str.length-target.length) === target;\n};\n"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.prototype.substr()"
|
||||
"String.prototype.substr()",
|
||||
"String.prototype.substring()"
|
||||
],
|
||||
"challengeType": 5,
|
||||
"titleEs": "Confirma la terminación",
|
||||
@ -362,7 +365,7 @@
|
||||
},
|
||||
{
|
||||
"id": "afcc8d540bea9ea2669306b6",
|
||||
"title": "Repeat a string repeat a string",
|
||||
"title": "Repeat a string",
|
||||
"description": [
|
||||
"Repeat a given string (first argument) <code>num</code> times (second argument). Return an empty string if <code>num</code> is not a positive number.",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/FreeCodeCamp-Get-Help\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
@ -648,7 +651,7 @@
|
||||
"id": "a24c1a4622e3c05097f71d67",
|
||||
"title": "Where do I belong",
|
||||
"description": [
|
||||
"Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted.",
|
||||
"Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted. The returned value should be a number.",
|
||||
"For example, <code>getIndexToIns([1,2,3,4], 1.5)</code> should return <code>1</code> because it is greater than <code>1</code> (index 0), but less than <code>2</code> (index 1).",
|
||||
"Likewise, <code>getIndexToIns([20,3,5], 19)</code> should return <code>2</code> because once the array has been sorted it will look like <code>[3,5,20]</code> and <code>19</code> is less than <code>20</code> (index 2) and greater than <code>5</code> (index 1).",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/FreeCodeCamp-Get-Help\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
|
@ -235,7 +235,7 @@
|
||||
"<strong>Examples:</strong>",
|
||||
"<blockquote>var someVariable;<br>var anotherVariableName;<br>var thisVariableNameIsTooLong;</blockquote>",
|
||||
"<h4>Instructions</h4>",
|
||||
"Fix the variable declarations and assignments so their names use <dfn>camelCase</dfn>."
|
||||
"Modify the existing declarations and assignments so their names use <dfn>camelCase</dfn>.<br>Do not create any new variables."
|
||||
],
|
||||
"releasedOn": "January 1, 2016",
|
||||
"challengeSeed": [
|
||||
@ -4559,7 +4559,7 @@
|
||||
" }",
|
||||
"};",
|
||||
"// Keep a copy of the collection for tests",
|
||||
"var collectionCopy = JSON.parse(stringify(collection));",
|
||||
"var collectionCopy = JSON.parse(JSON.stringify(collection));",
|
||||
"",
|
||||
"// Only change code below this line",
|
||||
"function updateRecords(id, prop, value) {",
|
||||
|
@ -169,14 +169,14 @@
|
||||
},
|
||||
{
|
||||
"id": "a8e512fbe388ac2f9198f0fa",
|
||||
"title": "Where art thou",
|
||||
"title": "Wherefore art thou",
|
||||
"description": [
|
||||
"Make a function that looks through an array of objects (first argument) and returns an array of all objects that have matching property and value pairs (second argument). Each property and value pair of the source object has to be present in the object from the collection if it is to be included in the returned array.",
|
||||
"For example, if the first argument is <code>[{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }]</code>, and the second argument is <code>{ last: \"Capulet\" }</code>, then you must return the third object from the array (the first argument), because it contains the property and its value, that was passed on as the second argument.",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/FreeCodeCamp-Get-Help' target='_blank'>Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function whereAreYou(collection, source) {",
|
||||
"function whatIsInAName(collection, source) {",
|
||||
" // What's in a name?",
|
||||
" var arr = [];",
|
||||
" // Only change code below this line",
|
||||
@ -186,16 +186,16 @@
|
||||
" return arr;",
|
||||
"}",
|
||||
"",
|
||||
"whereAreYou([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" });"
|
||||
"whatIsInAName([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" });"
|
||||
],
|
||||
"solutions": [
|
||||
"function whereAreYou(collection, source) {\n var arr = [];\n var keys = Object.keys(source);\n collection.forEach(function(e) {\n if(keys.every(function(key) {return e[key] === source[key];})) {\n arr.push(e); \n }\n });\n return arr;\n}"
|
||||
"function whatIsInAName(collection, source) {\n var arr = [];\n var keys = Object.keys(source);\n collection.forEach(function(e) {\n if(keys.every(function(key) {return e[key] === source[key];})) {\n arr.push(e); \n }\n });\n return arr;\n}"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(whereAreYou([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" }), [{ first: \"Tybalt\", last: \"Capulet\" }], 'message: <code>whereAreYou([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" })</code> should return <code>[{ first: \"Tybalt\", last: \"Capulet\" }]</code>.');",
|
||||
"assert.deepEqual(whereAreYou([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 }), [{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], 'message: <code>whereAreYou([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 })</code> should return <code>[{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }]</code>.');",
|
||||
"assert.deepEqual(whereAreYou([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 }), [{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], 'message: <code>whereAreYou([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 })</code> should return <code>[{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }]</code>.');",
|
||||
"assert.deepEqual(whereAreYou([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"c\": 2 }), [{ \"a\": 1, \"b\": 2, \"c\": 2 }], 'message: <code>whereAreYou([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"c\": 2 })</code> should return <code>[{ \"a\": 1, \"b\": 2, \"c\": 2 }]</code>.');"
|
||||
"assert.deepEqual(whatIsInAName([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" }), [{ first: \"Tybalt\", last: \"Capulet\" }], 'message: <code>whatIsInAName([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" })</code> should return <code>[{ first: \"Tybalt\", last: \"Capulet\" }]</code>.');",
|
||||
"assert.deepEqual(whatIsInAName([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 }), [{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], 'message: <code>whatIsInAName([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 })</code> should return <code>[{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }]</code>.');",
|
||||
"assert.deepEqual(whatIsInAName([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 }), [{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], 'message: <code>whatIsInAName([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 })</code> should return <code>[{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }]</code>.');",
|
||||
"assert.deepEqual(whatIsInAName([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"c\": 2 }), [{ \"a\": 1, \"b\": 2, \"c\": 2 }], 'message: <code>whatIsInAName([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"c\": 2 })</code> should return <code>[{ \"a\": 1, \"b\": 2, \"c\": 2 }]</code>.');"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"MDNlinks": [
|
||||
|
@ -58,8 +58,8 @@
|
||||
],
|
||||
[
|
||||
"//i.imgur.com/2a20Vah.gif",
|
||||
"A gif showing you how to start mongoDB in c9.io's terminal.",
|
||||
"In your terminal, start MongoDB by entering:<br><br><code>mongod --smallfiles</code>",
|
||||
"A gif showing you how to install MongoDB and start it in c9.io's terminal.",
|
||||
"In your terminal, install MongoDB by entering: <br><br><code>sudo apt-get install mongodb-org</code><br><br> then start MongoDB by entering:<br><br><code>mongod --smallfiles</code>",
|
||||
""
|
||||
],
|
||||
[
|
||||
@ -151,7 +151,7 @@
|
||||
[
|
||||
"//i.imgur.com/2a20Vah.gif",
|
||||
"Una imagen gif que te muestra cómo iniciar mongoDB en la terminal de c9.io.",
|
||||
"En tu terminal, inicia MongoDB con el siguiente comando: <code>mongod --smallfiles</code>",
|
||||
"En tu terminal, instala MongoDB usando el siguiente comando: <br><br><code>sudo apt-get install mongodb-org</code><br><br>. Inicia MongoDB con el siguiente comando: <code>mongod --smallfiles</code>",
|
||||
""
|
||||
],
|
||||
[
|
||||
|
@ -17,6 +17,7 @@
|
||||
"Click the \"Create workspace\" button.",
|
||||
"Once C9 builds and loads your workspace, you should see a terminal window in the lower right hand corner. In this window use the following commands. You don't need to know what these mean at this point.",
|
||||
"Install <code>learnyoumongo</code> with this command: <code>npm install learnyoumongo -g</code>",
|
||||
"Install MongoDB with this command: <code>sudo apt-get install mongodb-org</code>",
|
||||
"Set up your mongod alias by following the directions at <a href='https://community.c9.io/t/setting-up-mongodb/1717' target='_blank'>https://community.c9.io/t/setting-up-mongodb/1717</a>.",
|
||||
"Now start the tutorial by running <code>learnyoumongo</code>.",
|
||||
"Whenever you run a command that includes <code>mongod</code> on c9.io, use <code>./mongod</code> instead.",
|
||||
@ -51,6 +52,7 @@
|
||||
"Haz click en el botón que dice \"Create workspace\".",
|
||||
"Una vez C9 termine de cargar tu espacio de trabajo, verás una terminal en la ventana de la esquina inferior derecha. Introduce los comandos siguientes en esa ventana (no te preocupes si no entiendes por ahora qué es lo que hacen):",
|
||||
"Instala <code>learnyoumongo</code> usando el siguiente comando: <code>npm install learnyoumongo -g</code>",
|
||||
"Instala MongoDB usando el siguiente comando: <code>sudo apt-get install mongodb-org</code>",
|
||||
"Ahora inicia el tutorial ejecutando <code>learnyoumongo</code>",
|
||||
"Siempre que ejecutes un comando que incluya <code>mongod</code> en c9.io, asegúrate de usar la bandera <code>--nojournal</code>. Por ejemplo: <code>mongod --nojournal</code>.",
|
||||
"Puedes modificar el tamaño de las ventanas en c9.io arrastrándolas por el borde.",
|
||||
|
@ -27,6 +27,7 @@ export function setProfileFromGithub(
|
||||
created_at: joinedGithubOn,
|
||||
blog: website,
|
||||
location,
|
||||
bio,
|
||||
name
|
||||
}
|
||||
) {
|
||||
@ -37,6 +38,7 @@ export function setProfileFromGithub(
|
||||
email: user.email || githubEmail,
|
||||
username: username.toLowerCase(),
|
||||
location,
|
||||
bio,
|
||||
joinedGithubOn,
|
||||
website,
|
||||
isGithubCool: true,
|
||||
|
@ -37,6 +37,7 @@ block content
|
||||
a.fa.fa-linkedin-square.text-primary(title="@#{username}'s LinkedIn Profile", href=linkedin, target='_blank')
|
||||
h1.flat-top.wrappable= name
|
||||
h1.flat-top.wrappable= location
|
||||
p.flat-top.bio= bio
|
||||
h1.flat-top.text-primary= "[ " + (progressTimestamps.length) + " ]"
|
||||
if pledge
|
||||
.spacer
|
||||
|
Reference in New Issue
Block a user