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
# Markdown files managed by DatoCMS | |
src/pages/ | |
# Secret API keys for Auth0 testing locally | |
.env.development |
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
}, | |
{ | |
resolve: `gatsby-theme-auth0`, | |
options: { | |
domain: process.env.AUTH0_DOMAIN, | |
clientID: process.env.AUTH0_CLIENT_ID, | |
redirectUri: process.env.AUTH0_CALLBACK_URL, | |
// Optional fields: | |
// audience: process.env.AUTH0_AUDIENCE, | |
// responseType: process.env.AUTH0_RESPONSE_TYPE, |
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
require("dotenv").config({ | |
path: `.env.${process.env.NODE_ENV}`, | |
}) |
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 strings = ["👌", "👌", "👌", "🐱👤", "🐱👤", "🐱🚀", "🐱🚀"] | |
const stringsSet = new Set(strings) | |
const uniqueStrings = [...stringsSet] | |
console.log(uniqueStrings) | |
// Output: Array(3) [ "👌", "🐱👤", "🐱🚀" ] | |
// One-liner using the method Array.from(): | |
console.log(Array.from(new Set(strings))) | |
// Output: Array(3) [ "👌", "🐱👤", "🐱🚀" ] |
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 myStrings = ["👌", "👌", "👌", "🐱👤", "🐱👤", "🐱🚀", "🐱🚀"] | |
const myUniqueStrings = [] | |
const myStringObject = {} // Used to check for uniqueness | |
for (const string of myStrings) { | |
// Object keys that aren't yet set are undefined, | |
// and undefined is a falsy value in JavaScript. | |
if (!myStringObject[string]) { | |
myUniqueStrings.push(string) | |
myStringObject[string] = 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
var stringsES5 = ["👌", "👌", "👌", "🐱👤", "🐱👤", "🐱🚀", "🐱🚀"] | |
var uniqueStringsES5 = [] | |
var stringObjectES5 = {} | |
// Since JavaScript objects must have unique properties | |
// (keys), you can find unique strings using an object. | |
for (var i = 0; i < stringsES5.length; i++) { | |
var string = stringsES5[i] | |
// Object keys that haven't been set are undefined, | |
// which is one of JavaScript's falsy values. |
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
{ | |
"files.autoSave": "onFocusChange", | |
"editor.fontLigatures": true, | |
"editor.fontFamily": "Fira Code SemiBold, Consolas, 'Courier New', monospace", | |
"editor.fontSize": 20, | |
"editor.wordWrap": "wordWrapColumn", | |
"editor.tabSize": 2, | |
"prettier.requireConfig": false, | |
"prettier.semi": false, | |
"editor.codeActionsOnSave": { "source.fixAll": 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
"files.autoSave": "onFocusChange", | |
"editor.tabSize": 2, | |
"prettier.requireConfig": false, | |
"prettier.semi": false, | |
"editor.codeActionsOnSave": { "source.fixAll": true }, | |
"editor.defaultFormatter": "esbenp.prettier-vscode", | |
"editor.formatOnPaste": true, | |
"editor.formatOnSave": true, | |
"editor.formatOnType": true, | |
"html.format.enable": false, |
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
"eslint.alwaysShowStatus": true, | |
"htmlhint.enable": 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
"editor.fontLigatures": true, | |
"editor.fontFamily": "Fira Code SemiBold, Consolas, 'Courier New', monospace", | |
"editor.fontSize": 20, |