This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service cloud.firestore { | |
match /databases/{database}/documents { | |
// START - Usage example | |
match /people/{document=**} { | |
function propertiesValid() { | |
return request.resource.data.keys().hasAll(['name', 'birthdate', 'yearsOfExperience']) | |
&& request.resource.data.size() == 3 | |
&& isString('name') && minlength('name', 3) && maxlength('name', 255) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printPrimeNumbersFromZeroToHundred() { | |
const primeNumbers = []; | |
for (let i = 0; i <= 100; i++) { | |
let isPrime = true; | |
if (i < 2) { | |
isPrime = false; | |
} else if(i === 2) { | |
isPrime = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printPrimeNumbersFromZeroToHundred() { | |
const primeNumbers = []; | |
for (let i = 0; i <= 100; i++) { | |
if (isPrime(i)) { | |
primeNumbers.push(i); | |
} | |
} | |
console.log(primeNumbers); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printPrimeNumbersFromZeroToHundred() { | |
const primeNumbersToPrint = primeNumbersBetween(0, 100); | |
console.log(primeNumbersToPrint); | |
} | |
function primeNumbersBetween(min, max) { | |
const result = []; | |
for (let i = min; i <= max; i++) { | |
if (isPrime(i)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function selectSeniorCandidates(candidates) { | |
return candidates.filter(candidate => { | |
// with at least 5 years of experience that knows Javascript | |
return ( | |
candidate.yearsOfExperience >= 5 && | |
candidate.languages.includes('Javascript') | |
); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const seniorCandidatesRequirements = [ | |
{ | |
matches(candidate) { | |
return Number(candidate.yearsOfExperience) >= 5; | |
} | |
}, | |
{ | |
matches(candidate) { | |
return candidate.languages && candidate.languages.includes('Javascript'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const seniorCandidatesRequirements = [ | |
// ... | |
]; | |
const candidates = [ | |
// ... | |
]; | |
function matchesEveryRequirement(candidates, requirements) { | |
if (!requirements) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"target": "es2016", | |
"jsx": "preserve", | |
"checkJs": true, | |
"baseUrl": "./src" | |
}, | |
"exclude": ["node_modules", "**/node_modules/*"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"javascript.updateImportsOnFileMove.enabled": "always", | |
"javascript.preferences.importModuleSpecifier": "non-relative" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NODE_PATH=src/ |
OlderNewer