chore: fix typos in spelling (#38100)
* spelling: accidentally * spelling: announce * spelling: assembly * spelling: avoid * spelling: backend * spelling: because * spelling: claimed * spelling: candidate * spelling: certification * spelling: certified * spelling: challenge * spelling: circular * spelling: it isn't * spelling: coins * spelling: combination * spelling: compliant * spelling: containers * spelling: concise * spelling: deprecated * spelling: development * spelling: donor * spelling: error * spelling: everything * spelling: exceed * spelling: exist * spelling: falsy * spelling: faulty * spelling: forward * spelling: handle * spelling: indicates * spelling: initial * spelling: integers * spelling: issealed * spelling: javascript * spelling: length * spelling: maximum * spelling: minimum * spelling: mutable * spelling: notifier * spelling: coordinate * spelling: passport * spelling: perform * spelling: permuter * spelling: placeholder * spelling: progressively * spelling: semantic * spelling: submission * spelling: submit * spelling: translations * spelling: turquoise * spelling: visualization * spelling: without * spelling: registration * spelling: representation
This commit is contained in:
@ -67,7 +67,7 @@ The challenge hints and articles will still be available on the forum which we h
|
|||||||
|
|
||||||
We do intend to make the curriculum available in more languages, right now we do not have a timeline for this.
|
We do intend to make the curriculum available in more languages, right now we do not have a timeline for this.
|
||||||
|
|
||||||
We will begin by making the curriculum available in *Chinese* first. This will help us understand the caveats and the streamline the development workflows. China is one of the largest demographic regions in terms of our non-english audience. It is hence an ideal candiate for the internationalization (i18n). We currently have hundreds of thousands of users using an old version of the platform.
|
We will begin by making the curriculum available in *Chinese* first. This will help us understand the caveats and the streamline the development workflows. China is one of the largest demographic regions in terms of our non-english audience. It is hence an ideal candidate for the internationalization (i18n). We currently have hundreds of thousands of users using an old version of the platform.
|
||||||
|
|
||||||
The next languages to follow would be *Arabic, Portuguese, Russian and Spanish* in no particular order. For Portuguese and Spanish we will focus on Latin America as our target demographic region based on the audience we have.
|
The next languages to follow would be *Arabic, Portuguese, Russian and Spanish* in no particular order. For Portuguese and Spanish we will focus on Latin America as our target demographic region based on the audience we have.
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
"chicago"
|
"chicago"
|
||||||
]
|
]
|
||||||
}, {
|
}, {
|
||||||
"name": "General Asssembly",
|
"name": "General Assembly",
|
||||||
"cost": "11500",
|
"cost": "11500",
|
||||||
"housing": "500",
|
"housing": "500",
|
||||||
"finance": true,
|
"finance": true,
|
||||||
|
@ -70,7 +70,7 @@ function ifNoSuperBlock404(req, res, next) {
|
|||||||
return res.status(404).end();
|
return res.status(404).end();
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderCertifedEmail = loopback.template(
|
const renderCertifiedEmail = loopback.template(
|
||||||
path.join(__dirname, '..', 'views', 'emails', 'certified.ejs')
|
path.join(__dirname, '..', 'views', 'emails', 'certified.ejs')
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ function sendCertifiedEmail(
|
|||||||
Congratulations on completing all of the
|
Congratulations on completing all of the
|
||||||
freeCodeCamp certifications!
|
freeCodeCamp certifications!
|
||||||
`,
|
`,
|
||||||
text: renderCertifedEmail({
|
text: renderCertifiedEmail({
|
||||||
username,
|
username,
|
||||||
name
|
name
|
||||||
})
|
})
|
||||||
|
@ -13,8 +13,8 @@ module.exports = function(app) {
|
|||||||
const User = app.models.User;
|
const User = app.models.User;
|
||||||
|
|
||||||
router.get('/api/github', githubCalls);
|
router.get('/api/github', githubCalls);
|
||||||
router.get('/u/:email', unsubscribeDepricated);
|
router.get('/u/:email', unsubscribeDeprecated);
|
||||||
router.get('/unsubscribe/:email', unsubscribeDepricated);
|
router.get('/unsubscribe/:email', unsubscribeDeprecated);
|
||||||
router.get('/ue/:unsubscribeId', unsubscribeById);
|
router.get('/ue/:unsubscribeId', unsubscribeById);
|
||||||
router.get(
|
router.get(
|
||||||
'/the-fastest-web-page-on-the-internet',
|
'/the-fastest-web-page-on-the-internet',
|
||||||
@ -48,7 +48,7 @@ module.exports = function(app) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function unsubscribeDepricated(req, res) {
|
function unsubscribeDeprecated(req, res) {
|
||||||
req.flash(
|
req.flash(
|
||||||
'info',
|
'info',
|
||||||
'We are no longer able to process this unsubscription request. ' +
|
'We are no longer able to process this unsubscription request. ' +
|
||||||
|
@ -164,7 +164,7 @@ describe('boot/challenge', () => {
|
|||||||
expect(result).toEqual(requestedChallengeUrl);
|
expect(result).toEqual(requestedChallengeUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can handle non-url-complient challenge names', () => {
|
it('can handle non-url-compliant challenge names', () => {
|
||||||
const challenge = { ...mockChallenge, superBlock: 'my awesome' };
|
const challenge = { ...mockChallenge, superBlock: 'my awesome' };
|
||||||
const expected = '/learn/my-awesome/actual/challenge';
|
const expected = '/learn/my-awesome/actual/challenge';
|
||||||
const result = buildChallengeUrl(challenge);
|
const result = buildChallengeUrl(challenge);
|
||||||
|
@ -33,7 +33,7 @@ export function reportError(err) {
|
|||||||
: console.error(err);
|
: console.error(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function errrorReporter() {
|
export default function errorReporter() {
|
||||||
if (
|
if (
|
||||||
process.env.FREECODECAMP_NODE_ENV !== 'production' &&
|
process.env.FREECODECAMP_NODE_ENV !== 'production' &&
|
||||||
process.env.ERROR_REPORTER === 'true'
|
process.env.ERROR_REPORTER === 'true'
|
||||||
|
@ -43,7 +43,7 @@ export default function(Donation) {
|
|||||||
function seedTheCache() {
|
function seedTheCache() {
|
||||||
return new Promise((resolve, reject) =>
|
return new Promise((resolve, reject) =>
|
||||||
Observable.defer(activeDonationsQuery$).subscribe(count => {
|
Observable.defer(activeDonationsQuery$).subscribe(count => {
|
||||||
log('activeDonator count: %d', count);
|
log('activeDonor count: %d', count);
|
||||||
activeDonationCountCache.update(() => count);
|
activeDonationCountCache.update(() => count);
|
||||||
return resolve();
|
return resolve();
|
||||||
}, reject)
|
}, reject)
|
||||||
@ -55,7 +55,7 @@ export default function(Donation) {
|
|||||||
() =>
|
() =>
|
||||||
Observable.defer(activeDonationsQuery$).subscribe(
|
Observable.defer(activeDonationsQuery$).subscribe(
|
||||||
count => {
|
count => {
|
||||||
log('activeDonator count: %d', count);
|
log('activeDonor count: %d', count);
|
||||||
return activeDonationCountCache.update(() => count);
|
return activeDonationCountCache.update(() => count);
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Donation",
|
"name": "Donation",
|
||||||
"description": "A representaion of a donation to freeCodeCamp",
|
"description": "A representation of a donation to freeCodeCamp",
|
||||||
"plural": "donations",
|
"plural": "donations",
|
||||||
"base": "PersistedModel",
|
"base": "PersistedModel",
|
||||||
"idInjection": true,
|
"idInjection": true,
|
||||||
@ -46,7 +46,7 @@
|
|||||||
"customerId": {
|
"customerId": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"required": true,
|
"required": true,
|
||||||
"description": "The providers reference for the donator"
|
"description": "The providers reference for the donor"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"validations": [
|
"validations": [
|
||||||
|
@ -7,7 +7,7 @@ exports.onCreateNode = function remarkNodeIdentityOnCreateNode(
|
|||||||
'Please supply a predicate function to `gatsby-plugin-identity`'
|
'Please supply a predicate function to `gatsby-plugin-identity`'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (typeof identity !== 'string' || identity.lenght === 0) {
|
if (typeof identity !== 'string' || identity.length === 0) {
|
||||||
reporter.panic(
|
reporter.panic(
|
||||||
'`gatsby-plugin-identity` requires an identify string to add to nodes ' +
|
'`gatsby-plugin-identity` requires an identify string to add to nodes ' +
|
||||||
'that match the predicate'
|
'that match the predicate'
|
||||||
|
@ -9,7 +9,7 @@ const mapStateToProps = () => ({});
|
|||||||
const mapDispatchToProps = dispatch =>
|
const mapDispatchToProps = dispatch =>
|
||||||
bindActionCreators({ appMount }, dispatch);
|
bindActionCreators({ appMount }, dispatch);
|
||||||
|
|
||||||
class AppMountNotifer extends Component {
|
class AppMountNotifier extends Component {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
return this.props.appMount();
|
return this.props.appMount();
|
||||||
}
|
}
|
||||||
@ -18,8 +18,8 @@ class AppMountNotifer extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AppMountNotifer.displayName = 'AppMountNotifier';
|
AppMountNotifier.displayName = 'AppMountNotifier';
|
||||||
AppMountNotifer.propTypes = {
|
AppMountNotifier.propTypes = {
|
||||||
appMount: PropTypes.func.isRequired,
|
appMount: PropTypes.func.isRequired,
|
||||||
render: PropTypes.func.isRequired
|
render: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
@ -27,4 +27,4 @@ AppMountNotifer.propTypes = {
|
|||||||
export default connect(
|
export default connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(AppMountNotifer);
|
)(AppMountNotifier);
|
||||||
|
@ -53,7 +53,7 @@ class DonateFormChildViewForHOC extends Component {
|
|||||||
...initialState,
|
...initialState,
|
||||||
donationAmount: this.props.donationAmount,
|
donationAmount: this.props.donationAmount,
|
||||||
donationDuration: this.props.donationDuration,
|
donationDuration: this.props.donationDuration,
|
||||||
isSubmitionValid: null,
|
isSubmissionValid: null,
|
||||||
email: null,
|
email: null,
|
||||||
isEmailValid: true,
|
isEmailValid: true,
|
||||||
isFormValid: false
|
isFormValid: false
|
||||||
@ -96,12 +96,12 @@ class DonateFormChildViewForHOC extends Component {
|
|||||||
|
|
||||||
if ((!isEmailValid, !isFormValid)) {
|
if ((!isEmailValid, !isFormValid)) {
|
||||||
return this.setState({
|
return this.setState({
|
||||||
isSubmitionValid: false
|
isSubmissionValid: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
isSubmitionValid: null
|
isSubmissionValid: null
|
||||||
});
|
});
|
||||||
|
|
||||||
const email = this.getUserEmail();
|
const email = this.getUserEmail();
|
||||||
@ -228,12 +228,12 @@ class DonateFormChildViewForHOC extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderDonateForm() {
|
renderDonateForm() {
|
||||||
const { isEmailValid, isSubmitionValid, email } = this.state;
|
const { isEmailValid, isSubmissionValid, email } = this.state;
|
||||||
const { getDonationButtonLabel, theme, defaultTheme } = this.props;
|
const { getDonationButtonLabel, theme, defaultTheme } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form className='donation-form' onSubmit={this.handleSubmit}>
|
<Form className='donation-form' onSubmit={this.handleSubmit}>
|
||||||
<div>{isSubmitionValid !== null ? this.renderErrorMessage() : ''}</div>
|
<div>{isSubmissionValid !== null ? this.renderErrorMessage() : ''}</div>
|
||||||
<FormGroup className='donation-email-container'>
|
<FormGroup className='donation-email-container'>
|
||||||
<ControlLabel>
|
<ControlLabel>
|
||||||
Email (we'll send you a tax-deductible donation receipt):
|
Email (we'll send you a tax-deductible donation receipt):
|
||||||
|
@ -24,7 +24,7 @@ describe('<Intro />', () => {
|
|||||||
const loggedInProps = {
|
const loggedInProps = {
|
||||||
complete: true,
|
complete: true,
|
||||||
isSignedIn: true,
|
isSignedIn: true,
|
||||||
name: 'Developement User',
|
name: 'Development User',
|
||||||
navigate: () => {},
|
navigate: () => {},
|
||||||
pending: false,
|
pending: false,
|
||||||
slug: '/',
|
slug: '/',
|
||||||
|
@ -81,7 +81,7 @@ export class Map extends Component {
|
|||||||
node = nodes.find(node => dasherize(node.superBlock) === hash);
|
node = nodes.find(node => dasherize(node.superBlock) === hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
// whitout hash only expand when signed in
|
// without hash only expand when signed in
|
||||||
if (isSignedIn) {
|
if (isSignedIn) {
|
||||||
// if there is no hash or the hash did not match any challenge superblock
|
// if there is no hash or the hash did not match any challenge superblock
|
||||||
// and there was a currentChallengeId
|
// and there was a currentChallengeId
|
||||||
|
@ -326,7 +326,7 @@ export class CertificationSettings extends Component {
|
|||||||
// filter the new solutions that need to be updated
|
// filter the new solutions that need to be updated
|
||||||
const completedChallenges = this.props.completedChallenges;
|
const completedChallenges = this.props.completedChallenges;
|
||||||
let challengesToUpdate = {};
|
let challengesToUpdate = {};
|
||||||
let newChalleneFound = true;
|
let newChallengeFound = true;
|
||||||
let oldSubmissions = 0;
|
let oldSubmissions = 0;
|
||||||
for (let submittedChal of Object.keys(idsToSolutions)) {
|
for (let submittedChal of Object.keys(idsToSolutions)) {
|
||||||
for (let i of completedChallenges) {
|
for (let i of completedChallenges) {
|
||||||
@ -335,14 +335,14 @@ export class CertificationSettings extends Component {
|
|||||||
challengesToUpdate[submittedChal] = idsToSolutions[submittedChal];
|
challengesToUpdate[submittedChal] = idsToSolutions[submittedChal];
|
||||||
}
|
}
|
||||||
oldSubmissions++;
|
oldSubmissions++;
|
||||||
newChalleneFound = false;
|
newChallengeFound = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (newChalleneFound && idsToSolutions[submittedChal] !== '') {
|
if (newChallengeFound && idsToSolutions[submittedChal] !== '') {
|
||||||
challengesToUpdate[submittedChal] = idsToSolutions[submittedChal];
|
challengesToUpdate[submittedChal] = idsToSolutions[submittedChal];
|
||||||
}
|
}
|
||||||
newChalleneFound = true;
|
newChallengeFound = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const valuesSaved = values(formChalObj)
|
const valuesSaved = values(formChalObj)
|
||||||
@ -536,7 +536,7 @@ export class CertificationSettings extends Component {
|
|||||||
solutionViewer: { files, solution, isOpen, projectTitle }
|
solutionViewer: { files, solution, isOpen, projectTitle }
|
||||||
} = this.state;
|
} = this.state;
|
||||||
return (
|
return (
|
||||||
<section id='certifcation-settings'>
|
<section id='certification-settings'>
|
||||||
<SectionHeader>Certifications</SectionHeader>
|
<SectionHeader>Certifications</SectionHeader>
|
||||||
{certifications.map(this.renderCertifications)}
|
{certifications.map(this.renderCertifications)}
|
||||||
{this.renderFullStack()}
|
{this.renderFullStack()}
|
||||||
|
@ -9,7 +9,7 @@ import { CertificationSettings } from './Certification';
|
|||||||
describe('<certification />', () => {
|
describe('<certification />', () => {
|
||||||
// shallow rendering does not render children component
|
// shallow rendering does not render children component
|
||||||
// form buttons are not included in shallow render
|
// form buttons are not included in shallow render
|
||||||
it('Should render show cert button for calimed legacy cert', () => {
|
it('Should render show cert button for claimed legacy cert', () => {
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
<CertificationSettings {...defaultTestProps} />
|
<CertificationSettings {...defaultTestProps} />
|
||||||
);
|
);
|
||||||
@ -19,7 +19,7 @@ describe('<certification />', () => {
|
|||||||
).toHaveTextContent('Show Certification');
|
).toHaveTextContent('Show Certification');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should link show cert button to the calimed legacy cert', () => {
|
it('Should link show cert button to the claimed legacy cert', () => {
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
<CertificationSettings {...defaultTestProps} />
|
<CertificationSettings {...defaultTestProps} />
|
||||||
);
|
);
|
||||||
@ -28,7 +28,7 @@ describe('<certification />', () => {
|
|||||||
container.querySelector('#button-legacy-data-visualization')
|
container.querySelector('#button-legacy-data-visualization')
|
||||||
).toHaveAttribute(
|
).toHaveAttribute(
|
||||||
'href',
|
'href',
|
||||||
'/certification/developementuser/legacy-data-visualization'
|
'/certification/developmentuser/legacy-data-visualization'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ const defaultTestProps = {
|
|||||||
isJsAlgoDataStructCert: false,
|
isJsAlgoDataStructCert: false,
|
||||||
isRespWebDesignCert: false,
|
isRespWebDesignCert: false,
|
||||||
updateLegacyCert: () => {},
|
updateLegacyCert: () => {},
|
||||||
username: 'developementuser',
|
username: 'developmentuser',
|
||||||
verifyCert: () => {},
|
verifyCert: () => {},
|
||||||
errors: {},
|
errors: {},
|
||||||
submit: () => {}
|
submit: () => {}
|
||||||
|
@ -65,15 +65,15 @@ class PortfolioSettings extends Component {
|
|||||||
const userInput = e.target.value.slice();
|
const userInput = e.target.value.slice();
|
||||||
return this.setState(state => {
|
return this.setState(state => {
|
||||||
const { portfolio: currentPortfolio } = state;
|
const { portfolio: currentPortfolio } = state;
|
||||||
const mutatblePortfolio = currentPortfolio.slice(0);
|
const mutablePortfolio = currentPortfolio.slice(0);
|
||||||
const index = findIndex(currentPortfolio, p => p.id === id);
|
const index = findIndex(currentPortfolio, p => p.id === id);
|
||||||
|
|
||||||
mutatblePortfolio[index] = {
|
mutablePortfolio[index] = {
|
||||||
...mutatblePortfolio[index],
|
...mutablePortfolio[index],
|
||||||
[key]: userInput
|
[key]: userInput
|
||||||
};
|
};
|
||||||
|
|
||||||
return { portfolio: mutatblePortfolio };
|
return { portfolio: mutablePortfolio };
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -135,14 +135,14 @@ class PortfolioSettings extends Component {
|
|||||||
if (charsLeft < 0) {
|
if (charsLeft < 0) {
|
||||||
return {
|
return {
|
||||||
state: 'error',
|
state: 'error',
|
||||||
message: 'There is a maxiumum limit of 288 characters, you have 0 left'
|
message: 'There is a maximum limit of 288 characters, you have 0 left'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (charsLeft < 41 && charsLeft > 0) {
|
if (charsLeft < 41 && charsLeft > 0) {
|
||||||
return {
|
return {
|
||||||
state: 'warning',
|
state: 'warning',
|
||||||
message:
|
message:
|
||||||
'There is a maxiumum limit of 288 characters, you have ' +
|
'There is a maximum limit of 288 characters, you have ' +
|
||||||
charsLeft +
|
charsLeft +
|
||||||
' left'
|
' left'
|
||||||
};
|
};
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
#certifcation-settings .solutions-dropdown,
|
#certification-settings .solutions-dropdown,
|
||||||
#certifcation-settings .solutions-dropdown .dropdown-menu,
|
#certification-settings .solutions-dropdown .dropdown-menu,
|
||||||
#certifcation-settings .solutions-dropdown .dropdown {
|
#certification-settings .solutions-dropdown .dropdown {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#certifcation-settings tr {
|
#certification-settings tr {
|
||||||
height: 57px;
|
height: 57px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#certifcation-settings .project-title > a {
|
#certification-settings .project-title > a {
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,6 @@ superBlock: Data Visualization
|
|||||||
---
|
---
|
||||||
## Introduction to the Data Visualization Projects
|
## Introduction to the Data Visualization Projects
|
||||||
|
|
||||||
These challenges let you test your data visualzation skills and how to transfer and use data using AJAX technologies.
|
These challenges let you test your data visualization skills and how to transfer and use data using AJAX technologies.
|
||||||
|
|
||||||
By the end of this, you would have 5 projects to showcase your data visualization skills that you can show off to friends, family, employers, etc. Have fun and remember to use the [Read-Search-Ask](https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514) method if you get stuck.
|
By the end of this, you would have 5 projects to showcase your data visualization skills that you can show off to friends, family, employers, etc. Have fun and remember to use the [Read-Search-Ask](https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514) method if you get stuck.
|
||||||
|
@ -27,7 +27,7 @@ function delay(time = 0, fn) {
|
|||||||
return setTimeout(fn, time);
|
return setTimeout(fn, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if backenEndProjects have a solution
|
// check if backendEndProjects have a solution
|
||||||
const isSubmitable = failure =>
|
const isSubmitable = failure =>
|
||||||
failure.payload.challengeType !== backEndProject || failure.payload.solution;
|
failure.payload.challengeType !== backEndProject || failure.payload.solution;
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ function failedUpdateEpic(action$, state$) {
|
|||||||
const batch = failures.map((update, i) => {
|
const batch = failures.map((update, i) => {
|
||||||
// we stagger the updates here so we don't hammer the server
|
// we stagger the updates here so we don't hammer the server
|
||||||
// *********************************************************
|
// *********************************************************
|
||||||
// progressivly increase additional delay by the amount of updates
|
// progressively increase additional delay by the amount of updates
|
||||||
// 1st: 100ms delay
|
// 1st: 100ms delay
|
||||||
// 2nd: 200ms delay
|
// 2nd: 200ms delay
|
||||||
// 3rd: 400ms delay
|
// 3rd: 400ms delay
|
||||||
|
@ -9,8 +9,8 @@ import store from 'store';
|
|||||||
const key = 'fcc-failed-updates';
|
const key = 'fcc-failed-updates';
|
||||||
|
|
||||||
describe('failed-updates-epic', () => {
|
describe('failed-updates-epic', () => {
|
||||||
it('should remove falty backend challenges from localStorage', async () => {
|
it('should remove faulty backend challenges from localStorage', async () => {
|
||||||
store.set(key, failedSubmitions);
|
store.set(key, failedSubmissions);
|
||||||
|
|
||||||
const action$ = ActionsObservable.of({
|
const action$ = ActionsObservable.of({
|
||||||
type: types.updateComplete
|
type: types.updateComplete
|
||||||
@ -31,7 +31,7 @@ const initialState = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const failedSubmitions = [
|
const failedSubmissions = [
|
||||||
{
|
{
|
||||||
endpoint: '/project-completed',
|
endpoint: '/project-completed',
|
||||||
id: 'b1507944-7310-479f-bb59-ccafac488592',
|
id: 'b1507944-7310-479f-bb59-ccafac488592',
|
||||||
@ -59,4 +59,4 @@ const failedSubmitions = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const submitableChallenges = failedSubmitions.slice(1);
|
const submitableChallenges = failedSubmissions.slice(1);
|
||||||
|
@ -44,7 +44,7 @@ function* submitNewUsernameSaga({ payload: username }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function* sumbitProfileUISaga({ payload }) {
|
function* submitProfileUISaga({ payload }) {
|
||||||
try {
|
try {
|
||||||
const { data: response } = yield call(putUpdateMyProfileUI, payload);
|
const { data: response } = yield call(putUpdateMyProfileUI, payload);
|
||||||
yield put(submitProfileUIComplete({ ...response, payload }));
|
yield put(submitProfileUIComplete({ ...response, payload }));
|
||||||
@ -94,7 +94,7 @@ export function createSettingsSagas(types) {
|
|||||||
takeLatest(types.submitNewAbout, submitNewAboutSaga),
|
takeLatest(types.submitNewAbout, submitNewAboutSaga),
|
||||||
takeLatest(types.submitNewUsername, submitNewUsernameSaga),
|
takeLatest(types.submitNewUsername, submitNewUsernameSaga),
|
||||||
takeLatest(types.validateUsername, validateUsernameSaga),
|
takeLatest(types.validateUsername, validateUsernameSaga),
|
||||||
takeLatest(types.submitProfileUI, sumbitProfileUISaga),
|
takeLatest(types.submitProfileUI, submitProfileUISaga),
|
||||||
takeEvery(types.verifyCert, verifyCertificationSaga)
|
takeEvery(types.verifyCert, verifyCertificationSaga)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ export const legacyProjectMap = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'bd7158d8c442eddfaeb5bd17',
|
id: 'bd7158d8c442eddfaeb5bd17',
|
||||||
title: 'Build a Javascript Calculator',
|
title: 'Build a JavaScript Calculator',
|
||||||
link: `${legacyFrontEndBase}/build-a-javascript-calculator`,
|
link: `${legacyFrontEndBase}/build-a-javascript-calculator`,
|
||||||
superBlock: 'legacy-front-end'
|
superBlock: 'legacy-front-end'
|
||||||
},
|
},
|
||||||
|
@ -58,7 +58,7 @@ const preFormatted = {
|
|||||||
ignorecase: 'ignoreCase',
|
ignorecase: 'ignoreCase',
|
||||||
io: 'IO',
|
io: 'IO',
|
||||||
isarray: 'isArray',
|
isarray: 'isArray',
|
||||||
isealed: 'isSealed',
|
issealed: 'isSealed',
|
||||||
isextensible: 'isExtensible',
|
isextensible: 'isExtensible',
|
||||||
isfinite: 'isFinite',
|
isfinite: 'isFinite',
|
||||||
isfrozen: 'isFrozen',
|
isfrozen: 'isFrozen',
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
* **challenges:** adding code tags to description ([57d5b55](https://github.com/freeCodeCamp/curriculum/commit/57d5b55)), closes [#17911](https://github.com/freeCodeCamp/curriculum/issues/17911)
|
* **challenges:** adding code tags to description ([57d5b55](https://github.com/freeCodeCamp/curriculum/commit/57d5b55)), closes [#17911](https://github.com/freeCodeCamp/curriculum/issues/17911)
|
||||||
* **challenges:** adding negative integer to challenge to improve tests ([#211](https://github.com/freeCodeCamp/curriculum/issues/211)) ([2adc516](https://github.com/freeCodeCamp/curriculum/commit/2adc516))
|
* **challenges:** adding negative integer to challenge to improve tests ([#211](https://github.com/freeCodeCamp/curriculum/issues/211)) ([2adc516](https://github.com/freeCodeCamp/curriculum/commit/2adc516))
|
||||||
* **challenges:** allow user to comment out undesired code ([72c2407](https://github.com/freeCodeCamp/curriculum/commit/72c2407))
|
* **challenges:** allow user to comment out undesired code ([72c2407](https://github.com/freeCodeCamp/curriculum/commit/72c2407))
|
||||||
* **challenges:** challenge description is formatted and concised ([dcd8e45](https://github.com/freeCodeCamp/curriculum/commit/dcd8e45))
|
* **challenges:** challenge description is formatted and concise ([dcd8e45](https://github.com/freeCodeCamp/curriculum/commit/dcd8e45))
|
||||||
* **challenges:** change challengeType to fix help button ([ddcc661](https://github.com/freeCodeCamp/curriculum/commit/ddcc661))
|
* **challenges:** change challengeType to fix help button ([ddcc661](https://github.com/freeCodeCamp/curriculum/commit/ddcc661))
|
||||||
* **challenges:** change definition of complementary colors ([#299](https://github.com/freeCodeCamp/curriculum/issues/299)) ([c022dff](https://github.com/freeCodeCamp/curriculum/commit/c022dff))
|
* **challenges:** change definition of complementary colors ([#299](https://github.com/freeCodeCamp/curriculum/issues/299)) ([c022dff](https://github.com/freeCodeCamp/curriculum/commit/c022dff))
|
||||||
* **challenges:** check for shorthand character in regex ([#238](https://github.com/freeCodeCamp/curriculum/issues/238)) ([0bf8d32](https://github.com/freeCodeCamp/curriculum/commit/0bf8d32))
|
* **challenges:** check for shorthand character in regex ([#238](https://github.com/freeCodeCamp/curriculum/issues/238)) ([0bf8d32](https://github.com/freeCodeCamp/curriculum/commit/0bf8d32))
|
||||||
@ -50,7 +50,7 @@
|
|||||||
* **challenges:** rephrased wording in applied visual design ([#268](https://github.com/freeCodeCamp/curriculum/issues/268)) ([d560d58](https://github.com/freeCodeCamp/curriculum/commit/d560d58))
|
* **challenges:** rephrased wording in applied visual design ([#268](https://github.com/freeCodeCamp/curriculum/issues/268)) ([d560d58](https://github.com/freeCodeCamp/curriculum/commit/d560d58))
|
||||||
* **challenges:** replaced em tags with code tags ([68daaf7](https://github.com/freeCodeCamp/curriculum/commit/68daaf7)), closes [#18048](https://github.com/freeCodeCamp/curriculum/issues/18048)
|
* **challenges:** replaced em tags with code tags ([68daaf7](https://github.com/freeCodeCamp/curriculum/commit/68daaf7)), closes [#18048](https://github.com/freeCodeCamp/curriculum/issues/18048)
|
||||||
* **challenges:** reword test text and improve test accuracy ([f834a98](https://github.com/freeCodeCamp/curriculum/commit/f834a98))
|
* **challenges:** reword test text and improve test accuracy ([f834a98](https://github.com/freeCodeCamp/curriculum/commit/f834a98))
|
||||||
* **challenges:** small edit to correct sematic issues ([322bf80](https://github.com/freeCodeCamp/curriculum/commit/322bf80))
|
* **challenges:** small edit to correct semantic issues ([322bf80](https://github.com/freeCodeCamp/curriculum/commit/322bf80))
|
||||||
* clickjacking challenge description ([037990c](https://github.com/freeCodeCamp/curriculum/commit/037990c))
|
* clickjacking challenge description ([037990c](https://github.com/freeCodeCamp/curriculum/commit/037990c))
|
||||||
* **challenges:** spelling and grammar errors addressed ([8f17adf](https://github.com/freeCodeCamp/curriculum/commit/8f17adf))
|
* **challenges:** spelling and grammar errors addressed ([8f17adf](https://github.com/freeCodeCamp/curriculum/commit/8f17adf))
|
||||||
* **challenges:** typo ([4f7faba](https://github.com/freeCodeCamp/curriculum/commit/4f7faba))
|
* **challenges:** typo ([4f7faba](https://github.com/freeCodeCamp/curriculum/commit/4f7faba))
|
||||||
@ -93,7 +93,7 @@
|
|||||||
* **challenges:** add comments to getter/setter instructions codeblock ([9e9bc27](https://github.com/freeCodeCamp/curriculum/commit/9e9bc27)), closes [#92](https://github.com/freeCodeCamp/curriculum/issues/92)
|
* **challenges:** add comments to getter/setter instructions codeblock ([9e9bc27](https://github.com/freeCodeCamp/curriculum/commit/9e9bc27)), closes [#92](https://github.com/freeCodeCamp/curriculum/issues/92)
|
||||||
* **challenges:** add solution project euler 52 ([f31fe38](https://github.com/freeCodeCamp/curriculum/commit/f31fe38))
|
* **challenges:** add solution project euler 52 ([f31fe38](https://github.com/freeCodeCamp/curriculum/commit/f31fe38))
|
||||||
* **challenges:** add solution to project euler 53 ([56d7caf](https://github.com/freeCodeCamp/curriculum/commit/56d7caf))
|
* **challenges:** add solution to project euler 53 ([56d7caf](https://github.com/freeCodeCamp/curriculum/commit/56d7caf))
|
||||||
* **challenges:** add user story to tribute page challange ([12c78d4](https://github.com/freeCodeCamp/curriculum/commit/12c78d4))
|
* **challenges:** add user story to tribute page challenge ([12c78d4](https://github.com/freeCodeCamp/curriculum/commit/12c78d4))
|
||||||
* **challenges:** allows single quotes ([57dab6d](https://github.com/freeCodeCamp/curriculum/commit/57dab6d))
|
* **challenges:** allows single quotes ([57dab6d](https://github.com/freeCodeCamp/curriculum/commit/57dab6d))
|
||||||
* **challenges:** broken link ([64b93df](https://github.com/freeCodeCamp/curriculum/commit/64b93df))
|
* **challenges:** broken link ([64b93df](https://github.com/freeCodeCamp/curriculum/commit/64b93df))
|
||||||
* **challenges:** broken link ([de30ac8](https://github.com/freeCodeCamp/curriculum/commit/de30ac8)), closes [#17823](https://github.com/freeCodeCamp/curriculum/issues/17823)
|
* **challenges:** broken link ([de30ac8](https://github.com/freeCodeCamp/curriculum/commit/de30ac8)), closes [#17823](https://github.com/freeCodeCamp/curriculum/issues/17823)
|
||||||
@ -114,7 +114,7 @@
|
|||||||
* **challenges:** fix typo in findOneAndUpdate() challenge ([ab912e4](https://github.com/freeCodeCamp/curriculum/commit/ab912e4))
|
* **challenges:** fix typo in findOneAndUpdate() challenge ([ab912e4](https://github.com/freeCodeCamp/curriculum/commit/ab912e4))
|
||||||
* **challenges:** fix typo in node and express challenge ([7f3ed42](https://github.com/freeCodeCamp/curriculum/commit/7f3ed42))
|
* **challenges:** fix typo in node and express challenge ([7f3ed42](https://github.com/freeCodeCamp/curriculum/commit/7f3ed42))
|
||||||
* **challenges:** fix typos ([82f85b0](https://github.com/freeCodeCamp/curriculum/commit/82f85b0))
|
* **challenges:** fix typos ([82f85b0](https://github.com/freeCodeCamp/curriculum/commit/82f85b0))
|
||||||
* **challenges:** fixed a typo in Data structures challege ([a4f810e](https://github.com/freeCodeCamp/curriculum/commit/a4f810e)), closes [freeCodeCamp/freeCodeCamp#17786](https://github.com/freeCodeCamp/freeCodeCamp/issues/17786)
|
* **challenges:** fixed a typo in Data structures challenge ([a4f810e](https://github.com/freeCodeCamp/curriculum/commit/a4f810e)), closes [freeCodeCamp/freeCodeCamp#17786](https://github.com/freeCodeCamp/freeCodeCamp/issues/17786)
|
||||||
* **challenges:** fixed RegEx for template literals javascript challenge ([66d8463](https://github.com/freeCodeCamp/curriculum/commit/66d8463)), closes [#65](https://github.com/freeCodeCamp/curriculum/issues/65)
|
* **challenges:** fixed RegEx for template literals javascript challenge ([66d8463](https://github.com/freeCodeCamp/curriculum/commit/66d8463)), closes [#65](https://github.com/freeCodeCamp/curriculum/issues/65)
|
||||||
* **challenges:** fixed regex in a challenge ([c28aac0](https://github.com/freeCodeCamp/curriculum/commit/c28aac0)), closes [freeCodeCamp/freeCodeCamp#17861](https://github.com/freeCodeCamp/freeCodeCamp/issues/17861)
|
* **challenges:** fixed regex in a challenge ([c28aac0](https://github.com/freeCodeCamp/curriculum/commit/c28aac0)), closes [freeCodeCamp/freeCodeCamp#17861](https://github.com/freeCodeCamp/freeCodeCamp/issues/17861)
|
||||||
* **challenges:** glitch links in backend projects now open in new tabs ([507c22d](https://github.com/freeCodeCamp/curriculum/commit/507c22d)), closes [#17799](https://github.com/freeCodeCamp/curriculum/issues/17799)
|
* **challenges:** glitch links in backend projects now open in new tabs ([507c22d](https://github.com/freeCodeCamp/curriculum/commit/507c22d)), closes [#17799](https://github.com/freeCodeCamp/curriculum/issues/17799)
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
"587d7b8c367417b2b2512b55",
|
"587d7b8c367417b2b2512b55",
|
||||||
"Reuse Javascript Code Using import"
|
"Reuse JavaScript Code Using import"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"587d7b8c367417b2b2512b57",
|
"587d7b8c367417b2b2512b57",
|
||||||
|
@ -33,8 +33,8 @@ We have defined a function, <code>htmlColorNames</code>, which takes an array of
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: <code>htmlColorNames</code> should return <code>["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"]</code>
|
- text: <code>htmlColorNames</code> should return <code>["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurquoise", "FireBrick"]</code>
|
||||||
testString: assert.deepEqual(htmlColorNames(['DarkGoldenRod', 'WhiteSmoke', 'LavenderBlush', 'PaleTurqoise', 'FireBrick']), ['DarkSalmon', 'BlanchedAlmond', 'LavenderBlush', 'PaleTurqoise', 'FireBrick']);
|
testString: assert.deepEqual(htmlColorNames(['DarkGoldenRod', 'WhiteSmoke', 'LavenderBlush', 'PaleTurquoise', 'FireBrick']), ['DarkSalmon', 'BlanchedAlmond', 'LavenderBlush', 'PaleTurquoise', 'FireBrick']);
|
||||||
- text: The <code>htmlColorNames</code> function should utilize the <code>splice()</code> method
|
- text: The <code>htmlColorNames</code> function should utilize the <code>splice()</code> method
|
||||||
testString: assert(/.splice/.test(code));
|
testString: assert(/.splice/.test(code));
|
||||||
- text: You should not use <code>shift()</code> or <code>unshift()</code>.
|
- text: You should not use <code>shift()</code> or <code>unshift()</code>.
|
||||||
@ -60,7 +60,7 @@ function htmlColorNames(arr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// do not change code below this line
|
// do not change code below this line
|
||||||
console.log(htmlColorNames(['DarkGoldenRod', 'WhiteSmoke', 'LavenderBlush', 'PaleTurqoise', 'FireBrick']));
|
console.log(htmlColorNames(['DarkGoldenRod', 'WhiteSmoke', 'LavenderBlush', 'PaleTurquoise', 'FireBrick']));
|
||||||
```
|
```
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -70,7 +70,7 @@ console.clear();
|
|||||||
// Use console.log() to print the output variable.
|
// Use console.log() to print the output variable.
|
||||||
console.log(output);
|
console.log(output);
|
||||||
|
|
||||||
// Check the two consoles to see the difference. The freeCodeCamp console should have printed the variable twice, one for each test of this challenge. The browser console should only print the variable once becuase you cleared it first.
|
// Check the two consoles to see the difference. The freeCodeCamp console should have printed the variable twice, one for each test of this challenge. The browser console should only print the variable once because you cleared it first.
|
||||||
```
|
```
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
id: 587d7b8c367417b2b2512b55
|
id: 587d7b8c367417b2b2512b55
|
||||||
title: Reuse Javascript Code Using import
|
title: Reuse JavaScript Code Using import
|
||||||
challengeType: 1
|
challengeType: 1
|
||||||
forumTopicId: 301208
|
forumTopicId: 301208
|
||||||
---
|
---
|
||||||
|
@ -30,10 +30,10 @@ tests:
|
|||||||
testString: 'assert.strictEqual(truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex"), false);'
|
testString: 'assert.strictEqual(truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex"), false);'
|
||||||
- text: '<code>truthCheck([{"user": "Tinky-Winky", "sex": "male", "age": 0}, {"user": "Dipsy", "sex": "male", "age": 3}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age")</code> should return false.'
|
- text: '<code>truthCheck([{"user": "Tinky-Winky", "sex": "male", "age": 0}, {"user": "Dipsy", "sex": "male", "age": 3}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age")</code> should return false.'
|
||||||
testString: 'assert.strictEqual(truthCheck([{"user": "Tinky-Winky", "sex": "male", "age": 2}, {"user": "Dipsy", "sex": "male", "age": 0}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age"), false);'
|
testString: 'assert.strictEqual(truthCheck([{"user": "Tinky-Winky", "sex": "male", "age": 2}, {"user": "Dipsy", "sex": "male", "age": 0}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age"), false);'
|
||||||
- text: '<code>truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true}, {"name": "FastFoward", "onBoat": null}], "onBoat")</code> should return false'
|
- text: '<code>truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true}, {"name": "FastForward", "onBoat": null}], "onBoat")</code> should return false'
|
||||||
testString: 'assert.strictEqual(truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true}, {"name": "FastFoward", "onBoat": null}], "onBoat"), false);'
|
testString: 'assert.strictEqual(truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true}, {"name": "FastForward", "onBoat": null}], "onBoat"), false);'
|
||||||
- text: '<code>truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true, "alias": "Repete"}, {"name": "FastFoward", "onBoat": true}], "onBoat")</code> should return true'
|
- text: '<code>truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true, "alias": "Repete"}, {"name": "FastForward", "onBoat": true}], "onBoat")</code> should return true'
|
||||||
testString: 'assert.strictEqual(truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true, "alias": "Repete"}, {"name": "FastFoward", "onBoat": true}], "onBoat"), true);'
|
testString: 'assert.strictEqual(truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true, "alias": "Repete"}, {"name": "FastForward", "onBoat": true}], "onBoat"), true);'
|
||||||
- text: '<code>truthCheck([{"single": "yes"}], "single")</code> should return true'
|
- text: '<code>truthCheck([{"single": "yes"}], "single")</code> should return true'
|
||||||
testString: 'assert.strictEqual(truthCheck([{"single": "yes"}], "single"), true);'
|
testString: 'assert.strictEqual(truthCheck([{"single": "yes"}], "single"), true);'
|
||||||
- text: '<code>truthCheck([{"single": ""}, {"single": "double"}], "single")</code> should return false'
|
- text: '<code>truthCheck([{"single": ""}, {"single": "double"}], "single")</code> should return false'
|
||||||
|
@ -33,7 +33,7 @@ There are <code>counterReducer()</code> and <code>authReducer()</code> functions
|
|||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: The <code>counterReducer</code> should increment and decrement the <code>state</code>.
|
- text: The <code>counterReducer</code> should increment and decrement the <code>state</code>.
|
||||||
testString: 'assert((function() { const initalState = store.getState().count; store.dispatch({type: INCREMENT}); store.dispatch({type: INCREMENT}); const firstState = store.getState().count; store.dispatch({type: DECREMENT}); const secondState = store.getState().count; return firstState === initalState + 2 && secondState === firstState - 1 })());'
|
testString: 'assert((function() { const initialState = store.getState().count; store.dispatch({type: INCREMENT}); store.dispatch({type: INCREMENT}); const firstState = store.getState().count; store.dispatch({type: DECREMENT}); const secondState = store.getState().count; return firstState === initialState + 2 && secondState === firstState - 1 })());'
|
||||||
- text: The <code>authReducer</code> should toggle the <code>state</code> of <code>authenticated</code> between <code>true</code> and <code>false</code>.
|
- text: The <code>authReducer</code> should toggle the <code>state</code> of <code>authenticated</code> between <code>true</code> and <code>false</code>.
|
||||||
testString: 'assert((function() { store.dispatch({type: LOGIN}); const loggedIn = store.getState().auth.authenticated; store.dispatch({type: LOGOUT}); const loggedOut = store.getState().auth.authenticated; return loggedIn === true && loggedOut === false })());'
|
testString: 'assert((function() { store.dispatch({type: LOGIN}); const loggedIn = store.getState().auth.authenticated; store.dispatch({type: LOGOUT}); const loggedOut = store.getState().auth.authenticated; return loggedIn === true && loggedOut === false })());'
|
||||||
- text: 'The store <code>state</code> should have two keys: <code>count</code>, which holds a number, and <code>auth</code>, which holds an object. The <code>auth</code> object should have a property of <code>authenticated</code>, which holds a boolean.'
|
- text: 'The store <code>state</code> should have two keys: <code>count</code>, which holds a number, and <code>auth</code>, which holds an object. The <code>auth</code> object should have a property of <code>authenticated</code>, which holds a boolean.'
|
||||||
|
@ -41,8 +41,8 @@ Submit your page when you think you've got it right.
|
|||||||
tests:
|
tests:
|
||||||
- text: Event 'user' should be emitted with name, currentUsers, and connected.
|
- text: Event 'user' should be emitted with name, currentUsers, and connected.
|
||||||
testString: getUserInput => $.get(getUserInput('url')+ '/_api/server.js') .then(data => { assert.match(data, /io.emit.*('|")user('|").*name.*currentUsers.*connected/gi, 'You should have an event emitted named user sending name, currentUsers, and connected'); }, xhr => { throw new Error(xhr.statusText); })
|
testString: getUserInput => $.get(getUserInput('url')+ '/_api/server.js') .then(data => { assert.match(data, /io.emit.*('|")user('|").*name.*currentUsers.*connected/gi, 'You should have an event emitted named user sending name, currentUsers, and connected'); }, xhr => { throw new Error(xhr.statusText); })
|
||||||
- text: Client should properly handlle and display the new data from event 'user'.
|
- text: Client should properly handle and display the new data from event 'user'.
|
||||||
testString: "getUserInput => $.get(getUserInput('url')+ '/public/client.js') .then(data => { assert.match(data, /socket.on.*('|\")user('|\")[^]*num-users/gi, 'You should change the text of #num-users within on your client within the \"user\" even listener to show the current users connected'); assert.match(data, /socket.on.*('|\")user('|\")[^]*messages.*li/gi, 'You should append a list item to #messages on your client within the \"user\" event listener to annouce a user came or went'); }, xhr => { throw new Error(xhr.statusText); })"
|
testString: "getUserInput => $.get(getUserInput('url')+ '/public/client.js') .then(data => { assert.match(data, /socket.on.*('|\")user('|\")[^]*num-users/gi, 'You should change the text of #num-users within on your client within the \"user\" even listener to show the current users connected'); assert.match(data, /socket.on.*('|\")user('|\")[^]*messages.*li/gi, 'You should append a list item to #messages on your client within the \"user\" event listener to announce a user came or went'); }, xhr => { throw new Error(xhr.statusText); })"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ forumTopicId: 301553
|
|||||||
As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/edit/#!/remix/clone-from-repo?REPO_URL=https://github.com/freeCodeCamp/boilerplate-advancednode/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-advancednode/'>GitHub</a>.
|
As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/edit/#!/remix/clone-from-repo?REPO_URL=https://github.com/freeCodeCamp/boilerplate-advancednode/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-advancednode/'>GitHub</a>.
|
||||||
Going back to the information security section you may remember that storing plaintext passwords is <em>never</em> okay. Now it is time to implement BCrypt to solve this issue.
|
Going back to the information security section you may remember that storing plaintext passwords is <em>never</em> okay. Now it is time to implement BCrypt to solve this issue.
|
||||||
<hr>Add BCrypt as a dependency and require it in your server. You will need to handle hashing in 2 key areas: where you handle registering/saving a new account and when you check to see that a password is correct on login.
|
<hr>Add BCrypt as a dependency and require it in your server. You will need to handle hashing in 2 key areas: where you handle registering/saving a new account and when you check to see that a password is correct on login.
|
||||||
Currently on our registeration route, you insert a user's password into the database like the following: <code>password: req.body.password</code>. An easy way to implement saving a hash instead is to add the following before your database logic <code>var hash = bcrypt.hashSync(req.body.password, 12);</code> and replacing the <code>req.body.password</code> in the database saving with just <code>password: hash</code>.
|
Currently on our registration route, you insert a user's password into the database like the following: <code>password: req.body.password</code>. An easy way to implement saving a hash instead is to add the following before your database logic <code>var hash = bcrypt.hashSync(req.body.password, 12);</code> and replacing the <code>req.body.password</code> in the database saving with just <code>password: hash</code>.
|
||||||
Finally on our authentication strategy we check for the following in our code before completing the process: <code>if (password !== user.password) { return done(null, false); }</code>. After making the previous changes, now <code>user.password</code> is a hash. Before making a change to the existing code, notice how the statement is checking if the password is NOT equal then return non-authenticated. With this in mind your code could look as follows to properly check the password entered against the hash: <code>if (!bcrypt.compareSync(password, user.password)) { return done(null, false); }</code>
|
Finally on our authentication strategy we check for the following in our code before completing the process: <code>if (password !== user.password) { return done(null, false); }</code>. After making the previous changes, now <code>user.password</code> is a hash. Before making a change to the existing code, notice how the statement is checking if the password is NOT equal then return non-authenticated. With this in mind your code could look as follows to properly check the password entered against the hash: <code>if (!bcrypt.compareSync(password, user.password)) { return done(null, false); }</code>
|
||||||
That is all it takes to implement one of the most important security features when you have to store passwords! Submit your page when you think you've got it right.
|
That is all it takes to implement one of the most important security features when you have to store passwords! Submit your page when you think you've got it right.
|
||||||
</section>
|
</section>
|
||||||
|
@ -36,7 +36,7 @@ Submit your page when you think you've got it right. If you're running into erro
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: Passort and Express-session should be dependencies.
|
- text: Passport and Express-session should be dependencies.
|
||||||
testString: getUserInput => $.get(getUserInput('url')+ '/_api/package.json') .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, 'passport', 'Your project should list "passport" as a dependency'); assert.property(packJson.dependencies, 'express-session', 'Your project should list "express-session" as a dependency'); }, xhr => { throw new Error(xhr.statusText); })
|
testString: getUserInput => $.get(getUserInput('url')+ '/_api/package.json') .then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, 'passport', 'Your project should list "passport" as a dependency'); assert.property(packJson.dependencies, 'express-session', 'Your project should list "express-session" as a dependency'); }, xhr => { throw new Error(xhr.statusText); })
|
||||||
- text: Dependencies should be correctly required.
|
- text: Dependencies should be correctly required.
|
||||||
testString: getUserInput => $.get(getUserInput('url')+ '/_api/server.js') .then(data => { assert.match(data, /require.*("|')passport("|')/gi, 'You should have required passport'); assert.match(data, /require.*("|')express-session("|')/gi, 'You should have required express-session'); }, xhr => { throw new Error(xhr.statusText); })
|
testString: getUserInput => $.get(getUserInput('url')+ '/_api/server.js') .then(data => { assert.match(data, /require.*("|')passport("|')/gi, 'You should have required passport'); assert.match(data, /require.*("|')express-session("|')/gi, 'You should have required express-session'); }, xhr => { throw new Error(xhr.statusText); })
|
||||||
|
@ -29,7 +29,7 @@ tests:
|
|||||||
- text: All tests should pass.
|
- text: All tests should pass.
|
||||||
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=2').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
|
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=2').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
|
||||||
- text: You should choose the right assertion - isOk vs. isNotOk.
|
- text: You should choose the right assertion - isOk vs. isNotOk.
|
||||||
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=2').then(data => { assert.equal(data.assertions[0].method, 'isNotOk', 'Null is falsey'); }, xhr => { throw new Error(xhr.responseText); })
|
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=2').then(data => { assert.equal(data.assertions[0].method, 'isNotOk', 'Null is falsy'); }, xhr => { throw new Error(xhr.responseText); })
|
||||||
- text: You should choose the right assertion - isOk vs. isNotOk.
|
- text: You should choose the right assertion - isOk vs. isNotOk.
|
||||||
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=2').then(data => { assert.equal(data.assertions[1].method, 'isOk','A string is truthy'); }, xhr => { throw new Error(xhr.responseText); })
|
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=2').then(data => { assert.equal(data.assertions[1].method, 'isOk','A string is truthy'); }, xhr => { throw new Error(xhr.responseText); })
|
||||||
- text: You should choose the right assertion - isOk vs. isNotOk.
|
- text: You should choose the right assertion - isOk vs. isNotOk.
|
||||||
|
@ -71,12 +71,12 @@ permAlone('aab');
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
function permAlone(str) {
|
function permAlone(str) {
|
||||||
return permutor(str).filter(function(perm) {
|
return permuter(str).filter(function(perm) {
|
||||||
return !perm.match(/(.)\1/g);
|
return !perm.match(/(.)\1/g);
|
||||||
}).length;
|
}).length;
|
||||||
}
|
}
|
||||||
|
|
||||||
function permutor(str) {
|
function permuter(str) {
|
||||||
// http://staff.roguecc.edu/JMiller/JavaScript/permute.html
|
// http://staff.roguecc.edu/JMiller/JavaScript/permute.html
|
||||||
//permArr: Global array which holds the list of permutations
|
//permArr: Global array which holds the list of permutations
|
||||||
//usedChars: Global utility array which holds a list of "currently-in-use" characters
|
//usedChars: Global utility array which holds a list of "currently-in-use" characters
|
||||||
|
@ -12,7 +12,7 @@ Consider the following two triangles:
|
|||||||
A(-340,495), B(-153,-910), C(835,-947)
|
A(-340,495), B(-153,-910), C(835,-947)
|
||||||
X(-175,41), Y(-421,-714), Z(574,-645)
|
X(-175,41), Y(-421,-714), Z(574,-645)
|
||||||
It can be verified that triangle ABC contains the origin, whereas triangle XYZ does not.
|
It can be verified that triangle ABC contains the origin, whereas triangle XYZ does not.
|
||||||
Using triangles.txt (right click and 'Save Link/Target As...'), a 27K text file containing the co-ordinates of one thousand "random" triangles, find the number of triangles for which the interior contains the origin.
|
Using triangles.txt (right click and 'Save Link/Target As...'), a 27K text file containing the coordinates of one thousand "random" triangles, find the number of triangles for which the interior contains the origin.
|
||||||
NOTE: The first two examples in the file represent the triangles in the example given above.
|
NOTE: The first two examples in the file represent the triangles in the example given above.
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ forumTopicId: 301820
|
|||||||
|
|
||||||
## Description
|
## Description
|
||||||
<section id='description'>
|
<section id='description'>
|
||||||
Consider the set Ir of points (x,y) with integer co-ordinates in the interior of the circle with radius r, centered at the origin, i.e. x2 + y2 < r2.
|
Consider the set Ir of points (x,y) with integer coordinates in the interior of the circle with radius r, centered at the origin, i.e. x2 + y2 < r2.
|
||||||
For a radius of 2, I2 contains the nine points (0,0), (1,0), (1,1), (0,1), (-1,1), (-1,0), (-1,-1), (0,-1) and (1,-1). There are eight triangles having all three vertices in I2 which contain the origin in the interior. Two of them are shown below, the others are obtained from these by rotation.
|
For a radius of 2, I2 contains the nine points (0,0), (1,0), (1,1), (0,1), (-1,1), (-1,0), (-1,-1), (0,-1) and (1,-1). There are eight triangles having all three vertices in I2 which contain the origin in the interior. Two of them are shown below, the others are obtained from these by rotation.
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73
|
|||||||
How many circular primes are there below n, whereas 100 <= n <= 1000000?
|
How many circular primes are there below n, whereas 100 <= n <= 1000000?
|
||||||
|
|
||||||
<br><strong>Note:</strong><br>
|
<br><strong>Note:</strong><br>
|
||||||
Circular primes individual rotation can exceeed `n`.
|
Circular primes individual rotation can exceed `n`.
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
## Instructions
|
## Instructions
|
||||||
@ -106,7 +106,7 @@ function circularPrimes(n) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (!primes[x]) {
|
else if (!primes[x]) {
|
||||||
// If the rotated value is 0 then its not a ciruclar prime, break the loop
|
// If the rotated value is 0 then it isn't a circular prime, break the loop
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ Let C<sub>out</sub> be the circle having the diameter WZ.
|
|||||||
The triplet (<var>a</var>, <var>b</var>, <var>c</var>) is called a <em>necklace triplet</em> if you can place <var>k</var> ≥ 3 distinct circles C<sub>1</sub>, C<sub>2</sub>, ..., C<sub><var>k</var></sub> such that:
|
The triplet (<var>a</var>, <var>b</var>, <var>c</var>) is called a <em>necklace triplet</em> if you can place <var>k</var> ≥ 3 distinct circles C<sub>1</sub>, C<sub>2</sub>, ..., C<sub><var>k</var></sub> such that:
|
||||||
<ul><li>C<sub><var>i</var></sub> has no common interior points with any C<sub><var>j</var></sub> for 1 ≤ <var>i</var>, <var>j</var> ≤ <var>k</var> and <var>i</var> ≠ <var>j</var>,</li><li>C<sub><var>i</var></sub> is tangent to both C<sub>in</sub> and C<sub>out</sub> for 1 ≤ <var>i</var> ≤ <var>k</var>,</li><li>C<sub><var>i</var></sub> is tangent to C<sub><var>i</var>+1</sub> for 1 ≤ <var>i</var> < <var>k</var>, and</li><li>C<sub><var>k</var></sub> is tangent to C<sub>1</sub>.</li></ul>
|
<ul><li>C<sub><var>i</var></sub> has no common interior points with any C<sub><var>j</var></sub> for 1 ≤ <var>i</var>, <var>j</var> ≤ <var>k</var> and <var>i</var> ≠ <var>j</var>,</li><li>C<sub><var>i</var></sub> is tangent to both C<sub>in</sub> and C<sub>out</sub> for 1 ≤ <var>i</var> ≤ <var>k</var>,</li><li>C<sub><var>i</var></sub> is tangent to C<sub><var>i</var>+1</sub> for 1 ≤ <var>i</var> < <var>k</var>, and</li><li>C<sub><var>k</var></sub> is tangent to C<sub>1</sub>.</li></ul>
|
||||||
For example, (5, 5, 5) and (4, 3, 21) are necklace triplets, while it can be shown that (2, 2, 5) is not.
|
For example, (5, 5, 5) and (4, 3, 21) are necklace triplets, while it can be shown that (2, 2, 5) is not.
|
||||||
<img src="https://projecteuler.net/project/images/p428_necklace.png" alt="a visual reresentation of a necklace triplet">
|
<img src="https://projecteuler.net/project/images/p428_necklace.png" alt="a visual representation of a necklace triplet">
|
||||||
|
|
||||||
Let T(<var>n</var>) be the number of necklace triplets (<var>a</var>, <var>b</var>, <var>c</var>) such that <var>a</var>, <var>b</var> and <var>c</var> are positive integers, and <var>b</var> ≤ <var>n</var>.
|
Let T(<var>n</var>) be the number of necklace triplets (<var>a</var>, <var>b</var>, <var>c</var>) such that <var>a</var>, <var>b</var> and <var>c</var> are positive integers, and <var>b</var> ≤ <var>n</var>.
|
||||||
For example, T(1) = 9, T(20) = 732 and T(3000) = 438106.
|
For example, T(1) = 9, T(20) = 732 and T(3000) = 438106.
|
||||||
|
@ -7,12 +7,12 @@ forumTopicId: 302208
|
|||||||
|
|
||||||
## Description
|
## Description
|
||||||
<section id='description'>
|
<section id='description'>
|
||||||
The points P (x1, y1) and Q (x2, y2) are plotted at integer co-ordinates and are joined to the origin, O(0,0), to form ΔOPQ.
|
The points P (x1, y1) and Q (x2, y2) are plotted at integer coordinates and are joined to the origin, O(0,0), to form ΔOPQ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
There are exactly fourteen triangles containing a right angle that can be formed when each co-ordinate lies between 0 and 2 inclusive; that is,0 ≤ x1, y1, x2, y2 ≤ 2.
|
There are exactly fourteen triangles containing a right angle that can be formed when each coordinate lies between 0 and 2 inclusive; that is,0 ≤ x1, y1, x2, y2 ≤ 2.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ Implement a function to determine how many ways there are to make change for a d
|
|||||||
tests:
|
tests:
|
||||||
- text: <code>countCoins</code> should be a function.
|
- text: <code>countCoins</code> should be a function.
|
||||||
testString: assert(typeof countCoins === 'function');
|
testString: assert(typeof countCoins === 'function');
|
||||||
- text: <code>countCoints()</code> should return 242.
|
- text: <code>countCoins()</code> should return 242.
|
||||||
testString: assert.equal(countCoins(), 242);
|
testString: assert.equal(countCoins(), 242);
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -28,13 +28,13 @@ tests:
|
|||||||
testString: assert(typeof add12Hours('January 17 2017 11:43am EST') === 'string');
|
testString: assert(typeof add12Hours('January 17 2017 11:43am EST') === 'string');
|
||||||
- text: <code>add12Hours("January 17 2017 11:43am EST")</code> should return <code>"January 17 2017 11:43pm EST"</code>
|
- text: <code>add12Hours("January 17 2017 11:43am EST")</code> should return <code>"January 17 2017 11:43pm EST"</code>
|
||||||
testString: assert(add12Hours('January 17 2017 11:43am EST') === 'January 17 2017 11:43pm EST');
|
testString: assert(add12Hours('January 17 2017 11:43am EST') === 'January 17 2017 11:43pm EST');
|
||||||
- text: Should handel day change. <code>add12Hours("March 7 2009 7:30pm EST")</code> should return <code>"March 8 2009 7:30am EST"</code>
|
- text: Should handle day change. <code>add12Hours("March 7 2009 7:30pm EST")</code> should return <code>"March 8 2009 7:30am EST"</code>
|
||||||
testString: assert(add12Hours('March 7 2009 7:30pm EST') === 'March 8 2009 7:30am EST');
|
testString: assert(add12Hours('March 7 2009 7:30pm EST') === 'March 8 2009 7:30am EST');
|
||||||
- text: Should handel month change in a leap years. <code>add12Hours("February 29 2004 9:15pm EST")</code> should return <code>"March 1 2004 9:15am EST"</code>
|
- text: Should handle month change in a leap years. <code>add12Hours("February 29 2004 9:15pm EST")</code> should return <code>"March 1 2004 9:15am EST"</code>
|
||||||
testString: assert(add12Hours('February 29 2004 9:15pm EST') === 'March 1 2004 9:15am EST');
|
testString: assert(add12Hours('February 29 2004 9:15pm EST') === 'March 1 2004 9:15am EST');
|
||||||
- text: Should handel month change in a common years. <code>add12Hours("February 28 1999 3:15pm EST")</code> should return <code>"March 1 1999 3:15am EST"</code>
|
- text: Should handle month change in a common years. <code>add12Hours("February 28 1999 3:15pm EST")</code> should return <code>"March 1 1999 3:15am EST"</code>
|
||||||
testString: assert(add12Hours('February 28 1999 3:15pm EST') === 'March 1 1999 3:15am EST');
|
testString: assert(add12Hours('February 28 1999 3:15pm EST') === 'March 1 1999 3:15am EST');
|
||||||
- text: Should handel year change. <code>add12Hours("December 31 2020 1:45pm EST")</code> should return <code>"January 1 2021 1:45am EST"</code>
|
- text: Should handle year change. <code>add12Hours("December 31 2020 1:45pm EST")</code> should return <code>"January 1 2021 1:45am EST"</code>
|
||||||
testString: assert(add12Hours('December 31 2020 1:45pm EST') === 'January 1 2021 1:45am EST');
|
testString: assert(add12Hours('December 31 2020 1:45pm EST') === 'January 1 2021 1:45am EST');
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -10,7 +10,7 @@ forumTopicId: 302273
|
|||||||
Write a generalized version of <a href="https://rosettacode.org/wiki/FizzBuzz" target="_blank">FizzBuzz</a> that works for any list of factors, along with their words.
|
Write a generalized version of <a href="https://rosettacode.org/wiki/FizzBuzz" target="_blank">FizzBuzz</a> that works for any list of factors, along with their words.
|
||||||
This is basically a "fizzbuzz" implementation where the rules of the game are supplied to the user. Create a function to implement this. The function should take two parameters.
|
This is basically a "fizzbuzz" implementation where the rules of the game are supplied to the user. Create a function to implement this. The function should take two parameters.
|
||||||
The first will be an array with the FizzBuzz rules. For example: <code>[ [3, "Fizz"] , [5, "Buzz"] ]</code>.
|
The first will be an array with the FizzBuzz rules. For example: <code>[ [3, "Fizz"] , [5, "Buzz"] ]</code>.
|
||||||
This indcates that <code>Fizz</code> should be printed if the number is a multiple of 3 and <code>Buzz</code> if it is a multiple of 5. If it is a multiple of both then the strings should be concatenated in the order specified in the array. In this case, <code>FizzBuzz</code> if the number is a multiple of 3 and 5.
|
This indicates that <code>Fizz</code> should be printed if the number is a multiple of 3 and <code>Buzz</code> if it is a multiple of 5. If it is a multiple of both then the strings should be concatenated in the order specified in the array. In this case, <code>FizzBuzz</code> if the number is a multiple of 3 and 5.
|
||||||
The second parameter is the number for which the function should return a string as stated above.
|
The second parameter is the number for which the function should return a string as stated above.
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ If you already have <i>gcd</i> for <a href="https://rosettacode.org/wiki/great
|
|||||||
## Instructions
|
## Instructions
|
||||||
<section id='instructions'>
|
<section id='instructions'>
|
||||||
|
|
||||||
Compute the least common multiple of an array of intergers.
|
Compute the least common multiple of an array of integers.
|
||||||
Given <i>m</i> and <i>n</i>, the least common multiple is the smallest positive integer that has both <i>m</i> and <i>n</i> as factors.
|
Given <i>m</i> and <i>n</i>, the least common multiple is the smallest positive integer that has both <i>m</i> and <i>n</i> as factors.
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -32,8 +32,8 @@ tests:
|
|||||||
testString: assert.deepEqual(lengthSorter(["Mine", "is", "going", "great"]), ["going", "great", "Mine", "is"], '<code>lengthSorter(["Mine", "is", "going", "great"])</code> should return <code>["going", "great", "Mine", "is"]</code>.');
|
testString: assert.deepEqual(lengthSorter(["Mine", "is", "going", "great"]), ["going", "great", "Mine", "is"], '<code>lengthSorter(["Mine", "is", "going", "great"])</code> should return <code>["going", "great", "Mine", "is"]</code>.');
|
||||||
- text: <code>lengthSorter(["Have", "fun", "sorting", "!!"])</code> should return <code>["sorting", "Have", "fun", "!!"]</code>.
|
- text: <code>lengthSorter(["Have", "fun", "sorting", "!!"])</code> should return <code>["sorting", "Have", "fun", "!!"]</code>.
|
||||||
testString: assert.deepEqual(lengthSorter(["Have", "fun", "sorting", "!!"]), ["sorting", "Have", "fun", "!!"], '<code>lengthSorter(["Have", "fun", "sorting", "!!"])</code> should return <code>["sorting", "Have", "fun", "!!"]</code>.');
|
testString: assert.deepEqual(lengthSorter(["Have", "fun", "sorting", "!!"]), ["sorting", "Have", "fun", "!!"], '<code>lengthSorter(["Have", "fun", "sorting", "!!"])</code> should return <code>["sorting", "Have", "fun", "!!"]</code>.');
|
||||||
- text: <code>lengthSorter(["Everthing", "is", "good", "!!"])</code> should return <code>["Everthing", "good", "!!", "is"]</code>.
|
- text: <code>lengthSorter(["Everything", "is", "good", "!!"])</code> should return <code>["Everything", "good", "!!", "is"]</code>.
|
||||||
testString: assert.deepEqual(lengthSorter(["Everthing", "is", "good", "!!"]), ["Everthing", "good", "!!", "is"], '<code>lengthSorter(["Everthing", "is", "good", "!!"])</code> should return <code>["Everthing", "good", "!!", "is"]</code>.');
|
testString: assert.deepEqual(lengthSorter(["Everything", "is", "good", "!!"]), ["Everything", "good", "!!", "is"], '<code>lengthSorter(["Everything", "is", "good", "!!"])</code> should return <code>["Everything", "good", "!!", "is"]</code>.');
|
||||||
```
|
```
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
@ -7,7 +7,7 @@ forumTopicId: 302318
|
|||||||
|
|
||||||
## Description
|
## Description
|
||||||
<section id='description'>
|
<section id='description'>
|
||||||
Write a function to permform <a href="https://en.wikipedia.org/wiki/Stooge sort" target="_blank">Stooge Sort</a> on an array of integers. The function should return a sorted array.
|
Write a function to perform <a href="https://en.wikipedia.org/wiki/Stooge sort" target="_blank">Stooge Sort</a> on an array of integers. The function should return a sorted array.
|
||||||
The Stooge Sort algorithm is as follows:
|
The Stooge Sort algorithm is as follows:
|
||||||
<pre>
|
<pre>
|
||||||
<b>algorithm</b> stoogesort(<b>array</b> L, i = 0, j = <b>length</b>(L)-1)
|
<b>algorithm</b> stoogesort(<b>array</b> L, i = 0, j = <b>length</b>(L)-1)
|
||||||
|
@ -67,7 +67,7 @@ const text =
|
|||||||
`Wrap text using a more sophisticated algorithm such as the Knuth and Plass TeX algorithm.
|
`Wrap text using a more sophisticated algorithm such as the Knuth and Plass TeX algorithm.
|
||||||
If your language provides this, you get easy extra credit,
|
If your language provides this, you get easy extra credit,
|
||||||
but you ''must reference documentation'' indicating that the algorithm
|
but you ''must reference documentation'' indicating that the algorithm
|
||||||
is something better than a simple minimimum length algorithm.`;
|
is something better than a simple minimum length algorithm.`;
|
||||||
|
|
||||||
const wrapped80 = wrap(text, 80);
|
const wrapped80 = wrap(text, 80);
|
||||||
const wrapped42 = wrap(text, 42);
|
const wrapped42 = wrap(text, 42);
|
||||||
|
@ -203,7 +203,7 @@ The domain name will be different than **`freeCodeCamp.org`**. Currently this pu
|
|||||||
|
|
||||||
<h3 align="center"><a href='https://www.freecodecamp.dev' _target='blank'><code>www.freecodecamp.dev</code></a></h4>
|
<h3 align="center"><a href='https://www.freecodecamp.dev' _target='blank'><code>www.freecodecamp.dev</code></a></h4>
|
||||||
|
|
||||||
To prevent accidental indexing on search engines and users accidenatly using this site (without knowledge of it being a developement site) is closed off with a simple password:
|
To prevent accidental indexing on search engines and users accidentally using this site (without knowledge of it being a development site) is closed off with a simple password:
|
||||||
|
|
||||||
<h3 align="center"><code>freecodecamp-is-awesome</code></h4>
|
<h3 align="center"><code>freecodecamp-is-awesome</code></h4>
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ require('dotenv').config({ path: envPath });
|
|||||||
const { zip, timer, from } = require('rxjs');
|
const { zip, timer, from } = require('rxjs');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The below has been commented out to aviod inadvertant
|
* The below has been commented out to avoid inadvertant
|
||||||
* ops usage with algolia
|
* ops usage with algolia
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -44,20 +44,20 @@ function createPlugin() {
|
|||||||
if (sectionFilter(node, 'challengeSeed')) {
|
if (sectionFilter(node, 'challengeSeed')) {
|
||||||
let seeds = {};
|
let seeds = {};
|
||||||
const codeDivs = selectAll('div', node);
|
const codeDivs = selectAll('div', node);
|
||||||
const seedConatiners = codeDivs.filter(({ properties: { id } }) =>
|
const seedContainers = codeDivs.filter(({ properties: { id } }) =>
|
||||||
seedRE.test(id)
|
seedRE.test(id)
|
||||||
);
|
);
|
||||||
seedConatiners.forEach(createCodeGetter('contents', seedRE, seeds));
|
seedContainers.forEach(createCodeGetter('contents', seedRE, seeds));
|
||||||
|
|
||||||
const headConatiners = codeDivs.filter(({ properties: { id } }) =>
|
const headContainers = codeDivs.filter(({ properties: { id } }) =>
|
||||||
headRE.test(id)
|
headRE.test(id)
|
||||||
);
|
);
|
||||||
headConatiners.forEach(createCodeGetter('head', headRE, seeds));
|
headContainers.forEach(createCodeGetter('head', headRE, seeds));
|
||||||
|
|
||||||
const tailConatiners = codeDivs.filter(({ properties: { id } }) =>
|
const tailContainers = codeDivs.filter(({ properties: { id } }) =>
|
||||||
tailRE.test(id)
|
tailRE.test(id)
|
||||||
);
|
);
|
||||||
tailConatiners.forEach(createCodeGetter('tail', tailRE, seeds));
|
tailContainers.forEach(createCodeGetter('tail', tailRE, seeds));
|
||||||
|
|
||||||
file.data = {
|
file.data = {
|
||||||
...file.data,
|
...file.data,
|
||||||
|
@ -6,7 +6,7 @@ const textToData = require('./text-to-data');
|
|||||||
describe('text-to-data', () => {
|
describe('text-to-data', () => {
|
||||||
const expectedField = 'description';
|
const expectedField = 'description';
|
||||||
const otherExpectedField = 'instructions';
|
const otherExpectedField = 'instructions';
|
||||||
const unexpectedField = 'does-not-exis';
|
const unexpectedField = 'does-not-exist';
|
||||||
let file = { data: {} };
|
let file = { data: {} };
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
const apiPlaceholderRE = /#\{\{API\}\}/g;
|
const apiPlaceholderRE = /#\{\{API\}\}/g;
|
||||||
const newsPlaceholderRE = /#\{\{NEWS\}\}/g;
|
const newsPlaceholderRE = /#\{\{NEWS\}\}/g;
|
||||||
const forumPlacehilderRE = /#\{\{FORUM\}\}/g;
|
const forumPlaceholderRE = /#\{\{FORUM\}\}/g;
|
||||||
|
|
||||||
exports.createRedirects = function createRedirects(locations) {
|
exports.createRedirects = function createRedirects(locations) {
|
||||||
const { api, newsProxy, forumProxy } = locations;
|
const { api, newsProxy, forumProxy } = locations;
|
||||||
@ -18,7 +18,7 @@ exports.createRedirects = function createRedirects(locations) {
|
|||||||
return template
|
return template
|
||||||
.replace(apiPlaceholderRE, api)
|
.replace(apiPlaceholderRE, api)
|
||||||
.replace(newsPlaceholderRE, newsProxy)
|
.replace(newsPlaceholderRE, newsProxy)
|
||||||
.replace(forumPlacehilderRE, forumProxy);
|
.replace(forumPlaceholderRE, forumProxy);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* eslint-disable max-len */
|
/* eslint-disable max-len */
|
||||||
|
@ -64,7 +64,7 @@ function getFile(file, dir) {
|
|||||||
processFile(fileString, description, instructions, tests, title, file, dir);
|
processFile(fileString, description, instructions, tests, title, file, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get translatins from Google Translate API and insert into file
|
// Get translations from Google Translate API and insert into file
|
||||||
function processFile(
|
function processFile(
|
||||||
fileString,
|
fileString,
|
||||||
description,
|
description,
|
||||||
|
Reference in New Issue
Block a user