YAML is a superset of JSON
The basic structure of YAML is a hash map -
key: value
YAML is a superset of JSON
The basic structure of YAML is a hash map -
key: value
### Keybase proof | |
I hereby claim: | |
* I am erockdotdev on github. | |
* I am erockdanger (https://keybase.io/erockdanger) on keybase. | |
* I have a public key ASA7LSOzhJwsKz1RHmLpvkp4mLkrfS0Vwb0jfXJX3V1bbwo | |
To claim this, I am signing this object: |
// Given 2 positive integers find out if the 2 numbers have the same frequency of digits | |
function numberToArrStr(num){ | |
return num.toString().split(''); | |
}; | |
function incrementFrequency(obj){ | |
return function(n){ | |
obj[n] = ++obj[n] || 1 | |
}; |
Executing Shell Commands with Node.js | |
https://stackabuse.com/executing-shell-commands-with-node-js/ | |
Configuring automatic backups for Contentful | |
https://www.contentful.com/blog/2019/05/15/configuring-automatic-backups-for-contentful/ |
VS code change es-lint settings | |
https://bit.ly/3g6Lwde | |
CTRL + SHIFT + P, type workspace settings (JSON) and press ENTER. | |
Slice vs Splice | |
const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]; | |
slice // immutable ( does not mutate original array ) |
Add new heroku remote ( if you rename an app in heroku run this step before renaming remotes) | |
heroku git:remote -a [app name]. | |
Add remote with name | |
heroku git:remote -a [app name] -r [remote] | |
exmaple: heroku git:remote -a erock-dot-dev-staging -r staging | |
Remove heroku remote | |
git remote rm [remote name] |
function outterFunction() { | |
let score = 0; | |
return function innerFunctio() { | |
if (score === 0) { | |
console.log("you have no points"); | |
} else { | |
console.log(`you have ${score} points`); | |
} | |
score += 1; | |
}; |
const person = { | |
firstName: "Eric", | |
lastName: "Sanchez", | |
get fullName() { | |
return `${this.firstName} ${this.lastName}`; | |
}, | |
set fullName(name) { | |
const updateName = name.split(" "); | |
this.firstName = updateName[0]; | |
this.lastName = updateName[1]; |
class Company { | |
constructor(brand){ | |
this.brandName = brand; | |
} | |
get name() { | |
return this.brandName | |
} | |
set name(brand) { | |
this.brandName = brand; | |
} |
import React, { useState, useEffect } from "react"; | |
function App() { | |
// implied setState in second param | |
const [buttonText, setButtonText] = useState("What is This?"); | |
const [input, updateInput] = useState("placeholder"); | |
const [swapiData, setData] = useState(); |